Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6923

Improve the decorator for manufacturing/order/facility component for re-use

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: manufacturing, order, product
    • Labels:
      None

      Description

      We have a problem on organize the existing decorator. In this case is manufacturing decorator and also in another decorator too. We cannot use the existing decorator with main-decorator that define on another component in hot-deploy.

      So, I thought we should make reorganization for decorator like in the partymgr component

      applications/party/widget/partymgr/CommonScreens.xml

      All screen should call the common decorator and each common decorator call main-decorator in each commonent, so if we have create the new component in hot-deploy and it should use the main-decorator in their.

      1. OFBIZ-6923.patch
        33 kB
        Kongrath Suankaewmanee
      2. OFBIZ-6923.patch
        0.8 kB
        Kongrath Suankaewmanee

        Activity

        Hide
        hansbak Hans Bakker added a comment -

        correction\ committed 1735189

        Show
        hansbak Hans Bakker added a comment - correction\ committed 1735189
        Hide
        kongrath Kongrath Suankaewmanee added a comment -

        Thanks Hans,

        I just saw some code in my patch that's not correct in :

        applications/product/widget/facility/ShipmentScreens.xml
            <screen name="CommonShipmentMainDecorator">
                <section>
                    <actions>
                        <set field="titleProperty" value="ProductFindShipment"/>
                        <set field="headerItem" value="shipment"/>
                        <script location="component://product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy"/>
                    </actions>
                    <widgets>
                        <decorator-screen name="CommonShipmentMainDecorator" location="${parameters.commonShipmentDecoratorLocation}">
                            <decorator-section name="body">
                                <section>
                                    <condition>
                                        <if-has-permission permission="FACILITY" action="_VIEW"/>
                                    </condition>
                                    <widgets>
                                        <decorator-section-include name="body"/>
                                    </widgets>
                                    <fail-widgets>
                                        <label style="h3">${uiLabelMap.ProductFacilityViewPermissionError}</label>
                                    </fail-widgets>
                                </section>
                            </decorator-section>
                        </decorator-screen>
                    </widgets>
                </section>
            </screen>
        

        It should be this :

        applications/product/widget/facility/ShipmentScreens.xml
            <screen name="CommonShipmentMainDecorator">
                <section>
                    <actions>
                        <set field="titleProperty" value="ProductFindShipment"/>
                        <set field="headerItem" value="shipment"/>
                        <script location="component://product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy"/>
                    </actions>
                    <widgets>
                        <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                            <decorator-section name="body">
                                <section>
                                    <condition>
                                        <if-has-permission permission="FACILITY" action="_VIEW"/>
                                    </condition>
                                    <widgets>
                                        <decorator-section-include name="body"/>
                                    </widgets>
                                    <fail-widgets>
                                        <label style="h3">${uiLabelMap.ProductFacilityViewPermissionError}</label>
                                    </fail-widgets>
                                </section>
                            </decorator-section>
                        </decorator-screen>
                    </widgets>
                </section>
            </screen>
        

        I have attached file the new patch file in here.

        Show
        kongrath Kongrath Suankaewmanee added a comment - Thanks Hans, I just saw some code in my patch that's not correct in : applications/product/widget/facility/ShipmentScreens.xml <screen name= "CommonShipmentMainDecorator" > <section> <actions> <set field= "titleProperty" value= "ProductFindShipment" /> <set field= "headerItem" value= "shipment" /> <script location= "component: //product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy" /> </actions> <widgets> <decorator-screen name= "CommonShipmentMainDecorator" location= "${parameters.commonShipmentDecoratorLocation}" > <decorator-section name= "body" > <section> <condition> < if -has-permission permission= "FACILITY" action= "_VIEW" /> </condition> <widgets> <decorator-section-include name= "body" /> </widgets> <fail-widgets> <label style= "h3" >${uiLabelMap.ProductFacilityViewPermissionError}</label> </fail-widgets> </section> </decorator-section> </decorator-screen> </widgets> </section> </screen> It should be this : applications/product/widget/facility/ShipmentScreens.xml <screen name= "CommonShipmentMainDecorator" > <section> <actions> <set field= "titleProperty" value= "ProductFindShipment" /> <set field= "headerItem" value= "shipment" /> <script location= "component: //product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy" /> </actions> <widgets> <decorator-screen name= "main-decorator" location= "${parameters.mainDecoratorLocation}" > <decorator-section name= "body" > <section> <condition> < if -has-permission permission= "FACILITY" action= "_VIEW" /> </condition> <widgets> <decorator-section-include name= "body" /> </widgets> <fail-widgets> <label style= "h3" >${uiLabelMap.ProductFacilityViewPermissionError}</label> </fail-widgets> </section> </decorator-section> </decorator-screen> </widgets> </section> </screen> I have attached file the new patch file in here.
        Hide
        hansbak Hans Bakker added a comment -

        Committed revision 1735178.
        Thank you Kongrath Suankaewmanee for your contribution.

        Show
        hansbak Hans Bakker added a comment - Committed revision 1735178. Thank you Kongrath Suankaewmanee for your contribution.
        Hide
        kongrath Kongrath Suankaewmanee added a comment -

        has update the new patch and also included update on some decorator in facility and ordermgr component.

        Show
        kongrath Kongrath Suankaewmanee added a comment - has update the new patch and also included update on some decorator in facility and ordermgr component.
        Hide
        hansbak Hans Bakker added a comment -

        + <decorator-screen name="CommonJobshopDecorator" location="$

        {parameters.mainDecoratorLocation}

        ">
        does not seem right....

        Show
        hansbak Hans Bakker added a comment - + <decorator-screen name="CommonJobshopDecorator" location="$ {parameters.mainDecoratorLocation} "> does not seem right....

          People

          • Assignee:
            hansbak Hans Bakker
            Reporter:
            kongrath Kongrath Suankaewmanee
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development