Re: svn commit: r1518777 - in /ofbiz/trunk: applications/accounting/webapp/accounting/WEB-INF/ applications/order/webapp/ordermgr/WEB-INF/ applications/product/webapp/facility/WEB-INF/ framework/base/src/org/ofbiz/base/location/ framework/base/src/org/ofbi

Posted by Pierre Smits on
URL: http://ofbiz.116.s1.nabble.com/Re-svn-commit-r1518777-in-ofbiz-trunk-applications-accounting-webapp-accounting-WEB-INF-applications-tp4643588p4643931.html

Hi Jacques,

Why not use the  '_WEBAPP_NAME'  variable. That is already available in the
parameter list. You could even avoid transforming it to upper case. A one
time conversion of the data to the appropriate case would then align the
data.

Regards,

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


On Fri, Sep 13, 2013 at 12:02 PM, Jacques Le Roux <
[hidden email]> 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
>