<div dir="ltr">Well done! Happy to help!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 29, 2013 at 9:53 PM, Juraci Paixão Kröhling <span dir="ltr"><<a href="mailto:jpkroehling@redhat.com" target="_blank">jpkroehling@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Patrice,<br>
<br>
Cool, it seems to work. I've sent a pull request for GateIn to<br>
incorporate this: <a href="https://github.com/gatein/gatein-portal/pull/709" target="_blank">https://github.com/gatein/gatein-portal/pull/709</a><br>
<br>
You might notice that I did it only for the favicon.<br>
<br>
- Juca.<br>
<div class="HOEnZb"><div class="h5"><br>
On 11/29/2013 10:00 AM, Juraci Paixão Kröhling wrote:<br>
> Patrice,<br>
><br>
> Thanks a lot! We indeed have RedefinableResourceFilter, but not this<br>
> specific component plugin.<br>
><br>
> Would it be a problem if I implement this as a GateIn feature? Do you<br>
> foresee any possible conflicts with your implementation?<br>
><br>
> - Juca.<br>
><br>
><br>
> On 11/29/2013 09:39 AM, Patrice LAMARQUE wrote:<br>
>> We've done this in eXo Platform<br>
>> : <a href="https://jira.exoplatform.org/browse/PLF-497" target="_blank">https://jira.exoplatform.org/browse/PLF-497</a><br>
>><br>
>> <a href="https://github.com/exoplatform/platform/commit/586e1b411c9a9509e3d415a9f0fcbb91bb76e1ba" target="_blank">https://github.com/exoplatform/platform/commit/586e1b411c9a9509e3d415a9f0fcbb91bb76e1ba</a><br>
>><br>
>><br>
>> <external-component-plugins><br>
>> <target-component>org.exoplatform.web.filter.ExtensibleFilter</target-component><br>
>><br>
>><br>
>> <component-plugin><br>
>> <name>JSP filter Plugin</name><br>
>><br>
>><br>
>> <set-method>addFilterDefinitions</set-method><br>
>> <type>org.exoplatform.web.filter.FilterDefinitionPlugin</type><br>
>> <init-params><br>
>> <object-param><br>
>><br>
>><br>
>> <name>JSP Filter</name><br>
>> <object<br>
>> type="org.exoplatform.web.filter.FilterDefinition"><br>
>><br>
>><br>
>> <field<br>
>> name="filter"><object<br>
>> type="org.exoplatform.commons.platform.RedefinableResourceFilter"/></field><br>
>><br>
>><br>
>> <field name="patterns"><br>
>><br>
>><br>
>> <!-- WARNING: the mapping is expressed with<br>
>> regular expressions --><br>
>><br>
>><br>
>> <collection<br>
>> type="java.util.ArrayList" item-type="java.lang.String"><br>
>><br>
>><br>
>> <value><br>
>> <string>.*/.*\.jsp</string><br>
>> </value><br>
>> <value><br>
>><br>
>><br>
>> <string>.*/favicon\.ico</string><br>
>> </value><br>
>> </collection><br>
>><br>
>><br>
>> </field><br>
>> </object><br>
>><br>
>><br>
>> </object-param><br>
>> </init-params><br>
>><br>
>><br>
>> </component-plugin><br>
>> </external-component-plugins><br>
>><br>
>><br>
>><br>
>><br>
>> It's leveraging a customized filter called : RedefinableResourceFilter<br>
>> that I'm not sure exists in Gatein (but should IMO) :<br>
>><br>
>><br>
>><br>
>> package org.exoplatform.web.filter;<br>
>><br>
>><br>
>><br>
>> import org.exoplatform.container.PortalContainer;<br>
>><br>
>><br>
>><br>
>> import java.io.IOException;<br>
>><br>
>><br>
>><br>
>> import javax.servlet.FilterChain;<br>
>><br>
>><br>
>> import javax.servlet.ServletContext;<br>
>> import javax.servlet.ServletException;<br>
>> import javax.servlet.ServletRequest;<br>
>><br>
>><br>
>> import javax.servlet.ServletResponse;<br>
>> import javax.servlet.http.HttpServletRequest;<br>
>><br>
>> public class RedefinableResourceFilter implements Filter {<br>
>><br>
>><br>
>><br>
>> public void doFilter(ServletRequest request, ServletResponse response,<br>
>> FilterChain chain) throws IOException,<br>
>><br>
>><br>
>> ServletException<br>
>> {<br>
>><br>
>><br>
>> HttpServletRequest req = (HttpServletRequest) request;<br>
>><br>
>><br>
>> PortalContainer pContainer =<br>
>> PortalContainer.getInstance(req.getSession().getServletContext());<br>
>><br>
>><br>
>> ServletContext context = pContainer.getPortalContext();<br>
>><br>
>><br>
>> String path = req.getRequestURI();<br>
>><br>
>><br>
>> String ctx = req.getContextPath();<br>
>><br>
>><br>
>> if (ctx != null && ctx.length() > 1 && path.startsWith(ctx)) {<br>
>><br>
>><br>
>> path = path.substring(ctx.length());<br>
>><br>
>><br>
>> }<br>
>> context.getRequestDispatcher(path).include(request, response);<br>
>><br>
>><br>
>> }<br>
>><br>
>> }<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Fri, Nov 29, 2013 at 3:23 PM, Juraci Paixão Kröhling<br>
>> <<a href="mailto:jpkroehling@redhat.com">jpkroehling@redhat.com</a> <mailto:<a href="mailto:jpkroehling@redhat.com">jpkroehling@redhat.com</a>>> wrote:<br>
>><br>
>> Nicolas,<br>
>><br>
>> My goal is to change the favicon from /portal, without affecting custom<br>
>> modifications that might have been done at /sample-portal. I think we<br>
>> have already this behavior for templates via extensions, but it doesn't<br>
>> seem to work for other resources (like .ico files).<br>
>><br>
>> The final solution could be anything (extensions, service, ...), hence<br>
>> the request for suggestions :-)<br>
>><br>
>> - Juca.<br>
>><br>
>> On 11/28/2013 05:07 PM, Nicolas Filotto wrote:<br>
>> > I'm not sure I understand what you want to do, you want to be able to<br>
>> > modify the favicon from an extension (like sample-extension) or<br>
>> from an<br>
>> > new portal (like sample-portal)?<br>
>> ><br>
>> ><br>
>> > On Thu, Nov 28, 2013 at 3:40 PM, Juraci Paixão Kröhling<br>
>> > <<a href="mailto:jpkroehling@redhat.com">jpkroehling@redhat.com</a> <mailto:<a href="mailto:jpkroehling@redhat.com">jpkroehling@redhat.com</a>><br>
>> <mailto:<a href="mailto:jpkroehling@redhat.com">jpkroehling@redhat.com</a> <mailto:<a href="mailto:jpkroehling@redhat.com">jpkroehling@redhat.com</a>>>> wrote:<br>
>> ><br>
>> > All,<br>
>> ><br>
>> > We have a request to display a specific favicon for JBoss<br>
>> Portal, and it<br>
>> > seems there's no "easy" (or correct) solution in place for that<br>
>> > right now.<br>
>> ><br>
>> > The first intuitive solution would be to override the<br>
>> templates, to make<br>
>> > them link to the desired favicon. This doesn't scales, as the<br>
>> whole<br>
>> > template is duplicated and it will only cause headaches in the<br>
>> future.<br>
>> ><br>
>> > The second possible solution would be to incorporate the path<br>
>> to the<br>
>> > favicon into the properties file, but this means having a<br>
>> fixed path to<br>
>> > the favicon, which is a step backwards from what there is<br>
>> today: in one<br>
>> > of the templates for /portal, it gets the favicon for the<br>
>> context path,<br>
>> > so, if the current portal is /example-portal, it currently<br>
>> gets the<br>
>> > favicon at /example-portal/favicon . With the favicon coming<br>
>> from the<br>
>> > properties file, this would not be the case anymore, as all<br>
>> favicons<br>
>> > would be coming from a fixed path.<br>
>> ><br>
>> > The third solution would be to build a FaviconService, that<br>
>> would take<br>
>> > care of determining the proper favicon path. It sounds to me<br>
>> that this<br>
>> > is a bit of overkill, but would be a clean solution.<br>
>> ><br>
>> > Of course, the best option would be to be possible to override the<br>
>> > favicon from /portal, but this doesn't seems to be possible at the<br>
>> > moment. It seems that only templates are overriden.<br>
>> ><br>
>> > Before proceeding with the third solution (which seems the most<br>
>> > desirable as of now), I would like to get your comments,<br>
>> opinions and<br>
>> > suggestions on how this could be better handled.<br>
>> ><br>
>> > Best Regards,<br>
>> > Juca.<br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > gatein-dev mailing list<br>
>> > <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a> <mailto:<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a>><br>
>> <mailto:<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a> <mailto:<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a>>><br>
>> > <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > gatein-dev mailing list<br>
>> > <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a> <mailto:<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a>><br>
>> > <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
>> ><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> gatein-dev mailing list<br>
>> <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a> <mailto:<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a>><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> *Patrice Lamarque<br>
>> eXo - VP Products<br>
>><br>
>> *<br>
>><br>
>><br>
>> _______________________________________________<br>
>> gatein-dev mailing list<br>
>> <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
>><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> gatein-dev mailing list<br>
> <a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
><br>
<br>
<br>
</div></div><br>_______________________________________________<br>
gatein-dev mailing list<br>
<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><b><span style="font-weight:normal;background-color:rgb(255,255,255)"><span style="font-family:'lucida grande',arial,helvetica,sans-serif;color:rgb(128,128,128);font-size:small">Patrice Lamarque</span><br>
<span style="font-family:'lucida grande',arial,helvetica,sans-serif;color:rgb(128,128,128);font-size:x-small">eXo - VP Products </span><br><font color="#ff6600" face="'lucida grande', arial, helvetica, sans-serif" size="1"><br>
</font></span></b>
</div>