continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r306556 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-web/src/main/resources/META-INF/plexus/ continuum-web/src/main/resources/templat...
Date Thu, 06 Oct 2005 08:51:40 GMT
Author: evenisse
Date: Thu Oct  6 01:51:27 2005
New Revision: 306556

URL: http://svn.apache.org/viewcvs?rev=306556&view=rev
Log:
Add edit configuration screen

Added:
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm
  (with props)
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-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Configure.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ConfigureContinuum.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=306556&r1=306555&r2=306556&view=diff
==============================================================================
--- 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
Thu Oct  6 01:51:27 2005
@@ -207,6 +207,8 @@
 
     ConfigurationService getConfiguration();
 
+    void updateConfiguration( Map parameters );
+
     void reloadConfiguration()
         throws ContinuumException;
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=306556&r1=306555&r2=306556&view=diff
==============================================================================
--- 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
Thu Oct  6 01:51:27 2005
@@ -1047,6 +1047,30 @@
         return configurationService;
     }
 
+    public void updateConfiguration( Map configuration )
+    {
+        if ( convertBoolean( (String) configuration.get( "conf.enableGuest" ) ) )
+        {
+            configurationService.setGuestAccountEnabled( true );
+        }
+        else
+        {
+            configurationService.setGuestAccountEnabled( false );
+        }
+
+        configurationService.setWorkingDirectory( configurationService.getFile( (String)
configuration.get( "conf.workingDirectory" ) ) );
+
+        configurationService.setBuildOutputDirectory( configurationService.getFile( (String)
configuration.get( "conf.buildOutputDirectory" ) ) );
+
+        configurationService.setUrl( (String) configuration.get( "conf.url" ) );
+
+        configurationService.setCompanyName( (String) configuration.get( "conf.companyName"
) );
+
+        configurationService.setCompanyLogo( (String) configuration.get( "conf.companyLogo"
) );
+
+        configurationService.setCompanyUrl( (String) configuration.get( "conf.companyUrl"
) );
+    }
+
     public void reloadConfiguration()
         throws ContinuumException
     {
@@ -1234,72 +1258,72 @@
     {
         List perms = new ArrayList();
 
-        if ( convert( (String) configuration.get( "group.permission.addProject" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.addProject" )
) )
         {
             perms.add( store.getPermission( "addProject" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.editProject" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.editProject" )
) )
         {
             perms.add( store.getPermission( "editProject" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.deleteProject" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.deleteProject"
) ) )
         {
             perms.add( store.getPermission( "deleteProject" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.buildProject" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.buildProject"
) ) )
         {
             perms.add( store.getPermission( "buildProject" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.showProject" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.showProject" )
) )
         {
             perms.add( store.getPermission( "showProject" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.addBuildDefinition" )
) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.addBuildDefinition"
) ) )
         {
             perms.add( store.getPermission( "addBuildDefinition" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.editBuildDefinition"
) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.editBuildDefinition"
) ) )
         {
             perms.add( store.getPermission( "editBuildDefinition" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.deleteBuildDefinition"
) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.deleteBuildDefinition"
) ) )
         {
             perms.add( store.getPermission( "deleteBuildDefinition" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.addNotifier" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.addNotifier" )
) )
         {
             perms.add( store.getPermission( "addNotifier" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.editNotifier" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.editNotifier"
) ) )
         {
             perms.add( store.getPermission( "editNotifier" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.deleteNotifier" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.deleteNotifier"
) ) )
         {
             perms.add( store.getPermission( "deleteNotifier" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.manageConfiguration"
) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.manageConfiguration"
) ) )
         {
             perms.add( store.getPermission( "manageConfiguration" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.manageSchedule" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.manageSchedule"
) ) )
         {
             perms.add( store.getPermission( "manageSchedule" ) );
         }
 
-        if ( convert( (String) configuration.get( "group.permission.manageUsers" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.manageUsers" )
) )
         {
             perms.add( store.getPermission( "manageUsers" ) );
         }
@@ -1341,7 +1365,7 @@
         store.removeUserGroup( group );
     }
 
-    private boolean convert( String value )
+    private boolean convertBoolean( String value )
     {
         if ( "true".equalsIgnoreCase( value ) || "on".equalsIgnoreCase( value ) || "yes".equalsIgnoreCase(
value ) )
         {

Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=306556&r1=306555&r2=306556&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
Thu Oct  6 01:51:27 2005
@@ -555,6 +555,15 @@
             <cid>updateUser</cid>
             <expression>updateUser(#id,#parameters)</expression>
           </call>
+          <!--
+           |
+           | Configuration
+           |
+           -->
+          <call>
+            <cid>updateConfiguration</cid>
+            <expression>updateConfiguration(#parameters)</expression>
+          </call>
         </calls>
       </configuration>
     </component>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Configure.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Configure.vm?rev=306556&r1=306555&r2=306556&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Configure.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Configure.vm
Thu Oct  6 01:51:27 2005
@@ -7,7 +7,7 @@
 
       <h3>Admin account</h3>
       <div class="axial">
-        <table cellspacing="2" cellpadding="3" width="450">
+        <table cellspacing="2" cellpadding="3" width="700">
           <tr>
             <td>Username :</td>
             <td><input type="text" name="username" size="50"></td>
@@ -32,7 +32,7 @@
       </div>
 
       <h3>Directories</h3>
-      <table cellspacing="2" cellpadding="3" width="450">
+      <table cellspacing="2" cellpadding="3" width="700">
         <tr>
           <td>Working Directory :</td>
           <td><input type="text" name="workingDirectory" value="working-directory"
size="50"> If you define a relative path, it will be relative to $CONTINUUM_HOME/apps/continuum/</td>
@@ -44,7 +44,7 @@
       </table>
 
       <h3>Base URL</h3>
-      <table cellspacing="2" cellpadding="3" width="450">
+      <table cellspacing="2" cellpadding="3" width="700">
         <tr>
           <td>Base URL :</td>
           <td><input type="text" name="baseUrl" value="http://localhost:8080/continuum/servlet/continuum"
size="50"></td>
@@ -52,7 +52,7 @@
       </table>
 
       <h3>Company Informations</h3>
-      <table cellspacing="2" cellpadding="3" width="450">
+      <table cellspacing="2" cellpadding="3" width="700">
         <tr>
           <td>Name :</td>
           <td><input type="text" name="companyName" size="50"></td>
@@ -68,7 +68,7 @@
       </table>
 
       <h3>Guest access</h3>
-      <table cellspacing="2" cellpadding="3" width="450">
+      <table cellspacing="2" cellpadding="3" width="700">
         <tr>
           <td>Allow Guest :</td>
           <td><input type="checkbox" name="guestAccountEnabled" checked="checked"></td>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ConfigureContinuum.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ConfigureContinuum.vm?rev=306556&r1=306555&r2=306556&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ConfigureContinuum.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ConfigureContinuum.vm
Thu Oct  6 01:51:27 2005
@@ -1,5 +1,11 @@
 $page.setTitle( "Configure Continuum" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 <div class="app">
   <div id="axial" class="h3">
     <h3>General Configuration</h3>
@@ -43,23 +49,18 @@
           <td>#if ( $continuum.configuration.companyUrl ) $continuum.configuration.companyUrl
#end</td>
         </tr>
       </table>
-      <!--
+      #if ( $continuum.security.isAuthorized( $c1user, "manageConfiguration" ) )
       <div class="functnbar3">
         <table>
           <tr>
             <td>
-              <form method="post" action="editConfiguration.html">
-
-                <input type="hidden" name="action" value="cam"/>
-
-                <input type="hidden" name="cid" value="checkoutProject"/>
-                <input type="hidden" name="id" value="43"/>
-                <input type="submit" name="edit-project" value="Edit"/>
+              <form method="post" action="$link.setPage('EditContinuumConfiguration.vm')">
+                <input type="submit" name="edit-configuration" value="Edit"/>
               </form>
             </td>
           </tr>
         </table>
       </div>
-      -->
+      #end
     </div>
 </div>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm?rev=306556&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm
Thu Oct  6 01:51:27 2005
@@ -0,0 +1,49 @@
+$page.setTitle( "Edit Continuum Configuration" )
+
+#set ( $conf = $continuum.configuration )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>Edit Continuum Configuration</h3>
+    <form method="post" action="$link">
+      #hidden ( "action" "cam" )
+      #hidden ( "cid" "updateConfiguration" )
+      #hidden ( "view" "ConfigureContinuum.vm" )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+        <tr class="b">
+          <th>Guests</th>
+          <td>
+            <input type="checkbox" name="conf.enableGuest" #if ( $continuum.configuration.isGuestAccountEnabled()
) checked="checked" #end />
+          </td>
+        </tr>
+        <tr class="b">
+          <th>Working Directory</th>
+          <td><input type="text" name="conf.workingDirectory" value="$continuum.configuration.workingDirectory"
size="100"/></td>
+        </tr>
+        <tr class="b">
+          <th>Build Output Directory</th>
+          <td><input type="text" name="conf.buildOutputDirectory" value="$continuum.configuration.buildOutputDirectory"
size="100"/></td>
+        </tr>
+        <tr class="b">
+          <th>Base URL</th>
+          <td><input type="text" name="conf.url" value="$continuum.configuration.url"
size="100"/></td>
+        </tr>
+        <tr class="b">
+          <th>Company Name</th>
+          <td><input type="text" name="conf.companyName" #if ( $continuum.configuration.companyName
) value="$continuum.configuration.companyName" #end size="100"/></td>
+        </tr>
+        <tr class="b">
+          <th>Company Logo</th>
+          <td><input type="text" name="conf.companyLogo" #if ( $continuum.configuration.companyLogo
) value="$continuum.configuration.companyLogo" #end size="100"/></td>
+        </tr>
+        <tr class="b">
+          <th>Company URL</th>
+          <td><input type="text" name="conf.companyUrl" #if ( $continuum.configuration.companyUrl
) value="$continuum.configuration.companyUrl" #end size="100"/></td>
+        </tr>
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditContinuumConfiguration.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message