Hi Jacques,

thanks, what you propose is an interesting approach, but it would be better to 
use the webapp name or its mount point; however I am not sure there is an easy 
way to do this from that decorator... I will too try to think to a solution for 
this.

Regards,

Jacopo

On Sep 13, 2013, at 12:02 PM, Jacques Le Roux <jacques.le.r...@les7arts.com> 
wrote:

> Jacopo Cappellato wrote:
>> is a general issue caused by a wrong design in the generation of help links; 
>> specifically, the issue is that in     
>> 
>> <set field="helpTopic" value="${groovy: 
>> parameters.componentName.toUpperCase() + '_' + 
>> requestAttributes._CURRENT_VIEW_}"/>
>> 
>> the name of the help file is composed using the component name; this is a 
>> wrong approach and could be solved, for instance, by
>> using  the webapp name instead of the component name; 
> 
> As it is now, it should not be the webapp name but the component name or the 
> overriden component name.
> 
> We could do it like this (both cases will be covered as long as the web.xml 
> file of the overriding webapp is correct)
> 
> Index: applications/commonext/widget/CommonScreens.xml
> ===================================================================
> --- applications/commonext/widget/CommonScreens.xml (revision 1522780)
> +++ applications/commonext/widget/CommonScreens.xml (working copy)
> @@ -45,8 +45,7 @@
>                 <set field="layoutSettings.middleTopLink2" 
> value="${lastSystemInfoNote2.moreInfoUrl}${groovy: if 
> (lastSystemInfoNote2&amp;&amp;lastSystemInfoNote2.moreInfoItemName&amp;&amp;lastSystemInfoNote2.moreInfoItemId)&quot;?&quot;
>  + lastSystemInfoNote2.moreInfoItemName + &quot;=&quot; + 
> lastSystemInfoNote2.moreInfoItemId + &quot;&amp;id=&quot; + 
> lastSystemInfoNote2.moreInfoItemId;}"/>
>                 <set field="layoutSettings.middleTopLink3" 
> value="${lastSystemInfoNote3.moreInfoUrl}${groovy: if 
> (lastSystemInfoNote3&amp;&amp;lastSystemInfoNote3.moreInfoItemName&amp;&amp;lastSystemInfoNote3.moreInfoItemId)&quot;?&quot;
>  + lastSystemInfoNote3.moreInfoItemName + &quot;=&quot; + 
> lastSystemInfoNote3.moreInfoItemId + &quot;&amp;id=&quot; + 
> lastSystemInfoNote3.moreInfoItemId;}"/>
>                 <!-- Help link actions -->
> -                <!--<set field="helpTopic" value="${groovy: webSiteId + '_' 
> + requestAttributes._CURRENT_VIEW_}"/>-->
> -                <set field="helpTopic" value="${groovy: 
> parameters.componentName.toUpperCase() + '_' + 
> requestAttributes._CURRENT_VIEW_}"/>
> +                <set field="helpTopic" value="${groovy: 
> applicationName.toUpperCase() + '_' + requestAttributes._CURRENT_VIEW_}"/>
>                 <entity-and list="pageAvail" entity-name="ContentAssoc">
>                     <field-map field-name="mapKey" from-field="helpTopic"/>
>                 </entity-and>
> Index: framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
> ===================================================================
> --- framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java 
> (revision 1522780)
> +++ framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java (working 
> copy)
> @@ -220,6 +220,8 @@
>         if (servletContext != null) {
>             String rootDir = (String) context.get("rootDir");
>             String webSiteId = (String) context.get("webSiteId");
> +            String localDispatcherName = (String) 
> servletContext.getAttribute("localDispatcherName");
> +            context.put("applicationName", localDispatcherName);
>             String https = (String) context.get("https");
>             if (UtilValidate.isEmpty(rootDir)) {
>                 rootDir = servletContext.getRealPath("/");
> 
> Thanks for your help Jacopo, I really went on a wrong track, my apologies
> 
> 
> Jacques

Reply via email to