continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r519955 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-webapp/src...
Date Mon, 19 Mar 2007 14:25:18 GMT
Author: evenisse
Date: Mon Mar 19 07:25:17 2007
New Revision: 519955

URL: http://svn.apache.org/viewvc?view=rev&rev=519955
Log:
[CONTINUUM-1155] Allow user to choose if he want to use scm credential from cache when he
add a new project

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenOneProject.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Mon Mar 19 07:25:17 2007
@@ -270,6 +270,20 @@
         throws ContinuumException;
 
     /**
+     * Add a Maven 2 project to the list of projects.
+     *
+     * @param metadataUrl    url of the pom.xml
+     * @param projectGroupId id of the project group to use
+     * @param checkProtocol  check if the protocol is allowed, use false if the pom is uploaded
+     * @param useCredentialsCache  whether to use cached scm account credentials or not
+     * @return a holder with the projects, project groups and errors occurred during the
project adding
+     * @throws ContinuumException
+     */
+    ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
boolean checkProtocol, 
+                                                       boolean useCredentialsCache )
+        throws ContinuumException;
+    
+    /**
      * Add a Maven 1 project to the list of projects.
      *
      * @param metadataUrl url of the project.xml
@@ -311,6 +325,20 @@
      * @throws ContinuumException
      */
     ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId,
boolean checkProtocol )
+        throws ContinuumException;
+
+    /**
+     * Add a Maven 2 project to the list of projects.
+     *
+     * @param metadataUrl    url of the pom.xml
+     * @param projectGroupId id of the project group to use
+     * @param checkProtocol  check if the protocol is allowed, use false if the pom is uploaded
+     * @param useCredentialsCache  whether to use cached scm account credentials or not
+     * @return a holder with the projects, project groups and errors occurred during the
project adding
+     * @throws ContinuumException
+     */
+    ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId,
boolean checkProtocol, 
+                                                       boolean useCredentialsCache )
         throws ContinuumException;
 
     void updateProject( Project project )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Mar 19 07:25:17 2007
@@ -1135,8 +1135,15 @@
                                                               boolean checkProtocol )
         throws ContinuumException
     {
+        return addMavenOneProject( metadataUrl, projectGroupId, checkProtocol, false );
+    }
+
+    public ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId,
+                                                              boolean checkProtocol, boolean
useCredentialsCache )
+        throws ContinuumException
+    {
         return executeAddProjectsFromMetadataActivity( metadataUrl, MavenOneContinuumProjectBuilder.ID,
projectGroupId,
-                                                       checkProtocol );
+                                                       checkProtocol, useCredentialsCache
);
     }
 
     // ----------------------------------------------------------------------
@@ -1165,8 +1172,15 @@
                                                               boolean checkProtocol )
         throws ContinuumException
     {
+        return addMavenTwoProject( metadataUrl, projectGroupId, checkProtocol, false );
+    }
+
+    public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
+                                                              boolean checkProtocol, boolean
useCredentialsCache )
+        throws ContinuumException
+    {
         return executeAddProjectsFromMetadataActivity( metadataUrl, MavenTwoContinuumProjectBuilder.ID,
projectGroupId,
-                                                       checkProtocol );
+                                                       checkProtocol, useCredentialsCache
);
     }
 
     // ----------------------------------------------------------------------
@@ -1266,6 +1280,16 @@
                                                                                    boolean
checkProtocol )
         throws ContinuumException
     {
+        return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, -1,
checkProtocol, false );
+    }
+
+    private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String
metadataUrl,
+                                                                                   String
projectBuilderId,
+                                                                                   int projectGroupId,
+                                                                                   boolean
checkProtocol,
+                                                                                   boolean
useCredentialsCache )
+        throws ContinuumException
+    {
         if ( checkProtocol )
         {
             try
@@ -1394,6 +1418,8 @@
         for ( Iterator i = projects.iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
+            
+            project.setScmUseCache( useCredentialsCache );
 
             projectGroup.addProject( project );
         }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
Mon Mar 19 07:25:17 2007
@@ -36,10 +36,10 @@
     extends AddMavenProjectAction
 {
 
-    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup,
boolean checkProtocol )
+    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup,
boolean checkProtocol, boolean scmUseCache )
         throws ContinuumException
     {
-        return getContinuum().addMavenOneProject( pomUrl, selectedProjectGroup, checkProtocol
);
+        return getContinuum().addMavenOneProject( pomUrl, selectedProjectGroup, checkProtocol,
scmUseCache );
     }
 
     /**

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
Mon Mar 19 07:25:17 2007
@@ -63,6 +63,8 @@
 
     private boolean disableGroupSelection;
 
+    private boolean scmUseCache;
+
     public String execute()
         throws ContinuumException
     {
@@ -140,7 +142,7 @@
             }
         }
 
-        ContinuumProjectBuildingResult result = doExecute( pom, selectedProjectGroup, checkProtocol
);
+        ContinuumProjectBuildingResult result = doExecute( pom, selectedProjectGroup, checkProtocol,
scmUseCache );
 
         if ( result.hasErrors() )
         {
@@ -166,7 +168,7 @@
      * @return result of adding the pom to continuum
      */
     protected abstract ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup,
-                                                                 boolean checkProtocol )
+                                                                 boolean checkProtocol, boolean
scmUseCache )
         throws ContinuumException;
 
     // TODO: Remove this method because a default method return SUCCESS instead of INPUT
@@ -312,5 +314,15 @@
     public void setDisableGroupSelection( boolean disableGroupSelection )
     {
         this.disableGroupSelection = disableGroupSelection;
+    }
+
+    public boolean isScmUseCache()
+    {
+        return scmUseCache;
+    }
+
+    public void setScmUseCache( boolean scmUseCache )
+    {
+        this.scmUseCache = scmUseCache;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
Mon Mar 19 07:25:17 2007
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -50,7 +51,7 @@
 
     public static final String FILE_SCHEME = "file:/";
 
-    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup,
boolean checkProtocol )
+    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup,
boolean checkProtocol, boolean scmUseCache )
         throws ContinuumException
     {
         ContinuumProjectBuildingResult result = null;
@@ -101,7 +102,7 @@
 
         if ( result == null )
         {
-            result = getContinuum().addMavenTwoProject( pomUrl, selectedProjectGroup, checkProtocol
);
+            result = getContinuum().addMavenTwoProject( pomUrl, selectedProjectGroup, checkProtocol,
scmUseCache );
         }
 
         return result;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
Mon Mar 19 07:25:17 2007
@@ -63,6 +63,8 @@
 
     private boolean disableGroupSelection;
 
+    private boolean projectScmUseCache;
+
     public void validate()
     {
         boolean projectNameAlreadyExist = false;
@@ -128,6 +130,8 @@
 
         project.setScmTag( projectScmTag );
 
+        project.setScmUseCache( projectScmUseCache );
+
         getContinuum().addProject( project, projectType, selectedProjectGroup );
 
         return SUCCESS;
@@ -282,5 +286,15 @@
     public void setProjectGroupName( String projectGroupName )
     {
         this.projectGroupName = projectGroupName;
+    }
+
+    public boolean isProjectScmUseCache()
+    {
+        return projectScmUseCache;
+    }
+
+    public void setProjectScmUseCache( boolean projectScmUseCache )
+    {
+        this.projectScmUseCache = projectScmUseCache;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Mon Mar 19 07:25:17 2007
@@ -274,6 +274,8 @@
 projectVersion.error = You must provide a version
 projectVersion.message = Enter the version of the project
 
+projectScmUseCache.label = Use SCM Credentials Cache, if available
+
 # ----------------------------------------------------------------------
 # Page: DeleteProject
 # ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenOneProject.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenOneProject.jsp?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenOneProject.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenOneProject.jsp
Mon Mar 19 07:25:17 2007
@@ -53,6 +53,10 @@
                                       <td><input type="password" name="scmPassword"
size="20" id="addMavenOneProject_scmPassword"/><td>
                                     </tr>  
                                   </tbody>
+                                    <tr>
+                                      <td></td>
+                                      <td><ww:checkbox label="%{getText('projectEdit.project.scmUseCache.label')}"
name="scmUseCache"/><td>
+                                    </tr>
                                 </table>  
                                   <p><ww:text name="add.m1.project.m1PomUrl.message"/></p>
                                 </ww:param>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
Mon Mar 19 07:25:17 2007
@@ -53,6 +53,10 @@
                                       <td><input type="password" name="scmPassword"
size="20" id="addMavenTwoProject_scmPassword"/><td>
                                     </tr>  
                                   </tbody>
+                                    <tr>
+                                      <td></td>
+                                      <td><ww:checkbox label="%{getText('projectEdit.project.scmUseCache.label')}"
name="scmUseCache"/><td>
+                                    </tr>
                                 </table>  
                                   <p><ww:text name="add.m2.project.m2PomUrl.message"/></p>
                                 </ww:param>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp?view=diff&rev=519955&r1=519954&r2=519955
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp Mon
Mar 19 07:25:17 2007
@@ -73,6 +73,7 @@
                             <ww:textfield label="%{getText('projectScmTag.label')}" name="projectScmTag">
                                 <ww:param name="desc"><p><ww:text name="projectScmTag.message"/></p></ww:param>
                             </ww:textfield>
+                            <ww:checkbox label="%{getText('projectScmUseCache.label')}"
name="projectScmUseCache"/>
                             <ww:if test="disableGroupSelection == true">
                               <ww:hidden name="selectedProjectGroup"/>
                               <ww:hidden name="disableGroupSelection"/>



Mime
View raw message