Author: julien(a)jboss.com
Date: 2007-03-20 07:16:55 -0400 (Tue, 20 Mar 2007)
New Revision: 6772
Modified:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
Log:
fix cms content editor on safari because JSP url where generated using
<p:portletURL/> which was causing extra space in the HREF attribute of link and
causing issues.
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-03-20
10:11:40 UTC (rev 6771)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-03-20
11:16:55 UTC (rev 6772)
@@ -5,6 +5,7 @@
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.StringTokenizer" %>
+<%@ page import="javax.portlet.PortletURL" %>
<%@ page language="java"
extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
@@ -17,13 +18,13 @@
List folders = (List)request.getAttribute("folders");
List files = (List)request.getAttribute("files");
String uri = (String)renderRequest.getParameter("uri");
+ PortletURL url = renderResponse.createRenderURL();
+ url.setParameter("op", CMSAdminConstants.OP_MAIN);
+ url.setParameter("path", "/");
%>
<!-- Currently browsing -->
-Browsing: <a href="<portlet:renderURL>
-<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN
%>"/>
-<portlet:param name="path" value="/"/>
- </portlet:renderURL>">Home</a>
+Browsing: <a href="<%= url %>">Home</a>
<%
StringTokenizer parser = new StringTokenizer(sCurrPath, "/");
String sPathBuilder = "";
@@ -33,13 +34,9 @@
sPathBuilder += "/" + sPathChunk;
if (parser.hasMoreTokens())
{
+ url.setParameter("path", sPathBuilder);
%>
-> <a href="
-<portlet:renderURL>
- <portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN
%>"/>
- <portlet:param name="path" value="<%= sPathBuilder
%>"/>
-</portlet:renderURL>
-"><%= sPathChunk %>
+> <a href="<%= url %>"><%= sPathChunk %>
</a>
<%
}
@@ -72,15 +69,13 @@
for (int i = 0; i < folders.size(); i++)
{
Folder folder = (Folder)folders.get(i);
+ url.setParameter("path", folder.getBasePath());
%>
<tr onmouseover="this.className='portlet-section-alternate';"
onmouseout="this.className='portlet-section-body';">
<td><img
src="<%= renderRequest.getContextPath() +
CMSAdminConstants.DEFAULT_IMAGES_PATH%>/folder.gif"
alt="${n:i18n("CMS_FOLDER")}"
- border="0"> <a href="<portlet:renderURL>
- <portlet:param name="op" value="<%=
CMSAdminConstants.OP_MAIN %>"/>
- <portlet:param name="path" value="<%= folder.getBasePath()
%>"/>
- </portlet:renderURL>"><%=
+ border="0"> <a href="<%= url
%>"><%=
folder.getBasePath().substring(folder.getBasePath().lastIndexOf("/") + 1,
folder.getBasePath().length()) %>
</a>
</td>
@@ -88,14 +83,17 @@
<%
}
}
-%>
-<%
if (files.size() > 0)
{
for (int j = 0; j < files.size(); j++)
{
File file = (File)files.get(j);
+ PortletURL metaURL = renderResponse.createActionURL();
+ metaURL.setParameter("uri", file.getBasePath());
+ metaURL.setParameter("path", sCurrPath);
+ metaURL.setParameter("meta_action", "select");
+
if ((uri!=null) && (uri.equals(file.getBasePath())))
{
out.println("<tr
class=\"portlet-section-selected\">");
@@ -105,13 +103,10 @@
out.println("<tr
onmouseover=\"this.className='portlet-section-alternate';\"
onmouseout=\"this.className='portlet-section-body';\">");
}
%>
+<tr>
<td><img src="<%= renderRequest.getContextPath() +
CMSAdminConstants.DEFAULT_IMAGES_PATH%>/file.gif"
alt="${n:i18n("CMS_FILE")}"
- border="0"> <a href="<portlet:actionURL>
- <portlet:param name="uri" value="<%= file.getBasePath()
%>"/>
- <portlet:param name="path" value="<%= sCurrPath
%>"/>
- <portlet:param name="meta_action" value="select"/>
- </portlet:actionURL>"><%=
+ border="0"> <a href="<%= metaURL
%>"><%=
file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1,
file.getBasePath().length()) %>
</a>
</td>