Author: chris.laprun(a)jboss.com
Date: 2008-10-06 10:20:04 -0400 (Mon, 06 Oct 2008)
New Revision: 12038
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationParameterBindingMetaData.java
Removed:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/WindowBindingInfo.java
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/AliasBindingInfo.java
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/impl/coordination/CoordinationService.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationMetaData.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java
Log:
- JBPORTAL-2147: first step.
+ Removed ParameterBindingInfo parent
+ Renamed WindowBindingInfo to ParameterBindingInfo
+ Renamed methods and variables accordingly
+ Improved getEventWindows implementation a little (needs test case, btw)
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/AliasBindingInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/AliasBindingInfo.java 2008-10-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/AliasBindingInfo.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -22,6 +22,8 @@
package org.jboss.portal.core.controller.coordination;
+import org.jboss.portal.core.model.portal.Page;
+
import javax.xml.namespace.QName;
import java.util.Set;
@@ -30,7 +32,11 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version : 0.1 $
*/
-public interface AliasBindingInfo extends ParameterBindingInfo
+public interface AliasBindingInfo
{
Set<QName> getNames();
+
+ String getName();
+
+ Page getPage();
}
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-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -154,7 +154,7 @@
* @param mappings
* @throws IllegalCoordinationException
*/
- void setWindowBinding(String name, Map<Window, Set<QName>> mappings)
throws IllegalCoordinationException;
+ void setParameterBinding(String name, Map<Window, Set<QName>> mappings)
throws IllegalCoordinationException;
/**
* Removes given parameter binding
@@ -162,22 +162,22 @@
* @param parameterBinding
* @throws IllegalCoordinationException
*/
- void removeWindowBinding(WindowBindingInfo parameterBinding) throws
IllegalCoordinationException;
+ void removeParameterBinding(ParameterBindingInfo parameterBinding) throws
IllegalCoordinationException;
/**
* @param page
* @param name
*/
- void removeWindowBinding(Page page, String name);
+ void removeParameterBinding(Page page, String name);
/**
* Renames the specified window binding to the new name
*
- * @param windowBinding the window binding to be renamed
- * @param newName the binding new name
+ * @param parameterBinding the window binding to be renamed
+ * @param newName the binding new name
* @throws IllegalCoordinationException
*/
- void renameWindowBinding(WindowBindingInfo windowBinding, String newName) throws
IllegalCoordinationException;
+ void renameParameterBinding(ParameterBindingInfo parameterBinding, String newName)
throws IllegalCoordinationException;
/**
* @param page
@@ -185,19 +185,19 @@
* @param newName
* @throws IllegalCoordinationException
*/
- void renameWindowBinding(Page page, String bindingName, String newName) throws
IllegalCoordinationException;
+ void renameParameterBinding(Page page, String bindingName, String newName) throws
IllegalCoordinationException;
/**
* @param page
* @return window bindings define in the scope of a given page
*/
- Collection<? extends WindowBindingInfo> getWindowBindings(Page page);
+ Collection<? extends ParameterBindingInfo> getParameterBindings(Page page);
/**
* @param window
* @return window bindings where given window is involved
*/
- Collection<? extends WindowBindingInfo> getWindowBindings(Window window);
+ Collection<? extends ParameterBindingInfo> getParameterBindings(Window window);
/**
* @param page
@@ -205,7 +205,7 @@
* @return
* @throws IllegalCoordinationException
*/
- WindowBindingInfo getWindowBinding(Page page, String name) throws
IllegalCoordinationException;
+ ParameterBindingInfo getParameterBinding(Page page, String name) throws
IllegalCoordinationException;
/**
* Set parameter binding implicit mode for a given page container. This will be
inherited recursively by all children
@@ -294,5 +294,5 @@
* @param parameterQName
* @return window bindings for a given parameter qname
*/
- Collection<? extends WindowBindingInfo> getWindowBindings(Page page, QName
parameterQName);
+ Collection<? extends ParameterBindingInfo> getParameterBindings(Page page, QName
parameterQName);
}
Deleted:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java 2008-10-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -1,37 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.portal.core.controller.coordination;
-
-import org.jboss.portal.core.model.portal.Page;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version : 0.1 $
- */
-public interface ParameterBindingInfo
-{
- String getName();
-
- Page getPage();
-}
Copied:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java
(from rev 12035,
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/WindowBindingInfo.java)
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -0,0 +1,44 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.controller.coordination;
+
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Window;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version : 0.1 $
+ */
+public interface ParameterBindingInfo
+{
+ Map<Window, Set<QName>> getMappings();
+
+ String getName();
+
+ Page getPage();
+}
Property changes on:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/WindowBindingInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/WindowBindingInfo.java 2008-10-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/WindowBindingInfo.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -1,39 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.portal.core.controller.coordination;
-
-import org.jboss.portal.core.model.portal.Window;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version : 0.1 $
- */
-public interface WindowBindingInfo extends ParameterBindingInfo
-{
- Map<Window, Set<QName>> getMappings();
-}
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-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -29,7 +29,7 @@
import org.jboss.portal.core.controller.coordination.EventConverter;
import org.jboss.portal.core.controller.coordination.EventWiringInfo;
import org.jboss.portal.core.controller.coordination.IllegalCoordinationException;
-import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
+import org.jboss.portal.core.controller.coordination.ParameterBindingInfo;
import org.jboss.portal.core.controller.coordination.Utils;
import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
import org.jboss.portal.core.model.portal.Page;
@@ -107,19 +107,12 @@
// Only explicit wirings
Map<Window, PortletWindowEvent> windows;
- if (!implicitMode)
- {
- windows = getEventWindowsExplicit(page, event, context);
- }
+ windows = getEventWindowsExplicit(page, event, context);
+
// If no explicit wirings for this event fallback to implicit
- else
+ if (implicitMode && windows.size() == 0)
{
- windows = getEventWindowsExplicit(page, event, context);
-
- if (windows.size() == 0)
- {
- windows = getEventWindowsImplicit(page, event, context);
- }
+ windows = getEventWindowsImplicit(page, event, context);
}
return windows;
@@ -129,7 +122,7 @@
{
Set<String> names = new HashSet<String>();
- for (WindowBindingInfo info : getWindowBindings(window))
+ for (ParameterBindingInfo info : getParameterBindings(window))
{
for (Map.Entry<Window, Set<QName>> entry :
info.getMappings().entrySet())
{
@@ -514,7 +507,7 @@
// Binding stuff
*****************************************************************************************
- public void setWindowBinding(String name, Map<Window, Set<QName>>
mappings) throws IllegalCoordinationException
+ public void setParameterBinding(String name, Map<Window, Set<QName>>
mappings) throws IllegalCoordinationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(mappings, "windows");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "name",
"window binding");
@@ -547,14 +540,14 @@
}
}
- public void removeWindowBinding(WindowBindingInfo info) throws
IllegalCoordinationException
+ public void removeParameterBinding(ParameterBindingInfo info) throws
IllegalCoordinationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(info,
"WindowBindingInfo");
- removeWindowBinding(info.getPage(), info.getName());
+ removeParameterBinding(info.getPage(), info.getName());
}
- public void removeWindowBinding(Page page, String name)
+ public void removeParameterBinding(Page page, String name)
{
ParameterValidation.throwIllegalArgExceptionIfNull(name, "window binding
name");
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
@@ -566,20 +559,20 @@
}
}
- public void renameWindowBinding(WindowBindingInfo windowBinding, String newName)
throws IllegalCoordinationException
+ public void renameParameterBinding(ParameterBindingInfo parameterBinding, String
newName) throws IllegalCoordinationException
{
- removeWindowBinding(windowBinding);
- setWindowBinding(newName, windowBinding.getMappings());
+ removeParameterBinding(parameterBinding);
+ setParameterBinding(newName, parameterBinding.getMappings());
}
- public void renameWindowBinding(Page page, String bindingName, String newName) throws
IllegalCoordinationException
+ public void renameParameterBinding(Page page, String bindingName, String newName)
throws IllegalCoordinationException
{
- WindowBindingInfo info = getWindowBinding(page, bindingName);
- removeWindowBinding(page, bindingName);
- setWindowBinding(newName, info.getMappings());
+ ParameterBindingInfo info = getParameterBinding(page, bindingName);
+ removeParameterBinding(page, bindingName);
+ setParameterBinding(newName, info.getMappings());
}
- public WindowBindingInfo getWindowBinding(Page page, String name) throws
IllegalCoordinationException
+ public ParameterBindingInfo getParameterBinding(Page page, String name) throws
IllegalCoordinationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
ParameterValidation.throwIllegalArgExceptionIfNull(name, "window binding
name");
@@ -605,7 +598,7 @@
}
else
{
- return new WindowInfoPOJO(name, page, mappings);
+ return new ParameterInfoPOJO(name, page, mappings);
}
}
@@ -755,14 +748,14 @@
return names;
}
- public Collection<? extends WindowBindingInfo> getWindowBindings(Page page,
QName parameterName)
+ public Collection<? extends ParameterBindingInfo> getParameterBindings(Page
page, QName parameterName)
{
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
ParameterValidation.throwIllegalArgExceptionIfNull(parameterName, "parameter
QName");
- Collection<? extends WindowBindingInfo> pageParams =
getWindowBindings(page);
- Collection<WindowBindingInfo> infos = new
HashSet<WindowBindingInfo>();
- for (WindowBindingInfo pageParam : pageParams)
+ Collection<? extends ParameterBindingInfo> pageParams =
getParameterBindings(page);
+ Collection<ParameterBindingInfo> infos = new
HashSet<ParameterBindingInfo>();
+ for (ParameterBindingInfo pageParam : pageParams)
{
if (pageParam.getMappings().containsValue(parameterName))
{
@@ -772,11 +765,11 @@
return infos;
}
- public Collection<WindowBindingInfo> getWindowBindings(Window window)
+ public Collection<ParameterBindingInfo> getParameterBindings(Window window)
{
- Collection<? extends WindowBindingInfo> pageParams =
getWindowBindings(window.getPage());
- Collection<WindowBindingInfo> infos = new
HashSet<WindowBindingInfo>();
- for (WindowBindingInfo pageParam : pageParams)
+ Collection<? extends ParameterBindingInfo> pageParams =
getParameterBindings(window.getPage());
+ Collection<ParameterBindingInfo> infos = new
HashSet<ParameterBindingInfo>();
+ for (ParameterBindingInfo pageParam : pageParams)
{
if (pageParam.getMappings().keySet().contains(window))
{
@@ -786,14 +779,14 @@
return infos;
}
- public Collection<? extends WindowBindingInfo> getWindowBindings(Page page)
+ public Collection<? extends ParameterBindingInfo> getParameterBindings(Page
page)
{
ParameterValidation.throwIllegalArgExceptionIfNull(page, "Page");
// Examine window properties and create page parameters
Collection<PortalObject> children =
page.getChildren(PortalObject.WINDOW_MASK);
- Map<String, WindowInfoPOJO> params = new HashMap<String,
WindowInfoPOJO>();
+ Map<String, ParameterInfoPOJO> params = new HashMap<String,
ParameterInfoPOJO>();
for (PortalObject child : children)
{
Set<String> propNames = child.getProperties().keySet();
@@ -803,10 +796,10 @@
if (propName.startsWith(PREFIX_PARAMETER_BINDING))
{
String pn = propName.substring(PREFIX_PARAMETER_BINDING_LENGTH);
- WindowInfoPOJO info;
+ ParameterInfoPOJO info;
if (!params.keySet().contains(pn))
{
- info = new WindowInfoPOJO(pn, page);
+ info = new ParameterInfoPOJO(pn, page);
params.put(pn, info);
}
else
@@ -971,20 +964,20 @@
}
}
- private class WindowInfoPOJO implements WindowBindingInfo
+ private class ParameterInfoPOJO implements ParameterBindingInfo
{
private final String name;
private Map<Window, Set<QName>> mappings;
private final Page page;
- private WindowInfoPOJO(String name, Page page, Map<Window, Set<QName>>
mappings)
+ private ParameterInfoPOJO(String name, Page page, Map<Window,
Set<QName>> mappings)
{
this.name = name;
this.mappings = mappings;
this.page = page;
}
- private WindowInfoPOJO(String name, Page page)
+ private ParameterInfoPOJO(String name, Page page)
{
this(name, page, new HashMap<Window, Set<QName>>());
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationMetaData.java 2008-10-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationMetaData.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -22,21 +22,21 @@
package org.jboss.portal.core.model.portal.metadata.coordination;
+import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.core.controller.coordination.IllegalCoordinationException;
-import org.jboss.portal.core.model.portal.metadata.BuildContext;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PageContainer;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PageContainer;
-import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.core.model.portal.metadata.BuildContext;
import org.w3c.dom.Element;
import javax.xml.namespace.QName;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
-import java.util.LinkedList;
-import java.util.Iterator;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
/**
@@ -50,7 +50,7 @@
private String implicitModeParameter;
- List<CoordinationWindowBindingMetaData> windowBindings = new
LinkedList<CoordinationWindowBindingMetaData>();
+ List<CoordinationParameterBindingMetaData> parameterBindings = new
LinkedList<CoordinationParameterBindingMetaData>();
List<CoordinationAliasBindingMetaData> aliasBindings = new
LinkedList<CoordinationAliasBindingMetaData>();
@@ -100,7 +100,7 @@
while (paramBindingsIter.hasNext())
{
Element bindingElement = (Element)paramBindingsIter.next();
-
coordinationMetaData.addWindowBinding(CoordinationWindowBindingMetaData.buildMetaData(bindingElement));
+
coordinationMetaData.addParameterBinding(CoordinationParameterBindingMetaData.buildMetaData(bindingElement));
}
// Alias bindings
@@ -149,11 +149,11 @@
{
Page page = (Page)object;
- for (CoordinationWindowBindingMetaData windowBinding : windowBindings)
+ for (CoordinationParameterBindingMetaData parameterBinding : parameterBindings)
{
Map<Window, Set<QName>> bindings = new HashMap<Window,
Set<QName>>();
- for (CoordinationWindowMultiQNameMetaData windowMD :
windowBinding.getWindows())
+ for (CoordinationWindowMultiQNameMetaData windowMD :
parameterBinding.getWindows())
{
String windowName = windowMD.getWindowName();
Window window = page.getWindow(windowName);
@@ -167,7 +167,7 @@
bindings.put(window, windowMD.getNames());
}
-
buildContext.getCoordinationConfigurator().setWindowBinding(windowBinding.getName(),
bindings);
+
buildContext.getCoordinationConfigurator().setParameterBinding(parameterBinding.getName(),
bindings);
}
for (CoordinationAliasBindingMetaData windowBinding : aliasBindings)
@@ -244,19 +244,19 @@
this.wirings.add(wiring);
}
- public List<CoordinationWindowBindingMetaData> getWindowBindings()
+ public List<CoordinationParameterBindingMetaData> getParameterBindings()
{
- return windowBindings;
+ return parameterBindings;
}
- public void setWindowBindings(List<CoordinationWindowBindingMetaData>
windowBindings)
+ public void setParameterBindings(List<CoordinationParameterBindingMetaData>
parameterBindings)
{
- this.windowBindings = windowBindings;
+ this.parameterBindings = parameterBindings;
}
- public void addWindowBinding(CoordinationWindowBindingMetaData binding)
+ public void addParameterBinding(CoordinationParameterBindingMetaData binding)
{
- this.windowBindings.add(binding);
+ this.parameterBindings.add(binding);
}
public List<CoordinationAliasBindingMetaData> getAliasBindings()
Copied:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationParameterBindingMetaData.java
(from rev 12035,
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationWindowBindingMetaData.java)
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationParameterBindingMetaData.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/metadata/coordination/CoordinationParameterBindingMetaData.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -0,0 +1,83 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.model.portal.metadata.coordination;
+
+import org.jboss.portal.common.xml.XMLTools;
+import org.w3c.dom.Element;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class CoordinationParameterBindingMetaData
+{
+ private String name;
+
+ List<CoordinationWindowMultiQNameMetaData> windows = new
LinkedList<CoordinationWindowMultiQNameMetaData>();
+
+ public CoordinationParameterBindingMetaData(String name)
+ {
+ this.name = name;
+ }
+
+ public List<CoordinationWindowMultiQNameMetaData> getWindows()
+ {
+ return windows;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ private void addWindow(CoordinationWindowMultiQNameMetaData window)
+ {
+ windows.add(window);
+ }
+
+ public static CoordinationParameterBindingMetaData buildMetaData(Element
bindingElement)
+ {
+ Element nameElt = XMLTools.getUniqueChild(bindingElement, "id", true);
+ CoordinationParameterBindingMetaData paramMetaData = new
CoordinationParameterBindingMetaData(XMLTools.asString(nameElt));
+
+ Iterator windowIter = XMLTools.getChildrenIterator(bindingElement,
"window-coordination");
+
+ while (windowIter.hasNext())
+ {
+ Element element = (Element)windowIter.next();
+
+
paramMetaData.addWindow(CoordinationWindowMultiQNameMetaData.buildMetaData(element));
+ }
+
+ return paramMetaData;
+ }
+}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java 2008-10-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -32,7 +32,7 @@
import org.jboss.portal.core.controller.coordination.AliasBindingInfo;
import org.jboss.portal.core.controller.coordination.EventWiringInfo;
import org.jboss.portal.core.controller.coordination.IllegalCoordinationException;
-import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
+import org.jboss.portal.core.controller.coordination.ParameterBindingInfo;
import org.jboss.portal.core.impl.coordination.CoordinationService;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.portal.Context;
@@ -45,11 +45,11 @@
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import java.util.Collections;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
@@ -261,7 +261,7 @@
TransactionAssert.commitTransaction();
}
- public void testWindowBinding() throws Exception
+ public void testParameterBinding() throws Exception
{
TransactionAssert.beginTransaction();
@@ -277,9 +277,9 @@
ws.put(w2, Collections.singleton(new QName("juju", "foo1")));
ws.put(w4, Collections.singleton(new QName("juju", "foo3")));
- cos.setWindowBinding("binding1", ws);
+ cos.setParameterBinding("binding1", ws);
- Collection<? extends WindowBindingInfo> bindings =
cos.getWindowBindings(page1);
+ Collection<? extends ParameterBindingInfo> bindings =
cos.getParameterBindings(page1);
assertEquals(1, bindings.size());
@@ -291,9 +291,9 @@
assertTrue(mappings.containsKey(w2));
assertTrue(mappings.containsKey(w4));
- cos.removeWindowBinding(bindings.iterator().next());
+ cos.removeParameterBinding(bindings.iterator().next());
- bindings = cos.getWindowBindings(w1);
+ bindings = cos.getParameterBindings(w1);
assertEquals(0, bindings.size());
@@ -301,7 +301,7 @@
TransactionAssert.commitTransaction();
}
- public void testGetWindowBinding() throws Exception
+ public void testGetParameterBinding() throws Exception
{
TransactionAssert.beginTransaction();
@@ -317,14 +317,14 @@
QName qName12 = new QName("ns1", "2");
ws.put(w1, Collections.singleton(qName11));
ws.put(w2, Collections.singleton(qName12));
- cos.setWindowBinding("binding1", ws);
+ cos.setParameterBinding("binding1", ws);
QName qName21 = new QName("ns2", "foo3");
ws.clear();
ws.put(w4, Collections.singleton(qName21));
- cos.setWindowBinding("binding2", ws);
+ cos.setParameterBinding("binding2", ws);
- WindowBindingInfo info = cos.getWindowBinding(page1, "binding1");
+ ParameterBindingInfo info = cos.getParameterBinding(page1, "binding1");
assertNotNull(info);
assertEquals("binding1", info.getName());
assertEquals(page1, info.getPage());
@@ -336,7 +336,7 @@
assertEquals(Collections.singleton(qName11), windows.get(w1));
assertEquals(Collections.singleton(qName12), windows.get(w2));
- info = cos.getWindowBinding(page1, "binding2");
+ info = cos.getParameterBinding(page1, "binding2");
assertNotNull(info);
assertEquals("binding2", info.getName());
assertEquals(page1, info.getPage());
@@ -349,7 +349,7 @@
TransactionAssert.commitTransaction();
}
- public void testRemoveWindowBinding() throws Exception
+ public void testRemoveParameterBinding() throws Exception
{
TransactionAssert.beginTransaction();
@@ -364,23 +364,23 @@
QName qName12 = new QName("ns1", "2");
ws.put(w1, Collections.singleton(qName11));
ws.put(w2, Collections.singleton(qName12));
- cos.setWindowBinding("binding1", ws);
+ cos.setParameterBinding("binding1", ws);
QName qName21 = new QName("ns2", "foo3");
ws.clear();
ws.put(w4, Collections.singleton(qName21));
- cos.setWindowBinding("binding2", ws);
+ cos.setParameterBinding("binding2", ws);
- Collection<? extends WindowBindingInfo> infos =
cos.getWindowBindings(page1);
+ Collection<? extends ParameterBindingInfo> infos =
cos.getParameterBindings(page1);
assertNotNull(infos);
assertEquals(2, infos.size());
- cos.removeWindowBinding(page1, "binding2");
- infos = cos.getWindowBindings(page1);
+ cos.removeParameterBinding(page1, "binding2");
+ infos = cos.getParameterBindings(page1);
assertNotNull(infos);
assertEquals(1, infos.size());
- assertNotNull(cos.getWindowBinding(page1, "binding1"));
- assertNull(cos.getWindowBinding(page1, "binding2"));
+ assertNotNull(cos.getParameterBinding(page1, "binding1"));
+ assertNull(cos.getParameterBinding(page1, "binding2"));
TransactionAssert.commitTransaction();
}
@@ -724,7 +724,7 @@
TransactionAssert.commitTransaction();
}
- public void testRenameWindowBinding() throws Exception
+ public void testRenameParameterBinding() throws Exception
{
TransactionAssert.beginTransaction();
@@ -737,24 +737,24 @@
ws.put(w1, Collections.singleton(new QName("juju", "foo")));
ws.put(w2, Collections.singleton(new QName("juju", "foo1")));
- cos.setWindowBinding("binding1", ws);
+ cos.setParameterBinding("binding1", ws);
- Collection<? extends WindowBindingInfo> bindings =
cos.getWindowBindings(page1);
+ Collection<? extends ParameterBindingInfo> bindings =
cos.getParameterBindings(page1);
assertEquals(1, bindings.size());
- WindowBindingInfo info = bindings.iterator().next();
+ ParameterBindingInfo info = bindings.iterator().next();
assertEquals("binding1", info.getName());
- cos.renameWindowBinding(info, "new");
+ cos.renameParameterBinding(info, "new");
- bindings = cos.getWindowBindings(w1);
+ bindings = cos.getParameterBindings(w1);
assertEquals(1, bindings.size());
info = bindings.iterator().next();
assertEquals("new", info.getName());
- cos.renameWindowBinding(page1, "new", "newer");
+ cos.renameParameterBinding(page1, "new", "newer");
- info = cos.getWindowBinding(page1, "newer");
+ info = cos.getParameterBinding(page1, "newer");
assertNotNull(info);
TransactionAssert.commitTransaction();
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java 2008-10-06
12:08:57 UTC (rev 12037)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java 2008-10-06
14:20:04 UTC (rev 12038)
@@ -23,8 +23,8 @@
package org.jboss.portal.core.admin.ui.coordination;
import org.jboss.portal.core.controller.coordination.IllegalCoordinationException;
+import org.jboss.portal.core.controller.coordination.ParameterBindingInfo;
import org.jboss.portal.core.controller.coordination.Utils;
-import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Window;
@@ -137,11 +137,11 @@
public void loadInfoFrom(Page page)
{
- Collection<? extends WindowBindingInfo> windowBindingInfos =
managerBean.getCoordinationService().getWindowBindings(page);
+ Collection<? extends ParameterBindingInfo> windowBindingInfos =
managerBean.getCoordinationService().getParameterBindings(page);
if (windowBindingInfos != null && !windowBindingInfos.isEmpty())
{
displayParameterBindings = new HashMap<String,
DisplayParameterBinding>(windowBindingInfos.size());
- for (WindowBindingInfo wbInfo : windowBindingInfos)
+ for (ParameterBindingInfo wbInfo : windowBindingInfos)
{
displayParameterBindings.put(wbInfo.getName(), new
DisplayParameterBinding(wbInfo));
}
@@ -166,7 +166,7 @@
Utils.addToMultiMap(windowBinding, window,
QName.valueOf(names[ParameterWindowPair.PARAM_NAME]));
}
- managerBean.getCoordinationService().setWindowBinding(windowBindingName,
windowBinding);
+ managerBean.getCoordinationService().setParameterBinding(windowBindingName,
windowBinding);
}
return resetSelection();
@@ -182,13 +182,13 @@
public String delete(String name) throws IllegalCoordinationException
{
-
managerBean.getCoordinationService().removeWindowBinding(managerBean.getSelectedPage(),
name);
+
managerBean.getCoordinationService().removeParameterBinding(managerBean.getSelectedPage(),
name);
return resetSelection();
}
public String rename(String name, String newName) throws IllegalCoordinationException
{
-
managerBean.getCoordinationService().renameWindowBinding(managerBean.getSelectedPage(),
name, newName);
+
managerBean.getCoordinationService().renameParameterBinding(managerBean.getSelectedPage(),
name, newName);
return resetSelection();
}
@@ -208,9 +208,9 @@
public static class DisplayParameterBinding implements Comparable
{
private List<ParameterWindowPair> parameterWindowPairs;
- private WindowBindingInfo bindingInfo;
+ private ParameterBindingInfo bindingInfo;
- public DisplayParameterBinding(WindowBindingInfo bindingInfo)
+ public DisplayParameterBinding(ParameterBindingInfo bindingInfo)
{
this.bindingInfo = bindingInfo;
Set<Map.Entry<Window, Set<QName>>> entries =
bindingInfo.getMappings().entrySet();
@@ -230,7 +230,7 @@
return bindingInfo.getName();
}
- public WindowBindingInfo getBindingInfo()
+ public ParameterBindingInfo getBindingInfo()
{
return bindingInfo;
}