Author: chris.laprun(a)jboss.com
Date: 2009-10-28 14:54:30 -0400 (Wed, 28 Oct 2009)
New Revision: 440
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
Log:
- Removed renderParametersMap in UIPortlet as it was not appropriately reflecting the
navigational state and replaced it by a StateString instead.
This allows, in particular, handling of the case where the navigational state is opaque,
coming from a remote producer. Still not sure why
public parameters are merged into the navigational state, though...
- Use constants instead of hardcoded values for parameter names where possible.
- Added methods to get the default WindowState or PortletMode if none was provided in the
reponse, as this can be the case when interacting with
a remote producer.
- Removed unused code and cleaned up some.
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2009-10-28
13:55:12 UTC (rev 439)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2009-10-28
18:54:30 UTC (rev 440)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -38,6 +38,8 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.lifecycle.HtmlValidator;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
@@ -48,12 +50,9 @@
import java.util.Map;
import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
/**
* This class extends the abstract WebuiRequestContext which itself extends the
RequestContext one
- *
+ * <p/>
* It mainly implements the abstract methods and overide some.
*/
public class PortalRequestContext extends WebuiRequestContext
@@ -114,24 +113,34 @@
ajaxRequest_ = "true".equals(req.getParameter("ajaxRequest"));
String cache = req.getParameter(CACHE_LEVEL);
if (cache != null)
+ {
cacheLevel_ = cache;
+ }
requestURI_ = URLDecoder.decode(req.getRequestURI(), "UTF-8");
String pathInfo = req.getPathInfo();
if (pathInfo == null)
+ {
pathInfo = "/";
+ }
int colonIndex = pathInfo.indexOf("/", 1);
if (colonIndex < 0)
+ {
colonIndex = pathInfo.length();
+ }
portalOwner_ = pathInfo.substring(1, colonIndex);
nodePath_ = pathInfo.substring(colonIndex, pathInfo.length());
portalURI = requestURI_.substring(0, requestURI_.lastIndexOf(nodePath_)) +
"/";
if (requestURI_.indexOf("/public/") >= 0)
+ {
accessPath = PUBLIC_ACCESS;
+ }
else if (requestURI_.indexOf("/private/") >= 0)
+ {
accessPath = PRIVATE_ACCESS;
+ }
//TODO use the encoding from the locale-config.xml file
response_.setContentType("text/html; charset=UTF-8");
@@ -156,7 +165,9 @@
{
String title = (String)request_.getAttribute(REQUEST_TITLE);
if (title != null)
+ {
return title;
+ }
UIPortal uiportal = Util.getUIPortal();
String resolvedLabel =
(uiportal.getSelectedNode() == null) ? null :
uiportal.getSelectedNode().getResolvedLabel();
@@ -199,9 +210,8 @@
Map<String, String[]> unsortedParams = getRequest().getParameterMap();
Map<String, String[]> sortedParams = new HashMap<String, String[]>();
Set<String> keys = unsortedParams.keySet();
- for (Iterator<String> iter = keys.iterator(); iter.hasNext();)
+ for (String key : keys)
{
- String key = iter.next();
if (!key.startsWith(Constants.PARAMETER_ENCODER))
{
sortedParams.put(key, unsortedParams.get(key));
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2009-10-28
13:55:12 UTC (rev 439)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2009-10-28
18:54:30 UTC (rev 440)
@@ -53,6 +53,10 @@
private String portletId;
+ static final String INTERACTION_STATE_PARAM_NAME = "interactionstate";
+ static final String NAVIGATIONAL_STATE_PARAM_NAME = "navigationalstate";
+ static final String RESOURCE_STATE_PARAM_NAME = "resourcestate";
+
public ExoPortletInvocationContext(PortalRequestContext portalRequestContext,
UIPortlet portlet)
{
super(new MarkupInfo(MediaType.create("text/html"), "UTF-8"));
@@ -119,13 +123,13 @@
StateString state = actionURL.getInteractionState();
if (state != null)
{
- appendParameter(baseURL, "interactionstate",
state.getStringValue());
+ appendParameter(baseURL, INTERACTION_STATE_PARAM_NAME,
state.getStringValue());
}
state = actionURL.getNavigationalState();
if (state != null)
{
- appendParameter(baseURL, "navigationalstate",
state.getStringValue());
+ appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME,
state.getStringValue());
}
WindowState windowState = actionURL.getWindowState();
@@ -155,13 +159,13 @@
StateString resourceState = resourceURL.getResourceState();
if (resourceState != null)
{
- appendParameter(baseURL, "resourcestate",
resourceState.getStringValue());
+ appendParameter(baseURL, RESOURCE_STATE_PARAM_NAME,
resourceState.getStringValue());
}
resourceState = resourceURL.getNavigationalState();
if (resourceState != null)
{
- appendParameter(baseURL, "navigationalstate",
resourceState.getStringValue());
+ appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME,
resourceState.getStringValue());
}
WindowState windowState = resourceURL.getWindowState();
@@ -208,7 +212,7 @@
StateString state = renderURL.getNavigationalState();
if (state != null)
{
- appendParameter(baseURL, "navigationalstate",
state.getStringValue());
+ appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME,
state.getStringValue());
}
}
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-10-28
13:55:12 UTC (rev 439)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-10-28
18:54:30 UTC (rev 440)
@@ -49,6 +49,7 @@
import org.gatein.common.i18n.LocalizedString;
import org.gatein.common.net.media.MediaType;
import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.Portlet;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvoker;
@@ -141,7 +142,6 @@
private String portletStyle;
private boolean showPortletMode = true;
- private Map<String, String[]> renderParametersMap_;
private PortletMode currentPortletMode_ = PortletMode.VIEW;
private WindowState currentWindowState_ = WindowState.NORMAL;
@@ -150,6 +150,7 @@
private List<QName> supportedProcessingEvents_;
private List<String> supportedPublicParams_;
private boolean portletInPortal_ = true;
+ private StateString navigationalState;
public UIPortlet()
{
@@ -307,16 +308,6 @@
return themeMap;
}
- public Map<String, String[]> getRenderParametersMap()
- {
- return renderParametersMap_;
- }
-
- public void setRenderParametersMap(Map<String, String[]> map)
- {
- renderParametersMap_ = map;
- }
-
public PortletMode getCurrentPortletMode()
{
return currentPortletMode_;
@@ -574,9 +565,8 @@
Map<String, String[]> publicParams = uiPortal.getPublicParameters();
Set<String> allPublicParamsNames = publicParams.keySet();
List<String> supportedPublicParamNames = getPublicRenderParamNames();
- for (Iterator<String> iter = allPublicParamsNames.iterator();
iter.hasNext();)
+ for (String oneOfAllParams : allPublicParamsNames)
{
- String oneOfAllParams = iter.next();
if (supportedPublicParamNames.contains(oneOfAllParams))
{
publicParamsMap.put(oneOfAllParams, publicParams.get(oneOfAllParams));
@@ -611,7 +601,7 @@
actionInvocation.setForm(allParams);
actionInvocation.setRequestContext(new AbstractRequestContext(servletRequest));
- String interactionState =
servletRequest.getParameter("interactionstate");
+ String interactionState =
servletRequest.getParameter(ExoPortletInvocationContext.INTERACTION_STATE_PARAM_NAME);
if (interactionState != null)
{
actionInvocation.setInteractionState(StateString.create(interactionState));
@@ -636,7 +626,7 @@
resourceInvocation.setCacheLevel(CacheLevel.valueOf(cachability));
}
- String resourceState = servletRequest.getParameter("resourcestate");
+ String resourceState =
servletRequest.getParameter(ExoPortletInvocationContext.RESOURCE_STATE_PARAM_NAME);
if (resourceState != null)
{
resourceInvocation.setResourceState(StateString.create(resourceState));
@@ -659,9 +649,8 @@
throw new AssertionError();
}
- // Navigational state todo: fix me, this is stupid to first encode the Map to
decode it afterwards
- String stateString = StateString.encodeAsOpaqueValue(getRenderParameterMap(this));
- StateString navigationalState = StateString.create(stateString);
+ // Navigational state
+ StateString navigationalState =
ParametersStateString.create(getRenderParameterMap(this));
invocation.setNavigationalState(navigationalState);
// Mode
@@ -731,22 +720,37 @@
/** This method returns all the parameters supported by the targeted portlets, both
the private and public ones */
private Map<String, String[]> getRenderParameterMap(UIPortlet uiPortlet)
{
- Map<String, String[]> renderParams = uiPortlet.getRenderParametersMap();
+ Map<String, String[]> publicParams = uiPortlet.getPublicParameters();
+ Map<String, String[]> renderParams;
- if (renderParams == null)
+ if (navigationalState == null)
{
- renderParams = new HashMap<String, String[]>();
- uiPortlet.setRenderParametersMap(renderParams);
+ return publicParams;
}
+ else
+ {
+ if (navigationalState instanceof ParametersStateString)
+ {
+ // if the navigational state is not opaque, retrieve the parameter map
+ ParametersStateString parametersStateString =
(ParametersStateString)navigationalState;
+ renderParams = parametersStateString.getParameters();
+ }
+ else
+ {
+ // if we have an opaque navigation state, just add it as it to the param map
under the proper key
+ renderParams = new HashMap<String, String[]>(publicParams.size() + 1);
+ renderParams.put(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME,
new String[]{navigationalState.getStringValue()});
+ }
- /*
- * handle public params to only get the one supported by the targeted
- * portlet
- */
- Map<String, String[]> allParams = new HashMap<String,
String[]>(renderParams);
- allParams.putAll(uiPortlet.getPublicParameters());
+ /*
+ * handle public params to only get the one supported by the targeted
+ * portlet
+ */
+ Map<String, String[]> allParams = new HashMap<String,
String[]>(renderParams);
+ allParams.putAll(publicParams);
- return allParams;
+ return allParams;
+ }
}
//
@@ -870,4 +874,9 @@
currentPortlet.set(null);
}
}
+
+ void setNavigationalState(StateString navigationalState)
+ {
+ this.navigationalState = navigationalState;
+ }
}
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-10-28
13:55:12 UTC (rev 439)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-10-28
18:54:30 UTC (rev 440)
@@ -19,7 +19,6 @@
package org.exoplatform.portal.webui.application;
-import org.exoplatform.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.exoplatform.portal.webui.page.UIPage;
@@ -37,6 +36,8 @@
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
import org.gatein.common.util.MultiValuedPropertyMap;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.StateString;
import org.gatein.pc.api.StatefulPortletContext;
@@ -49,7 +50,6 @@
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import javax.portlet.PortletMode;
-import javax.portlet.ResourceURL;
import javax.portlet.WindowState;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -61,7 +61,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/** May 29, 2006 */
public class UIPortletActionListener
@@ -146,11 +145,11 @@
* If the current node is displaying a usual layout page, also tells the
* page which portlet to render or not when the state is maximized
*/
- WindowState state = new
WindowState(navStateResponse.getWindowState().toString());
+ WindowState state = new WindowState(getWindowStateOrDefault(navStateResponse));
setNextState(uiPortlet, state);
// update the portlet with the next mode to display
- PortletMode mode = new PortletMode(navStateResponse.getMode().toString());
+ PortletMode mode = new PortletMode(getPortletModeOrDefault(navStateResponse));
setNextMode(uiPortlet, mode);
// set the public params
@@ -165,9 +164,10 @@
*/
//
- Map<String, String[]> map =
-
StateString.decodeOpaqueValue((navStateResponse.getNavigationalState()).getStringValue());
- uiPortlet.setRenderParametersMap(map);
+ StateString navigationalState = navStateResponse.getNavigationalState();
+ uiPortlet.setNavigationalState(navigationalState);
+
+
//
/*
@@ -305,9 +305,7 @@
try
{
PortalRequestContext context =
(PortalRequestContext)event.getRequestContext();
- HttpServletRequest request = context.getRequest();
HttpServletResponse response = context.getResponse();
- String resourceId = request.getParameter(Constants.RESOURCE_ID_PARAMETER);
//
ResourceInvocation resourceInvocation =
uiPortlet.create(ResourceInvocation.class, context);
@@ -386,53 +384,6 @@
}
}
- /** This method returns all the parameters supported by the targeted portlets, both
the private and public ones */
- @SuppressWarnings({"unchecked"})
- private static Map getResourceParameterMap(UIPortlet uiPortlet, PortalRequestContext
prcontext)
- {
-
- Map portletParams = new HashMap(prcontext.getPortletParameters());
-
- /*
- * For serveResource requests the portlet must receive any resource parameters that
- * were explicitly set on the ResourceURL that triggered the request. If
- * the cacheability level of that resource URL (see PLT.13.7) was PORTLET or PAGE,
- * the portlet must also receive the render parameters present in the request in
- * which the URL was created.
- *
- * If a resource parameter is set that has the same name as a render parameter,
- * the render parameter must be the last entry in the parameter value array.
- */
- String cacheLevel = prcontext.getCacheLevel();
- if (ResourceURL.PAGE.equals(cacheLevel) || ResourceURL.PORTLET.equals(cacheLevel))
- {
- Map renderParams = uiPortlet.getRenderParametersMap();
- if (renderParams != null)
- {
- Set keys = renderParams.keySet();
- for (Iterator iter = keys.iterator(); iter.hasNext();)
- {
- String key = (String)iter.next();
- if (portletParams.containsKey(key))
- {
- String[] renderValueArray = (String[])renderParams.get(key);
- String[] portletValueArray = (String[])portletParams.get(key);
- String[] resources = new String[renderValueArray.length +
portletValueArray.length];
- System.arraycopy(portletValueArray, 0, resources, 0,
portletValueArray.length);
- System.arraycopy(renderValueArray, 0, resources,
portletValueArray.length, renderValueArray.length);
- portletParams.put(key, resources);
- }
- else
- {
- portletParams.put(key, renderParams.get(key));
- }
- }
- portletParams.putAll(renderParams);
- }
- }
- return portletParams;
- }
-
/**
* Process Events sent by the portlet API during the processAction() and
serverResource() methods defined in Portlet
* API 2.0 (JSR 286)
@@ -553,11 +504,11 @@
* If the current node is displaying a usual layout page, also tells the
* page which portlet to render or not when the state is maximized
*/
- WindowState state = new WindowState(navResponse.getWindowState().toString());
+ WindowState state = new WindowState(getWindowStateOrDefault(navResponse));
setNextState(uiPortlet, state);
// update the portlet with the next mode to display
- PortletMode mode = new PortletMode(navResponse.getMode().toString());
+ PortletMode mode = new PortletMode(getPortletModeOrDefault(navResponse));
setNextMode(uiPortlet, mode);
//TODO: (mwringe) add this to the UpdateNavigationStateResponse.Event class
instead of here
@@ -609,6 +560,26 @@
return null;
}
+ private static String getPortletModeOrDefault(UpdateNavigationalStateResponse
navResponse)
+ {
+ Mode mode = navResponse.getMode();
+ if (mode == null)
+ {
+ mode = Mode.VIEW;
+ }
+ return mode.toString();
+ }
+
+ private static String getWindowStateOrDefault(UpdateNavigationalStateResponse
navResponse)
+ {
+ org.gatein.pc.api.WindowState state = navResponse.getWindowState();
+ if (state == null)
+ {
+ state = org.gatein.pc.api.WindowState.NORMAL;
+ }
+ return state.toString();
+ }
+
/**
* This listener is called when a RenderURL url has been generated by the portlet
container. In that case it means
* that the render() method of a targeted portlet will be directly called and that the
existing navigational state
@@ -619,7 +590,7 @@
public void execute(Event<UIPortlet> event) throws Exception
{
UIPortlet uiPortlet = event.getSource();
- uiPortlet.setRenderParametersMap(null);
+ uiPortlet.setNavigationalState(null);
// set the public params
HttpServletRequest request = event.getRequestContext().getRequest();
@@ -627,7 +598,7 @@
//set render params
Map<String, String[]> renderParams =
((PortalRequestContext)event.getRequestContext()).getPortletParameters();
- uiPortlet.setRenderParametersMap(renderParams);
+ uiPortlet.setNavigationalState(ParametersStateString.create(renderParams));
}
}
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2009-10-28
13:55:12 UTC (rev 439)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2009-10-28
18:54:30 UTC (rev 440)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -41,8 +41,8 @@
import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormInputIconSelector;
import org.exoplatform.webui.form.UIFormInputInfo;
@@ -71,21 +71,14 @@
import org.gatein.pc.portlet.impl.spi.AbstractUserContext;
import org.gatein.pc.portlet.impl.spi.AbstractWindowContext;
+import javax.portlet.PortletMode;
+import javax.servlet.http.Cookie;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.ResourceBundle;
-import javax.portlet.PortletMode;
-import javax.servlet.http.Cookie;
-
-/**
- * Author : Nhu Dinh Thuan
- * nhudinhthuan(a)yahoo.com
- * Jun 8, 2006
- */
+/** Author : Nhu Dinh Thuan nhudinhthuan(a)yahoo.com Jun 8, 2006 */
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/portal/webui/portal/UIPortletForm.gtmpl", events = {
@EventConfig(listeners = UIPortletForm.SaveActionListener.class),
@@ -111,21 +104,21 @@
addUIFormInput(uiPortletPrefSet);
UIFormInputSet uiSettingSet = new UIFormInputSet("PortletSetting");
uiSettingSet.
- /*addUIFormInput(new UIFormStringInput("id", "id", null).
+ /*addUIFormInput(new UIFormStringInput("id", "id", null).
addValidator(MandatoryValidator.class).setEditable(false)).
addUIFormInput(new UIFormStringInput("windowId", "windowId",
null).setEditable(false)).*/
- addUIFormInput(new UIFormInputInfo("displayName",
"displayName", null)).addUIFormInput(
+ addUIFormInput(new UIFormInputInfo("displayName",
"displayName", null)).addUIFormInput(
new UIFormStringInput("title", "title",
null).addValidator(StringLengthValidator.class, 3, 60))
.addUIFormInput(
new UIFormStringInput("width", "width",
null).addValidator(ExpressionValidator.class, "(^([1-9]\\d*)px$)?",
"UIPortletForm.msg.InvalidWidthHeight")).addUIFormInput(
- new UIFormStringInput("height", "height",
null).addValidator(ExpressionValidator.class,
- "(^([1-9]\\d*)px$)?",
"UIPortletForm.msg.InvalidWidthHeight")).addUIFormInput(
- new UIFormCheckBoxInput("showInfoBar", "showInfoBar",
false)).addUIFormInput(
- new UIFormCheckBoxInput("showPortletMode",
"showPortletMode", false)).addUIFormInput(
- new UIFormCheckBoxInput("showWindowState",
"showWindowState", false)).addUIFormInput(
- new UIFormTextAreaInput("description", "description",
null).addValidator(StringLengthValidator.class, 0,
- 255));
+ new UIFormStringInput("height", "height",
null).addValidator(ExpressionValidator.class,
+ "(^([1-9]\\d*)px$)?",
"UIPortletForm.msg.InvalidWidthHeight")).addUIFormInput(
+ new UIFormCheckBoxInput("showInfoBar", "showInfoBar",
false)).addUIFormInput(
+ new UIFormCheckBoxInput("showPortletMode",
"showPortletMode", false)).addUIFormInput(
+ new UIFormCheckBoxInput("showWindowState",
"showWindowState", false)).addUIFormInput(
+ new UIFormTextAreaInput("description", "description",
null).addValidator(StringLengthValidator.class, 0,
+ 255));
addUIFormInput(uiSettingSet);
UIFormInputIconSelector uiIconSelector = new
UIFormInputIconSelector("Icon", "icon");
addUIFormInput(uiIconSelector);
@@ -321,25 +314,6 @@
uiPortlet_.update(propertyChanges);
}
- private Map<String, String[]> getRenderParameterMap(UIPortlet uiPortlet)
- {
- Map<String, String[]> renderParams = uiPortlet.getRenderParametersMap();
-
- if (renderParams == null)
- {
- renderParams = new HashMap<String, String[]>();
- uiPortlet.setRenderParametersMap(renderParams);
- }
-
- /*
- * handle public params to only get the one supported by the targeted portlet
- */
- Map<String, String[]> allParams = new HashMap<String,
String[]>(renderParams);
- allParams.putAll(uiPortlet.getPublicParameters());
-
- return allParams;
- }
-
static public class SaveActionListener extends EventListener<UIPortletForm>
{
public void execute(final Event<UIPortletForm> event) throws Exception