You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by es...@apache.org on 2007/07/09 01:44:48 UTC
svn commit: r554485 - in
/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl:
PortalURLImpl.java PortalURLParserImpl.java RelativePortalURLImpl.java
Author: esm
Date: Sun Jul 8 16:44:47 2007
New Revision: 554485
URL: http://svn.apache.org/viewvc?view=rev&rev=554485
Log:
[PLUTO-356]: PortalURLParser is now provided on construction to RelativePortalURLImpl (thanks Nate Johnson!)
Modified:
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java?view=diff&rev=554485&r1=554484&r2=554485
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java Sun Jul 8 16:44:47 2007
@@ -16,18 +16,19 @@
*/
package org.apache.pluto.driver.url.impl;
-import org.apache.pluto.driver.url.PortalURL;
-import org.apache.pluto.driver.url.PortalURLParameter;
-
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.driver.url.PortalURLParameter;
+import org.apache.pluto.driver.url.PortalURLParser;
+
/**
* The portal URL.
* @since 1.0
@@ -41,6 +42,12 @@
private String servletPath;
private String renderPath;
private String actionWindow;
+
+ /**
+ * PortalURLParser used to construct the string
+ * representation of this portal url.
+ */
+ private PortalURLParser urlParser;
/** The window states: key is the window ID, value is WindowState. */
private Map windowStates = new HashMap();
@@ -63,8 +70,9 @@
public PortalURLImpl(String protocol,
String hostName,
String contextPath,
- String servletName) {
- this(protocol, hostName, -1, contextPath, servletName);
+ String servletName,
+ PortalURLParser urlParser) {
+ this(protocol, hostName, -1, contextPath, servletName, urlParser);
}
/**
@@ -79,7 +87,8 @@
String hostName,
int port,
String contextPath,
- String servletName) {
+ String servletName,
+ PortalURLParser urlParser) {
StringBuffer buffer = new StringBuffer();
buffer.append(protocol);
buffer.append(hostName);
@@ -92,6 +101,7 @@
buffer.append(contextPath);
buffer.append(servletName);
servletPath = buffer.toString();
+ this.urlParser = urlParser;
}
/**
@@ -190,7 +200,7 @@
* @see org.apache.pluto.driver.url.impl.PortalURLParserImpl#toString(PortalURL)
*/
public String toString() {
- return PortalURLParserImpl.getParser().toString(this);
+ return urlParser.toString(this);
}
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java?view=diff&rev=554485&r1=554484&r2=554485
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java Sun Jul 8 16:44:47 2007
@@ -104,7 +104,7 @@
String servletName = request.getServletPath();
// Construct portal URL using info retrieved from servlet request.
- PortalURL portalURL = new RelativePortalURLImpl(contextPath, servletName);
+ PortalURL portalURL = new RelativePortalURLImpl(contextPath, servletName, this);
// Support added for filter. Should we seperate into a different impl?
String pathInfo = request.getPathInfo();
@@ -113,7 +113,7 @@
int idx = servletName.indexOf(".jsp")+".jsp".length();
pathInfo = servletName.substring(idx);
servletName = servletName.substring(0, idx);
- portalURL = new RelativePortalURLImpl(contextPath, servletName);
+ portalURL = new RelativePortalURLImpl(contextPath, servletName, this);
} else {
return portalURL;
}
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java?view=diff&rev=554485&r1=554484&r2=554485
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java Sun Jul 8 16:44:47 2007
@@ -16,18 +16,20 @@
*/
package org.apache.pluto.driver.url.impl;
-import org.apache.pluto.driver.url.PortalURL;
-import org.apache.pluto.driver.url.PortalURLParameter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-import java.util.Map;
-import java.util.HashMap;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.driver.url.PortalURLParameter;
+import org.apache.pluto.driver.url.PortalURLParser;
/**
* The portal URL.
@@ -39,7 +41,13 @@
private String servletPath;
private String renderPath;
- private String actionWindow;
+ private String actionWindow;
+
+ /**
+ * PortalURLParser used to construct the string
+ * representation of this portal url.
+ */
+ private PortalURLParser urlParser;
/** The window states: key is the window ID, value is WindowState. */
private Map windowStates = new HashMap();
@@ -53,12 +61,14 @@
* Constructs a PortalURLImpl instance using customized port.
* @param contextPath the servlet context path.
* @param servletName the servlet name.
+ * @param urlParser the {@link PortalURLParser} used to construct a string representation of the url.
*/
- public RelativePortalURLImpl(String contextPath, String servletName) {
+ public RelativePortalURLImpl(String contextPath, String servletName, PortalURLParser urlParser) {
StringBuffer buffer = new StringBuffer();
buffer.append(contextPath);
buffer.append(servletName);
servletPath = buffer.toString();
+ this.urlParser = urlParser;
}
/**
@@ -157,7 +167,7 @@
* @see PortalURLParserImpl#toString(org.apache.pluto.driver.url.PortalURL)
*/
public String toString() {
- return PortalURLParserImpl.getParser().toString(this);
+ return urlParser.toString(this);
}
@@ -190,6 +200,7 @@
portalURL.windowStates = new HashMap(windowStates);
portalURL.renderPath = renderPath;
portalURL.actionWindow = actionWindow;
+ portalURL.urlParser = urlParser;
return portalURL;
}
}