Author: chris.laprun(a)jboss.com
Date: 2010-10-28 11:29:33 -0400 (Thu, 28 Oct 2010)
New Revision: 4870
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java
Log:
- GTNWSRP-117: automatically select window if there's only one associated with
selected page to bypass the fact that select event might not be triggered by JSF
- GTNWSRP-143: pass selected exported portlet handle to assignPortletToWindow method so
that it can be used to update the window name.
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-10-28
14:27:24 UTC (rev 4869)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-10-28
15:29:33 UTC (rev 4870)
@@ -619,10 +619,11 @@
int importCount = 0;
for (SelectablePortletHandle importedPortlet : portletsToImport)
{
- PortletContext portletContext =
info.getPortletContextFor(importedPortlet.getHandle());
+ String handle = importedPortlet.getHandle();
+ PortletContext portletContext = info.getPortletContextFor(handle);
if (portletContext != null)
{
- structureProvider.assignPortletToWindow(portletContext,
importedPortlet.getWindow(), importedPortlet.getPage());
+ structureProvider.assignPortletToWindow(portletContext,
importedPortlet.getWindow(), importedPortlet.getPage(), handle);
importCount++;
}
}
@@ -734,6 +735,16 @@
{
page = (String)event.getNewValue();
+ // if we only have one window, select it automatically as a select event might
not be triggerer if there's only one :/
+ if (page != null)
+ {
+ List<String> windows = provider.getWindowIdentifiersFor(page);
+ if (ParameterValidation.existsAndIsNotEmpty(windows) &&
windows.size() == 1)
+ {
+ window = windows.get(0);
+ }
+ }
+
// bypass the rest of the life cycle and re-display page
FacesContext.getCurrentInstance().renderResponse();
}
Modified:
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java
===================================================================
---
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java 2010-10-28
14:27:24 UTC (rev 4869)
+++
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java 2010-10-28
15:29:33 UTC (rev 4870)
@@ -37,5 +37,5 @@
List<String> getWindowIdentifiersFor(String pageId);
- void assignPortletToWindow(PortletContext portletContext, String windowId, String
pageId);
+ void assignPortletToWindow(PortletContext portletContext, String windowId, String
pageId, String exportedPortletHandle);
}
Show replies by date