continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r500518 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/AddProjectAction.java webapp/WEB-INF/jsp/addProject.jsp webapp/WEB-INF/jsp/projectGroupSummary.jsp
Date Sat, 27 Jan 2007 12:27:25 GMT
Author: epunzalan
Date: Sat Jan 27 04:27:24 2007
New Revision: 500518

URL: http://svn.apache.org/viewvc?view=rev&rev=500518
Log:
[CONTINUUM-1141]

ability to add Ant/Shell projects in projectGroupSummary page

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp

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=500518&r1=500517&r2=500518
==============================================================================
--- 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
Sat Jan 27 04:27:24 2007
@@ -64,6 +64,10 @@
 
     private int selectedProjectGroup;
 
+    private String projectGroupName;
+
+    private boolean disableGroupSelection;
+
     public void validate()
     {
         boolean projectNameAlreadyExist = false;
@@ -132,8 +136,11 @@
             projectGroups.add( pg );
         }
 
-        selectedProjectGroup = getContinuum().getProjectGroupByGroupId(
-            Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID ).getId();
+        if ( !disableGroupSelection )
+        {
+            selectedProjectGroup = getContinuum().getProjectGroupByGroupId(
+                Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID ).getId();
+        }
 
         return SUCCESS;
     }
@@ -237,5 +244,25 @@
     public void setSelectedProjectGroup( int selectedProjectGroup )
     {
         this.selectedProjectGroup = selectedProjectGroup;
+    }
+
+    public boolean isDisableGroupSelection()
+    {
+        return disableGroupSelection;
+    }
+
+    public void setDisableGroupSelection( boolean disableGroupSelection )
+    {
+        this.disableGroupSelection = disableGroupSelection;
+    }
+
+    public String getProjectGroupName()
+    {
+        return projectGroupName;
+    }
+
+    public void setProjectGroupName( String projectGroupName )
+    {
+        this.projectGroupName = projectGroupName;
     }
 }

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=500518&r1=500517&r2=500518
==============================================================================
--- 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 Sat
Jan 27 04:27:24 2007
@@ -73,7 +73,14 @@
                             <ww:textfield label="%{getText('projectScmTag.label')}" name="projectScmTag">
                                 <ww:param name="desc"><p><ww:text name="projectScmTag.message"/></p></ww:param>
                             </ww:textfield>
-                            <ww:select label="%{getText('projectGroup.name.label')}" name="selectedProjectGroup"
list="projectGroups" listKey="id" listValue="name"/>
+                            <ww:if test="disableGroupSelection == true">
+                              <ww:hidden name="selectedProjectGroup"/>
+                              <ww:hidden name="disableGroupSelection"/>
+                              <ww:textfield label="%{getText('projectGroup.name.label')}"
name="projectGroupName" disabled="true"/>
+                            </ww:if>
+                            <ww:else>
+                              <ww:select label="%{getText('projectGroup.name.label')}"
name="selectedProjectGroup" list="projectGroups" listKey="id" listValue="name"/>
+                            </ww:else>
                           </tbody>
                         </table>
                         <div class="functnbar3">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp?view=diff&rev=500518&r1=500517&r2=500518
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
Sat Jan 27 04:27:24 2007
@@ -30,6 +30,38 @@
     <title>
       <ww:text name="projectGroup.page.title"/>
     </title>
+    <script type="text/javascript">
+      function goToAddProject()
+      {
+        var urls = document.getElementById( "projectTypes" );
+        var index = urls.selectedIndex;
+
+        if ( index > 0 )
+        {
+          var form = document.forms[ "addNewProject" ];
+          form.action = urls[ index ].value;
+
+          if ( index == 3 )
+          {
+            form.projectType.value = "ant";
+          }
+          else if ( index == 4 )
+          {
+            form.projectType.value = "shell";
+          }
+          else
+          {
+            form.projectType.value = "";
+          }
+
+          form.submit();
+        }
+        else
+        {
+          alert( "Please choose a project type to add from the dropdown list." );
+        }
+      }
+    </script>
   </head>
   <body>
   <div id="h3">
@@ -75,44 +107,39 @@
                 </form>
               </pss:ifAuthorized>
             </td>
+            <td>
+              <pss:ifAnyAuthorized permissions="continuum-add-project-to-group" resource="${projectGroup.name}">
+                <ww:form name="addNewProject">
+                  <ww:hidden name="disableGroupSelection" value="true"/>
+                  <ww:hidden name="selectedProjectGroup" value="${projectGroup.id}"/>
+                  <ww:hidden name="projectGroupName" value="${projectGroup.name}"/>
+                  <ww:hidden name="projectType" value=""/>
+                </ww:form>
+
+                <c:url var="addM2ProjectUrl" value="/addMavenTwoProject!input.action"
/>
+                <c:url var="addM1ProjectUrl" value="/addMavenOneProject!input.action"
/>
+                <c:url var="addProjectUrl" value="/addProjectInput.action" />
+
+                <select id="projectTypes">
+                  <option value="">Add New Project</option>
+                  <option value="${addM2ProjectUrl}">Add M2 Project</option>
+                  <option value="${addM1ProjectUrl}">Add M1 Project</option>
+                  <option value="${addProjectUrl}">Add Ant Project</option>
+                  <option value="${addProjectUrl}">Add Shell Project</option>
+                </select>
+
+                <input type="button" value="Add" onclick="goToAddProject()"/>
+              </pss:ifAnyAuthorized>
+            </td>
           </tr>
         </table>
       </div>
     </pss:ifAnyAuthorized>
-   
+
     <ww:action name="projectSummary" executeResult="true" namespace="component">
       <ww:param name="projectGroupId" value="%{projectGroupId}"/>
       <ww:param name="projectGroupName" value="%{projectGroup.name}"/>
     </ww:action>
-    
-    <pss:ifAnyAuthorized permissions="continuum-add-project-to-group" resource="${projectGroup.name}">
-      <div class="functnbar3">
-        <c:url var="addM2ProjectUrl" value="/addMavenTwoProject!default.action">
-          <c:param name="disableGroupSelection" value="true"/>
-          <c:param name="selectedProjectGroup" value="${projectGroup.id}"/>
-          <c:param name="projectGroupName" value="${projectGroup.name}"/>
-        </c:url>
-        <c:url var="addM1ProjectUrl" value="/addMavenOneProject!default.action">
-          <c:param name="disableGroupSelection" value="true"/>
-          <c:param name="selectedProjectGroup" value="${projectGroup.id}"/>
-          <c:param name="projectGroupName" value="${projectGroup.name}"/>
-        </c:url>
-        <table>
-          <tr>
-            <td>
-              <form action="${addM2ProjectUrl}" method="post">
-                <input type="submit" name="addM2Project" value="<ww:text name="add.m2.project.section.title"/>"/>
-              </form>
-            </td>
-            <td>
-              <form action="${addM1ProjectUrl}" method="post">
-                <input type="submit" name="addM1Project" value="<ww:text name="add.m1.project.section.title"/>"/>
-              </form>
-            </td>
-          </tr>
-        </table>
-      </div>
-    </pss:ifAnyAuthorized>
 
   </div>
   </body>



Mime
View raw message