continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r219607 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/store/ continuum-web/src/main/java...
Date Tue, 19 Jul 2005 03:00:08 GMT
Author: jvanzyl
Date: Mon Jul 18 19:59:49 2005
New Revision: 219607

URL: http://svn.apache.org/viewcvs?rev=219607&view=rev
Log:
o updates for schedules

Added:
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleAdd.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleDelete.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleEdit.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleSummary.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleView.vm
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-core/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
    maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.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=219607&r1=219606&r2=219607&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
Mon Jul 18 19:59:49 2005
@@ -163,6 +163,7 @@
     void updateShellProject( ShellProject project )
         throws ContinuumException;
 
+
     // ----------------------------------------------------------------------
     // Notification
     // ----------------------------------------------------------------------
@@ -170,7 +171,7 @@
     ContinuumNotifier getNotifier( String projectId, String notifierType )
         throws ContinuumException;
 
-    void updateNotifier( String projectId, String notifierType, Map configuration )
+     void updateNotifier( String projectId, String notifierType, Map configuration )
         throws ContinuumException;
 
     void addNotifier( String projectId, String notifierType, Map configuration )
@@ -183,16 +184,18 @@
     // Schedules
     // ----------------------------------------------------------------------
 
-    ContinuumSchedule getSchedule( String scheduleId )
+     Collection getSchedules()
         throws ContinuumException;
 
-    void addSchedule( ContinuumSchedule schedule )
+     ContinuumSchedule getSchedule( String scheduleId )
         throws ContinuumException;
 
-    void updateSchedule( ContinuumSchedule schedule )
+     void addSchedule( ContinuumSchedule schedule )
         throws ContinuumException;
 
-    void removeSchedule( String scheduleId )
+     void updateSchedule( ContinuumSchedule schedule )
         throws ContinuumException;
 
+     void removeSchedule( String scheduleId )
+        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=219607&r1=219606&r2=219607&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
Mon Jul 18 19:59:49 2005
@@ -676,7 +676,20 @@
         }
         catch ( ContinuumStoreException ex )
         {
-            throw logAndCreateException( "Exception while getting project '" + scheduleId
+ "'.", ex );
+            throw logAndCreateException( "Exception while getting schedule '" + scheduleId
+ "'.", ex );
+        }
+    }
+
+    public Collection getSchedules()
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getSchedules();
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Exception while getting schedules.", ex );
         }
     }
 
@@ -689,7 +702,7 @@
         }
         catch ( ContinuumStoreException ex )
         {
-            throw logAndCreateException( "Error while removing project.", ex );
+            throw logAndCreateException( "Error while removing schedule.", ex );
         }
     }
 
@@ -702,7 +715,7 @@
         }
         catch ( ContinuumStoreException ex )
         {
-            throw logAndCreateException( "Error while removing project.", ex );
+            throw logAndCreateException( "Error while removing schedule.", ex );
         }
     }
 
@@ -715,7 +728,7 @@
         }
         catch ( ContinuumStoreException ex )
         {
-            throw logAndCreateException( "Error while removing project.", ex );
+            throw logAndCreateException( "Error while removing schedule.", ex );
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=219607&r1=219606&r2=219607&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Mon Jul 18 19:59:49 2005
@@ -456,11 +456,6 @@
 
             result = pm.detachCopyAll( result );
 
-            for ( Iterator it = result.iterator(); it.hasNext(); )
-            {
-                setProjectState( (ContinuumProject) it.next() );
-            }
-
             commit( tx );
 
             return result;

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java?rev=219607&r1=219606&r2=219607&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
Mon Jul 18 19:59:49 2005
@@ -105,7 +105,7 @@
 
             String view = data.getTarget();
 
-            if ( view != null && ( view.startsWith( "View" ) || view.startsWith(
"Edit" ) ) )
+            if ( view != null && ( view.indexOf( "View" ) >= 0 || view.indexOf(
"Edit" ) >= 0 ) )
             {
                 Object item = formicaTool.getItem( form, id );
 

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java?rev=219607&r1=219606&r2=219607&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
Mon Jul 18 19:59:49 2005
@@ -20,7 +20,6 @@
 import ognl.OgnlException;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.summit.rundata.RunData;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
@@ -28,14 +27,12 @@
 import org.codehaus.plexus.formica.Form;
 import org.codehaus.plexus.formica.FormManager;
 import org.codehaus.plexus.formica.FormNotFoundException;
-import org.codehaus.plexus.formica.Operation;
-import org.codehaus.plexus.formica.SummaryElement;
 import org.codehaus.plexus.formica.web.ContentGenerator;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.codehaus.plexus.summit.rundata.RunData;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -68,94 +65,6 @@
         }
     }
 
-    // ----------------------------------------------------------------------
-    // Summary
-    // ----------------------------------------------------------------------
-
-    public Object getSummaryItems( String formId )
-        throws FormToolException
-    {
-        Form form = null;
-
-        Object component = null;
-
-        try
-        {
-            form = formManager.getForm( formId );
-
-            component = container.lookup( assertNotEmpty( form, form.getSourceRole(), "source
role" ) );
-        }
-        catch ( FormNotFoundException e )
-        {
-            throw new FormToolException( "Cannot find form with id = " + formId, e );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new FormToolException( "Cannot find component with role = " + form.getSourceRole(),
e );
-        }
-
-        String expr = form.getSummaryCollectionExpression();
-
-        return getValue( expr, Collections.EMPTY_MAP, component );
-    }
-
-    public String getSummaryItem( Form form, SummaryElement se, Object item )
-        throws FormToolException
-    {
-        return getItem( form, form.getElement( se.getId() ), item );
-    }
-
-    public String getOperationUrl( Form form, Object item, Operation op )
-        throws FormToolException
-    {
-        String id = null;
-
-        String type = null;
-
-        // TODO; throw an exception if the expression key isn't there
-        try
-        {
-            id = (String) Ognl.getValue( form.getKeyExpression(), item );
-
-            type = (String) Ognl.getValue( form.getTypeExpression(), item );
-        }
-        catch ( OgnlException e )
-        {
-            throw new FormToolException( "Error retrieving expression:", e );
-        }
-
-        String s = StringUtils.replace( op.getAction(), "$id$", id );
-
-        s = StringUtils.replace( s, "$formId$", form.getId() );
-
-        s = StringUtils.replace( s, "$type$", type );
-
-        return s;
-    }
-
-    public boolean enableOperation( Form form, Operation operation, Object item )
-        throws FormToolException
-    {
-        if ( operation.getEnable() == null )
-        {
-            return true;
-        }
-
-        try
-        {
-            return ((Boolean)Ognl.getValue( operation.getEnable(), item )).booleanValue();
-        }
-        catch ( OgnlException e )
-        {
-            getLogger().error( "Cannot evaluate enable expression: " + operation.getEnable()
+ " on " + item, e );
-
-            // ----------------------------------------------------------------------
-            // If there is an error evaluating the expression we'll protect
-            // ----------------------------------------------------------------------
-
-            return false;
-        }
-    }
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties?rev=219607&r1=219606&r2=219607&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
Mon Jul 18 19:59:49 2005
@@ -178,6 +178,9 @@
 
 schedule.updateTitle = Update Schedule
 
+schedule.deleteTitle = Delete Schedule
+schedule.deleteConfirmationMessage = Are you sure you want to delete this schedule?
+
 scheduleName.label = Name
 scheduleName.message = Enter the name of the schedule
 scheduleName.error = You must enter a name for the schedule

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm?rev=219607&r1=219606&r2=219607&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm Mon Jul
18 19:59:49 2005
@@ -81,8 +81,7 @@
 #end
 
 #macro ( checkbox $element $elementData )
->>>>> $elementData
-<input type="checkbox" name="$element.id"/>
+<input type="checkbox" name="$element.id" #if( $elementData == "true" )checked#end/>
 #end
 
 #macro ( pulldown $element $elementData )

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm?rev=219607&r1=219606&r2=219607&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm Mon Jul
18 19:59:49 2005
@@ -2,7 +2,6 @@
 
 <div class="app">
   <div id="axial" class="h3">
-    >>>>>>>>> $form.add.titleKey
     <h3>$i18n.getString( $form.add.titleKey )</h3>
     <form method="post" action="$link" #if( $form.attributes.multipart )enctype="multipart/form-data"#end>
       #hidden ( "fid" $form.id )

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleAdd.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleAdd.vm?rev=219607&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleAdd.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleAdd.vm
Mon Jul 18 19:59:49 2005
@@ -0,0 +1,29 @@
+$page.setTitle( "Add Project" )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.add.titleKey )</h3>
+    <form method="post" action="$link" #if( $form.attributes.multipart )enctype="multipart/form-data"#end>
+      #hidden ( "fid" $form.id )
+      #hidden ( "action" $form.add.action )
+      #hidden ( "view" $form.add.view )
+      #hidden ( "id" $id )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          #foreach ( $element in $form.elements )
+          #if ( !$element.immutable )
+          <tr>
+            #field( $i18n $data $element $item $formtool )
+          </tr>
+          #else
+            #if ( $element.defaultValue )
+              #hidden ( $element.id $element.defaultValue )
+            #end
+          #end
+          #end
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleDelete.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleDelete.vm?rev=219607&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleDelete.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleDelete.vm
Mon Jul 18 19:59:49 2005
@@ -0,0 +1,22 @@
+$page.setTitle( "Delete Project" )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.delete.titleKey )</h3>
+    <div class="warningmessage">
+      <p>
+        <strong>$i18n.getString( "schedule.deleteConfirmationMessage" )</strong>
+      </p>
+    </div>
+    <form method="post" action="$link">
+      #hidden ( "fid" $form.id )
+      #hidden ( "action" $form.delete.action )
+      #hidden ( "view" $form.delete.view )
+      #hidden ( "id" $id )
+      <div class="functnbar3">
+        <input type="submit" name="deleteEntry" value="Delete"/>
+        <input type="submit" name="cancel" value="Cancel"/>
+      </div>
+  </form>
+  </div>
+</div>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleEdit.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleEdit.vm?rev=219607&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleEdit.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleEdit.vm
Mon Jul 18 19:59:49 2005
@@ -0,0 +1,25 @@
+$page.setTitle( $item.name )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.update.titleKey )</h3>
+    <form method="post" action="$link">
+      #hidden ( "fid" $form.id )      
+      #hidden ( "action" $form.update.action )
+      #hidden ( "view" $form.update.view )
+      #hidden ( "id" $id )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          #foreach ( $element in $form.elements )
+          #if ( !$element.immutable )
+          <tr>
+            #field( $i18n $data $element $item $formtool )
+          </tr>
+          #end
+          #end
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleSummary.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleSummary.vm?rev=219607&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleSummary.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleSummary.vm
Mon Jul 18 19:59:49 2005
@@ -0,0 +1,38 @@
+$page.setTitle( "Continuum Schedules" )
+
+<div class="app">
+  <div id="h3">
+    <h3>Continuum Schedules</h3>
+    <table border="1" cellspacing="2" cellpadding="3" width="100%" id="projectSummaryTable">
+
+      <!-- i18n -->
+      <tr>
+        <th>Name</th>
+        <th>Description</th>
+        <th>Active</th>
+        <th>Next</th>
+        <th colspan="7"></th>
+      </tr>
+
+      #set ( $items = $continuum.schedules )
+
+      #foreach ( $item in $items )
+      <tr class="$css.nextClass">
+        <td>$item.name</td>
+        <td>$item.description</td>
+        <td>$item.active</td>
+        <td>???</td>
+        <td><a href="$link.setPage('schedule,ScheduleView.vm').addPathInfo('fid',
'schedule').addPathInfo('id', $item.id)">View</a></td>
+        <td><a href="$link.setPage('schedule,ScheduleEdit.vm').addPathInfo('fid',
'schedule').addPathInfo('id', $item.id)">Edit</a></td>
+        <td><a href="$link.setPage('schedule,ScheduleDelete.vm').addPathInfo('fid',
'schedule').addPathInfo('id', $item.id)">Delete</a></td>
+      </tr>
+      #end
+    </table>
+
+    <div class="functnbar3">
+      <form method="post" action="$link">
+        <a href="$link.setPage('schedule,ScheduleAdd.vm').addPathInfo( 'fid', 'schedule')">Add
Schedule</a>
+      </form>
+    </div>
+  </div>
+</div>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleView.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleView.vm?rev=219607&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleView.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/schedule/ScheduleView.vm
Mon Jul 18 19:59:49 2005
@@ -0,0 +1,21 @@
+$page.setTitle( "Continuum - Project View: ${item.name}" )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.view.titleKey )</h3>
+    <div class="axial">
+      <table border="1" cellspacing="2" cellpadding="3" width="100%">
+        #foreach ( $element in $form.elements )
+        #if ( !$element.immutable )
+        <tr class="b">
+          <th>$i18n.getString( $element.labelKey )</th>
+          <td>$formtool.getItem( $form, $element, $item )</td>
+        </tr>
+        #end
+        #end
+    </table>
+    <div class="functnbar3">
+      <a href="$link.setPage('schedule,ScheduleSummary.vm')">Back to Schedules</a>
+    </div>
+  </div>
+</div>



Mime
View raw message