Author: chris.laprun(a)jboss.com
Date: 2008-03-20 17:54:39 -0400 (Thu, 20 Mar 2008)
New Revision: 10356
Modified:
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/metadata/JBossApplicationMetaData.java
branches/JBoss_Portal_Branch_2_7/wsrp/build.xml
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPPortletInvocationContext.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
- Fixed a bug in WSRPPortletInvocationContext: hidden NPE due to auto-boxing...
- Added missing information on portlet invocation in RequestProcessor.
- Test re-wiring.
- More generification.
- All WSRP tests now run and pass pending update of portlet and common module in
thirdparty.
Modified:
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -106,18 +106,18 @@
// Merge or provide defaults
JBossApplicationMetaData standardJBossAppMD =
factory.getStandardJBossApplicationMetaData();
- log.debug("Found standard jboss app meta data");
-
if (standardJBossAppMD != null)
{
- JBossPortletMetaData defaultJBossPortletMD =
(JBossPortletMetaData)standardJBossAppMD.getPortlets().get("DefaultPortlet");
- log.debug("Found default jboss portlet meta data");
+ log.debug("Found standard jboss app meta data");
+
+ JBossPortletMetaData defaultJBossPortletMD =
standardJBossAppMD.getPortlets().get("DefaultPortlet");
if (defaultJBossPortletMD != null)
{
+ log.debug("Found default jboss portlet meta data");
for (PortletMetaData portletMD : portletAppMD.getPortlets().values())
{
String name = portletMD.getPortletName();
- JBossPortletMetaData jbossPortletMD =
(JBossPortletMetaData)jbossAppMD.getPortlets().get(name);
+ JBossPortletMetaData jbossPortletMD =
jbossAppMD.getPortlets().get(name);
if (jbossPortletMD != null)
{
log.debug("Merging default jboss portlet meta data for " +
name);
@@ -131,7 +131,7 @@
else
{
log.debug("Using default jboss portlet meta data for " +
name);
- jbossAppMD.getPortlets().put(name, defaultJBossPortletMD.clone());
+ jbossAppMD.getPortlets().put(name,
(JBossPortletMetaData)defaultJBossPortletMD.clone());
}
}
}
Modified:
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/metadata/JBossApplicationMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/metadata/JBossApplicationMetaData.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/metadata/JBossApplicationMetaData.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -36,14 +36,14 @@
protected Boolean remotable;
/** . */
- protected Map portlets;
+ protected Map<String, JBossPortletMetaData> portlets;
public JBossApplicationMetaData()
{
- portlets = new LinkedHashMap();
+ portlets = new LinkedHashMap<String, JBossPortletMetaData>();
}
- public Map getPortlets()
+ public Map<String, JBossPortletMetaData> getPortlets()
{
return portlets;
}
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/build.xml 2008-03-20 21:42:07 UTC (rev 10355)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/build.xml 2008-03-20 21:54:39 UTC (rev 10356)
@@ -25,15 +25,29 @@
<!-- $Id$ -->
-<!--+======================================================================+--><!--|
JBoss Portal (The OpenSource Portal) Build File |--><!--|
|--><!--|
Distributable under LGPL license. |--><!--| See
terms of license at
http://www.gnu.org. |--><!--|
|--><!--| This file has
been designed to work with the 'tools' module and |--><!--| Buildmagic
extentions.
|--><!--+======================================================================+-->
+<!--+======================================================================+-->
+<!--| JBoss Portal (The Open Source Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
<project default="main" name="WSRP for JBoss Portal"
xmlns:server="http://jboss.org/ns/test/ant/server">
- <!--| Include the common build elements.
|--><!--|
|--><!--| This defines several different targets, properties and paths.
|--><!--| It also sets up the basic extention tasks amoung other things.
|--><!--+====================================================================+-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
&buildmagic; &modules; &defaults; &tools; &targets;
- <!-- ==================================================================
--><!-- Initialization
--><!-- ================================================================== -->
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
<!--
| Initialize the build system. Must depend on '_buildmagic:init'.
@@ -58,7 +72,12 @@
<!-- Add module specific elements here -->
</target>
-
<!--+====================================================================+--><!--|
Configuration |--><!--|
|--><!--| This target is
invoked by the Buildmagic initialization logic |--><!--| and should contain
module specific configuration elements.
|--><!--+====================================================================+-->
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
<target name="configure" unless="configure.disable">
@@ -137,7 +156,9 @@
<path refid="jboss.portal-faces.classpath"/>
</path>
- <!--+=======================================+--><!--| Override any default
properties here. |--><!--+=======================================+-->
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
<!-- Classes generated from WSDL are in a non-standard location so need to
override properties -->
<property name="build.gen" value="${module.source}"/>
@@ -163,7 +184,9 @@
<call target="configure-explode"/>
<call target="configure-jbossaop"/>
- <!--+=======================================+--><!--| Define module
specific elements here. |--><!--+=======================================+-->
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
<property name="javadoc.private" value="true"/>
<property name="javadoc.protected" value="false"/>
@@ -193,7 +216,13 @@
<taskdef name="explode"
classname="org.jboss.portal.common.ant.Explode"
classpathref="explode.task.classpath"/>
</target>
-
<!--+====================================================================+--><!--|
Compile |--><!--|
|--><!--| This target
should depend on other compile-* targets for each |--><!--| different type of
compile that needs to be performed, short of |--><!--| documentation compiles.
|--><!--+====================================================================+-->
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
<target name="compile" description="Compile all source files."
depends="_default:compile-classes,_default:compile-etc">
@@ -232,7 +261,13 @@
<property name="compile.disable" value="true"/>
</target>
-
<!--+====================================================================+--><!--|
Generate Output |--><!--|
|--><!--| Generates the
target output for this module. Target output is |--><!--| the output which is
meant to be released or used by external |--><!--| modules.
|--><!--+====================================================================+-->
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is meant to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
<target name="output" description="Generate WSRP Service
archive." depends="compile">
<mkdir dir="${build.lib}"/>
@@ -278,7 +313,9 @@
<explode file="${build.lib}/portal-wsrp.sar"
todir="${build.lib}" name="portal-wsrp-exploded.sar"/>
</target>
- <!-- ==================================================================
--><!-- Cleaning
--><!-- ================================================================== -->
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
<!-- Clean up all build output -->
<target name="clean" depends="_default:clean">
@@ -286,20 +323,28 @@
<!-- Add module specific elements here. -->
</target>
-
<!--+====================================================================+--><!--|
Documents |--><!--|
|--><!--| Generate all
documentation for this module.
|--><!--+====================================================================+-->
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
<target name="docs" depends="_default:docs">
<!-- Add module specific elements here. -->
</target>
- <!-- ==================================================================
--><!-- Misc.
--><!-- ================================================================== -->
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
<target name="main" depends="most"/>
<target name="all" depends="_default:all, explode"/>
<target name="most" depends="_default:most"/>
<target name="help" depends="_default:help"/>
- <!-- ==================================================================
--><!-- Deployment
--><!-- ================================================================== -->
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
<!-- Deployment of test agent -->
<target name="agent-deploy" depends="init">
@@ -347,7 +392,9 @@
<undeploy file="${build.lib.test}/test-wsrp-consumer.sar"
config="default"/>
</target>
- <!-- ==================================================================
--><!-- Tests
--><!-- ================================================================== -->
+ <!-- ================================================================== -->
+ <!-- Tests -->
+ <!-- ================================================================== -->
<target name="package-deployment-test" description="Generates the
deployment test artifacts" depends="compile">
<jar jarfile="${build.lib.test}/test-deployment-lib.jar">
@@ -432,8 +479,7 @@
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-portal-lib.jar"/>
<fileset dir="${jboss.portal-api.root}/lib"
includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal/modules/portlet.lib}"
-
includes="portal-portlet-lib.jar,portal-portlet-federation-lib.jar,portal-portlet-jsr168api-lib.jar"/>
- <!-- , portal-portlet-test-lib.jar -->
+
includes="portal-portlet-lib.jar,portal-portlet-federation-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/web.lib}"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-portlet-server.root}/lib"
includes="portal-portlet-server-lib.jar"/>
@@ -489,7 +535,8 @@
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-portal-lib.jar"/>
<fileset dir="${jboss.portal-api.root}/lib"
includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal/modules/portlet.lib}"
-
includes="portal-portlet-lib.jar,portal-portlet-federation-lib.jar,portal-portlet-jsr168api-lib.jar"/>
+
includes="portal-portlet-lib.jar,portal-portlet-federation-lib.jar"/>
+ <fileset dir="${portlet.portlet.lib}"
includes="portlet-api.jar"/>
<fileset dir="${jboss.portal/modules/web.lib}"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}"
includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-portlet-server.root}/lib"
includes="portal-portlet-server-lib.jar"/>
@@ -500,6 +547,7 @@
<fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-server.lib}"
includes="portal-server-test-framework-lib.jar"/>
<fileset dir="${jboss.portal-core.lib}"
includes="portal-core-lib.jar"/>
+ <fileset dir="${apache.fileupload.lib}"
includes="commons-fileupload.jar"/>
</copy>
<jar jarfile="${build.lib.test}/test-wsrp-producer.sar">
@@ -572,7 +620,9 @@
package-protocolv1-producer-test, package-producer-configuration-test"
description="Packages all the test-related artifacts. Does NOT compile classes so
this should be done before
calling this task."/>
- <!-- ==================================================================
--><!-- Tests
--><!-- ================================================================== -->
+ <!-- ================================================================== -->
+ <!-- Tests -->
+ <!-- ================================================================== -->
<target name="clean-test">
<!-- remove generated test xml files -->
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -291,7 +291,7 @@
private void createMetaInfo(PortletDescription portletDescription)
{
- final Map metaInfos = new HashMap();
+ final Map<String, org.jboss.portal.common.i18n.LocalizedString> metaInfos =
new HashMap<String, org.jboss.portal.common.i18n.LocalizedString>();
metaInfos.put(MetaInfo.DESCRIPTION,
getPortalLocalizedStringOrNullFrom(portletDescription.getDescription()));
metaInfos.put(MetaInfo.DISPLAY_NAME,
getPortalLocalizedStringOrNullFrom(portletDescription.getDisplayName()));
metaInfos.put(MetaInfo.SHORT_TITLE,
getPortalLocalizedStringOrNullFrom(portletDescription.getShortTitle()));
@@ -345,24 +345,24 @@
mimeType = MediaType.create(markupType.getMimeType());
String[] modeNames = markupType.getModes();
- modes = new HashSet(modeNames.length);
- for (int i = 0; i < modeNames.length; i++)
+ modes = new HashSet<ModeInfo>(modeNames.length);
+ for (String modeName : modeNames)
{
- modes.add(new
BasicModeInfo(WSRPUtils.getJSR168PortletModeFromWSRPName(modeNames[i])));
+ modes.add(new
BasicModeInfo(WSRPUtils.getJSR168PortletModeFromWSRPName(modeName)));
}
String[] windStateNames = markupType.getWindowStates();
- windowStates = new HashSet(windStateNames.length);
- for (int i = 0; i < windStateNames.length; i++)
+ windowStates = new HashSet<WindowStateInfo>(windStateNames.length);
+ for (String windStateName : windStateNames)
{
- windowStates.add(new
BasicWindowStateInfo(WSRPUtils.getJSR168WindowStateFromWSRPName(windStateNames[i])));
+ windowStates.add(new
BasicWindowStateInfo(WSRPUtils.getJSR168WindowStateFromWSRPName(windStateName)));
}
String[] localeNames = markupType.getLocales();
if (localeNames != null)
{
int localeNumber = localeNames.length;
- locales = new HashSet(localeNumber);
+ locales = new HashSet<Locale>(localeNumber);
for (int i = 0; i < localeNumber; i++)
{
Locale locale = WSRPUtils.getLocale(localeNames[i]);
@@ -371,14 +371,14 @@
}
else
{
- locales = Collections.EMPTY_SET;
+ locales = Collections.emptySet();
}
}
MediaType mimeType;
- Set modes;
- Set windowStates;
- Set locales;
+ Set<ModeInfo> modes;
+ Set<WindowStateInfo> windowStates;
+ Set<Locale> locales;
}
class BasicWindowStateInfo implements WindowStateInfo
@@ -433,21 +433,21 @@
private class WSRPCapabilitiesInfo implements CapabilitiesInfo
{
- private Map mediaTypes;
- private Set modes;
- private Set windowStates;
- private Set locales;
+ private Map<MediaType, MediaTypeInfo> mediaTypes;
+ private Set<ModeInfo> modes;
+ private Set<WindowStateInfo> windowStates;
+ private Set<Locale> locales;
private WSRPCapabilitiesInfo()
{
}
- private void setMediaTypes(Map mediaTypes)
+ private void setMediaTypes(Map<MediaType, MediaTypeInfo> mediaTypes)
{
this.mediaTypes = mediaTypes;
}
- public WSRPCapabilitiesInfo(Map mediaTypes, Set modes, Set windowStates, Set
locales)
+ public WSRPCapabilitiesInfo(Map<MediaType, MediaTypeInfo> mediaTypes,
Set<ModeInfo> modes, Set windowStates, Set locales)
{
this.mediaTypes = mediaTypes;
this.modes = modes;
@@ -455,60 +455,60 @@
this.locales = locales;
}
- public Set getMediaTypes()
+ public Set<MediaType> getMediaTypes()
{
return mediaTypes.keySet();
}
- public Set getAllModes()
+ public Set<ModeInfo> getAllModes()
{
return modes;
}
- public Set getModes(MediaType mediaType)
+ public Set<ModeInfo> getModes(MediaType mediaType)
{
- MediaTypeInfo mimeTypeInfo = (MediaTypeInfo)mediaTypes.get(mediaType);
+ MediaTypeInfo mimeTypeInfo = mediaTypes.get(mediaType);
if (mimeTypeInfo == null)
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
return Collections.unmodifiableSet(mimeTypeInfo.modes);
}
- public Set getAllWindowStates()
+ public Set<WindowStateInfo> getAllWindowStates()
{
return windowStates;
}
- public Set getWindowStates(MediaType mediaType)
+ public Set<WindowStateInfo> getWindowStates(MediaType mediaType)
{
- MediaTypeInfo mimeTypeInfo = (MediaTypeInfo)mediaTypes.get(mediaType);
+ MediaTypeInfo mimeTypeInfo = mediaTypes.get(mediaType);
if (mimeTypeInfo == null)
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
return Collections.unmodifiableSet(mimeTypeInfo.windowStates);
}
- public Set getAllLocales()
+ public Set<Locale> getAllLocales()
{
return locales;
}
- public Set getLocales(MediaType mediaType)
+ public Set<Locale> getLocales(MediaType mediaType)
{
- MediaTypeInfo mimeTypeInfo = (MediaTypeInfo)mediaTypes.get(mediaType);
+ MediaTypeInfo mimeTypeInfo = mediaTypes.get(mediaType);
if (mimeTypeInfo == null)
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
return Collections.unmodifiableSet(mimeTypeInfo.locales);
}
- private void addModes(Set modes)
+ private void addModes(Set<ModeInfo> modes)
{
if (modes != null)
{
@@ -517,7 +517,7 @@
{
if (this.modes == null)
{
- this.modes = new HashSet(size);
+ this.modes = new HashSet<ModeInfo>(size);
}
this.modes.addAll(modes);
@@ -525,7 +525,7 @@
}
}
- private void addWindowStates(Set windowStates)
+ private void addWindowStates(Set<WindowStateInfo> windowStates)
{
if (windowStates != null)
{
@@ -534,7 +534,7 @@
{
if (this.windowStates == null)
{
- this.windowStates = new HashSet(size);
+ this.windowStates = new HashSet<WindowStateInfo>(size);
}
this.windowStates.addAll(windowStates);
@@ -542,7 +542,7 @@
}
}
- private void addLocales(Set locales)
+ private void addLocales(Set<Locale> locales)
{
if (locales != null)
{
@@ -551,7 +551,7 @@
{
if (this.locales == null)
{
- this.locales = new HashSet(size);
+ this.locales = new HashSet<Locale>(size);
}
this.locales.addAll(locales);
@@ -577,21 +577,21 @@
static class WSRPPreferencesInfo implements PreferencesInfo
{
- private Map preferences;
+ private Map<String, PreferenceInfo> preferences;
- public WSRPPreferencesInfo(Map preferences)
+ public WSRPPreferencesInfo(Map<String, PreferenceInfo> preferences)
{
this.preferences = preferences;
}
- public Set getKeys()
+ public Set<String> getKeys()
{
return Collections.unmodifiableSet(preferences.keySet());
}
public PreferenceInfo getPreference(String key) throws IllegalArgumentException
{
- return (PreferenceInfo)preferences.get(key);
+ return preferences.get(key);
}
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -59,7 +59,6 @@
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
-import javax.activation.MimeTypeParseException;
import java.security.Principal;
import java.util.Arrays;
import java.util.Collections;
@@ -152,7 +151,12 @@
// prepare the invocation
WSRPPortletInvocationContext context = new WSRPPortletInvocationContext(streamInfo,
securityContext, portalContext, userContext, instanceContext, windowContext);
PortletInvocation invocation = initInvocation(context);
+
invocation.setTarget(portlet.getContext());
+
invocation.setWindowState(WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()));
+
invocation.setMode(WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()));
+ invocation.setNavigationalState(navigationalState);
+
context.contextualize(invocation);
setInvocation(invocation);
}
@@ -278,11 +282,11 @@
{
List possibleList = Arrays.asList(possibleValues);
- for (int i = 0; i < preferredValues.length; i++)
+ for (String preferredValue : preferredValues)
{
- if (possibleList.contains(preferredValues[i]))
+ if (possibleList.contains(preferredValue))
{
- return preferredValues[i];
+ return preferredValue;
}
}
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -199,7 +199,7 @@
Iterator<MediaType> mediaTypes = allMediaTypes.iterator();
for (int i = 0; mediaTypes.hasNext(); i++)
{
- MediaType mimeType = (MediaType)mediaTypes.next();
+ MediaType mimeType = mediaTypes.next();
markupTypes[i] = new MarkupType(
mimeType.getValue(),
getModeNamesFrom(capInfo.getModes(mimeType)),
@@ -263,7 +263,7 @@
return desc;
}
- private String[] getLocaleNamesFrom(Collection locales)
+ private String[] getLocaleNamesFrom(Collection<Locale> locales)
{
if (locales == null || locales.isEmpty())
{
@@ -272,36 +272,32 @@
String[] localeNames = new String[locales.size()];
int i = 0;
- for (Object locale : locales)
+ for (Locale locale : locales)
{
- localeNames[i++] = WSRPUtils.toString((Locale)locale);
+ localeNames[i++] = WSRPUtils.toString(locale);
}
return localeNames;
}
- private String[] getWindowStateNamesFrom(Collection windowStates)
+ private String[] getWindowStateNamesFrom(Collection<WindowStateInfo>
windowStates)
{
String[] result = new String[windowStates.size()];
int i = 0;
- for (Iterator windowsStatesIt = windowStates.iterator(); windowsStatesIt.hasNext();
i++)
+ for (WindowStateInfo windowStateInfo : windowStates)
{
- WindowStateInfo windowStateInfo = (WindowStateInfo)windowsStatesIt.next();
- result[i] =
WSRPUtils.convertJSR168WindowStateNameToWSRPName(windowStateInfo.getWindowStateName());
+ result[i++] =
WSRPUtils.convertJSR168WindowStateNameToWSRPName(windowStateInfo.getWindowStateName());
}
-
return result;
}
- private String[] getModeNamesFrom(Collection modes)
+ private String[] getModeNamesFrom(Collection<ModeInfo> modes)
{
String[] result = new String[modes.size()];
int i = 0;
- for (Iterator modesIt = modes.iterator(); modesIt.hasNext(); i++)
+ for (ModeInfo modeInfo : modes)
{
- ModeInfo modeInfo = (ModeInfo)modesIt.next();
- result[i] =
WSRPUtils.convertJSR168PortletModeNameToWSRPName(modeInfo.getModeName());
+ result[i++] =
WSRPUtils.convertJSR168PortletModeNameToWSRPName(modeInfo.getModeName());
}
-
return result;
}
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPPortletInvocationContext.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPPortletInvocationContext.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPPortletInvocationContext.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -162,7 +162,9 @@
{
PortletURL portletURL = (PortletURL)containerURL;
- return WSRPPortletURL.create(portletURL,
urlFormat.getWantSecure()).toString();
+ Boolean wantSecureBool = urlFormat.getWantSecure();
+ boolean wantSecure = (wantSecureBool != null ? wantSecureBool : false);
+ return WSRPPortletURL.create(portletURL, wantSecure).toString();
}
else if (containerURL instanceof ResourceURL)
{
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-03-20
21:54:39 UTC (rev 10356)
@@ -81,6 +81,7 @@
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import java.rmi.RemoteException;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -417,14 +418,19 @@
{
log.debug("Retrieving remotable portlets");
Set<Portlet> allPortlets = invoker.getPortlets();
- Set<Portlet> remotablePortlets = new
HashSet<Portlet>(allPortlets.size());
- for (Portlet portlet : allPortlets)
+ int portletNumber = allPortlets.size();
+ Set<Portlet> remotablePortlets = Collections.emptySet();
+ if (portletNumber > 0)
{
- log.debug("Found portlet: " + portlet.getContext());
- if (isRemotable(portlet))
+ remotablePortlets = new HashSet<Portlet>(portletNumber);
+ for (Portlet portlet : allPortlets)
{
- remotablePortlets.add(portlet);
- log.debug("Adding remotable portlet to set: " +
portlet.getContext());
+ log.debug("Found portlet: " + portlet.getContext());
+ if (isRemotable(portlet))
+ {
+ remotablePortlets.add(portlet);
+ log.debug("Adding remotable portlet to set: " +
portlet.getContext());
+ }
}
}
return remotablePortlets;
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2008-03-20
21:42:07 UTC (rev 10355)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2008-03-20
21:54:39 UTC (rev 10356)
@@ -46,6 +46,9 @@
<depends optional-attribute-name="CoreInfoBuilderFactory"
proxy-type="attribute">
portal:service=InfoBuilderFactory,type=Core
</depends>
+ <depends optional-attribute-name="PortletContainerInvoker"
proxy-type="attribute">
+ portal:service=PortletInvoker,type=Container
+ </depends>
<!--<depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>-->
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
</mbean>
@@ -109,7 +112,7 @@
</mbean>
<!-- The portlet container invoker -->
- <mbean code="org.jboss.portal.portlet.container.PortletContainerInvoker"
+ <mbean code="org.jboss.portal.portlet.container.ContainerPortletInvoker"
name="portal:service=PortletInvoker,type=Container"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>