Author: wesleyhales
Date: 2008-08-07 23:40:05 -0400 (Thu, 07 Aug 2008)
New Revision: 11677
Added:
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/resources/portal-admin-war/jsf/editCoordination.xhtml
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
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/jboss-portlet.xml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/objectNavigation.xhtml
Log:
initial coordination ui
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-08-07
16:43:17 UTC (rev 11676)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-08-08
03:40:05 UTC (rev 11677)
@@ -42,12 +42,14 @@
import org.jboss.portal.api.content.SelectedContent;
import org.jboss.portal.core.CoreConstants;
+import org.jboss.portal.core.controller.coordination.CoordinationConfigurator;
import org.jboss.portal.core.admin.ui.actions.AddPageAction;
import org.jboss.portal.core.admin.ui.actions.PropertyAction;
import org.jboss.portal.core.admin.ui.common.PageManagerBean;
import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
import org.jboss.portal.core.event.PortalEventListenerRegistry;
import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
+import org.jboss.portal.core.impl.coordination.CoordinationService;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.ContentProvider;
@@ -94,6 +96,9 @@
private PortalObjectContainer portalObjectContainer;
/** . */
+ private CoordinationConfigurator coordinationService;
+
+ /** . */
private InstanceContainer instanceContainer;
/** . */
@@ -254,6 +259,14 @@
this.portalObjectContainer = poc;
}
+ public CoordinationConfigurator getCoordinationService() {
+ return coordinationService;
+ }
+
+ public void setCoordinationService(CoordinationConfigurator coordinationService) {
+ this.coordinationService = coordinationService;
+ }
+
public InstanceContainer getInstanceContainer()
{
return instanceContainer;
@@ -546,7 +559,7 @@
return "objects";
}
- private PortalObjectId getSelectedPortalObjectId()
+ public PortalObjectId getSelectedPortalObjectId()
{
// Get id
Map<String, String> pmap = getRequestParameterMap();
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2008-08-07
16:43:17 UTC (rev 11676)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2008-08-08
03:40:05 UTC (rev 11677)
@@ -241,7 +241,7 @@
{
// Get portlet
Portlet portlet = getSelectedPortlet();
-
+
//
if (portlet != null)
{
Added:
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
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-08
03:40:05 UTC (rev 11677)
@@ -0,0 +1,183 @@
+/******************************************************************************
+ * 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.core.model.portal.*;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.controller.coordination.EventWiringInfo;
+import org.jboss.portal.core.controller.coordination.AliasBindingInfo;
+import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
+import org.jboss.portal.common.util.ConversionException;
+
+import javax.faces.event.ActionEvent;
+import java.util.*;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 777 $
+ */
+public class CoordinationAction {
+
+ private PortalObjectId selectedObjectId;
+
+ private PortalObject selectedObject;
+
+ private PortalObjectManagerBean pomb;
+
+ private Map<String,PortalObjectId> windows;
+
+ private Collection<EventWiringInfo> eventWirings;
+
+ private Map<String,Collection<EventWiringInfo>> eventSources;
+
+ private Map<String,Collection<EventWiringInfo>> eventDestinations;
+
+ private Collection<? extends AliasBindingInfo> aliasBindings;
+
+ private Collection<? extends WindowBindingInfo> windowBindings;
+
+
+ public PortalObjectId getSelectedObjectId() {
+ selectedObjectId = pomb.getSelectedPortalObjectId();
+ return selectedObjectId;
+ }
+
+ public void setSelectedObjectId(PortalObjectId selectedObjectId) {
+ this.selectedObjectId = selectedObjectId;
+ }
+
+ public PortalObject getSelectedObject() {
+ selectedObject = pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
+ return selectedObject;
+ }
+
+ public void setSelectedObject(PortalObject selectedObject) {
+ this.selectedObject = selectedObject;
+ }
+
+ public Map<String, PortalObjectId> getWindows() {
+ if (windows == null){
+ windows = new HashMap<String, PortalObjectId>();
+ }
+ return windows;
+ }
+
+ public void setWindows(Map<String, PortalObjectId> windows) {
+ this.windows = windows;
+ }
+
+ public PortalObjectManagerBean getPomb() {
+ return pomb;
+ }
+
+ public void setPomb(PortalObjectManagerBean pomb) {
+ this.pomb = pomb;
+ }
+
+ public Collection<EventWiringInfo> getEventWirings() {
+ return eventWirings;
+ }
+
+ public void setEventWirings(Collection<EventWiringInfo> eventWirings) {
+ this.eventWirings = eventWirings;
+ }
+
+ public Map<String, Collection<EventWiringInfo>> getEventSources() {
+ if (eventSources == null){
+ new HashMap<String,Collection<EventWiringInfo>>();
+ }
+ return eventSources;
+ }
+
+ public void setEventSources(Map<String, Collection<EventWiringInfo>>
eventSources) {
+ this.eventSources = eventSources;
+ }
+
+ public Map<String, Collection<EventWiringInfo>> getEventDestinations() {
+ if (eventDestinations == null){
+ new HashMap<String,Collection<EventWiringInfo>>();
+ }
+ return eventDestinations;
+ }
+
+ public void setEventDestinations(Map<String, Collection<EventWiringInfo>>
eventDestinations) {
+ this.eventDestinations = eventDestinations;
+ }
+
+ public Collection<? extends AliasBindingInfo> getAliasBindings() {
+ return aliasBindings;
+ }
+
+ public void setAliasBindings(Collection<? extends AliasBindingInfo>
aliasBindings) {
+ this.aliasBindings = aliasBindings;
+ }
+
+ public Collection<? extends WindowBindingInfo> getWindowBindings() {
+ return windowBindings;
+ }
+
+ public void setWindowBindings(Collection<? extends WindowBindingInfo>
windowBindings) {
+ this.windowBindings = windowBindings;
+ }
+
+ public String editCoordination(ActionEvent event) throws ConversionException
+ {
+ getSelectedObject();
+
+ if (selectedObject.getType() == PortalObject.TYPE_PAGE){
+
+ try{
+ eventWirings =
pomb.getCoordinationService().getEventWirings((Page)selectedObject);
+ aliasBindings =
pomb.getCoordinationService().getAliasBindings((Page)selectedObject);
+ windowBindings =
pomb.getCoordinationService().getWindowBindings((Page)selectedObject);
+
+ System.out.println("-----------ew-" + eventWirings.size());
+
+ System.out.println("-----------ab-" + aliasBindings.size());
+
+ System.out.println("-----------wb-" + windowBindings.size());
+
+ for(PortalObject portalObject : selectedObject.getChildren()){
+
+ if (portalObject.getType() == PortalObject.TYPE_WINDOW){
+ getWindows().put(portalObject.getName(),portalObject.getId());
+ if (eventWirings.size() > 0){
+
getEventSources().put(portalObject.getName(),pomb.getCoordinationService().getEventDestinationWirings((Window)portalObject));
+
getEventDestinations().put(portalObject.getName(),pomb.getCoordinationService().getEventSourceWirings((Window)portalObject));
+ }
+
+ }else{
+
+ }
+ }
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+
+ }
+
+ return "editCoordination";
+ }
+
+}
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-07
16:43:17 UTC (rev 11676)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-08-08
03:40:05 UTC (rev 11677)
@@ -91,6 +91,10 @@
<property-name>listenerRegistry</property-name>
<value>#{applicationScope.ListenerRegistry}</value>
</managed-property>
+ <managed-property>
+ <property-name>coordinationService</property-name>
+ <value>#{applicationScope.CoordinationService}</value>
+ </managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>portalAction</managed-bean-name>
@@ -340,6 +344,16 @@
</managed-bean>
<managed-bean>
+ <managed-bean-name>coordinationAction</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.CoordinationAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>pomb</property-name>
+ <value>#{portalobjectmgr}</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
<managed-bean-name>renameDashboardPageAction</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.RenameAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
@@ -450,6 +464,10 @@
<to-view-id>/jsf/displayNameObject.xhtml</to-view-id>
</navigation-case>
<navigation-case>
+ <from-outcome>editCoordination</from-outcome>
+ <to-view-id>/jsf/editCoordination.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>editWindowTheme</from-outcome>
<to-view-id>/jsf/editWindowTheme.xhtml</to-view-id>
</navigation-case>
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2008-08-07
16:43:17 UTC (rev 11676)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2008-08-08
03:40:05 UTC (rev 11677)
@@ -92,6 +92,11 @@
<service-ref>:service=LayoutService</service-ref>
</service>
<service>
+ <service-name>CoordinationService</service-name>
+
<service-class>org.jboss.portal.core.controller.coordination.CoordinationConfigurator</service-class>
+ <service-ref>:service=CoordinationService</service-ref>
+ </service>
+ <service>
<service-name>UserModule</service-name>
<service-class>org.jboss.portal.identity.UserModule</service-class>
<service-ref>:service=Module,type=User</service-ref>
Added:
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
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-08
03:40:05 UTC (rev 11677)
@@ -0,0 +1,71 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:pfc="http://www.jboss.com/portal/facelet/common"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+
+<f:loadBundle basename="Resource" var="bundle"/>
+ <h2
class="sectionTitle">#{coordinationAction.selectedObject.name}</h2>
+ <h3 class="sectionTitle">Coordination</h3>
+ Parameter Implicit Mode
#{coordinationAction.selectedObject.properties['coordination.parameter.implicit_mode']}
+ <hr/>
+ Event Implicit Mode
#{coordinationAction.selectedObject.properties['coordination.event.implicit_mode']}
+ <hr/>
+ Windows
+ <h:selectManyListbox size="5"
value="#{addDisplayNameAction.newLocale}">
+ <f:selectItems value="#{coordinationAction.windows}"/>
+ </h:selectManyListbox>
+
+
+ <hr/>
+
+ Alias Bindings
+ <ui:repeat value="#{coordinationAction.aliasBindings}"
var="aliasBindings">
+ #{aliasBindings}
+ </ui:repeat>
+
+ <hr/>
+ Window Bindings
+ <ui:repeat var="windowBindings"
value="#{coordinationAction.windowBindings}">
+ #{windowBindings}
+ </ui:repeat>
+
+ <hr/>
+ Event Wirings
+ <ui:repeat var="eventWirings"
value="#{coordinationAction.eventWirings}">
+ #{eventWirings}
+ </ui:repeat>
+ <hr/>
+ <f:subview rendered="#{not empty coordinationAction.eventWirings}"
id="events">
+ eventSources
+ <ui:repeat var="eventSources"
value="#{coordinationAction.eventSources}">
+ #{eventSources}
+ </ui:repeat>
+
+ <hr/>
+ eventDestinations
+ <ui:repeat var="eventDestinations"
value="#{coordinationAction.eventDestinations}">
+ #{eventDestinations}
+ </ui:repeat>
+ </f:subview>
+
+ <ui:remove>
+ <h:selectOneMenu id="locales"
value="#{addDisplayNameAction.newLocale}">
+ <f:selectItems value="#{coordinationAction.pomb.portalItems}"/>
+ </h:selectOneMenu>
+ <br/>
+
+ <h:selectOneMenu id="locales"
value="#{addDisplayNameAction.newLocale}">
+ <f:selectItems value="#{coordinationAction.pomb.instanceItems}"/>
+ </h:selectOneMenu>
+ <br/>
+
+ <h:selectOneMenu id="locales"
value="#{addDisplayNameAction.newLocale}">
+ <f:selectItems
value="#{coordinationAction.pomb.portalPageItems}"/>
+ </h:selectOneMenu>
+ </ui:remove>
+</div>
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-07
16:43:17 UTC (rev 11676)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/objectNavigation.xhtml 2008-08-08
03:40:05 UTC (rev 11677)
@@ -110,6 +110,10 @@
actionListener="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{object.id}"/>
#{bundle.DISPLAY_NAMES}
+ </h:commandLink> | <h:commandLink action="editCoordination"
styleClass="actionCoordination"
+
actionListener="#{coordinationAction.editCoordination}">
+ <f:param name="id" value="#{object.id}"/>
+ Coordination
</h:commandLink>
<h:panelGroup
rendered="#{not object.default}"> | <h:commandLink
action="confirm" styleClass="actionDelete"