Author: ate
Date: Sat Dec 12 19:18:21 2009
New Revision: 889962
URL: http://svn.apache.org/viewvc?rev=889962&view=rev
Log:
JS2-5057: minor adjustments to get toolbox working when the portal is deployed
under / (ROOT)
Modified:
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
Modified:
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp?rev=889962&r1=889961&r2=889962&view=diff
==============================================================================
---
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
(original)
+++
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
Sat Dec 12 19:18:21 2009
@@ -31,10 +31,15 @@
<portlet:defineObjects/>
<c_rt:set var="requestContext"
value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="portalContextPrefix"
value="${requestContext.request.contextPath}"/>
<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
+<c:set var="portalPath" value="${requestContext.portalURL.path}"/>
<c:if test="${empty portalContextPath}">
<c:set var="portalContextPath" value="/"/>
</c:if>
+<c:if test="${empty portalPath}">
+ <c:set var="portalPath" value="/"/>
+</c:if>
<table style="border-collapse: collapse; width: 100%; margin-top: 0px;
margin-bottom: 0px; float: left;">
<tr>
@@ -234,9 +239,9 @@
clone.setStyle('display', '');
var imgNode = clone.one('img');
if (def.portletIcon) {
- imgNode.set("src", "${portalContextPath}/images/portlets/" +
def.portletIcon);
+ imgNode.set("src", "${portalContextPrefix}/images/portlets/" +
def.portletIcon);
} else {
- imgNode.set("src",
"${portalContextPath}/images/portlets/applications-other.png");
+ imgNode.set("src",
"${portalContextPefix}/images/portlets/applications-other.png");
}
var nameNode = clone.one('div');
@@ -270,7 +275,7 @@
return;
}
Y.Cookie.set("toolboxcat", category);
- var uri =
"${portalContextPath}/services/portletregistry/definition/?_type=json";
+ var uri =
"${portalContextPrefix}/services/portletregistry/definition/?_type=json";
uri += "&query=" + category;
var request = Y.io(uri, { on: { complete: onLoadPortletComplete } });
Y.Node.getDOMNode(Y.Node.one("#<portlet:namespace/>form")).query.value
= "";
@@ -279,7 +284,7 @@
var loadPortletsByQuery = function(e) {
var form = Y.Node.getDOMNode(e.target);
var query = form.query.value;
- var uri =
"${portalContextPath}/services/portletregistry/definition/?_type=json";
+ var uri =
"${portalContextPrefix}/services/portletregistry/definition/?_type=json";
if (query) {
uri += "&query=" + query;
}
@@ -315,11 +320,11 @@
var portletUniqueName = a.getAttribute("portletUniqueName");
if (portletUniqueName) {
- var uri =
"${portalContextPath}/services/pagelayout/fragment/portlet/" +
portletUniqueName + "/?_type=json";
+ var uri =
"${portalContextPrefix}/services/pagelayout/fragment/portlet/" +
portletUniqueName + "/?_type=json";
var config = {
on: { complete: onAddPortletComplete },
method: "POST",
- headers: { "X-Portal-Path" :
"${requestContext.portalURL.path}" }
+ headers: { "X-Portal-Path" : "${portalPath}" }
};
var request = Y.io(uri, config);
}
@@ -341,4 +346,4 @@
switchTab(tabId);
});
-</script>
+</script>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]