> I would change the createPortletID to have in generated code a usefull ID
> for the div in the HTML code. So I can use CSS to arrange the portlets on
> site. Now I have some like this "/context.portletName!764587357|0". That I
> cannot use for CSS.
> If I only have the name for portlet, t.e. "myPortlet", I change the
> pluto-default-theme to
>
> <c:set var="portlet" value="myPortlet" scope="request"/>
> <jsp:include page="portlet-skin.jsp"/>
>
> to arrange them.
>
> I need a site with arranged portlets. If you have another solution to make
> that, please teach me :-)

Serge,

I would either create a custom tag (preferably) or even use inline java in
your JSP to parse the portlet name with a regular expression.  Here is a
Groovy script to give you a hint (I left the class names in so that it
will be easier to convert to Java):

import java.util.regex.*

id = '/context.portletName!764587357|0'
Pattern p = Pattern.compile("[^\\.]+\\.([^!]+)!.*")
Matcher m = p.matcher(id)
m.find()
print m.group(1)

Be sure to store the java.util.regex.Pattern in a static constant or
something so that you are compiling it on every invocation, as this is
somewhat expensive.  I'm not an expert on regular expression matching, so
you might be able to create a more efficient expression or even realize
better performance from good old brute force parsing.  No matter what your
implementation though, I think that you will have better results if you
keep this logic contained in the theme of your portal.

-- Ben

Reply via email to