Author: chris.laprun(a)jboss.com
Date: 2008-08-27 13:10:13 -0400 (Wed, 27 Aug 2008)
New Revision: 11750
Removed:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editPage.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/objectNavigation.xhtml
Log:
- Erased CoordinationAction and renamed bean to coordinationManager.
Deleted:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-27
17:05:50 UTC (rev 11749)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-27
17:10:13 UTC (rev 11750)
@@ -1,984 +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.admin.ui.actions;
-
-import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.util.ConversionException;
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
-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.impl.model.content.portlet.PortletContent;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.portlet.info.EventInfo;
-import org.jboss.portal.portlet.info.EventingInfo;
-import org.jboss.portal.portlet.info.NavigationInfo;
-import org.jboss.portal.portlet.info.ParameterInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
-import javax.xml.namespace.QName;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-/**
- * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision: 777 $
- */
-public class CoordinationAction
-{
- private PortalObjectManagerBean pomb;
-
- private Map<String, String> windows;
-
- private List<String> selectedWindows;
-
- private Map<String, String> aliasBindings;
-
- private Map<String, Map<String, String>> windowBindings;
-
- private String selectedRenderParameter;
-
- private Map<String, String> availableRenderParameters;
-
- private String stringStub;
-
- private Page selectedPage;
-
- private PortalObjectId selectedObjectId;
-
- private String windowBindingName;
-
- private Map<String, DisplayEventWiring> displayEventWirings;
- private Map<QNameSelectItem, SortedSet<WindowSelectItem>>
eventNameToWindowSources;
- private Map<QNameSelectItem, SortedSet<WindowSelectItem>>
eventNameToWindowDestinations;
-
- private String selectedSourceEvent;
- private List<String> selectedSourceWindows;
- private String selectedDestinationEvent;
- private List<String> selectedDestinationWindows;
- private EventWiringInfoCreator currentWiring;
-
- private String selectedForDeletionName;
- private String selectedForDeletionType;
- private static final String RESOURCE_NAME = "Resource";
- private static final String COORDINATION_UNKNOWN = "COORDINATION_UNKNOWN";
- private static final String COORDINATION_WIRING = "COORDINATION_WIRING";
- private static final String COORDINATION_PARAMETER =
"COORDINATION_PARAMETER";
-
- public PortalObjectId getSelectedObjectId()
- {
- //since this backing bean is in session, always check for new object request
- String id = getFacesParam("id");
- if (id != null)
- {
- selectedObjectId = parsePortalObjectId(id);
- }
- else
- {
- selectedObjectId = pomb.getSelectedObject().getId();
- }
- return selectedObjectId;
- }
-
- public void setSelectedObjectId(PortalObjectId selectedObjectId)
- {
- this.selectedObjectId = selectedObjectId;
- }
-
- public Page getSelectedPage()
- {
- PortalObject portalObject =
pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
- if (portalObject.getType() != PortalObject.TYPE_PAGE)
- {
- throw new IllegalArgumentException("Coordination can only be dealt with at
the page level!");
- }
-
- selectedPage = (Page) portalObject;
-
- //perform surgery on portalobjectmanager
-
pomb.selectObject(pomb.getPortalObjectContainer().getObject(selectedPage.getId()));
- return selectedPage;
- }
-
- public Map<String, String> getWindows()
- {
- return windows;
- }
-
- public void setWindows(Map<String, String> windows)
- {
- this.windows = windows;
- }
-
- public List<String> getSelectedWindows()
- {
- return selectedWindows;
- }
-
- public void setSelectedWindows(List<String> selectedWindows)
- {
- this.selectedWindows = selectedWindows;
- }
-
- public PortalObjectManagerBean getPomb()
- {
- return pomb;
- }
-
- public void setPomb(PortalObjectManagerBean pomb)
- {
- this.pomb = pomb;
- }
-
- public Map<String, String> getAliasBindings()
- {
- if (aliasBindings == null)
- {
- aliasBindings = new HashMap<String, String>();
- }
- return aliasBindings;
- }
-
- public void setAliasBindings(Map<String, String> aliasBindings)
- {
- this.aliasBindings = aliasBindings;
- }
-
- public Map<String, String> getAvailableRenderParameters()
- {
- return availableRenderParameters;
- }
-
- public void setAvailableRenderParameters(Map<String, String>
availableRenderParameters)
- {
- this.availableRenderParameters = availableRenderParameters;
- }
-
- public Map<String, Map<String, String>> getWindowBindings()
- {
- return windowBindings;
- }
-
- public void setWindowBindings(Map<String, Map<String, String>>
windowBindings)
- {
- this.windowBindings = windowBindings;
- }
-
- public String getSelectedRenderParameter()
- {
- return selectedRenderParameter;
- }
-
- public void setSelectedRenderParameter(String selectedRenderParameter)
- {
- this.selectedRenderParameter = selectedRenderParameter;
- }
-
- public String getWindowBindingName()
- {
- return windowBindingName;
- }
-
- public void setWindowBindingName(String windowBindingName)
- {
- this.windowBindingName = windowBindingName;
- }
-
- public String getStringStub()
- {
- return stringStub;
- }
-
- public void setStringStub(String stringStub)
- {
- this.stringStub = stringStub;
- }
-
- public String editCoordination() throws ConversionException
- {
- Page page = getSelectedPage();
- try
- {
- loadEventWirings(page);
- loadWindowBindings(page);
-
- //aliasbindings prep for ui
- for (AliasBindingInfo abInfo :
pomb.getCoordinationService().getAliasBindings(page))
- {
- for (QName name : abInfo.getNames())
- {
- getAliasBindings().put(name.getNamespaceURI(), name.getNamespaceURI());
- }
- }
-
- // Extract metadata only on window children
- Collection<PortalObject> children =
page.getChildren(PortalObject.WINDOW_MASK);
- if (!children.isEmpty())
- {
- availableRenderParameters = new LinkedHashMap<String, String>();
- this.windows = new LinkedHashMap<String, String>(children.size());
-
- for (PortalObject po : children)
- {
- Window window = (Window)po;
- this.windows.put(window.getName(),
window.getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT));
- if (ContentType.PORTLET.equals(window.getContentType()))
- {
- PortletContent pc = (PortletContent)window.getContent();
- Instance instance =
pomb.getInstanceContainer().getDefinition(pc.getInstanceRef());
- PortletInfo info = instance.getPortlet().getInfo();
-
- // retrieve metadata on public render parameters
- NavigationInfo navInfo = info.getNavigation();
- for (ParameterInfo pInfo : navInfo.getPublicParameters())
- {
- availableRenderParameters.put(pInfo.getName().toString(),
pInfo.getName().toString());
- }
-
- // retrieve metadata on events
- EventingInfo eventingInfo = info.getEventing();
- eventNameToWindowSources = addEventInfoFor(window,
eventingInfo.getProducedEvents(), eventNameToWindowSources);
- eventNameToWindowDestinations = addEventInfoFor(window,
eventingInfo.getConsumedEvents(), eventNameToWindowDestinations);
- }
- }
- }
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- return "editCoordination";
- }
-
- private Map<QNameSelectItem, SortedSet<WindowSelectItem>>
addEventInfoFor(Window window, Map<QName, ? extends EventInfo> windowEvents,
Map<QNameSelectItem, SortedSet<WindowSelectItem>> existing)
- {
- if (windowEvents != null && !windowEvents.isEmpty())
- {
- if (existing == null)
- {
- existing = new HashMap<QNameSelectItem,
SortedSet<WindowSelectItem>>();
- }
- for (QName qName : windowEvents.keySet())
- {
- QNameSelectItem item = new QNameSelectItem(qName);
- SortedSet<WindowSelectItem> windows = existing.get(item);
- if (windows == null)
- {
- windows = new TreeSet<WindowSelectItem>();
- existing.put(item, windows);
- }
- windows.add(new WindowSelectItem(window));
- }
- }
-
- return existing;
- }
-
- // JSF helper methods
-
- /**
- * Retrieves the value of the parameter which name is given.
- *
- * @param name
- * @return
- */
- public String getFacesParam(String name)
- {
- return
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(name);
- }
-
- /**
- * Util: Parse PortalObjectId for given portlet object.
- *
- * @param id
- * @return
- */
- private PortalObjectId parsePortalObjectId(String id)
- {
- return PortalObjectId.parse(id, PortalObjectPath.LEGACY_BASE64_FORMAT);
- }
-
- /** Bypass the rest of the life cycle and re-display page */
- public void renderResponse()
- {
- FacesContext.getCurrentInstance().renderResponse();
- }
-
-
- // Event Wirings methods
- private void loadEventWirings(Page page)
- {
- Collection<EventWiringInfo> wiringInfos =
pomb.getCoordinationService().getEventWirings(page);
- if (!wiringInfos.isEmpty())
- {
- displayEventWirings = new HashMap<String,
DisplayEventWiring>(wiringInfos.size());
- for (EventWiringInfo ewInfo : wiringInfos)
- {
- displayEventWirings.put(ewInfo.getName(), new DisplayEventWiring(ewInfo));
- }
- }
- else
- {
- displayEventWirings = Collections.emptyMap();
- }
- }
-
- public boolean isExplicitEventsUsed()
- {
- boolean enabled = false;
- Page page = getSelectedPage();
- if (pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page) != null)
- {
- enabled =
!pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page);
- }
- return enabled;
- }
-
- public void setExplicitEventsUsed(boolean usingExplicitEvents)
- {
- try
- {
- pomb.getCoordinationService().setEventWiringImplicitMode(getSelectedPage(),
usingExplicitEvents);
- }
- catch (IllegalCoordinationException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
- }
- }
-
- public void selectSourceEvent(ValueChangeEvent event)
- {
- System.out.println("selectSourceEvent");
- System.out.println("old value = " + event.getOldValue());
- System.out.println("new value = " + event.getNewValue());
- }
-
- public void selectSourceWindows(ValueChangeEvent event)
- {
- System.out.println("selectSourceWindows");
- System.out.println("old value = " + event.getOldValue());
- System.out.println("new value = " + event.getNewValue());
- }
-
- public void selectDestinationEvent(ValueChangeEvent event)
- {
- System.out.println("selectDestinationEvent");
- System.out.println("old value = " + event.getOldValue());
- System.out.println("new value = " + event.getNewValue());
- }
-
- public void selectDestinationWindows(ValueChangeEvent event)
- {
- System.out.println("selectDestinationWindows");
- System.out.println("old value = " + event.getOldValue());
- System.out.println("new value = " + event.getNewValue());
- }
-
- public Collection<DisplayEventWiring> getDisplayEventWirings()
- {
- if (displayEventWirings == null)
- {
- return Collections.emptyList();
- }
-
- List<DisplayEventWiring> result = new
LinkedList<DisplayEventWiring>(displayEventWirings.values());
- Collections.sort(result);
-
- return result;
- }
-
- public List<QNameSelectItem> getSourceEvents()
- {
- // create new wiring
- currentWiring = new EventWiringInfoCreator();
-
- // return list of produced events
- return getPossibleEvents(eventNameToWindowSources);
- }
-
- public List<QNameSelectItem> getDestinationEvents()
- {
- // at this point, we have the sources selected, populate new wiring
- Map<Window, QName> sources = getMappingForWiring(selectedSourceWindows,
selectedSourceEvent);
- currentWiring.setSources(sources);
-
- return getPossibleEvents(eventNameToWindowDestinations);
- }
-
- private List<QNameSelectItem> getPossibleEvents(Map<QNameSelectItem,
SortedSet<WindowSelectItem>> eventNameToWindows)
- {
- if (eventNameToWindows == null)
- {
- return Collections.emptyList();
- }
-
- List<QNameSelectItem> result = new LinkedList<QNameSelectItem>();
- result.addAll(eventNameToWindows.keySet());
- Collections.sort(result);
- return result;
- }
-
- /**
- * Format selected information into something that can be used to construct a new
event wiring.
- *
- * @param selectedWindows
- * @param selectedEvent
- * @return
- */
- private Map<Window, QName> getMappingForWiring(List<String>
selectedWindows, String selectedEvent)
- {
- if (selectedWindows != null)
- {
- if (selectedPage == null)
- {
- throw new IllegalStateException("A page should have been
selected!");
- }
-
- Map<Window, QName> windowQNameMap = new HashMap<Window,
QName>(selectedWindows.size());
- for (String windowName : selectedWindows)
- {
- Window window = (Window)selectedPage.getChild(windowName);
- windowQNameMap.put(window, QName.valueOf(selectedEvent));
- }
-
- return windowQNameMap;
- }
-
- return Collections.emptyMap();
- }
-
- public List<WindowSelectItem> getSourceWindows()
- {
- return getPossibleWindows(eventNameToWindowSources, selectedSourceEvent);
- }
-
- public List<WindowSelectItem> getDestinationWindows()
- {
- return getPossibleWindows(eventNameToWindowDestinations,
selectedDestinationEvent);
- }
-
- private List<WindowSelectItem> getPossibleWindows(Map<QNameSelectItem,
SortedSet<WindowSelectItem>> eventNameToWindows, String selectedEventName)
- {
- if (eventNameToWindows == null)
- {
- return Collections.emptyList();
- }
-
- if (selectedEventName != null)
- {
- List<WindowSelectItem> result = new LinkedList<WindowSelectItem>();
- result.addAll(eventNameToWindows.get(new
QNameSelectItem(QName.valueOf(selectedEventName))));
- Collections.sort(result);
- return result;
- }
-
- return Collections.emptyList();
- }
-
- public String getSelectedSourceEvent()
- {
- return selectedSourceEvent;
- }
-
- public void setSelectedSourceEvent(String selectedSourceEvent)
- {
- this.selectedSourceEvent = selectedSourceEvent;
- }
-
- public List<String> getSelectedSourceWindows()
- {
- return selectedSourceWindows;
- }
-
- public void setSelectedSourceWindows(List<String> selectedSourceWindows)
- {
- this.selectedSourceWindows = selectedSourceWindows;
- }
-
- public String getSelectedDestinationEvent()
- {
- return selectedDestinationEvent;
- }
-
- public void setSelectedDestinationEvent(String selectedDestinationEvent)
- {
- this.selectedDestinationEvent = selectedDestinationEvent;
- }
-
- public List<String> getSelectedDestinationWindows()
- {
- return selectedDestinationWindows;
- }
-
- public void setSelectedDestinationWindows(List<String>
selectedDestinationWindows)
- {
- this.selectedDestinationWindows = selectedDestinationWindows;
- }
-
- public String getWiringName()
- {
- if (currentWiring == null)
- {
- return null;
- }
-
- return currentWiring.getName();
- }
-
- public void setWiringName(String eventWiringName)
- {
- if (currentWiring != null)
- {
- currentWiring.setName(eventWiringName);
-
- // we also now have the information to build the destinations
- Map<Window, QName> destinations =
getMappingForWiring(selectedDestinationWindows, selectedDestinationEvent);
- currentWiring.setDestinations(destinations);
- }
- }
-
- public String createWiring()
- {
- if (currentWiring != null)
- {
- try
- {
- pomb.getCoordinationService().setEventWiring(currentWiring.getSources(),
currentWiring.getDestinations(), currentWiring.getName());
- }
- catch (IllegalCoordinationException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
- }
- }
- return null;
- }
-
- public String cancelWiring()
- {
- currentWiring = null;
- selectedSourceEvent = null;
- selectedSourceWindows = null;
- selectedDestinationEvent = null;
- selectedDestinationWindows = null;
-
- return null;
- }
-
- public String getSelectedForDeletionName()
- {
- return selectedForDeletionName;
- }
-
- public String getSelectedForDeletionType()
- {
- Locale locale =
FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
- ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_NAME, locale);
- String localizationKey = COORDINATION_UNKNOWN;
- if ("wiring".equals(selectedForDeletionType))
- {
- localizationKey = COORDINATION_WIRING;
- }
- else if ("parameter".equals(selectedForDeletionType))
- {
- localizationKey = COORDINATION_PARAMETER;
- }
-
- return MessageFormat.format(rb.getString(localizationKey), null);
- }
-
- public void selectWiringForDeletion(ActionEvent event)
- {
- selectedForDeletionName = getFacesParam("wiring");
- selectedForDeletionType = getFacesParam("type");
- }
-
- public String deleteWiring(ActionEvent actionEvent)
- {
- DisplayEventWiring displayEvent =
displayEventWirings.get(selectedForDeletionName);
-
- if (displayEvent != null)
- {
- EventWiringInfo event = displayEvent.getEventInfo();
- try
- {
- pomb.getCoordinationService().removeEventWiring(event);
- displayEventWirings.remove(selectedForDeletionName);
- }
- catch (IllegalCoordinationException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
- }
-
- // reset selected values
- selectedForDeletionName = null;
- selectedForDeletionType = null;
- }
- return null;
- }
-
- public String renameWiring()
- {
- String wiring = getFacesParam("wiring");
- DisplayEventWiring displayEvent = displayEventWirings.get(wiring);
- if (displayEvent != null)
- {
- //todo: implement, rename operation should be on CoordinationConfigurator
- }
-
- throw new NotYetImplemented("renameWiring not yet implemented!");
- }
-
- public static class DisplayEventWiring implements Comparable
- {
- private Set<Window> sourceWindows;
- private Set<QName> sourceEvents;
- private Set<Window> destinationWindows;
- private Set<QName> destinationEvents;
- private EventWiringInfo eventInfo;
-
- DisplayEventWiring(EventWiringInfo eventInfo)
- {
- this.eventInfo = eventInfo;
-
- Map<Window, QName> sources = eventInfo.getSources();
- sourceWindows = new HashSet<Window>(sources.keySet());
- sourceEvents = new HashSet<QName>(sources.values());
-
- Map<Window, QName> destinations = eventInfo.getDestinations();
- destinationWindows = new HashSet<Window>(destinations.keySet());
- destinationEvents = new HashSet<QName>(destinations.values());
- }
-
- public EventWiringInfo getEventInfo()
- {
- return eventInfo;
- }
-
- public String getName()
- {
- return eventInfo.getName();
- }
-
- public Set<Window> getSourceWindows()
- {
- return sourceWindows;
- }
-
- public Set<QName> getSourceEvents()
- {
- return sourceEvents;
- }
-
- public Set<Window> getDestinationWindows()
- {
- return destinationWindows;
- }
-
- public Set<QName> getDestinationEvents()
- {
- return destinationEvents;
- }
-
- public int compareTo(Object o)
- {
- DisplayEventWiring other = (DisplayEventWiring)o;
- return getName().compareTo(other.getName());
- }
- }
-
- public static class WindowSelectItem extends SelectItem implements Comparable
- {
- public WindowSelectItem(Window window)
- {
- super(window.getName(), window.getName());
- }
-
- public int compareTo(Object o)
- {
- WindowSelectItem other = (WindowSelectItem)o;
- return getLabel().compareTo(other.getLabel());
- }
-
- @Override
- public int hashCode()
- {
- return getLabel().hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof WindowSelectItem)
- {
- return false;
- }
- WindowSelectItem item = (WindowSelectItem)obj;
- return getLabel().equals(item.getLabel());
- }
- }
-
- public static class QNameSelectItem extends SelectItem implements Comparable
- {
- public QNameSelectItem(QName qName)
- {
- super(qName, qName.toString());
- }
-
- public QName getQName()
- {
- return (QName)getValue();
- }
-
- public int compareTo(Object o)
- {
- QNameSelectItem other = (QNameSelectItem)o;
- return getQName().toString().compareTo(other.getQName().toString());
- }
-
- @Override
- public int hashCode()
- {
- return getQName().hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (!(obj instanceof QNameSelectItem))
- {
- return false;
- }
- QNameSelectItem item = (QNameSelectItem)obj;
- return getQName().equals(item.getQName());
- }
- }
-
- private static class EventWiringInfoCreator implements EventWiringInfo
- {
- private String name;
- private Map<Window, QName> sources;
- private Map<Window, QName> destinations;
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public Map<Window, QName> getSources()
- {
- return sources;
- }
-
- public void setSources(Map<Window, QName> sources)
- {
- this.sources = sources;
- }
-
- public Map<Window, QName> getDestinations()
- {
- return destinations;
- }
-
- public void setDestinations(Map<Window, QName> destinations)
- {
- this.destinations = destinations;
- }
- }
-
- public static class QNameComparator implements Comparator<QName>
- {
- public int compare(QName o1, QName o2)
- {
- return o1.toString().compareTo(o2.toString());
- }
- }
-
- // Parameter Binding
- public boolean isParameterImplicitEnabled()
- {
- boolean enabled = false;
- Page page = getSelectedPage();
- if (pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page) !=
null)
- {
- enabled =
pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page);
- }
- return enabled;
- }
-
- /**
- * Listener for implicit parameter binding checkbox
- *
- * @param event
- * @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
- *
- */
- public void implicitParameterListener(ValueChangeEvent event) throws
IllegalCoordinationException
- {
- String newValue = event.getNewValue().toString();
- pomb.getCoordinationService().setParameterBindingImplicitMode(getSelectedPage(),
Boolean.parseBoolean(newValue));
- }
-
-
- public static class DisplayParameterBinding implements Comparable
- {
-
- private String id;
-
- private QName name;
-
- private List<Window> windows;
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public void setName(QName name)
- {
- this.name = name;
- }
-
- public List<Window> getWindows()
- {
- if (windows == null)
- {
- windows = new ArrayList<Window>();
- }
- return windows;
- }
-
- public void setWindows(List<Window> windows)
- {
- this.windows = windows;
- }
-
- public int compareTo(Object o)
- {
- DisplayParameterBinding other = (DisplayParameterBinding)o;
- return id.compareTo(other.getId());
- }
- }
-
- private List<DisplayParameterBinding> displayParameterBindings;
-
- public List<DisplayParameterBinding> getDisplayParameterBindings()
- {
- return displayParameterBindings;
- }
-
- public void setDisplayParameterBindings(List<DisplayParameterBinding>
displayParameterBindings)
- {
- this.displayParameterBindings = displayParameterBindings;
- }
-
- private void loadWindowBindings(Page page)
- {
- Collection<? extends WindowBindingInfo> windowBindingInfos =
pomb.getCoordinationService().getWindowBindings(page);
- if (windowBindingInfos != null && !windowBindingInfos.isEmpty())
- {
- displayParameterBindings = new
ArrayList<DisplayParameterBinding>(windowBindingInfos.size());
- for (WindowBindingInfo wbInfo : windowBindingInfos)
- {
- DisplayParameterBinding dpb = new DisplayParameterBinding();
- for (Map.Entry<Window,QName> entry : wbInfo.getWindows().entrySet())
- {
- Window paramName = entry.getKey();
- QName paramValue = entry.getValue();
- //quick filter for duplicate binding ids
- dpb.getWindows().add(paramName);
- if (dpb.getWindows().size() < 2)
- {
- dpb.setId(wbInfo.getId());
- dpb.setName(paramValue);
- }
- }
- displayParameterBindings.add(dpb);
- }
- }
- else
- {
- displayParameterBindings = Collections.emptyList();
- }
- }
-
- public void createWindowBinding(ActionEvent event) throws
IllegalCoordinationException
- {
- Map<Window, QName> windowBinding;
- for (String window : selectedWindows)
- {
- windowBinding = new HashMap<Window, QName>();
- PortalObject portalObject =
pomb.getPortalObjectContainer().getObject(parsePortalObjectId(window));
-
- if (portalObject.getType() == PortalObject.TYPE_WINDOW)
- {
- windowBinding.put((Window)portalObject,
QName.valueOf(selectedRenderParameter));
- pomb.getCoordinationService().setWindowBinding(windowBindingName,
windowBinding);
- }
- }
- //refresh data
- loadWindowBindings(getSelectedPage());
- }
-}
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-08-27
17:05:50 UTC (rev 11749)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-08-27
17:10:13 UTC (rev 11750)
@@ -344,7 +344,7 @@
</managed-bean>
<managed-bean>
- <managed-bean-name>coordinationAction</managed-bean-name>
+ <managed-bean-name>coordinationManager</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.admin.ui.coordination.CoordinationManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml 2008-08-27
17:05:50 UTC (rev 11749)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml 2008-08-27
17:10:13 UTC (rev 11750)
@@ -12,31 +12,31 @@
<ui:param name="portalObjectScreen"
value="#{bundle.COMMON_DELETE}"/>
<ui:define name="content">
- <f:subview rendered="#{empty
coordinationAction.selectedForDeletionName}">
+ <f:subview rendered="#{empty
coordinationManager.selectedForDeletionName}">
<p
class="portlet-msg-error">#{bundle.COMMON_INCONSISTENT_STATE}</p>
</f:subview>
- <f:subview rendered="#{not empty
coordinationAction.selectedForDeletionName}">
+ <f:subview rendered="#{not empty
coordinationManager.selectedForDeletionName}">
<div class="portlet-msg">
<div class="portlet-msg-icon"><h:graphicImage
url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
- <h3>#{bundle.COMMON_DELETE}  <h:outputText
value="#{coordinationAction.selectedForDeletionType}"/></h3>
+ <h3>#{bundle.COMMON_DELETE}  <h:outputText
value="#{coordinationManager.selectedForDeletionType}"/></h3>
<p class="portlet-msg-alert">
#{bundle.COMMON_DELETING}
- <span
class="objectName">#{coordinationAction.selectedForDeletionName}</span>
- #{coordinationAction.selectedForDeletionType} #{bundle.COMMON_FROM}
+ <span
class="objectName">#{coordinationManager.selectedForDeletionName}</span>
+ #{coordinationManager.selectedForDeletionType} #{bundle.COMMON_FROM}
<c:if test="#{not empty
portalobjectmgr.selectedObjectParent.name}">
<span
class="objectName">#{portalobjectmgr.selectedObject.name}</span>
</c:if>
#{portalobjectmgr.selectedObject.typeName}!
</p>
- <p class="portlet-class">#{bundle.COMMON_SURE_DELETE}
#{coordinationAction.selectedForDeletionType}?</p>
+ <p class="portlet-class">#{bundle.COMMON_SURE_DELETE}
#{coordinationManager.selectedForDeletionType}?</p>
<h:form>
<h:commandButton value="#{bundle.COMMON_DELETE}"
action="editCoordination"
-
actionListener="#{coordinationAction.deleteWiring}"
+
actionListener="#{coordinationManager.deleteWiring}"
styleClass="portlet-form-button
portlet-section-buttonrow">
</h:commandButton>
<h:commandButton value="#{bundle.COMMON_CANCEL}"
action="editCoordination"
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-27
17:05:50 UTC (rev 11749)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-27
17:10:13 UTC (rev 11750)
@@ -10,15 +10,15 @@
<ui:define name="content">
<div class="tenpx-top-bottom">
- <h2
class="portlet-area-header">#{coordinationAction.selectedPage.name}
#{bundle.COORDINATION_PARAMETER_BINDINGS}</h2>
+ <h2
class="portlet-area-header">#{coordinationManager.selectedPage.name}
#{bundle.COORDINATION_PARAMETER_BINDINGS}</h2>
<h:form>
- <h:selectBooleanCheckbox id="useImplicitBinding"
value="#{coordinationAction.explicitParametersUsed}"
+ <h:selectBooleanCheckbox id="useImplicitBinding"
value="#{coordinationManager.explicitParametersUsed}"
onchange="this.form.submit()"
immediate="true"/>
#{bundle.COORDINATION_PARAMETER_EXPLICIT_MODE}
</h:form>
- <h:panelGroup
rendered="#{coordinationAction.explicitParametersUsed}">
+ <h:panelGroup
rendered="#{coordinationManager.explicitParametersUsed}">
<hr/>
<!-- Create parameter binding -->
@@ -89,14 +89,14 @@
</div>
<!-- Event wirings -->
- <h2
class="portlet-area-header">#{coordinationAction.selectedPage.name}
#{bundle.COORDINATION_EVENT_WIRINGS}</h2>
+ <h2
class="portlet-area-header">#{coordinationManager.selectedPage.name}
#{bundle.COORDINATION_EVENT_WIRINGS}</h2>
<h:form>
- <h:selectBooleanCheckbox id="useExplicitEvents"
value="#{coordinationAction.explicitEventsUsed}"
+ <h:selectBooleanCheckbox id="useExplicitEvents"
value="#{coordinationManager.explicitEventsUsed}"
onchange="this.form.submit()"
immediate="true"/>#{bundle.COORDINATION_EVENT_EXPLICIT_MODE}
</h:form>
- <h:panelGroup rendered="#{coordinationAction.explicitEventsUsed}">
+ <h:panelGroup rendered="#{coordinationManager.explicitEventsUsed}">
<hr/>
<!-- Create new event wiring -->
<h3 class="sectionTitle
tenpx-top-bottom">#{bundle.COORDINATION_EVENT_CREATE}</h3>
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editPage.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editPage.xhtml 2008-08-27
17:05:50 UTC (rev 11749)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editPage.xhtml 2008-08-27
17:10:13 UTC (rev 11750)
@@ -41,7 +41,7 @@
#{bundle.DISPLAY_NAMES}
</h:commandLink>
<h:panelGroup rendered="#{'page' eq
portalobjectmgr.selectedObjectType}">
- | <h:commandLink
action="#{coordinationAction.editCoordination}"
+ | <h:commandLink
action="#{coordinationManager.editCoordination}"
actionListener="#{portalobjectmgr.selectObject}"
styleClass="actionCoordination">
<f:param name="id"
value="#{portalobjectmgr.selectedObject.id}" />
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/objectNavigation.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/objectNavigation.xhtml 2008-08-27
17:05:50 UTC (rev 11749)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/objectNavigation.xhtml 2008-08-27
17:10:13 UTC (rev 11750)
@@ -108,7 +108,7 @@
actionListener="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{object.id}"/>
#{bundle.DISPLAY_NAMES}
- </h:commandLink> | <h:commandLink
action="#{coordinationAction.editCoordination}"
styleClass="actionCoordination"
+ </h:commandLink> | <h:commandLink
action="#{coordinationManager.editCoordination}"
styleClass="actionCoordination"
actionListener="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{object.id}"/>
#{bundle.COORDINATION_COORDINATION}