JBoss Portal SVN: r11680 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-08 13:27:04 -0400 (Fri, 08 Aug 2008)
New Revision: 11680
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
Log:
minor
Modified: 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-08 17:02:59 UTC (rev 11679)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-08 17:27:04 UTC (rev 11680)
@@ -22,16 +22,21 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui.actions;
-import org.jboss.portal.core.model.portal.*;
+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.AliasBindingInfo;
import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
-import org.jboss.portal.common.util.ConversionException;
+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.Window;
import javax.faces.event.ActionEvent;
import javax.xml.namespace.QName;
-import java.util.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
17 years, 9 months
JBoss Portal SVN: r11679 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-08 13:02:59 -0400 (Fri, 08 Aug 2008)
New Revision: 11679
Modified:
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
Log:
more coordination ui
Modified: 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-08 16:02:45 UTC (rev 11678)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-08 17:02:59 UTC (rev 11679)
@@ -22,27 +22,16 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui.actions;
-import org.jboss.portal.common.util.ConversionException;
+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.EventWiringInfo;
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.Window;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.info.EventingInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.common.util.ConversionException;
import javax.faces.event.ActionEvent;
import javax.xml.namespace.QName;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -65,9 +54,9 @@
private Map<String, Collection<QName>> eventDestinations;
- private Collection<? extends AliasBindingInfo> aliasBindings;
+ private Map<String, String> aliasBindings;
- private Collection<? extends WindowBindingInfo> windowBindings;
+ private Map<Window, QName> windowBindings;
public PortalObjectId getSelectedObjectId()
@@ -132,7 +121,6 @@
{
eventSources = new HashMap<String, Collection<QName>>();
}
-
return eventSources;
}
@@ -155,22 +143,30 @@
this.eventDestinations = eventDestinations;
}
- public Collection<? extends AliasBindingInfo> getAliasBindings()
+ public Map<String, String> getAliasBindings()
{
+ if (aliasBindings == null)
+ {
+ aliasBindings = new HashMap<String, String>();
+ }
return aliasBindings;
}
- public void setAliasBindings(Collection<? extends AliasBindingInfo> aliasBindings)
+ public void setAliasBindings(Map<String, String> aliasBindings)
{
this.aliasBindings = aliasBindings;
}
- public Collection<? extends WindowBindingInfo> getWindowBindings()
+ public Map<Window, QName> getWindowBindings()
{
+ if (windowBindings == null)
+ {
+ windowBindings = new HashMap<Window, QName>();
+ }
return windowBindings;
}
- public void setWindowBindings(Collection<? extends WindowBindingInfo> windowBindings)
+ public void setWindowBindings(Map<Window, QName> windowBindings)
{
this.windowBindings = windowBindings;
}
@@ -185,30 +181,49 @@
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());
+ //aliasbindings ready for ui
+ for (Object o : pomb.getCoordinationService().getAliasBindings((Page)selectedObject))
+ {
+ AliasBindingInfo abInfo = (AliasBindingInfo)o;
+ for (QName name : abInfo.getNames())
+ {
+ getAliasBindings().put(name.getNamespaceURI(), name.getNamespaceURI());
+ }
- System.out.println("-----------ab-" + aliasBindings.size());
+ }
- System.out.println("-----------wb-" + windowBindings.size());
+ //windowbindings ready for ui
+ for (Object o : pomb.getCoordinationService().getWindowBindings((Page)selectedObject))
+ {
+ WindowBindingInfo wbInfo = (WindowBindingInfo)o;
+ getWindowBindings().putAll(wbInfo.getWindows());
- for (PortalObject portalObject : selectedObject.getChildren(PortalObject.WINDOW_MASK))
+ }
+
+ //System.out.println("-----------ew-" + eventWirings.size());
+
+ //System.out.println("-----------ab-" + aliasBindings.size());
+
+ //System.out.println("-----------wb-" + windowBindings.size());
+
+ for (PortalObject portalObject : selectedObject.getChildren())
{
- Window window = (Window) portalObject;
- getWindows().put(window.getName(), window.getId());
- if(ContentType.PORTLET.equals(window.getContentType()))
+
+ if (portalObject.getType() == PortalObject.TYPE_WINDOW)
{
- PortletContent pc = (PortletContent) window.getContent();
- Instance instance = pomb.getInstanceContainer().getDefinition(pc.getInstanceRef());
- Portlet portlet = instance.getPortlet();
- PortletInfo info = portlet.getInfo();
- EventingInfo eventingInfo = info.getEventing();
- getEventSources().put(portalObject.getName(), eventingInfo.getProducedEvents().keySet());
- getEventDestinations().put(portalObject.getName(), eventingInfo.getConsumedEvents().keySet());
+ 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
+ {
+ }
}
}
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-08 16:02:45 UTC (rev 11678)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-08 17:02:59 UTC (rev 11679)
@@ -24,16 +24,17 @@
<hr/>
Alias Bindings
- <ui:repeat value="#{coordinationAction.aliasBindings}" var="aliasBindings">
- #{aliasBindings}
- </ui:repeat>
+ <h:selectManyListbox size="5" value="#{addDisplayNameAction.newLocale}">
+ <f:selectItems value="#{coordinationAction.aliasBindings}"/>
+ </h:selectManyListbox>
+ <br/>
<hr/>
Window Bindings
- <ui:repeat var="windowBindings" value="#{coordinationAction.windowBindings}">
- #{windowBindings}
- </ui:repeat>
-
+ <h:selectManyListbox size="5" value="#{addDisplayNameAction.newLocale}">
+ <f:selectItems value="#{coordinationAction.windowBindings}"/>
+ </h:selectManyListbox>
+
<hr/>
Event Wirings
<ui:repeat var="eventWirings" value="#{coordinationAction.eventWirings}">
17 years, 9 months
JBoss Portal SVN: r11678 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-08 12:02:45 -0400 (Fri, 08 Aug 2008)
New Revision: 11678
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
Log:
- Event sources and destinations should use portlet event metadata (unless I am mistaken, in which case, feel free to revert).
Modified: 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-08 03:40:05 UTC (rev 11677)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-08 16:02:45 UTC (rev 11678)
@@ -22,21 +22,34 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui.actions;
-import org.jboss.portal.core.model.portal.*;
+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.AliasBindingInfo;
import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
-import org.jboss.portal.common.util.ConversionException;
+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.Window;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.info.EventingInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
import javax.faces.event.ActionEvent;
-import java.util.*;
+import javax.xml.namespace.QName;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
* @version $Revision: 777 $
*/
-public class CoordinationAction {
+public class CoordinationAction
+{
private PortalObjectId selectedObjectId;
@@ -44,109 +57,133 @@
private PortalObjectManagerBean pomb;
- private Map<String,PortalObjectId> windows;
+ private Map<String, PortalObjectId> windows;
private Collection<EventWiringInfo> eventWirings;
- private Map<String,Collection<EventWiringInfo>> eventSources;
+ private Map<String, Collection<QName>> eventSources;
- private Map<String,Collection<EventWiringInfo>> eventDestinations;
+ private Map<String, Collection<QName>> eventDestinations;
private Collection<? extends AliasBindingInfo> aliasBindings;
private Collection<? extends WindowBindingInfo> windowBindings;
- public PortalObjectId getSelectedObjectId() {
+ public PortalObjectId getSelectedObjectId()
+ {
selectedObjectId = pomb.getSelectedPortalObjectId();
return selectedObjectId;
}
- public void setSelectedObjectId(PortalObjectId selectedObjectId) {
+ public void setSelectedObjectId(PortalObjectId selectedObjectId)
+ {
this.selectedObjectId = selectedObjectId;
}
- public PortalObject getSelectedObject() {
+ public PortalObject getSelectedObject()
+ {
selectedObject = pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
return selectedObject;
}
- public void setSelectedObject(PortalObject selectedObject) {
+ public void setSelectedObject(PortalObject selectedObject)
+ {
this.selectedObject = selectedObject;
}
- public Map<String, PortalObjectId> getWindows() {
- if (windows == null){
+ public Map<String, PortalObjectId> getWindows()
+ {
+ if (windows == null)
+ {
windows = new HashMap<String, PortalObjectId>();
}
return windows;
}
- public void setWindows(Map<String, PortalObjectId> windows) {
+ public void setWindows(Map<String, PortalObjectId> windows)
+ {
this.windows = windows;
}
- public PortalObjectManagerBean getPomb() {
+ public PortalObjectManagerBean getPomb()
+ {
return pomb;
}
- public void setPomb(PortalObjectManagerBean pomb) {
+ public void setPomb(PortalObjectManagerBean pomb)
+ {
this.pomb = pomb;
}
- public Collection<EventWiringInfo> getEventWirings() {
+ public Collection<EventWiringInfo> getEventWirings()
+ {
return eventWirings;
}
- public void setEventWirings(Collection<EventWiringInfo> eventWirings) {
+ public void setEventWirings(Collection<EventWiringInfo> eventWirings)
+ {
this.eventWirings = eventWirings;
}
- public Map<String, Collection<EventWiringInfo>> getEventSources() {
- if (eventSources == null){
- new HashMap<String,Collection<EventWiringInfo>>();
+ public Map<String, Collection<QName>> getEventSources()
+ {
+ if (eventSources == null)
+ {
+ eventSources = new HashMap<String, Collection<QName>>();
}
+
return eventSources;
}
- public void setEventSources(Map<String, Collection<EventWiringInfo>> eventSources) {
+ public void setEventSources(Map<String, Collection<QName>> eventSources)
+ {
this.eventSources = eventSources;
}
- public Map<String, Collection<EventWiringInfo>> getEventDestinations() {
- if (eventDestinations == null){
- new HashMap<String,Collection<EventWiringInfo>>();
+ public Map<String, Collection<QName>> getEventDestinations()
+ {
+ if (eventDestinations == null)
+ {
+ eventDestinations = new HashMap<String, Collection<QName>>();
}
return eventDestinations;
}
- public void setEventDestinations(Map<String, Collection<EventWiringInfo>> eventDestinations) {
+ public void setEventDestinations(Map<String, Collection<QName>> eventDestinations)
+ {
this.eventDestinations = eventDestinations;
}
- public Collection<? extends AliasBindingInfo> getAliasBindings() {
+ public Collection<? extends AliasBindingInfo> getAliasBindings()
+ {
return aliasBindings;
}
- public void setAliasBindings(Collection<? extends AliasBindingInfo> aliasBindings) {
+ public void setAliasBindings(Collection<? extends AliasBindingInfo> aliasBindings)
+ {
this.aliasBindings = aliasBindings;
}
- public Collection<? extends WindowBindingInfo> getWindowBindings() {
+ public Collection<? extends WindowBindingInfo> getWindowBindings()
+ {
return windowBindings;
}
- public void setWindowBindings(Collection<? extends WindowBindingInfo> 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{
+ 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);
@@ -157,27 +194,32 @@
System.out.println("-----------wb-" + windowBindings.size());
- for(PortalObject portalObject : selectedObject.getChildren()){
+ for (PortalObject portalObject : selectedObject.getChildren(PortalObject.WINDOW_MASK))
+ {
+ Window window = (Window) portalObject;
+ getWindows().put(window.getName(), window.getId());
+ if(ContentType.PORTLET.equals(window.getContentType()))
+ {
+ PortletContent pc = (PortletContent) window.getContent();
+ Instance instance = pomb.getInstanceContainer().getDefinition(pc.getInstanceRef());
+ Portlet portlet = instance.getPortlet();
+ PortletInfo info = portlet.getInfo();
+ EventingInfo eventingInfo = info.getEventing();
+ getEventSources().put(portalObject.getName(), eventingInfo.getProducedEvents().keySet());
+ getEventDestinations().put(portalObject.getName(), eventingInfo.getConsumedEvents().keySet());
+ }
- 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();
}
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
return "editCoordination";
}
-
+
}
17 years, 9 months
JBoss Portal SVN: r11677 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: main/org/jboss/portal/core/admin/ui/actions and 2 other directories.
by portal-commits@lists.jboss.org
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"
17 years, 9 months
JBoss Portal SVN: r11676 - branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-07 12:43:17 -0400 (Thu, 07 Aug 2008)
New Revision: 11676
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml
Log:
- JBPORTAL-2115: Use proper case in formula. Thanks, esmith1!
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml 2008-08-07 16:42:22 UTC (rev 11675)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml 2008-08-07 16:43:17 UTC (rev 11676)
@@ -23,8 +23,8 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.jboss.portal.wsrp.consumer.ProducerInfo" table="JBP_PRODUCER_INFO">
<cache usage="@portal.hibernate.cache.usage@"/>
@@ -81,7 +81,7 @@
<map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
<cache usage="@portal.hibernate.cache.usage@"/>
<key column="REG_PK" not-null="true"/>
- <map-key type="string" formula="name"/>
+ <map-key type="string" formula="NAME"/>
<one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
</map>
</class>
@@ -98,12 +98,12 @@
<property name="invalid" column="INVALID" type="java.lang.Boolean"/>
<property name="lang" column="LANG" type="java.lang.String" not-null="true"/>
<many-to-one
- name="description"
- column="DESC_PK"
- class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
- unique="true"
- cascade="all"
- lazy="false"/>
+ name="description"
+ column="DESC_PK"
+ class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
+ unique="true"
+ cascade="all"
+ lazy="false"/>
</class>
<class name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription" table="JBP_REG_PROP_DESC">
<cache usage="@portal.hibernate.cache.usage@"/>
17 years, 9 months
JBoss Portal SVN: r11675 - branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-07 12:42:22 -0400 (Thu, 07 Aug 2008)
New Revision: 11675
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml
Log:
- JBPORTAL-2115: Use proper case in formula. Thanks, esmith1!
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml 2008-08-06 22:42:48 UTC (rev 11674)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml 2008-08-07 16:42:22 UTC (rev 11675)
@@ -81,7 +81,7 @@
<map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
<cache usage="@portal.hibernate.cache.usage@"/>
<key column="REG_PK" not-null="true"/>
- <map-key type="string" formula="name"/>
+ <map-key type="string" formula="NAME"/>
<one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
</map>
</class>
17 years, 9 months
JBoss Portal SVN: r11674 - branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-06 18:42:48 -0400 (Wed, 06 Aug 2008)
New Revision: 11674
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
Log:
- JBPORTAL-2114: InternalContentProvider.renderWindow now fails if a window state or mode that the portlet doesn't support is requested.
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-08-06 22:23:49 UTC (rev 11673)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-08-06 22:42:48 UTC (rev 11674)
@@ -25,6 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.net.media.MediaType;
import org.jboss.portal.common.util.MultiValuedPropertyMap;
import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
@@ -44,9 +45,11 @@
import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.content.WindowRendition;
import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
import org.jboss.portal.portlet.invocation.RenderInvocation;
@@ -63,6 +66,8 @@
import org.w3c.dom.Element;
import javax.portlet.MimeResponse;
+import javax.portlet.PortletModeException;
+import javax.portlet.WindowStateException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -206,13 +211,13 @@
//
return new WindowRendition(windowProps, WindowState.NORMAL, Mode.VIEW, null, null, cr);
}
-
+
//
PortletWindowNavigationalState windowNS = rendererContext.getPortletNavigationalState();
-
+
if (windowNS == null)
{
-
+
}
//
@@ -250,7 +255,8 @@
//
try
{
- CapabilitiesInfo capabilitiesInfo = instance.getPortlet().getInfo().getCapabilities();
+ Portlet portlet = instance.getPortlet();
+ CapabilitiesInfo capabilitiesInfo = portlet.getInfo().getCapabilities();
// Add window states for any media type
Set<WindowStateInfo> windowStatesInfo = capabilitiesInfo.getAllWindowStates();
@@ -266,7 +272,7 @@
// Get current Media Type
MediaType mediaType = invocation.getContext().getMarkupInfo().getMediaType();
-
+
// Add window states for the current media type
windowStatesInfo = capabilitiesInfo.getWindowStates(mediaType);
supportedWindowStates = new ArrayList<WindowState>(windowStatesInfo.size());
@@ -279,6 +285,14 @@
}
}
+ // fail fast if we are requesting a window state that is not supported by this portlet
+ if (!supportedWindowStates.contains(windowState))
+ {
+ String windowStateName = windowState.toString();
+ throw new WindowStateException(windowStateName + " is not supported by portlet " + getPortletName(portlet),
+ new javax.portlet.WindowState(windowStateName));
+ }
+
// Add modes for any media type
Set<ModeInfo> modesInfo = capabilitiesInfo.getAllModes();
supportedModes = new ArrayList<Mode>(modesInfo.size());
@@ -303,6 +317,14 @@
}
}
+ // fail fast if we are requesting a window state that is not supported by this portlet
+ if (!supportedModes.contains(mode))
+ {
+ String modeName = mode.toString();
+ throw new PortletModeException(modeName + " is not supported by portlet " + getPortletName(portlet),
+ new javax.portlet.PortletMode(modeName));
+ }
+
// Remove edit mode if the user is not logged it
if (rendererContext.getUser() == null)
{
@@ -322,7 +344,7 @@
//
response = instance.invoke(invocation);
}
- catch (PortletInvokerException e)
+ catch (Exception e)
{
ControllerResponse cr;
@@ -421,4 +443,20 @@
//
return new WindowRendition(windowProps, windowState, mode, supportedWindowStates, supportedModes, cr);
}
+
+ private String getPortletName(Portlet portlet) throws PortletInvokerException
+ {
+ LocalizedString displayName = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ // if we can't get a display name, default to portlet id...
+ String name;
+ if (displayName == null)
+ {
+ name = portlet.getContext().getId();
+ }
+ else
+ {
+ name = displayName.getDefaultString();
+ }
+ return "'" + name + "'";
+ }
}
17 years, 9 months
JBoss Portal SVN: r11673 - in branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core: model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-06 18:23:49 -0400 (Wed, 06 Aug 2008)
New Revision: 11673
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/ParameterBindingInfo.java
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/model/portal/DefaultPortalCommandFactory.java
Log:
- Minor.
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-08-06 22:20:16 UTC (rev 11672)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java 2008-08-06 22:23:49 UTC (rev 11673)
@@ -22,13 +22,13 @@
package org.jboss.portal.core.controller.coordination;
-import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PageContainer;
+import org.jboss.portal.core.model.portal.Window;
import javax.xml.namespace.QName;
+import java.util.Collection;
import java.util.Map;
-import java.util.Collection;
import java.util.Set;
/**
@@ -40,7 +40,7 @@
// Management
/**
- * Defines a wiring for a given even QName between multiply source and destination windows
+ * Defines a wiring for a given even QName between multiple source and destination windows
*
* @param sources
* @param targets
Modified: 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-08-06 22:20:16 UTC (rev 11672)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/ParameterBindingInfo.java 2008-08-06 22:23:49 UTC (rev 11673)
@@ -22,11 +22,6 @@
package org.jboss.portal.core.controller.coordination;
-import org.jboss.portal.core.model.portal.Window;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-
/**
* @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>
@@ -35,7 +30,4 @@
public interface ParameterBindingInfo
{
String getId();
-
-
-
}
Modified: 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-08-06 22:20:16 UTC (rev 11672)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/WindowBindingInfo.java 2008-08-06 22:23:49 UTC (rev 11673)
@@ -34,6 +34,5 @@
*/
public interface WindowBindingInfo extends ParameterBindingInfo
{
-
Map<Window, QName> getWindows();
}
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2008-08-06 22:20:16 UTC (rev 11672)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2008-08-06 22:23:49 UTC (rev 11673)
@@ -74,7 +74,7 @@
{
throw new IllegalStateException("Context does not exist");
}
- Portal portal = (Portal)context.getDefaultPortal();
+ Portal portal = context.getDefaultPortal();
if (portal == null)
{
throw new IllegalStateException("Default portal does not exist");
17 years, 9 months
JBoss Portal SVN: r11672 - in branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core: impl/model/content/generic and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-06 18:20:16 -0400 (Wed, 06 Aug 2008)
New Revision: 11672
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
Log:
- JBPORTAL-2114: InternalContentProvider.renderWindow now fails if a window state or mode that the portlet doesn't support is requested.
- Renamed WindowNavigationalState.bilto to something more appropriate... :)
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-08-06 18:22:50 UTC (rev 11671)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-08-06 22:20:16 UTC (rev 11672)
@@ -25,6 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.command.response.SecurityErrorResponse;
@@ -35,16 +36,18 @@
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
import org.jboss.portal.core.model.portal.content.ContentRenderer;
+import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.content.WindowRendition;
-import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -59,6 +62,8 @@
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+import javax.portlet.PortletModeException;
+import javax.portlet.WindowStateException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -162,7 +167,7 @@
// Get the parent portal
Portal portal = null;
- for (PortalObject current = window;current != null;current = current.getParent())
+ for (PortalObject current = window; current != null; current = current.getParent())
{
if (current.getType() == PortalObject.TYPE_PORTAL)
{
@@ -217,7 +222,8 @@
//
try
{
- CapabilitiesInfo capabilitiesInfo = instance.getPortlet().getInfo().getCapabilities();
+ Portlet portlet = instance.getPortlet();
+ CapabilitiesInfo capabilitiesInfo = portlet.getInfo().getCapabilities();
//
Set windowStatesInfo = capabilitiesInfo.getAllWindowStates();
@@ -232,6 +238,14 @@
}
}
+ // fail fast if we are requesting a window state that is not supported by this portlet
+ if (!supportedWindowStates.contains(windowState))
+ {
+ String windowStateName = windowState.toString();
+ throw new WindowStateException(windowStateName + " is not supported by portlet " + getPortletName(portlet),
+ new javax.portlet.WindowState(windowStateName));
+ }
+
//
Set modesInfo = capabilitiesInfo.getAllModes();
supportedModes = new ArrayList(modesInfo.size());
@@ -245,6 +259,14 @@
}
}
+ // fail fast if we are requesting a window state that is not supported by this portlet
+ if (!supportedModes.contains(mode))
+ {
+ String modeName = mode.toString();
+ throw new PortletModeException(modeName + " is not supported by portlet " + getPortletName(portlet),
+ new javax.portlet.PortletMode(modeName));
+ }
+
// Remove edit mode if the user is not logged it
if (rendererContext.getUser() == null)
{
@@ -264,7 +286,7 @@
//
response = instance.invoke(invocation);
}
- catch (PortletInvokerException e)
+ catch (Exception e)
{
ControllerResponse cr;
@@ -345,4 +367,21 @@
//
return new WindowRendition(windowProps, windowState, mode, supportedWindowStates, supportedModes, cr);
}
+
+ private String getPortletName(Portlet portlet) throws PortletInvokerException
+ {
+ LocalizedString displayName = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ // if we can't get a display name, default to portlet id...
+ String name;
+ if (displayName == null)
+ {
+ name = portlet.getContext().getId();
+ }
+ else
+ {
+ name = displayName.getDefaultString();
+ }
+
+ return "'" + name + "'";
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2008-08-06 18:22:50 UTC (rev 11671)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2008-08-06 22:20:16 UTC (rev 11672)
@@ -36,8 +36,8 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
+import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.content.WindowRendition;
-import org.jboss.portal.core.model.portal.content.ContentRendererContext;
import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
import org.jboss.portal.portlet.PortletParametersStateString;
@@ -195,7 +195,7 @@
state.setValue("uri", uri);
//
- rendererContext.setNavigationalState(WindowNavigationalState.bilto(navigationalState, null, null, state));
+ rendererContext.setNavigationalState(WindowNavigationalState.copyAndUpdateIfNeeded(navigationalState, null, null, state));
}
//
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2008-08-06 18:22:50 UTC (rev 11671)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2008-08-06 22:20:16 UTC (rev 11672)
@@ -50,21 +50,21 @@
protected final StateString navigationalState;
public InvokePortletWindowRenderCommand(
- PortalObjectId windowId,
- Mode mode,
- WindowState windowState,
- StateString navigationalState)
- throws IllegalArgumentException
+ PortalObjectId windowId,
+ Mode mode,
+ WindowState windowState,
+ StateString navigationalState)
+ throws IllegalArgumentException
{
super(windowId, mode, windowState);
this.navigationalState = navigationalState;
}
public InvokePortletWindowRenderCommand(
- PortalObjectId windowId,
- Mode mode,
- WindowState windowState)
- throws IllegalArgumentException
+ PortalObjectId windowId,
+ Mode mode,
+ WindowState windowState)
+ throws IllegalArgumentException
{
super(windowId, mode, windowState);
this.navigationalState = null;
@@ -90,7 +90,7 @@
WindowNavigationalState oldNS = (WindowNavigationalState)ctx.getAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey);
// Create new NS
- WindowNavigationalState newNS = WindowNavigationalState.bilto(oldNS, this.windowState, this.mode, this.navigationalState);
+ WindowNavigationalState newNS = WindowNavigationalState.copyAndUpdateIfNeeded(oldNS, this.windowState, this.mode, this.navigationalState);
// Update NS
ctx.setAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey, newNS);
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2008-08-06 18:22:50 UTC (rev 11671)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2008-08-06 22:20:16 UTC (rev 11672)
@@ -270,7 +270,7 @@
resolver.setAttribute(key, wns);
}
- public static WindowNavigationalState bilto(WindowNavigationalState oldNS, WindowState windowState, Mode mode, StateString contentState)
+ public static WindowNavigationalState copyAndUpdateIfNeeded(WindowNavigationalState oldNS, WindowState windowState, Mode mode, StateString contentState)
{
StateString newState = oldNS != null ? oldNS.getContentState() : null;
WindowState newWindowState = oldNS != null ? oldNS.getWindowState() : WindowState.NORMAL;
17 years, 9 months
JBoss Portal SVN: r11671 - branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-06 14:22:50 -0400 (Wed, 06 Aug 2008)
New Revision: 11671
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
Log:
- Minor javadoc fix.
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2008-08-06 14:56:38 UTC (rev 11670)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2008-08-06 18:22:50 UTC (rev 11671)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.core.model.portal;
+import org.jboss.portal.common.i18n.LocalizedString;
+
import java.util.Collection;
import java.util.Map;
-import org.jboss.portal.common.i18n.LocalizedString;
-
/**
* The base interface for all portal objects.
*
@@ -97,7 +97,7 @@
/**
* Set the localized string used to represent that object.
*
- * @param the localized display name
+ * @param localizedString the localized display name
*/
void setDisplayName(LocalizedString localizedString);
17 years, 9 months