continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r208835 - in /maven/continuum/trunk/continuum-web/src/main: java/org/apache/maven/continuum/web/tool/ resources/META-INF/plexus/ resources/forms/ resources/templates/screens/
Date Sat, 02 Jul 2005 14:30:29 GMT
Author: trygvis
Date: Sat Jul  2 07:30:28 2005
New Revision: 208835

URL: http://svn.apache.org/viewcvs?rev=208835&view=rev
Log:
o Brushing up on the web app a bit.
 - Updating with changes in the model and the Continuum interface.
 - Showing the developer list in the project view. This is not properly
   implemented as a form.

Modified:
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java?rev=208835&r1=208834&r2=208835&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
Sat Jul  2 07:30:28 2005
@@ -22,6 +22,8 @@
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -31,16 +33,34 @@
     extends AbstractLogEnabled
     implements ContentGenerator
 {
+    /** @plexus.requirement */
+    private Continuum continuum;
+
     public String generate( Object item )
     {
         int state = 0;
 
         if ( item instanceof ContinuumProject )
         {
-            getLogger().warn( "The project doesn't have any state anymore" );
+            ContinuumProject project = (ContinuumProject) item;
+
+            try
+            {
+                ContinuumBuild build = continuum.getLatestBuildForProject( project.getId()
);
+
+                if ( build == null )
+                {
+                    return "New";
+                }
+
+                state = build.getState();
+            }
+            catch ( ContinuumException e )
+            {
+                getLogger().warn( "Error while getting latest build for project '" + project.getId()
+ "'.", e );
 
-            return "";
-//            state = ( (ContinuumProject) item ).getState();
+                return "Unknown";
+            }
         }
         else
         {

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=208835&r1=208834&r2=208835&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
Sat Jul  2 07:30:28 2005
@@ -307,6 +307,11 @@
       <role>org.codehaus.plexus.formica.web.ContentGenerator</role>
       <role-hint>continuum-state</role-hint>
       <implementation>org.apache.maven.continuum.web.tool.ContinuumStateContentGenerator</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.Continuum</role>
+        </requirement>
+      </requirements>
     </component>
 
   </components>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml?rev=208835&r1=208834&r2=208835&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml Sat
Jul  2 07:30:28 2005
@@ -45,6 +45,7 @@
       <type>text</type>
       <expression>scmUrl</expression>
     </element>
+<!-- TODO: Replace this with some notifier forms
     <element>
       <id>project.nagEmailAddress</id>
       <validators>
@@ -56,6 +57,7 @@
       <type>text</type>
       <expression>nagEmailAddress</expression>
     </element>
+-->
     <element>
       <id>project.version</id>
       <validators>
@@ -145,7 +147,9 @@
          | Only show the result pages if there are builds to show and if the project is in
a state
          | of ok, failed, error.
          -->
+        <!-- TODO: reenable
         <enable>getState() == 4 || ( getBuilds() != null &amp;&amp; getBuilds().size
> 0 &amp;&amp; ( getState() == 2 || getState() == 3 ) )</enable>
+        -->
       </operation>
       <operation>
         <name>Edit</name>
@@ -157,12 +161,16 @@
         <!--
          | Allow deletion when the project is in a state of new, ok, failed, error.
          -->
+        <!--
         <enable>getState() == 1 || getState() == 2 || getState() == 3 || getState()
== 4</enable>
+        -->
       </operation>
       <operation>
         <name>Build</name>
         <action>Summary.vm/action/cam/cid/buildProject/id/$id$</action>
+        <!--
         <enable>getState() == 1 || getState() == 2 || getState() == 3 || getState()
== 4</enable>
+        -->
       </operation>
     </operations>
   </summary>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm?rev=208835&r1=208834&r2=208835&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
Sat Jul  2 07:30:28 2005
@@ -1,3 +1,5 @@
+$page.setTitle( "Continuum - ${project.name} Build at $date.format('medium',$build.startTime)"
)
+
 <div class="app">
   <h3>Build result for $project.name</h3>
   <p>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm?rev=208835&r1=208834&r2=208835&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
Sat Jul  2 07:30:28 2005
@@ -1,3 +1,5 @@
+$page.setTitle( "Continuum - ${project.name} Builds" )
+
 <div class="app">
   #if ( $project.checkOutErrorException )
   <h3>Checkout Exception</h3>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm?rev=208835&r1=208834&r2=208835&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm Sat Jul
 2 07:30:28 2005
@@ -1,4 +1,4 @@
-$page.setTitle( $item.name )
+$page.setTitle( "Continuum - Project View: ${item.name}" )
 
 <div class="app">
   <div id="axial" class="h3">
@@ -16,22 +16,26 @@
       </table>
       #bar()
     </div>
+  </div>
 
     ## This is an extension which could be done by a parse or include
+## TODO: internationalize and use forms instead of this hardcoded layout - tryg
 
-    <h3>$i18n.getString( $form.view.titleKey )</h3>
-    <div class="axial">
-      <table border="1" cellspacing="2" cellpadding="3" width="100%">
-        #foreach ( $developer in $item.developers )
-        <tr class="b">
-          $developer.name
-          <th>$i18n.getString( $element.labelKey )</th>
-          <td>$formtool.getItem( $form, $element, $item )</td>
-        </tr>
-        #end
-      </table>
-      #bar()
-    </div>
-
+  <div id="h3">
+    <h3>Developers</h3>
+    <table border="1" cellspacing="2" cellpadding="3" width="100%">
+      <tr>
+        <th>Name</th>
+        <th>Email</th>
+      </tr>
+      #foreach ( $developer in $item.developers )
+      <tr class="$css.nextClass">
+        <td>${developer.name}</th>
+        <td><a href="mailto:${developer.email}">${developer.email}</a></td>
+      </tr>
+      #end
+    </table>
+    #bar()
   </div>
+
 </div>



Mime
View raw message