Author: ate
Date: Wed Nov 28 04:32:42 2007
New Revision: 598982
URL: http://svn.apache.org/viewvc?rev=598982&view=rev
Log:
Fix for JS2-816: Jetspeed common javascript doesn't support running the portal
under ROOT context
See: https://issues.apache.org/jira/browse/JS2-816
Modified:
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
Modified:
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java?rev=598982&r1=598981&r2=598982&view=diff
==============================================================================
---
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
(original)
+++
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
Wed Nov 28 04:32:42 2007
@@ -995,6 +995,10 @@
//preinitOut.append( " " ).append( "function
de_jsessionid_url(url){var tEnds = url.indexOf(';jsessionid=');if (tEnds > 0)
url = url.substring(0, tEnds);return url;}" ).append( EOL );
// presence of ;jsessionid in dojo baseScriptUri is bad news
preinitOut.append( " " ).append( "djConfig.baseScriptUri = \""
).append( getPortalResourceUrl( dojoGetPath(), false ) ).append( "\";"
).append( EOL );
+ if (this.requestContext.getRequest().getContextPath().length()==0)
+ {
+ preinitOut.append( " " ).append( "djConfig.jetspeed.rootContext
= \"true\";" ).append( EOL );
+ }
preinitOut.append( " " ).append( "djConfig.jetspeed.servletPath =
\"" ).append( this.requestContext.getRequest().getServletPath() ).append( "\";"
);
return preinitOut.toString();
}
Modified:
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js?rev=598982&r1=598981&r2=598982&view=diff
==============================================================================
---
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js
(original)
+++
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.js
Wed Nov 28 04:32:42 2007
@@ -168,28 +168,32 @@
}
var _19=jsU.parse(_18);
var _1a=_19.path;
-var _1b=-1;
-for(var _1c=1;_1b<=_1c;_1c++){
-_1b=_1a.indexOf("/",_1c);
-if(_1b==-1){
-break;
-}
-}
-var _1d="";
+var _1b="";
if(_19.scheme!=null){
-_1d+=_19.scheme+":";
+_1b+=_19.scheme+":";
}
if(_19.authority!=null){
-_1d+="//"+_19.authority;
+_1b+="//"+_19.authority;
}
-var _1e=null;
-if(_1b==-1){
-_1e=_1a;
+var _1c=null;
+if(djConfig.jetspeed.rootContext){
+_1c="";
+}else{
+var _1d=-1;
+for(var _1e=1;_1d<=_1e;_1e++){
+_1d=_1a.indexOf("/",_1e);
+if(_1d==-1){
+break;
+}
+}
+if(_1d==-1){
+_1c=_1a;
}else{
-_1e=_1a.substring(0,_1b);
+_1c=_1a.substring(0,_1d);
+}
}
-_16.JETSPEED=_1e;
-_16.SERVER=_1d;
+_16.JETSPEED=_1c;
+_16.SERVER=_1b;
_16.AJAX_API=_16.JETSPEED+"/ajaxapi";
_16.DESKTOP=_16.JETSPEED+"/desktop";
_16.PORTAL=_16.JETSPEED+"/portal";
@@ -712,4 +716,4 @@
};
}
jetspeed.initcommon();
-
+
Modified:
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js?rev=598982&r1=598981&r2=598982&view=diff
==============================================================================
---
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
(original)
+++
portals/jetspeed-2/branches/JETSPEED-2.1.3/src/webapp/javascript/jetspeed/common.src.js
Wed Nov 28 04:32:42 2007
@@ -36,7 +36,6 @@
if ( ! jetspeed.om )
jetspeed.om = {};
-
// jetspeed version
jetspeed.version =
@@ -250,23 +249,30 @@
var basePath = baseTag.path;
- var sepPos = -1;
- for( var startPos =1 ; sepPos <= startPos ; startPos++ )
- {
- sepPos = basePath.indexOf( "/", startPos );
- if ( sepPos == -1 )
- break;
- }
-
var serverUri = "";
if ( baseTag.scheme != null) { serverUri += baseTag.scheme + ":"; }
if ( baseTag.authority != null) { serverUri += "//" + baseTag.authority; }
var jetspeedPath = null;
- if ( sepPos == -1 )
- jetspeedPath = basePath;
+ if ( djConfig.jetspeed.rootContext )
+ {
+ jetspeedPath = "";
+ }
else
+ {
+ var sepPos = -1;
+ for( var startPos =1 ; sepPos <= startPos ; startPos++ )
+ {
+ sepPos = basePath.indexOf( "/", startPos );
+ if ( sepPos == -1 )
+ break;
+ }
+
+ if ( sepPos == -1 )
+ jetspeedPath = basePath;
+ else
jetspeedPath = basePath.substring( 0, sepPos );
+ }
//dojo.debug( "pathInitialize new-JETSPEED=" + jetspeedPath + "
orig-JETSPEED=" + jsUP.JETSPEED + " new-SERVER=" + serverUri + " orig-SERVER="
+ document.location.protocol + "//" + document.location.host );
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]