continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r161624 - in maven/continuum/trunk/continuum-web/src/main: java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java resources/META-INF/plexus/components.xml resources/forms/continuumProject.xml
Date Sun, 17 Apr 2005 04:53:07 GMT
Author: jvanzyl
Date: Sat Apr 16 21:53:06 2005
New Revision: 161624

URL: http://svn.apache.org/viewcvs?view=rev&rev=161624
Log:
o adding content generator for the continuum status

Added:
    maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
Modified:
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml

Added: maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java?view=auto&rev=161624
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
(added)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
Sat Apr 16 21:53:06 2005
@@ -0,0 +1,44 @@
+package org.codehaus.continuum.web.tool;
+
+import org.codehaus.plexus.formica.web.ContentGenerator;
+import org.apache.maven.continuum.project.ContinuumProject;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: StateContentGenerator.java,v 1.1 2005/04/04 14:05:38 jvanzyl Exp $
+ */
+public class ContinuumStateContentGenerator
+    implements ContentGenerator
+{
+    public String generate( Object item )
+    {
+        ContinuumProject p = (ContinuumProject) item;
+
+        int state = p.getState();
+
+        if ( state == 1 )
+        {
+            return "New";
+        }
+        else if ( state == 2 )
+        {
+            return "<img src=\"/continuum/images/icon_success_sml.gif\" alt=\"Success\"/>";
+        }
+        else if ( state == 3 )
+        {
+            return "<img src=\"/continuum/images/icon_error_sml.gif\" alt=\"Failed\"/>";
+        }
+        else if ( state == 4 )
+        {
+            return "<img src=\"/continuum/images/icon_warning_sml.gif\" alt=\"Error\"/>";
+        }
+        else if ( state == 5 )
+        {
+            return "Build Queued";
+        }
+        else
+        {
+            return "Building";
+        }
+    }
+}

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?view=diff&r1=161623&r2=161624
==============================================================================
--- 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 Apr 16 21:53:06 2005
@@ -183,5 +183,17 @@
       </requirements>
     </component>
 
+    <!--
+     |
+     | Content Generators
+     |
+     |-->
+
+    <component>
+      <role>org.codehaus.plexus.formica.web.ContentGenerator</role>
+      <role-hint>continuum-state</role-hint>
+      <implementation>org.codehaus.continuum.web.tool.ContinuumStateContentGenerator</implementation>
+    </component>
+
   </components>
 </component-set>

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?view=diff&r1=161623&r2=161624
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml Sat
Apr 16 21:53:06 2005
@@ -99,6 +99,7 @@
     <summary-elements>
       <summary-element>
         <id>project.state</id>
+        <content-generator>continuum-state</content-generator>
       </summary-element>
       <summary-element>
         <id>project.name</id>



Mime
View raw message