Author: chris.laprun(a)jboss.com
Date: 2010-02-18 17:06:39 -0500 (Thu, 18 Feb 2010)
New Revision: 1774
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java
Log:
- GTNPORTAL-692: WSRP portlets might have an extra / so we remove it if there's one.
- Removed unneeded re-parsing of the portlet id since the info for group_ and name_ is
already known.
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java 2010-02-18
06:47:16 UTC (rev 1773)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java 2010-02-18
22:06:39 UTC (rev 1774)
@@ -262,20 +262,29 @@
private PortletInfo portletInfo_;
final PortletContext context;
+ private static final String SEPARATOR = "/";
+ private static final int SEPARATOR_LENGTH = SEPARATOR.length();
public PortletExtra(Portlet portlet)
{
PortletInfo info = portlet.getInfo();
String portletName = info.getName();
String appName = info.getApplicationName();
- String portletId = appName + "/" + portletName;
- String type = portlet.isRemote() ? REMOTE : LOCAL;
+ boolean remote = portlet.isRemote();
+ // if the portlet is remote, we might have an extra '/' at the beginning
of the portlet name
+ if(remote && portletName.startsWith(SEPARATOR))
+ {
+ portletName = portletName.substring(SEPARATOR_LENGTH);
+ }
+
+ String portletId = appName + SEPARATOR + portletName;
+ String type = remote ? REMOTE : LOCAL;
+
//
id_ = portletId;
- String[] fragments = portletId.split("/");
- group_ = fragments[0];
- name_ = fragments[1];
+ group_ = appName;
+ name_ = portletName;
type_ = type;
portletInfo_ = info;
context = portlet.getContext();