continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r414280 - in /maven/continuum/trunk/continuum-webapp: ./ src/main/java/org/apache/maven/continuum/web/view/ src/main/java/org/apache/maven/continuum/web/view/buildresults/ src/main/java/org/apache/maven/continuum/web/view/commons/ src/main/...
Date Wed, 14 Jun 2006 14:51:59 GMT
Author: evenisse
Date: Wed Jun 14 07:51:58 2006
New Revision: 414280

URL: http://svn.apache.org/viewvc?rev=414280&view=rev
Log:
Update extremecomponents to final release

Modified:
    maven/continuum/trunk/continuum-webapp/pom.xml
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/buildresults/StateCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/commons/DateCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierEventCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierFromCell.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java

Modified: maven/continuum/trunk/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/pom.xml?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/pom.xml (original)
+++ maven/continuum/trunk/continuum-webapp/pom.xml Wed Jun 14 07:51:58 2006
@@ -69,7 +69,7 @@
     <dependency>
       <groupId>org.extremecomponents</groupId>
       <artifactId>extremecomponents</artifactId>
-      <version>1.0.1-M3</version>
+      <version>1.0.1</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
Wed Jun 14 07:51:58 2006
@@ -16,17 +16,16 @@
  * limitations under the License.
  */
 
+import com.opensymphony.webwork.views.util.UrlHelper;
 import org.apache.maven.continuum.web.model.SummaryProjectModel;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
-
-import java.util.HashMap;
+import org.extremecomponents.table.core.TableModel;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
-import com.opensymphony.webwork.views.util.UrlHelper;
+import javax.servlet.jsp.PageContext;
+import java.util.HashMap;
 
 /**
  * Used in Summary view
@@ -37,47 +36,50 @@
 public class BuildCell
     extends DisplayCell
 {
-    public void init( BaseModel model, Column column )
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init( model, column );
-
-        SummaryProjectModel project = (SummaryProjectModel) model.getCurrentCollectionBean();
+        SummaryProjectModel project = (SummaryProjectModel) tableModel.getCurrentRowBean();
 
         int buildNumber = project.getBuildNumber();
 
         if ( project.isInQueue() )
         {
-            column.setValue( "<b>In&nbsp;queue</b>" );
+            return "<b>In&nbsp;queue</b>";
         }
-        else if ( project.getState() == 1 || project.getState() == 2 || project.getState()
== 3
-            || project.getState() == 4 )
+        else
         {
-            if ( project.getBuildNumber() > 0 )
+            if ( project.getState() == 1 || project.getState() == 2 || project.getState()
== 3 ||
+                project.getState() == 4 )
             {
-                HashMap params = new HashMap();
+                if ( project.getBuildNumber() > 0 )
+                {
+                    HashMap params = new HashMap();
+
+                    params.put( "projectId", new Integer( project.getId() ) );
 
-                params.put( "projectId", new Integer( project.getId() ) );
+                    params.put( "projectName", project.getName() );
 
-                params.put( "projectName", project.getName() );
+                    params.put( "buildId", new Integer( buildNumber ) );
 
-                params.put( "buildId", new Integer( buildNumber ) );
+                    PageContext pageContext = (PageContext) tableModel.getContext().getContextObject();
 
-                HttpServletRequest request = (HttpServletRequest) model.getPageContext().getRequest();
+                    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
 
-                HttpServletResponse response = (HttpServletResponse) model.getPageContext().getResponse();
+                    HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
 
-                String url = UrlHelper.buildUrl( "/buildResult.action", request, response,
params );
+                    String url = UrlHelper.buildUrl( "/buildResult.action", request, response,
params );
 
-                column.setValue( "<a href=\"" + url + ">" + project.getBuildNumber()
+ "</a>" );
+                    return "<a href=\"" + url + ">" + project.getBuildNumber() + "</a>";
+                }
+                else
+                {
+                    return "&nbsp;";
+                }
             }
             else
             {
-                column.setValue( "&nbsp;" );
+                return "<b>In&nbsp;progress</b>";
             }
-        }
-        else
-        {
-            column.setValue( "<b>In&nbsp;progress</b>" );
         }
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
Wed Jun 14 07:51:58 2006
@@ -19,9 +19,7 @@
 import org.apache.maven.continuum.web.model.SummaryProjectModel;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
-
-import javax.servlet.http.HttpServletRequest;
+import org.extremecomponents.table.core.TableModel;
 
 /**
  * Used in Summary view
@@ -32,19 +30,23 @@
 public class BuildNowCell
     extends DisplayCell
 {
-    public void init( BaseModel model, Column column )
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init( model, column );
-
-        SummaryProjectModel project = (SummaryProjectModel) model.getCurrentCollectionBean();
+        SummaryProjectModel project = (SummaryProjectModel) tableModel.getCurrentRowBean();
 
-        HttpServletRequest request = (HttpServletRequest) model.getPageContext().getRequest();
+        String contextPath = tableModel.getContext().getContextPath();
 
-        if ( !project.isInQueue()
-            && ( project.getState() == 1 || project.getState() == 2 || project.getState()
== 3 || project.getState() == 4 ) )
+        if ( !project.isInQueue() && ( project.getState() == 1 || project.getState()
== 2 || project.getState() == 3 ||
+            project.getState() == 4 ) )
+        {
+            return "<a href=\"" + contextPath + "/buildProject.action?projectId=" + project.getId()
+ "\"><img src=\"" +
+                contextPath +
+                "/images/buildnow.gif\" alt=\"Build Now\" title=\"Build Now\" width=\"16\"
height=\"16\" border=\"0\"></a>";
+        }
+        else
         {
-            column.setValue( "<a href=\"" + request.getContextPath() + "/buildProject.action?projectId="
-                + project.getId() + "\">Build Now</a>" );
+            return "<img src=\"" + contextPath +
+                "/images/buildnow_disabled.gif\" alt=\"Build Now\" title=\"Build Now\" width=\"16\"
height=\"16\" border=\"0\">";
         }
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
Wed Jun 14 07:51:58 2006
@@ -16,18 +16,15 @@
  * limitations under the License.
  */
 
+import com.opensymphony.webwork.ServletActionContext;
+import com.opensymphony.webwork.views.util.UrlHelper;
 import org.apache.maven.continuum.web.model.SummaryProjectModel;
 import org.apache.maven.continuum.web.util.StateGenerator;
-
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
-
-import com.opensymphony.webwork.ServletActionContext;
-import com.opensymphony.webwork.views.util.UrlHelper;
+import org.extremecomponents.table.core.TableModel;
 
 import java.util.HashMap;
-import javax.servlet.http.HttpServletRequest;
 
 /**
  * Used in Summary view
@@ -38,17 +35,13 @@
 public class StateCell
     extends DisplayCell
 {
-    public void init(BaseModel model, Column column)
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init(model, column);
-
-        SummaryProjectModel project = (SummaryProjectModel) model.getCurrentCollectionBean();
+        SummaryProjectModel project = (SummaryProjectModel) tableModel.getCurrentRowBean();
 
         int latestBuildId = project.getLatestBuildId();
 
-        HttpServletRequest request = (HttpServletRequest) model.getPageContext().getRequest();
-
-        String state = StateGenerator.generate( project.getState(), request.getContextPath()
);
+        String state = StateGenerator.generate( project.getState(), tableModel.getContext().getContextPath()
);
 
         if ( project.getState() == 1 || project.getState() == 2 || project.getState() ==
3 || project.getState() == 4 )
         {
@@ -65,16 +58,16 @@
                 String url = UrlHelper.buildUrl( "/buildResult.action", ServletActionContext.getRequest(),
                                                  ServletActionContext.getResponse(), params
);
 
-                column.setValue( "<a href=\"" + url + "\">" + state + "</a>"
);
+                return "<a href=\"" + url + "\">" + state + "</a>";
             }
             else
             {
-                column.setValue( state );
+                return state;
             }
         }
         else
         {
-            column.setValue( "&nbsp;" );
+            return "&nbsp;";
         }
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/buildresults/StateCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/buildresults/StateCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/buildresults/StateCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/buildresults/StateCell.java
Wed Jun 14 07:51:58 2006
@@ -17,12 +17,12 @@
  */
 
 import org.apache.maven.continuum.web.util.StateGenerator;
-
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
+import org.extremecomponents.table.core.TableModel;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.PageContext;
 
 /**
  * Used in BuildResults
@@ -33,11 +33,11 @@
 public class StateCell
     extends DisplayCell
 {
-    public void init(BaseModel model, Column column)
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init(model, column);
+        PageContext pageContext = (PageContext) tableModel.getContext().getContextObject();
 
-        HttpServletRequest request = (HttpServletRequest) model.getPageContext().getRequest();
+        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
 
         Object value = column.getPropertyValue();
 
@@ -45,13 +45,13 @@
 
         if ( value instanceof Integer )
         {
-            state = ( (Integer) value).intValue();
+            state = ( (Integer) value ).intValue();
         }
 
         value = StateGenerator.generate( state, request.getContextPath() );
 
-        column.setValue(value);
+        column.setPropertyValue( value );
 
-        column.setPropertyValue(value);
+        return value.toString();
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/commons/DateCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/commons/DateCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/commons/DateCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/commons/DateCell.java
Wed Jun 14 07:51:58 2006
@@ -16,16 +16,15 @@
  * limitations under the License.
  */
 
-import java.util.Calendar;
-import java.util.Locale;
-
 import org.codehaus.plexus.util.StringUtils;
-
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
+import org.extremecomponents.table.core.TableModel;
 import org.extremecomponents.util.ExtremeUtils;
 
+import java.util.Calendar;
+import java.util.Locale;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -33,15 +32,13 @@
 public class DateCell
     extends DisplayCell
 {
-    public void init(BaseModel model, Column column)
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init(model, column);
-
         String valueString = column.getPropertyValueAsString();
 
         if ( !StringUtils.isEmpty( valueString ) && !"0".equals( valueString ) )
         {
-            Locale locale = model.getTableHandler().getTable().getLocale();
+            Locale locale = tableModel.getLocale();
 
             Object value = column.getPropertyValue();
 
@@ -49,16 +46,20 @@
             {
                 Calendar cal = Calendar.getInstance();
 
-                cal.setTimeInMillis( ( (Long) value).longValue() );
+                cal.setTimeInMillis( ( (Long) value ).longValue() );
 
                 value = cal.getTime();
             }
 
             value = ExtremeUtils.formatDate( column.getParse(), column.getFormat(), value,
locale );
 
-            column.setValue(value);
+            column.setPropertyValue( value );
 
-            column.setPropertyValue(value);
+            return value.toString();
+        }
+        else
+        {
+            return "&nbsp;";
         }
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierEventCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierEventCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierEventCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierEventCell.java
Wed Jun 14 07:51:58 2006
@@ -19,7 +19,7 @@
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
+import org.extremecomponents.table.core.TableModel;
 
 /**
  * Used in Project view
@@ -30,11 +30,9 @@
 public class NotifierEventCell
     extends DisplayCell
 {
-    public void init( BaseModel model, Column column )
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init( model, column );
-
-        ProjectNotifier notifier = (ProjectNotifier) model.getCurrentCollectionBean();
+        ProjectNotifier notifier = (ProjectNotifier) tableModel.getCurrentRowBean();
 
         String event = "";
 
@@ -58,6 +56,6 @@
             event += "Errors";
         }
 
-        column.setValue( event );
+        return event;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierFromCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierFromCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierFromCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierFromCell.java
Wed Jun 14 07:51:58 2006
@@ -19,7 +19,7 @@
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
+import org.extremecomponents.table.core.TableModel;
 
 /**
  * Used in Project view
@@ -30,19 +30,17 @@
 public class NotifierFromCell
     extends DisplayCell
 {
-    public void init( BaseModel model, Column column )
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init( model, column );
-
-        ProjectNotifier notifier = (ProjectNotifier) model.getCurrentCollectionBean();
+        ProjectNotifier notifier = (ProjectNotifier) tableModel.getCurrentRowBean();
 
         if ( notifier.isFromProject() )
         {
-            column.setValue( "Project" );
+            return "Project";
         }
         else
         {
-            column.setValue( "User" );
+            return "User";
         }
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java?rev=414280&r1=414279&r2=414280&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
Wed Jun 14 07:51:58 2006
@@ -19,7 +19,7 @@
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
-import org.extremecomponents.table.core.BaseModel;
+import org.extremecomponents.table.core.TableModel;
 
 /**
  * Used in Project view
@@ -30,11 +30,9 @@
 public class NotifierRecipientCell
     extends DisplayCell
 {
-    public void init( BaseModel model, Column column )
+    protected String getCellValue( TableModel tableModel, Column column )
     {
-        super.init( model, column );
-
-        ProjectNotifier notifier = (ProjectNotifier) model.getCurrentCollectionBean();
+        ProjectNotifier notifier = (ProjectNotifier) tableModel.getCurrentRowBean();
 
         if ( "irc".equals( notifier.getType() ) )
         {
@@ -55,11 +53,11 @@
                 address += notifier.getConfiguration().get( "channel" );
             }
 
-            column.setValue( address );
+            return address;
         }
         else
         {
-            column.setValue( notifier.getConfiguration().get( "address" ) );
+            return notifier.getConfiguration().get( "address" ).toString();
         }
     }
 }



Mime
View raw message