Author: julien(a)jboss.com
Date: 2007-03-21 11:55:05 -0400 (Wed, 21 Mar 2007)
New Revision: 6789
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
Log:
updated the render parameter convention to be clearer for portlet content editors
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-03-21
15:36:51 UTC (rev 6788)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-03-21
15:55:05 UTC (rev 6789)
@@ -63,6 +63,18 @@
{
/** . */
+ private static final String CONTENT_ACTION_SELECT =
"content.action.select";
+
+ /** . */
+ private static final String CONTENT_URI = "content.uri";
+
+ /** . */
+ private static final String CONTENT_PARAM_PREFIX = "content.param.";
+
+ /** . */
+ private static final int CONTENT_PARAM_PREFIX_LENGTH = CONTENT_PARAM_PREFIX.length();
+
+ /** . */
private static final int MOVE_UP = 'u';
/** . */
@@ -211,9 +223,9 @@
{
PortletActionEvent actionEvent = (PortletActionEvent)event;
Map actionParams = actionEvent.getParameterMap();
- if (actionParams.get("meta_action") != null)
+ if (actionParams.get(CONTENT_ACTION_SELECT) != null)
{
- String[] uris = (String[])actionParams.get("uri");
+ String[] uris = (String[])actionParams.get(CONTENT_URI);
if (uris != null && uris.length > 0)
{
String uri = uris[0];
@@ -247,9 +259,9 @@
{
Map.Entry entry = (Map.Entry)i.next();
String name = (String)entry.getKey();
- if (name.startsWith("param."))
+ if (name.startsWith(CONTENT_PARAM_PREFIX))
{
- String paramName = name.substring(6);
+ String paramName = name.substring(CONTENT_PARAM_PREFIX_LENGTH);
String paramValue = ((String[])entry.getValue())[0];
params.put(paramName, paramValue);
}
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java 2007-03-21
15:36:51 UTC (rev 6788)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java 2007-03-21
15:55:05 UTC (rev 6789)
@@ -66,10 +66,10 @@
{
if (req.getPortletMode().equals(EDIT_CONTENT))
{
- String uri = req.getParameter("uri");
+ String uri = req.getParameter("content.uri");
if (uri != null)
{
- resp.setRenderParameter("uri", uri);
+ resp.setRenderParameter("content.uri", uri);
}
}
}
@@ -88,7 +88,7 @@
protected void doEditContent(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- String selectedURI = req.getParameter("uri");
+ String selectedURI = req.getParameter("content.uri");
//
PortletURL actionURL = resp.createActionURL();
@@ -103,7 +103,7 @@
writer.print("<form action=\"");
writer.print(actionURL);
writer.print("\" method=\"post\">\n");
- writer.println("<select
name=\"uri\"size=\"20\">\n");
+ writer.println("<select
name=\"content.uri\"size=\"20\">\n");
for (int i = 0; i < available_instances.size(); i++)
{
Instance instance = (Instance)available_instances.get(i);
@@ -126,8 +126,8 @@
writer.println("</option>\n");
}
writer.println("</select>");
- writer.println("<input name=\"meta_action\"
value=\"Select\" type=\"submit\"/>");
- writer.println("<input name=\"select\" value=\"Info\"
type=\"submit\"/>");
+ writer.println("<input type=\"submit\"
name=\"content.action.select\" value=\"Select\"/>");
+ writer.println("<input type=\"submit\"
value=\"Info\"/>");
writer.print("</form>");
//
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-03-21
15:36:51 UTC (rev 6788)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-03-21
15:55:05 UTC (rev 6789)
@@ -60,17 +60,16 @@
{
if (req.getPortletMode().equals(EDIT_CONTENT))
{
- String uri = req.getParameter("uri");
+ String uri = req.getParameter("content.uri");
String path = req.getParameter("path");
if (uri != null)
{
- resp.setRenderParameter("uri", uri);
+ resp.setRenderParameter("content.uri", uri);
}
if (path != null)
{
resp.setRenderParameter("path", path);
}
- resp.setRenderParameter("meta_action", "blah");
}
}
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-21
15:36:51 UTC (rev 6788)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-03-21
15:55:05 UTC (rev 6789)
@@ -17,7 +17,7 @@
String sCurrPath = (String)request.getAttribute("currpath");
List folders = (List)request.getAttribute("folders");
List files = (List)request.getAttribute("files");
- String uri = (String)renderRequest.getParameter("uri");
+ String uri = (String)renderRequest.getParameter("content.uri");
PortletURL url = renderResponse.createRenderURL();
url.setParameter("op", CMSAdminConstants.OP_MAIN);
url.setParameter("path", "/");
@@ -90,9 +90,9 @@
File file = (File)files.get(j);
PortletURL metaURL = renderResponse.createActionURL();
- metaURL.setParameter("uri", file.getBasePath());
+ metaURL.setParameter("content.uri", file.getBasePath());
metaURL.setParameter("path", sCurrPath);
- metaURL.setParameter("meta_action", "select");
+ metaURL.setParameter("content.action.select", "select");
if ((uri!=null) && (uri.equals(file.getBasePath())))
{
Modified: trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
===================================================================
--- trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-03-21 15:36:51 UTC
(rev 6788)
+++ trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-03-21 15:55:05 UTC
(rev 6789)
@@ -63,7 +63,7 @@
%>
<p>You have selected the widget <%= selWidget.getTitle().getDefaultString()
%></p>
<p>
- <form action="<p:actionURL><p:param name="meta_action"
value="select"/><p:param name="uri" value="<%=
selWidget.getId() %>"/></p:actionURL>" method="post">
+ <form action="<p:actionURL><p:param
name="content.action.select" value="select"/><p:param
name="content.uri" value="<%= selWidget.getId()
%>"/></p:actionURL>" method="post">
<%
for (Iterator i =
selWidget.getPreferencesInfo().getPreferencesInfo().iterator(); i.hasNext();)
{
@@ -72,7 +72,7 @@
{
%>
- <input type="hidden" name="param.<%= prefInfo.getName()
%>" value="<%= prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "" %>"/>
+ <input type="hidden" name="content.param.<%=
prefInfo.getName() %>" value="<%= prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "" %>"/>
<%
}
}
@@ -93,7 +93,7 @@
break;
case DataType.ENUM:
%>
- <td><select name="param.<%= prefInfo.getName()
%>" class="portlet-form-field">
+ <td><select name="content.param.<%= prefInfo.getName()
%>" class="portlet-form-field">
<%
EnumType e = (EnumType)prefInfo.getType();
for (int j = 0;j < e.getSize();j++)
@@ -110,7 +110,7 @@
break;
default:
%>
- <td><input type="text" name="param.<%=
prefInfo.getName() %>" class="portlet-form-field" value="<%=
prefInfo.getDefaultValue() != null ? prefInfo.getDefaultValue() : ""
%>"/></td>
+ <td><input type="text" name="content.param.<%=
prefInfo.getName() %>" class="portlet-form-field" value="<%=
prefInfo.getDefaultValue() != null ? prefInfo.getDefaultValue() : ""
%>"/></td>
<%
break;
}