The pros and cons of each approach were discussed in detail a couple years ago. Do a search for "sub-decorator." The conclusion was putting these sub-decorators into a separate file makes the screens they decorate harder to reuse.
-Adrian --- On Thu, 7/23/09, Hans Bakker <[email protected]> wrote: > From: Hans Bakker <[email protected]> > Subject: Re: svn commit: r796873 - in /ofbiz/trunk/applications/accounting: > webapp/accounting/WEB-INF/web.xml widget/CommonScreens.xml > widget/FixedAssetScreens.xml > To: [email protected] > Date: Thursday, July 23, 2009, 8:45 PM > Adrian, > > up to now, please check the catalog and party component, > the current > practice is to store all decorators in the > commonscreens.xml as defined > in the web.xml file. > > Sure your way is working too, however: > 1. it needs an extra entry for every decorator to be > overridden to be > defined in web.xml > 2. now he accounting component gets a bit confusing because > in the > fixedassetscreens file, the location refers to: > location="${parameters.fixedAssetDecoratorLocation} which > is not > defined. > > so why not use he pattern which is already there? > > Regards, > Hans > > > > On Thu, 2009-07-23 at 08:04 -0700, Adrian Crum wrote: > > That is not correct. Decorators CAN be overridden, and > a perfect example > > of that is in the Asset Maintenance component. > > > > All of the fixed asset screens were in > FixedAssetScreens.xml. They > > worked fine - there was nothing wrong with them. > Therefore, there was no > > valid reason to take one of those screens out of > FixedAssetScreens.xml > > and put it in a different file. > > > > -Adrian > > > > Hans Bakker wrote: > > > Adrian, > > > > > > in general, decorators belong in the > commonscreens xml file (defined in > > > web.xml) so it can be overridden in other > components. With this commit > > > the fixed asset screens have to use the decorator > in the same file and > > > that can not be changed elsewhere. > > > > > > Regards, > > > Hans > > > > > > On Wed, 2009-07-22 at 20:35 +0000, [email protected] > wrote: > > >> Author: adrianc > > >> Date: Wed Jul 22 20:35:18 2009 > > >> New Revision: 796873 > > >> > > >> URL: http://svn.apache.org/viewvc?rev=796873&view=rev > > >> Log: > > >> Put the fixed asset decorator screen back > where it belongs. > > >> > > >> Modified: > > >> > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/web.xml > > >> > ofbiz/trunk/applications/accounting/widget/CommonScreens.xml > > >> > ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml > > >> > > >> Modified: > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/web.xml > > >> URL: > > >> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/web.xml?rev=796873&r1=796872&r2=796873&view=diff > > >> > ============================================================================== > > >> --- > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/web.xml > (original) > > >> +++ > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/web.xml > Wed Jul 22 20:35:18 2009 > > >> @@ -45,11 +45,6 @@ > > >> > <description>Configuration File(s) For The Service > Dispatcher</description> > > >> </context-param> > > >> <context-param> > > >> - > <param-name>fixedAssetDecoratorLocation</param-name> > > >> - > <param-value>component://accounting/widget/CommonScreens.xml</param-value> > > >> - > <description>The location of the > CommonFixedAssetDecorator screen to use for this > webapp.</description> > > >> - </context-param> > > >> - <context-param> > > >> > <param-name>mainDecoratorLocation</param-name> > > >> > <param-value>component://accounting/widget/CommonScreens.xml</param-value> > > >> > <description>The location of the main-decorator screen > to use for this webapp; referred to as a context variable in > screen def XML files.</description> > > >> > > >> Modified: > ofbiz/trunk/applications/accounting/widget/CommonScreens.xml > > >> URL: > > >> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/CommonScreens.xml?rev=796873&r1=796872&r2=796873&view=diff > > >> > ============================================================================== > > >> --- > ofbiz/trunk/applications/accounting/widget/CommonScreens.xml > (original) > > >> +++ > ofbiz/trunk/applications/accounting/widget/CommonScreens.xml > Wed Jul 22 20:35:18 2009 > > >> @@ -341,51 +341,4 @@ > > >> > </section> > > >> </screen> > > >> > > >> - <screen > name="CommonFixedAssetDecorator"> > > >> - <section> > > >> - > <actions> > > >> - > <set field="headerItem" > value="ListFixedAssets"/> > > >> - > </actions> > > >> - > <widgets> > > >> - > <decorator-screen name="main-decorator" > location="${parameters.mainDecoratorLocation}"> > > >> - > <decorator-section > name="pre-body"> > > >> - > <section> > > >> - > > <condition> > > >> - > > <not><if-empty > field="fixedAssetId"/></not> > > >> - > > </condition> > > >> - > > <widgets> > > >> - > > <include-menu name="FixedAssetTabBar" > location="component://accounting/widget/Menus.xml"/> > > >> - > > </widgets> > > >> - > </section> > > >> - > > <decorator-section-include name="pre-body"/> > > >> - > </decorator-section> > > >> - > <decorator-section > name="body"> > > >> - > <section> > > >> - > > <condition> > > >> - > > <if-service-permission > service-name="fixedAssetPermissionCheck" > main-action="VIEW"/> > > >> - > > </condition> > > >> - > > <widgets> > > >> - > > <section> > > >> - > > <condition> > > >> - > > > <not><if-empty > field="fixedAssetId"/></not> > > >> - > > </condition> > > >> - > > <widgets> > > >> - > > <container > style="h1"><label text="${uiLabelMap[titleProperty]} > ${uiLabelMap.CommonFor} ${fixedAsset.fixedAssetName} > [${fixedAssetId}] > ${${extraFunctionName}}"/></container> > > >> - > > </widgets> > > >> - > > <fail-widgets> > > >> - > > <container > style="h1"><label > text="${uiLabelMap[titleProperty]}"/></container> > > >> - > > </fail-widgets> > > >> - > > </section> > > >> - > > <decorator-section-include > name="body"/> > > >> - > > </widgets> > > >> - > > <fail-widgets> > > >> - > > <label style="h3" > text="${uiLabelMap.AccountingViewPermissionError}"/> > > >> - > > </fail-widgets> > > >> - > </section> > > >> - > </decorator-section> > > >> - > </decorator-screen> > > >> - > </widgets> > > >> - > </section> > > >> - </screen> > > >> - > > >> </screens> > > >> > > >> Modified: > ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml > > >> URL: > > >> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml?rev=796873&r1=796872&r2=796873&view=diff > > >> > ============================================================================== > > >> --- > ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml > (original) > > >> +++ > ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml > Wed Jul 22 20:35:18 2009 > > >> @@ -71,6 +71,53 @@ > > >> > </section> > > >> </screen> > > >> > > >> + <screen > name="CommonFixedAssetDecorator"> > > >> + <section> > > >> + > <actions> > > >> + > <set field="headerItem" > value="ListFixedAssets"/> > > >> + > </actions> > > >> + > <widgets> > > >> + > <decorator-screen name="main-decorator" > location="${parameters.mainDecoratorLocation}"> > > >> + > <decorator-section > name="pre-body"> > > >> + > <section> > > >> + > > <condition> > > >> + > > <not><if-empty > field="fixedAssetId"/></not> > > >> + > > </condition> > > >> + > > <widgets> > > >> + > > <include-menu name="FixedAssetTabBar" > location="component://accounting/widget/Menus.xml"/> > > >> + > > </widgets> > > >> + > </section> > > >> + > > <decorator-section-include name="pre-body"/> > > >> + > </decorator-section> > > >> + > <decorator-section > name="body"> > > >> + > <section> > > >> + > > <condition> > > >> + > > <if-service-permission > service-name="fixedAssetPermissionCheck" > main-action="VIEW"/> > > >> + > > </condition> > > >> + > > <widgets> > > >> + > > <section> > > >> + > > <condition> > > >> + > > > <not><if-empty > field="fixedAssetId"/></not> > > >> + > > </condition> > > >> + > > <widgets> > > >> + > > <container > style="h1"><label text="${uiLabelMap[titleProperty]} > ${uiLabelMap.CommonFor} ${fixedAsset.fixedAssetName} > [${fixedAssetId}] > ${${extraFunctionName}}"/></container> > > >> + > > </widgets> > > >> + > > <fail-widgets> > > >> + > > <container > style="h1"><label > text="${uiLabelMap[titleProperty]}"/></container> > > >> + > > </fail-widgets> > > >> + > > </section> > > >> + > > <decorator-section-include > name="body"/> > > >> + > > </widgets> > > >> + > > <fail-widgets> > > >> + > > <label style="h3" > text="${uiLabelMap.AccountingViewPermissionError}"/> > > >> + > > </fail-widgets> > > >> + > </section> > > >> + > </decorator-section> > > >> + > </decorator-screen> > > >> + > </widgets> > > >> + > </section> > > >> + </screen> > > >> + > > >> <!-- create and/or > update a fixed asset --> > > >> <screen > name="EditFixedAsset"> > > >> > <section> > > >> > > >> > -- > Antwebsystems.com: Quality OFBiz services for competitive > rates > >
