[
https://issues.jboss.org/browse/GTNPORTAL-3537?page=com.atlassian.jira.pl...
]
Trong Tran commented on GTNPORTAL-3537:
---------------------------------------
the *#sanitizePortletName* method not only replace "/" by "_", it also
truncates the "unique" value with *#substring(0, MAX - 1)* which MAX is 30.
That's mean that the "sanitized" value is max 29 length.
Unfortunately the max length of "unique" value can be 30 characters:
{code}
String unique = portletName.substring(0,Math.min(portletName.length(), 20)) +
String.valueOf(contentId.hashCode());
{code}
Therefore, in the case if we have two different "unique" values with
"local._juzu-tutorial1630574212" and "local._juzu-tutorial1630574210".
After sanitization, the "sanitized" values will be the same
"local._juzu-tutorial163057421" ==> It raises the problem.
So the proper fix for this could just be modifying:
{code}
if (sizePortletName >= MAX) {
- sanitizedPortletName = sanitizedPortletName.substring(0, MAX - 1);
+ sanitizedPortletName = sanitizedPortletName.substring(0, MAX);
} else if (sizePortletName <= MIN) {
sanitizedPortletName += "Portlet";
{code}
"Import applications" fails
---------------------------
Key: GTNPORTAL-3537
URL:
https://issues.jboss.org/browse/GTNPORTAL-3537
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.9.0.Final
Reporter: Trong Tran
Fix For: 3.9.0.Final
Attachments: juzu-tutorial-examples-gatein.war
"Import applications" fails when the application name is too long AND there are
two portlets with similar name (such as "Weather1" and "Weather2")
I attached the juzu portlets example war which we can use to reproduce the problem.
P/S: I notice that this problem is a regression from GTNPORTAL-3519
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)