continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1489423 - in /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web: action/WorkingCopyAction.java util/UrlHelperFactory.java view/BuildCell.java view/StateCell.java
Date Tue, 04 Jun 2013 13:09:34 GMT
Author: batkinson
Date: Tue Jun  4 13:09:33 2013
New Revision: 1489423

URL: http://svn.apache.org/r1489423
Log:
Latest struts2 removed static methods from UrlHelper

Added:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/UrlHelperFactory.java
Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java?rev=1489423&r1=1489422&r2=1489423&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
Tue Jun  4 13:09:33 2013
@@ -23,6 +23,7 @@ import org.apache.continuum.builder.dist
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.maven.continuum.web.util.UrlHelperFactory;
 import org.apache.maven.continuum.web.util.WorkingCopyContentGenerator;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.views.util.UrlHelper;
@@ -111,10 +112,12 @@ public class WorkingCopyAction
 
         params.put( "projectName", projectName );
 
-        String baseUrl = UrlHelper.buildUrl( "/workingCopy.action", ServletActionContext.getRequest(),
+        UrlHelper urlHelper = UrlHelperFactory.getInstance();
+        
+        String baseUrl = urlHelper.buildUrl( "/workingCopy.action", ServletActionContext.getRequest(),
                                              ServletActionContext.getResponse(), params );
 
-        String imagesBaseUrl = UrlHelper.buildUrl( "/images/", ServletActionContext.getRequest(),
+        String imagesBaseUrl = urlHelper.buildUrl( "/images/", ServletActionContext.getRequest(),
                                                    ServletActionContext.getResponse(), params
);
 
         imagesBaseUrl = imagesBaseUrl.substring( 0, imagesBaseUrl.indexOf( "/images/" ) +
"/images/".length() );

Added: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/UrlHelperFactory.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/UrlHelperFactory.java?rev=1489423&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/UrlHelperFactory.java
(added)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/util/UrlHelperFactory.java
Tue Jun  4 13:09:33 2013
@@ -0,0 +1,14 @@
+package org.apache.maven.continuum.web.util;
+
+import org.apache.struts2.views.util.DefaultUrlHelper;
+import org.apache.struts2.views.util.UrlHelper;
+
+public class UrlHelperFactory {
+	
+	private UrlHelperFactory() {}
+	
+	public static UrlHelper getInstance() {
+		return new DefaultUrlHelper();
+	}
+
+}

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java?rev=1489423&r1=1489422&r2=1489423&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
Tue Jun  4 13:09:33 2013
@@ -19,10 +19,15 @@ package org.apache.maven.continuum.web.v
  * under the License.
  */
 
-import com.opensymphony.xwork2.ActionContext;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.PageContext;
+
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.model.ProjectSummary;
-import org.apache.struts2.views.util.UrlHelper;
+import org.apache.maven.continuum.web.util.UrlHelperFactory;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -34,10 +39,7 @@ import org.extremecomponents.table.bean.
 import org.extremecomponents.table.cell.DisplayCell;
 import org.extremecomponents.table.core.TableModel;
 
-import java.util.HashMap;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.PageContext;
+import com.opensymphony.xwork2.ActionContext;
 
 /**
  * Used in Summary view
@@ -92,7 +94,7 @@ public class BuildCell
 
                     HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
 
-                    String url = UrlHelper.buildUrl( "/buildResult.action", request, response,
params );
+                    String url = UrlHelperFactory.getInstance().buildUrl( "/buildResult.action",
request, response, params );
 
                     if ( isAuthorized( project ) )
                     {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java?rev=1489423&r1=1489422&r2=1489423&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/StateCell.java
Tue Jun  4 13:09:33 2013
@@ -19,14 +19,15 @@ package org.apache.maven.continuum.web.v
  * under the License.
  */
 
-import com.opensymphony.xwork2.ActionContext;
+import java.util.HashMap;
+
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.model.ProjectSummary;
 import org.apache.maven.continuum.web.util.StateGenerator;
+import org.apache.maven.continuum.web.util.UrlHelperFactory;
 import org.apache.struts2.ServletActionContext;
-import org.apache.struts2.views.util.UrlHelper;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -38,7 +39,7 @@ import org.extremecomponents.table.bean.
 import org.extremecomponents.table.cell.DisplayCell;
 import org.extremecomponents.table.core.TableModel;
 
-import java.util.HashMap;
+import com.opensymphony.xwork2.ActionContext;
 
 /**
  * Used in Summary view
@@ -145,7 +146,7 @@ public class StateCell
 
         params.put( "projectGroupId", project.getProjectGroupId() );
 
-        String url = UrlHelper.buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
+        String url = UrlHelperFactory.getInstance().buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
                                          ServletActionContext.getResponse(), params );
 
         return "<a href=\"" + url + "\">" + state + "</a>";
@@ -159,7 +160,7 @@ public class StateCell
 
         params.put( "projectScmRootId", scmRoot.getId() );
 
-        String url = UrlHelper.buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
+        String url = UrlHelperFactory.getInstance().buildUrl( "/" + action + ".action", ServletActionContext.getRequest(),
                                          ServletActionContext.getResponse(), params );
 
         return "<a href=\"" + url + "\">" + state + "</a>";



Mime
View raw message