Author: sdumitriu
Date: 2008-02-08 19:39:55 +0100 (Fri, 08 Feb 2008)
New Revision: 7412
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiDebugGWTURLFactory.java
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiPortletURLFactory.java
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiServletURLFactory.java
Log:
XWIKI-2093: Improper names for the URL components in XWikiServletURLFactory
Fixed.
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiDebugGWTURLFactory.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiDebugGWTURLFactory.java
2008-02-08 18:27:46 UTC (rev 7411)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiDebugGWTURLFactory.java
2008-02-08 18:39:55 UTC (rev 7412)
@@ -11,9 +11,9 @@
public void init(XWikiContext context) {
URL url = context.getURL();
- servletPath = "/xwiki/";
+ contextPath = "/xwiki/";
- actionPath = "bin/";
+ servletPath = "bin/";
try {
serverURL = new URL(url.getProtocol(), url.getHost(), 1025, "/");
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiPortletURLFactory.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiPortletURLFactory.java
2008-02-08 18:27:46 UTC (rev 7411)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiPortletURLFactory.java
2008-02-08 18:39:55 UTC (rev 7412)
@@ -41,8 +41,8 @@
} catch (Exception e) {
}
- servletPath = "xwiki/";
- actionPath = "bin/";
+ contextPath = "xwiki/";
+ servletPath = "bin/";
}
public URL createAttachmentURL(String filename, String web, String name,
String action, String xwikidb, XWikiContext context) {
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiServletURLFactory.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiServletURLFactory.java
2008-02-08 18:27:46 UTC (rev 7411)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/XWikiServletURLFactory.java
2008-02-08 18:39:55 UTC (rev 7412)
@@ -37,10 +37,10 @@
{
protected URL serverURL;
+ protected String contextPath;
+
protected String servletPath;
- protected String actionPath;
-
public XWikiServletURLFactory()
{
}
@@ -49,8 +49,8 @@
public XWikiServletURLFactory(URL serverURL, String servletPath, String
actionPath)
{
this.serverURL = serverURL;
- this.servletPath = servletPath;
- this.actionPath = actionPath;
+ this.contextPath = servletPath;
+ this.servletPath = actionPath;
}
// Used by tests
@@ -69,24 +69,24 @@
String path = url.getPath();
String servletpath = context.getRequest().getServletPath();
- servletPath =
+ contextPath =
(context.getWiki() == null) ? "" :
context.getWiki().Param("xwiki.servletpath", "");
- if (servletPath.equals("")) {
+ if (contextPath.equals("")) {
try {
- servletPath =
context.getRequest().getContextPath().substring(1) + "/";
+ contextPath =
context.getRequest().getContextPath().substring(1) + "/";
} catch (Exception e) {
- servletPath = path.substring(0, path.indexOf('/', 1) + 1);
+ contextPath = path.substring(0, path.indexOf('/', 1) + 1);
}
}
- actionPath = context.getWiki().Param("xwiki.actionpath", "");
- if (actionPath.equals("")) {
+ servletPath = context.getWiki().Param("xwiki.actionpath", "");
+ if (servletPath.equals("")) {
if (servletpath.startsWith("/bin")) {
- actionPath = "bin/";
+ servletPath = "bin/";
} else if
(context.getRequest().getServletPath().startsWith("/testbin")) {
- actionPath = "testbin/";
+ servletPath = "testbin/";
} else {
- actionPath =
context.getWiki().Param("xwiki.defaultactionpath", "bin/");
+ servletPath =
context.getWiki().Param("xwiki.defaultactionpath", "bin/");
}
}
@@ -97,9 +97,9 @@
}
}
- public String getServletPath()
+ public String getContextPath()
{
- return servletPath;
+ return contextPath;
}
private URL getServerURL(XWikiContext context) throws MalformedURLException
@@ -161,8 +161,8 @@
querystring = querystring + "&" +
context.getLinksQueryString();
}
- StringBuffer newpath = new StringBuffer(servletPath);
- newpath.append(actionPath);
+ StringBuffer newpath = new StringBuffer(contextPath);
+ newpath.append(servletPath);
addAction(newpath, action, context);
addSpace(newpath, web, action, context);
@@ -246,7 +246,7 @@
public URL createSkinURL(String filename, String skin, XWikiContext
context)
{
- StringBuffer newpath = new StringBuffer(servletPath);
+ StringBuffer newpath = new StringBuffer(contextPath);
newpath.append("skins/");
newpath.append(skin);
addFileName(newpath, filename, false, context);
@@ -261,8 +261,8 @@
public URL createSkinURL(String filename, String web, String name, String
xwikidb,
XWikiContext context)
{
- StringBuffer newpath = new StringBuffer(servletPath);
- newpath.append(actionPath);
+ StringBuffer newpath = new StringBuffer(contextPath);
+ newpath.append(servletPath);
addAction(newpath, "skin", context);
addSpace(newpath, web, "skin", context);
addName(newpath, name, "skin", context);
@@ -277,7 +277,7 @@
public URL createTemplateURL(String filename, XWikiContext context)
{
- StringBuffer newpath = new StringBuffer(servletPath);
+ StringBuffer newpath = new StringBuffer(contextPath);
newpath.append("templates");
addFileName(newpath, filename, false, context);
try {
@@ -291,8 +291,8 @@
public URL createAttachmentURL(String filename, String web, String name,
String action,
String querystring, String xwikidb, XWikiContext context)
{
- StringBuffer newpath = new StringBuffer(servletPath);
- newpath.append(actionPath);
+ StringBuffer newpath = new StringBuffer(contextPath);
+ newpath.append(servletPath);
addAction(newpath, action, context);
addSpace(newpath, web, action, context);
addName(newpath, name, action, context);
@@ -347,8 +347,8 @@
String revision, String querystring, String xwikidb, XWikiContext
context)
{
String action = "downloadrev";
- StringBuffer newpath = new StringBuffer(servletPath);
- newpath.append(actionPath);
+ StringBuffer newpath = new StringBuffer(contextPath);
+ newpath.append(servletPath);
addAction(newpath, action, context);
addSpace(newpath, web, action, context);
addName(newpath, name, action, context);
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications