Author: julien(a)jboss.com
Date: 2007-06-25 18:51:04 -0400 (Mon, 25 Jun 2007)
New Revision: 7540
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java
trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
Log:
improve nav state management of the widget selection during the workflow
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-06-25
21:15:19 UTC (rev 7539)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-06-25
22:51:04 UTC (rev 7540)
@@ -93,6 +93,7 @@
this.layoutService = layoutService;
this.portletInvoker = portletInvoker;
this.selectedContentType = ContentType.PORTLET;
+ this.selectedRenderParameters = new HashMap();
}
/** . */
@@ -114,8 +115,11 @@
public String selectedContentURI;
/** . */
- public Map selectedContentParams;
+ public Map selectedContentParameters;
+ /** . */
+ public Map selectedRenderParameters;
+
public List getContentTypeItems()
{
LinkedList types = new LinkedList();
@@ -200,9 +204,12 @@
{
//
String selectedContentURI = this.selectedContentURI;
- Map selectedContentParams = this.selectedContentParams;
+ Map selectedContentParams = this.selectedContentParameters;
+
+ // Reset to new state
this.selectedContentURI = null;
- this.selectedContentParams = null;
+ this.selectedContentParameters = null;
+ this.selectedRenderParameters = new HashMap();
// Obtain a window name
String windowName =
(String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("blah");
@@ -344,7 +351,7 @@
String uri = uris[0];
//
- Map params = new HashMap();
+ Map parameters = new HashMap();
for (Iterator i = actionParams.entrySet().iterator();i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
@@ -353,13 +360,13 @@
{
String paramName = name.substring(CONTENT_PARAM_PREFIX_LENGTH);
String paramValue = ((String[])entry.getValue())[0];
- params.put(paramName, paramValue);
+ parameters.put(paramName, paramValue);
}
}
//
this.selectedContentURI = uri;
- this.selectedContentParams = params;
+ this.selectedContentParameters = parameters;
}
}
}
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-06-25
21:15:19 UTC (rev 7539)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-06-25
22:51:04 UTC (rev 7540)
@@ -65,6 +65,7 @@
supportedWindowStates="normal"
initialMode="select_content"
initialWindowState="normal"
+
renderParameters="#{pageManager.selectedRenderParameters}"
onClick="url.setParameter('windowName',
document.getElementById('windowForm:windowName').value);"/>
</div>
</td>
Modified: trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java
===================================================================
--- trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java 2007-06-25 21:15:19
UTC (rev 7539)
+++ trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java 2007-06-25 22:51:04
UTC (rev 7540)
@@ -80,16 +80,29 @@
for (Iterator i = req.getParameterMap().entrySet().iterator();i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
- if (name.startsWith("content.param"))
+ String contentParamName = (String)entry.getKey();
+ if (contentParamName.startsWith("content.param"))
{
- String contentParamName =
name.substring("content.param".length());
String[] contentParamValue = (String[])entry.getValue();
params.put(contentParamName, contentParamValue);
}
}
//
+ String catParam = req.getParameter("cat");
+ if (catParam != null)
+ {
+ params.put("cat", new String[]{catParam});
+ }
+
+ //
+ String queryParam = req.getParameter("query");
+ if (queryParam != null)
+ {
+ params.put("query", new String[]{queryParam});
+ }
+
+ //
resp.setRenderParameters(params);
}
}
Modified: trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
===================================================================
--- trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-06-25 21:15:19 UTC
(rev 7539)
+++ trunk/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-06-25 22:51:04 UTC
(rev 7540)
@@ -100,6 +100,17 @@
for (Iterator i =
selWidget.getPreferencesInfo().getPreferencesInfo().iterator(); i.hasNext();)
{
GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
+
+ // Get param value from nav state otherwise we use the default value
+ String prefValue = request.getParameter("content.param." +
prefInfo.getName());
+ if (prefValue == null)
+ {
+ prefInfo.getDefaultValue();
+ }
+ if (prefValue == null)
+ {
+ prefValue = "";
+ }
%>
<tr>
<td><%= prefInfo.getName() %>:</td>
@@ -116,7 +127,7 @@
for (int j = 0;j < e.getSize();j++)
{
EnumType.Value value = e.getValue(j);
- boolean selected =
value.getValue().equals(prefInfo.getDefaultValue());
+ boolean selected = value.getValue().equals(prefValue);
%>
<option <%= selected ?
"selected=\"selected\"" : "" %> value="<%=
value.getValue() %>"><%= value.getDisplayValue() != null ?
value.getDisplayValue() : value.getValue() %></option>
<%
@@ -127,7 +138,7 @@
break;
default:
%>
- <td><input type="text" name="content.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="<%=
prefValue %>"/></td>
<%
break;
}
Show replies by date