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

<span style="font-family:&#39;lucida grande&#39;,arial,helvetica,sans-serif;color:rgb(128,128,128);font-size:x-small">eXo - VP Products </span><br><font color="#ff6600" face="&#39;lucida grande&#39;, arial, helvetica, sans-serif" size="1"><br>

</font></span></b>
</div>