Author: julien(a)jboss.com
Date: 2008-01-15 13:19:23 -0500 (Tue, 15 Jan 2008)
New Revision: 9514
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventingInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerNavigationInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerParameterInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventingInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/NavigationInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ParameterInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventingInfoSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/NavigationInfoSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/ParameterInfoSupport.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java
Log:
- added runtime metadata support for public render parameter
- renamed EventsInfo to EventingInfo
Copied:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventingInfo.java
(from rev 9505,
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java)
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventingInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventingInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.EventingInfo;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerEventingInfo implements EventingInfo
+{
+
+ /** . */
+ private final List<ContainerEventInfo> producedEvents;
+
+ /** . */
+ private final List<ContainerEventInfo> consumedEvents;
+
+ public ContainerEventingInfo()
+ {
+ producedEvents = new ArrayList<ContainerEventInfo>();
+ consumedEvents = new ArrayList<ContainerEventInfo>();
+ }
+
+ public void addProducedEvent(ContainerEventInfo producedEvent)
+ {
+ producedEvents.add(producedEvent);
+ }
+
+ public void addConsumedEvent(ContainerEventInfo consumedEvent)
+ {
+ consumedEvents.add(consumedEvent);
+ }
+
+ public Collection<ContainerEventInfo> getProducedEvents()
+ {
+ return producedEvents;
+ }
+
+ public Collection<ContainerEventInfo> getConsumedEvents()
+ {
+ return consumedEvents;
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -1,69 +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.portlet.impl.info;
-
-import org.jboss.portal.portlet.info.EventsInfo;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ContainerEventsInfo implements EventsInfo
-{
-
- /** . */
- private final List<ContainerEventInfo> producedEvents;
-
- /** . */
- private final List<ContainerEventInfo> consumedEvents;
-
- public ContainerEventsInfo()
- {
- producedEvents = new ArrayList<ContainerEventInfo>();
- consumedEvents = new ArrayList<ContainerEventInfo>();
- }
-
- public void addProducedEvent(ContainerEventInfo producedEvent)
- {
- producedEvents.add(producedEvent);
- }
-
- public void addConsumedEvent(ContainerEventInfo consumedEvent)
- {
- consumedEvents.add(consumedEvent);
- }
-
- public Collection<ContainerEventInfo> getProducedEvents()
- {
- return producedEvents;
- }
-
- public Collection<ContainerEventInfo> getConsumedEvents()
- {
- return consumedEvents;
- }
-}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -37,6 +37,7 @@
import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.value.Value;
@@ -88,6 +89,9 @@
private final Map<QName, ContainerEventInfo> events;
/** . */
+ private final Map<String, ContainerParameterInfo> publicParameters;
+
+ /** . */
private ContainerPortletApplicationInfo portletApplication;
/** . */
@@ -102,7 +106,8 @@
{
this.portletApplicationMD = portletApplicationMD;
this.context = context;
- this.events = new HashMap<QName, ContainerEventInfo>();
+ this.events = new LinkedHashMap<QName, ContainerEventInfo>();
+ this.publicParameters = new LinkedHashMap<String, ContainerParameterInfo>();
this.portlets = new LinkedHashMap<String, ContainerPortletInfo>();
}
@@ -125,6 +130,10 @@
{
tmp.setEvents(new ArrayList<EventDefinitionMetaData>());
}
+ if (tmp.getPublicRenderParameters() == null)
+ {
+ tmp.setPublicRenderParameters(new
ArrayList<PublicRenderParameterMetaData>());
+ }
if (tmp.getDefaultNamespace() == null)
{
try
@@ -274,12 +283,40 @@
log.error("Cannot load event class " + e.getClassName(), e);
}
}
+
+ //
+ for (PublicRenderParameterMetaData parameterMD :
tmp.getPublicRenderParameters())
+ {
+ ContainerParameterInfo parameter = build(parameterMD);
+
+ //
+ publicParameters.put(parameter.getId(), parameter);
+ }
}
//
return new ContainerPortletApplicationInfo(defaultNamespace);
}
+ private ContainerParameterInfo build(PublicRenderParameterMetaData parameterMD)
+ {
+ QName name = getName(parameterMD.getQname(), parameterMD.getName());
+ ResourceBundleManager bundleMgr = context.getBundleManager();
+
+ //
+ LocalizedString description = bundleMgr.getLocalizedValue(
+ "javax.portlet.app.public-render-parameter." + name +
".description",
+ "Description of public render parameter " + name);
+
+ //
+ return new ContainerParameterInfo(
+ parameterMD.getIdentifier(),
+ name,
+ parameterMD.getAlias(),
+ description
+ );
+ }
+
private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD) throws
NoSuchClassException
{
QName name = getName(eventDefinitionMD.getQname(), eventDefinitionMD.getName());
@@ -296,8 +333,12 @@
//
- LocalizedString displayName =
bundleMgr.getLocalizedValue("javax.portlet.app.event-definition.." + name +
".display-name", "Event " + name);
- LocalizedString description =
bundleMgr.getLocalizedValue("javax.portlet.app.event-definition." + name +
".description", "Description of event " + name);
+ LocalizedString displayName = bundleMgr.getLocalizedValue(
+ "javax.portlet.app.event-definition.." + name +
".display-name",
+ "Event " + name);
+ LocalizedString description = bundleMgr.getLocalizedValue(
+ "javax.portlet.app.event-definition." + name +
".description",
+ "Description of event " + name);
//
return new ContainerEventInfo(name, type, displayName, description);
@@ -319,7 +360,8 @@
ContainerPortletInfo containerPortletInfo;
if (portletApplicationMD instanceof PortletApplication20MetaData)
{
- ContainerEventsInfo containerEvents = buildContainerEventsInfo(portletMD);
+ ContainerEventingInfo containerEvents = buildContainerEventsInfo(portletMD);
+ ContainerNavigationInfo containerNavigation =
buildContainerNavigationInfo(portletMD);
//
containerPortletInfo = new ContainerPortletInfo(
@@ -329,7 +371,8 @@
containerSecurity,
containerCache,
containerSession,
- containerEvents,
+ containerEvents,
+ containerNavigation,
portletMD.getPortletName(),
portletMD.getPortletClass(),
false,
@@ -368,11 +411,35 @@
return containerPortletInfo;
}
- private ContainerEventsInfo buildContainerEventsInfo(PortletMetaData portletMD)
+ private ContainerNavigationInfo buildContainerNavigationInfo(PortletMetaData
portletMD)
{
- ContainerEventsInfo portletEvents = new ContainerEventsInfo();
+ ContainerNavigationInfo navigation = new ContainerNavigationInfo();
//
+ for (String parameterId : portletMD.getSupportedPublicRenderParameters())
+ {
+ ContainerParameterInfo parameter = publicParameters.get(parameterId);
+
+ //
+ if (parameter == null)
+ {
+ // Do something
+ }
+ else
+ {
+ navigation.addPublicParameter(parameter);
+ }
+ }
+
+ //
+ return navigation;
+ }
+
+ private ContainerEventingInfo buildContainerEventsInfo(PortletMetaData portletMD)
+ {
+ ContainerEventingInfo portletEvents = new ContainerEventingInfo();
+
+ //
for (EventDefinitionReferenceMetaData eventDefinitionReferenceMD :
portletMD.getSupportedProcessingEvent())
{
QName name = getName(eventDefinitionReferenceMD.getQname(),
eventDefinitionReferenceMD.getName());
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerNavigationInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerNavigationInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerNavigationInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.NavigationInfo;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerNavigationInfo implements NavigationInfo
+{
+
+ /** . */
+ private Map<String, ContainerParameterInfo> publicParameters;
+
+ public ContainerNavigationInfo()
+ {
+ this.publicParameters = new HashMap<String, ContainerParameterInfo>();
+ }
+
+ public void addPublicParameter(ContainerParameterInfo publicParameter)
+ {
+ publicParameters.put(publicParameter.getId(), publicParameter);
+ }
+
+ public ContainerParameterInfo getPublicParameter(String id)
+ {
+ return publicParameters.get(id);
+ }
+
+ public Collection<ContainerParameterInfo> getPublicParameters()
+ {
+ return publicParameters.values();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerParameterInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerParameterInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerParameterInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import javax.xml.namespace.QName;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerParameterInfo implements ParameterInfo
+{
+
+ /** The id used by the portlet to reference. */
+ private final String id;
+
+ /** . */
+ private final QName name;
+
+ /** . */
+ private final List<QName> aliases;
+
+ /** . */
+ private final LocalizedString description;
+
+ public ContainerParameterInfo(String id, QName name, List<QName> aliases,
LocalizedString description)
+ {
+ this.id = id;
+ this.name = name;
+ this.aliases = aliases;
+ this.description = description;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public Collection<QName> getAliases()
+ {
+ return aliases;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -59,7 +59,7 @@
private final ContainerSessionInfo session;
/** . */
- private final ContainerEventsInfo events;
+ private final ContainerEventingInfo events;
/** . */
private final String name;
@@ -79,6 +79,9 @@
/** . */
private final ResourceBundleManager bundleManager;
+ /** . */
+ private final ContainerNavigationInfo navigation;
+
public ContainerPortletInfo(
ContainerCapabilitiesInfo capabilities,
ContainerPreferencesInfo preferences,
@@ -97,7 +100,8 @@
this.security = security;
this.cache = cache;
this.session = session;
- this.events = new ContainerEventsInfo();
+ this.events = new ContainerEventingInfo();
+ this.navigation = new ContainerNavigationInfo();
this.name = name;
this.className = className;
this.initParameters = new HashMap<String, String>();
@@ -113,7 +117,8 @@
ContainerSecurityInfo security,
ContainerCacheInfo cache,
ContainerSessionInfo session,
- ContainerEventsInfo events,
+ ContainerEventingInfo events,
+ ContainerNavigationInfo navigation,
String name,
String className,
Boolean remotable,
@@ -126,6 +131,7 @@
this.cache = cache;
this.session = session;
this.events = events;
+ this.navigation = navigation;
this.name = name;
this.className = className;
this.initParameters = new HashMap<String, String>();
@@ -209,8 +215,13 @@
return remotable;
}
- public ContainerEventsInfo getEvents()
+ public ContainerEventingInfo getEvents()
{
return events;
}
+
+ public ContainerNavigationInfo getNavigation()
+ {
+ return navigation;
+ }
}
\ No newline at end of file
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -29,7 +29,7 @@
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.info.ContainerEventsInfo;
+import org.jboss.portal.portlet.impl.info.ContainerEventingInfo;
import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import org.jboss.portal.portlet.impl.info.ContainerTypeInfo;
import org.jboss.portal.portlet.impl.info.ContainerEventInfo;
@@ -287,7 +287,7 @@
}
//
- ContainerEventsInfo eventsInfo = preq.container.getInfo().getEvents();
+ ContainerEventingInfo eventsInfo = preq.container.getInfo().getEvents();
// Check type
for (ContainerEventInfo eventInfo : eventsInfo.getProducedEvents())
Copied:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventingInfo.java
(from rev 9505,
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java)
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventingInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventingInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.portlet.info;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface EventingInfo
+{
+
+ Collection<? extends EventInfo> getProducedEvents();
+
+ Collection<? extends EventInfo> getConsumedEvents();
+
+}
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -1,38 +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.portlet.info;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface EventsInfo
-{
-
- Collection<? extends EventInfo> getProducedEvents();
-
- Collection<? extends EventInfo> getConsumedEvents();
-
-}
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/NavigationInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/NavigationInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/NavigationInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * 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.portlet.info;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface NavigationInfo
+{
+
+ Collection<? extends ParameterInfo> getPublicParameters();
+
+}
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ParameterInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ParameterInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ParameterInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.portlet.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import javax.xml.namespace.QName;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ParameterInfo
+{
+
+ QName getName();
+
+ Collection<QName> getAliases();
+
+ LocalizedString getDescription();
+
+}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -86,5 +86,7 @@
*/
Boolean isRemotable();
- EventsInfo getEvents();
+ EventingInfo getEvents();
+
+ NavigationInfo getNavigation();
}
Copied:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventingInfoSupport.java
(from rev 9505,
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java)
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventingInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventingInfoSupport.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.portlet.support.info;
+
+import org.jboss.portal.portlet.info.EventingInfo;
+import org.jboss.portal.portlet.info.EventInfo;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EventingInfoSupport implements EventingInfo
+{
+
+ /** . */
+ private List<EventInfoSupport> producedEvents;
+
+ /** . */
+ private List<EventInfoSupport> consumedEvents;
+
+ public EventingInfoSupport()
+ {
+ producedEvents = new ArrayList<EventInfoSupport>();
+ consumedEvents = new ArrayList<EventInfoSupport>();
+ }
+
+ public void addProducedEvent(EventInfoSupport event)
+ {
+ producedEvents.add(event);
+ }
+
+ public void addConsumedEvent(EventInfoSupport event)
+ {
+ producedEvents.add(event);
+ }
+
+ public Collection<? extends EventInfo> getProducedEvents()
+ {
+ return producedEvents;
+ }
+
+ public Collection<? extends EventInfo> getConsumedEvents()
+ {
+ return consumedEvents;
+ }
+}
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -1,70 +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.portlet.support.info;
-
-import org.jboss.portal.portlet.info.EventsInfo;
-import org.jboss.portal.portlet.info.EventInfo;
-
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class EventsInfoSupport implements EventsInfo
-{
-
- /** . */
- private List<EventInfoSupport> producedEvents;
-
- /** . */
- private List<EventInfoSupport> consumedEvents;
-
- public EventsInfoSupport()
- {
- producedEvents = new ArrayList<EventInfoSupport>();
- consumedEvents = new ArrayList<EventInfoSupport>();
- }
-
- public void addProducedEvent(EventInfoSupport event)
- {
- producedEvents.add(event);
- }
-
- public void addConsumedEvent(EventInfoSupport event)
- {
- producedEvents.add(event);
- }
-
- public Collection<? extends EventInfo> getProducedEvents()
- {
- return producedEvents;
- }
-
- public Collection<? extends EventInfo> getConsumedEvents()
- {
- return consumedEvents;
- }
-}
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/NavigationInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/NavigationInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/NavigationInfoSupport.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.portlet.support.info;
+
+import org.jboss.portal.portlet.info.NavigationInfo;
+import org.jboss.portal.portlet.info.ParameterInfo;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class NavigationInfoSupport implements NavigationInfo
+{
+
+ /** . */
+ private final List<ParameterInfoSupport> publicParameters;
+
+ public NavigationInfoSupport()
+ {
+ publicParameters = new ArrayList<ParameterInfoSupport>();
+ }
+
+ public void addPublicParameter(ParameterInfoSupport parameter)
+ {
+ publicParameters.add(parameter);
+ }
+
+ public Collection<? extends ParameterInfo> getPublicParameters()
+ {
+ return publicParameters;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/ParameterInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/ParameterInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/ParameterInfoSupport.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.portlet.support.info;
+
+import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import javax.xml.namespace.QName;
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ParameterInfoSupport implements ParameterInfo
+{
+
+ /** . */
+ private QName name;
+
+ /** . */
+ private LocalizedString description;
+
+ /** . */
+ private List<QName> aliases;
+
+ public ParameterInfoSupport(QName name)
+ {
+ this.name = name;
+ this.aliases = new ArrayList<QName>();
+ this.description = new LocalizedString("Description of event " + name);
+ }
+
+ public ParameterInfoSupport(QName name, String type)
+ {
+ this.name = name;
+ this.aliases = new ArrayList<QName>();
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public Collection<QName> getAliases()
+ {
+ return aliases;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ }
+
+ public void addAlias(QName alias)
+ {
+ aliases.add(alias);
+ }
+}
\ No newline at end of file
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -22,14 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.support.info;
-import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
-import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.info.PreferencesInfo;
-import org.jboss.portal.portlet.info.SecurityInfo;
-import org.jboss.portal.portlet.info.SessionInfo;
-import org.jboss.portal.portlet.info.EventsInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -44,7 +38,8 @@
private CacheInfoSupport cacheSupport = new CacheInfoSupport();
private SessionInfoSupport sessionSupport = new SessionInfoSupport();
private MetaInfoSupport metaSupport = new MetaInfoSupport();
- private EventsInfoSupport eventsSupports = new EventsInfoSupport();
+ private EventingInfoSupport eventsSupport = new EventingInfoSupport();
+ private NavigationInfoSupport navigationSupport = new NavigationInfoSupport();
public CapabilitiesInfo getCapabilities()
{
@@ -86,8 +81,13 @@
this.remotable = remotable;
}
- public EventsInfoSupport getEvents()
+ public EventingInfoSupport getEvents()
{
- return eventsSupports;
+ return eventsSupport;
}
+
+ public NavigationInfoSupport getNavigation()
+ {
+ return navigationSupport;
+ }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java 2008-01-15
16:16:29 UTC (rev 9513)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java 2008-01-15
18:19:23 UTC (rev 9514)
@@ -246,7 +246,7 @@
// Update portlet NS
if (response instanceof UpdateNavigationalStateResponse)
{
- updateNavigationalState(navState, action.portletId,
(UpdateNavigationalStateResponse)response);
+ updateNavigationalState(context, action.portletId,
(UpdateNavigationalStateResponse)response);
}
// Create event list and feed it with the events that may have been produced
@@ -285,7 +285,7 @@
UpdateNavigationalStateResponse update =
(UpdateNavigationalStateResponse)eventResponse;
// Update ns
- updateNavigationalState(navState, consumer.getContext().getId(),
update);
+ updateNavigationalState(context, consumer.getContext().getId(),
update);
// Add events if any
queue.addAll(update.getEvents());
@@ -427,13 +427,17 @@
}
private void updateNavigationalState(
- PortalNavigationalState portalNS,
- String windowId,
- UpdateNavigationalStateResponse update)
+ PortletControllerContext context,
+ String portletId,
+ UpdateNavigationalStateResponse update) throws PortletInvokerException
{
- WindowNavigationalState windowNS = portalNS.getWindow(windowId);
+ Portlet portlet = context.getPortlet(portletId);
+ PortalNavigationalState portalNS = context.getNavigationalState();
//
+ WindowNavigationalState windowNS = portalNS.getWindow(portletId);
+
+ //
if (windowNS == null)
{
windowNS = new WindowNavigationalState();
@@ -456,7 +460,10 @@
portletNS = update.getNavigationalState();
}
windowNS = new WindowNavigationalState(portletNS, mode, windowState);
- portalNS.setWindow(windowId, windowNS);
+ portalNS.setWindow(portletId, windowNS);
+
+ // Now update shared state
+// portlet.getInfo().get
}
static class Action