Author: chris.laprun(a)jboss.com
Date: 2008-10-08 16:10:58 -0400 (Wed, 08 Oct 2008)
New Revision: 12053
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/EventConverter.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/SimpleEventConverter.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PageContainer.java
Log:
- JBPORTAL-2147: more API fixes
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java 2008-10-08
18:34:17 UTC (rev 12052)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java 2008-10-08
20:10:58 UTC (rev 12053)
@@ -151,10 +151,10 @@
* Defines shared parameter binding for a given collection of windows.
*
* @param name
- * @param mappings
+ * @param parameterMappings
* @throws IllegalCoordinationException
*/
- void setParameterBinding(String name, Map<Window, Set<QName>> mappings)
throws IllegalCoordinationException;
+ void setParameterBinding(String name, Map<Window, Set<QName>>
parameterMappings) throws IllegalCoordinationException;
/**
* Removes given parameter binding
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java 2008-10-08
18:34:17 UTC (rev 12052)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java 2008-10-08
20:10:58 UTC (rev 12053)
@@ -22,10 +22,9 @@
package org.jboss.portal.core.controller.coordination;
+import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
import org.jboss.portal.core.model.portal.PageContainer;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import javax.xml.namespace.QName;
@@ -52,8 +51,8 @@
/**
- * Resolves wiring implicit mode. If there is no strategy defined for this page
container method will browse
- * parent object to resolve inherited modes. If no mode is set this method will return
default one
+ * Resolves wiring implicit mode. If there is no strategy defined for this page
container method will browse parent
+ * object to resolve inherited modes. If no mode is set this method will return
default one
*
* @param page
* @return
@@ -61,21 +60,21 @@
Boolean resolveEventWiringImplicitModeEnabled(PageContainer page);
/**
- * Resolves binding implicit mode. If there is no mode defined for this page container
method will browse
- * parent object to resolve inherited modes. If no mode is set this method will return
default one
+ * Resolves binding implicit mode. If there is no mode defined for this page container
method will browse parent
+ * object to resolve inherited modes. If no mode is set this method will return
default one
*
* @param pageContainer the page container
- * @return
+ * @return
*/
Boolean resolveParameterBindingImplicitModeEnabled(PageContainer pageContainer);
- /**
- * Returns the list of bindings for a given window and a given name. The collection is
an aggregation
- * of window bindings and alias bindings.
+ /**
+ * Returns the list of bindings for a given window and a given name. The collection is
an aggregation of parameter
+ * bindings and alias bindings.
*
* @param window the target window
- * @param name the target name
- * @return all parameter binding names with a given window/name mapping
+ * @param name the target name
+ * @return all binding names with a given window/name mapping
*/
Collection<String> getBindingNames(Window window, QName name);
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/EventConverter.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/EventConverter.java 2008-10-08
18:34:17 UTC (rev 12052)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/EventConverter.java 2008-10-08
20:10:58 UTC (rev 12053)
@@ -22,9 +22,9 @@
package org.jboss.portal.core.controller.coordination;
+import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.info.EventInfo;
-import org.jboss.portal.core.model.portal.Window;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
@@ -34,12 +34,12 @@
{
/**
- * Converts source event using information about destination event mapping. Return
event will have
- * destination event QName, source event windowId and negotiated payload value.
+ * Converts source event using information about destination event mapping. Return
event will have destination event
+ * QName, source event windowId and negotiated payload value.
*
* @param sourceEvent
* @param destEventInfo
* @return
*/
- PortletWindowEvent resolveEvent(PortletWindowEvent sourceEvent, EventInfo
destEventInfo, Window window);
+ PortletWindowEvent convertEvent(PortletWindowEvent sourceEvent, EventInfo
destEventInfo, Window window);
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2008-10-08
18:34:17 UTC (rev 12052)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2008-10-08
20:10:58 UTC (rev 12053)
@@ -172,7 +172,7 @@
EventInfo destEventInfo =
portletInfo.getEventing().getConsumedEvents().get(destEventName);
if (destEventInfo != null)
{
- windows.put(window, getEventConverter().resolveEvent(event,
destEventInfo, window));
+ windows.put(window, getEventConverter().convertEvent(event,
destEventInfo, window));
}
}
@@ -507,18 +507,18 @@
// Binding stuff
*****************************************************************************************
- public void setParameterBinding(String name, Map<Window, Set<QName>>
mappings) throws IllegalCoordinationException
+ public void setParameterBinding(String name, Map<Window, Set<QName>>
parameterMappings) throws IllegalCoordinationException
{
- ParameterValidation.throwIllegalArgExceptionIfNull(mappings, "windows");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "name",
"window binding");
- if (mappings.isEmpty())
+ ParameterValidation.throwIllegalArgExceptionIfNull(parameterMappings,
"parameter mappings");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "name",
"parameter binding");
+ if (parameterMappings.isEmpty())
{
- throw new IllegalArgumentException("empty windows map");
+ throw new IllegalArgumentException("empty parameter mappings");
}
// Obtain parent page and check that all windows are in one branch...
Page parentPage = null;
- for (Window window : mappings.keySet())
+ for (Window window : parameterMappings.keySet())
{
if (parentPage == null)
{
@@ -534,22 +534,22 @@
String prop_wiring = PREFIX_PARAMETER_BINDING + name;
//
- for (Window window : mappings.keySet())
+ for (Window window : parameterMappings.keySet())
{
- window.setDeclaredProperty(prop_wiring,
concatenateQNames(mappings.get(window)));
+ window.setDeclaredProperty(prop_wiring,
concatenateQNames(parameterMappings.get(window)));
}
}
public void removeParameterBinding(ParameterBindingInfo info) throws
IllegalCoordinationException
{
- ParameterValidation.throwIllegalArgExceptionIfNull(info,
"WindowBindingInfo");
+ ParameterValidation.throwIllegalArgExceptionIfNull(info,
"ParameterBindingInfo");
removeParameterBinding(info.getPage(), info.getName());
}
public void removeParameterBinding(Page page, String name)
{
- ParameterValidation.throwIllegalArgExceptionIfNull(name, "window binding
name");
+ ParameterValidation.throwIllegalArgExceptionIfNull(name, "parameter binding
name");
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
String nameProp = PREFIX_PARAMETER_BINDING + name;
@@ -575,7 +575,7 @@
public ParameterBindingInfo getParameterBinding(Page page, String name) throws
IllegalCoordinationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
- ParameterValidation.throwIllegalArgExceptionIfNull(name, "window binding
name");
+ ParameterValidation.throwIllegalArgExceptionIfNull(name, "parameter binding
name");
String nameProp = PREFIX_PARAMETER_BINDING + name;
@@ -669,7 +669,7 @@
public void removeAliasBinding(Page page, String name)
{
- ParameterValidation.throwIllegalArgExceptionIfNull(name, "window binding
name");
+ ParameterValidation.throwIllegalArgExceptionIfNull(name, "alias binding
name");
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
String nameProp = PREFIX_PARAMETER_ALIAS_NAME + name;
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/SimpleEventConverter.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/SimpleEventConverter.java 2008-10-08
18:34:17 UTC (rev 12052)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/SimpleEventConverter.java 2008-10-08
20:10:58 UTC (rev 12053)
@@ -25,8 +25,8 @@
import org.jboss.portal.core.controller.coordination.EventConverter;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
-import org.jboss.portal.portlet.info.EventInfo;
import org.jboss.portal.portlet.impl.info.ContainerTypeInfo;
+import org.jboss.portal.portlet.info.EventInfo;
import javax.xml.namespace.QName;
import java.io.Serializable;
@@ -38,7 +38,7 @@
public class SimpleEventConverter implements EventConverter
{
- public PortletWindowEvent resolveEvent(PortletWindowEvent sourceEvent, EventInfo
destEventInfo, Window window)
+ public PortletWindowEvent convertEvent(PortletWindowEvent sourceEvent, EventInfo
destEventInfo, Window window)
{
QName destName = destEventInfo.getName();
@@ -50,8 +50,8 @@
String sourcePayloadType = sourceEvent.getPayload().getClass().getName();
String destPayloadType =
((ContainerTypeInfo)destEventInfo.getType()).getType().getName();
-
+
// NOTE: rules below can be merged but I leave it like this to have more clear
logic to follow
// Same payload types
@@ -82,5 +82,4 @@
}
-
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PageContainer.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PageContainer.java 2008-10-08
18:34:17 UTC (rev 12052)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PageContainer.java 2008-10-08
20:10:58 UTC (rev 12053)
@@ -33,6 +33,7 @@
/**
* Return an existing page or null if the child does not exist or does not have the
right type.
*
+ * @param name the name of the child page to be retrieved
* @return the specified page
* @throws IllegalArgumentException if the name argument is null
*/