Author: julien(a)jboss.com
Date: 2008-02-05 18:52:19 -0500 (Tue, 05 Feb 2008)
New Revision: 9788
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/ContainerInfoBuilderContext.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/ContainerInfoBuilderContextImpl.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
Log:
add name/applicationName on portlet info which expose portlet name and application name
(context path name more or less).
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-02-05
21:59:46 UTC (rev 9787)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-02-05
23:52:19 UTC (rev 9788)
@@ -587,6 +587,7 @@
containerNavigation,
filters,
portletMD.getPortletName(),
+ context.getApplicationName(),
portletMD.getPortletClass(),
initParameters,
false,
@@ -604,6 +605,7 @@
containerCache,
containerSession,
portletMD.getPortletName(),
+ context.getApplicationName(),
portletMD.getPortletClass(),
Collections.unmodifiableMap(initParameters),
false,
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java 2008-02-05
21:59:46 UTC (rev 9787)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java 2008-02-05
23:52:19 UTC (rev 9788)
@@ -33,6 +33,8 @@
public interface ContainerInfoBuilderContext
{
+ String getApplicationName();
+
ResourceBundleManager getBundleManager();
ResourceBundleManager getBundleManager(PortletMetaData portletMD);
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-02-05
21:59:46 UTC (rev 9787)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-02-05
23:52:19 UTC (rev 9788)
@@ -65,6 +65,9 @@
private final String name;
/** . */
+ private final String applicationName;
+
+ /** . */
private final String className;
/** . */
@@ -94,6 +97,7 @@
ContainerSessionInfo session,
String name,
String className,
+ String applicationName,
Map<String, String> initParameters,
Boolean remotable,
ResourceBundleManager bundleManager)
@@ -108,6 +112,7 @@
this.navigation = new ContainerNavigationInfo();
this.filterRefs = Collections.emptyList();
this.name = name;
+ this.applicationName = applicationName;
this.className = className;
this.initParameters = initParameters;
this.remotable = remotable;
@@ -126,6 +131,7 @@
ContainerNavigationInfo navigation,
List<String> filterRefs,
String name,
+ String applicationName,
String className,
Map<String, String> initParameters,
Boolean remotable,
@@ -142,6 +148,7 @@
this.navigation = navigation;
this.filterRefs = filterRefs;
this.name = name;
+ this.applicationName = applicationName;
this.className = className;
this.initParameters = initParameters;
this.remotable = remotable;
@@ -154,6 +161,11 @@
return name;
}
+ public String getApplicationName()
+ {
+ return null;
+ }
+
public Map<String, ContainerOptionInfo> getOptions()
{
return options;
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java 2008-02-05
21:59:46 UTC (rev 9787)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java 2008-02-05
23:52:19 UTC (rev 9788)
@@ -41,20 +41,34 @@
public class ContainerInfoBuilderContextImpl implements ContainerInfoBuilderContext
{
- private PortletApplication10MetaData metaData;
+ /** . */
+ private final PortletApplication10MetaData metaData;
- private WebApp webApp;
+ /** . */
+ private final WebApp webApp;
- private final Map<String, ResourceBundleManager> portletBundleMgrs = new
HashMap<String, ResourceBundleManager>();
+ /** . */
+ private final Map<String, ResourceBundleManager> portletBundleMgrs;
+ /** . */
private ResourceBundleManager applicationBundleMgr;
+ /** . */
+ private final String applicationName;
+
public ContainerInfoBuilderContextImpl(PortletApplication10MetaData metaData, WebApp
webApp)
{
this.metaData = metaData;
this.webApp = webApp;
+ this.portletBundleMgrs = new HashMap<String, ResourceBundleManager>();
+ this.applicationName = webApp.getContextPath().substring(1);
}
+ public String getApplicationName()
+ {
+ return applicationName;
+ }
+
public ResourceBundleManager getBundleManager()
{
if (applicationBundleMgr == null)
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-02-05
21:59:46 UTC (rev 9787)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java 2008-02-05
23:52:19 UTC (rev 9788)
@@ -31,7 +31,22 @@
*/
public interface PortletInfo
{
+
/**
+ * Returns the portlet name.
+ *
+ * @return the portlet name
+ */
+ String getName();
+
+ /**
+ * Returns the portlet application name.
+ *
+ * @return the portlet application name
+ */
+ String getApplicationName();
+
+ /**
* Retrieves the capabilities of supported by the described portlet.
*
* @return the capabilities of the portlet
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-02-05
21:59:46 UTC (rev 9787)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java 2008-02-05
23:52:19 UTC (rev 9788)
@@ -32,6 +32,8 @@
public class PortletInfoSupport implements PortletInfo
{
+ private String name;
+ private String applicationName;
private Boolean remotable;
private PreferencesInfoSupport preferencesSupport = new PreferencesInfoSupport();
private SecurityInfoSupport securitySupport = new SecurityInfoSupport();
@@ -41,6 +43,26 @@
private EventingInfoSupport eventsSupport = new EventingInfoSupport();
private NavigationInfoSupport navigationSupport = new NavigationInfoSupport();
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getApplicationName()
+ {
+ return applicationName;
+ }
+
+ public void setApplicationName(String applicationName)
+ {
+ this.applicationName = applicationName;
+ }
+
public CapabilitiesInfo getCapabilities()
{
throw new UnsupportedOperationException("Implement me");