You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Adrian Crum <ad...@hlmksw.com> on 2006/07/01 01:47:43 UTC

Re: Management of Content Snippets on a non-Ecommerce Page

Since I can't see what you're trying to implement, I can't offer many details. 
I'm also at a disadvantage because we don't use the eCommerce application here. 
The changes I proposed were to enhance the back office web UI.

Basically, the idea was to provide "hooks" in the GlobalDecorator so that 
components could (optionally) insert content in the web page.

If I'm understanding you correctly, you could add a pre-body section to the 
GlobalDecorator and your component's MainDecorator. Specific screen or form 
widgets could then call the pre-body section of the MainDecorator.

Your MainDecorator would then have

<decorator-section-include name="pre-body"/>

And your About screen would then have

<decorator-section name="pre-body">

instead of

<decorator-section name="body">

The pre-template section I proposed in Jira 174 was intended to do things like 
put dynamic content in the page title.


Tim Ruppert wrote:
> Adrian, I've been studying those patch files and like the pre-template 
> way of staging my data.
> I guess my next questions for you would be where do you define what 
> happens in the pre-processor?   Are the multiple content snippets that 
> make up a single page in any way associated?  What do you add to the 
> About Screen to add those content snippets - or is it all handled by the 
> pre-template processing?
> 
> Much of this content is going to populate something in the leftbar.  
> Optimally, I would love for the sidedeepcategory to only show up on the 
> category and detail pages - but have the ability to configure the 
> content in that bar on standard content-based pages.  Thanks for any 
> further clarification that you guys can offer.
> 
> --Tim
> 
> Here is my very simple definition for the About page:
> 
>    <screen name="About">
>        <section>
>            <actions>
>                <set field="leftbarScreenName" value="leftbar"/>
>                <set field="MainColumnStyle" value="center"/>
>                <set field="title-property" value="About"/>
>            </actions>
>            <widgets>
>               <decorator-screen name="main-decorator" 
> location="${parameters.mainDecoratorLocation}">
>                    <decorator-section name="body">
>                        <sub-content content-id="10001" 
> assoc-name="About" />
>                    </decorator-section>
>                </decorator-screen>
>            </widgets>
>          </section>
>    </screen>     
> and here is the main-decorator:
> 
>    <screen name="main-decorator">
>        <section>
>            <actions>
>                <!-- base/top/specific map first, then more common map 
> added for shared labels -->
>                <property-map resource="EcommerceUiLabels" 
> map-name="uiLabelMap" global="true"/>
>                <property-map resource="ContentUiLabels" 
> map-name="uiLabelMap" global="true"/>
>                <property-map resource="CommonUiLabels" 
> map-name="uiLabelMap" global="true"/>
>                <property-map resource="ProductUiLabels" 
> map-name="uiLabelMap" global="true"/>
>                <property-map resource="AccountingUiLabels" 
> map-name="uiLabelMap" global="true"/>
>                <property-map resource="PartyUiLabels" 
> map-name="uiLabelMap" global="true"/>
>                <property-map resource="OrderUiLabels" 
> map-name="uiLabelMap" global="true"/>
> 
>                <set field="MainColumnStyle" value="nocolumns" 
> global="true"/>
>                <set field="layoutSettings.extraHead" value="&lt;link 
> rel=&quot;stylesheet&quot; 
> href=&quot;/content/images/contentForum.css&quot; 
> type=&quot;text/css&quot;/&gt;" global="true"/>
>                <script 
> location="component://ecommerce/widget/EcommerceSetup.bsh"/>
>            </actions>
>            <widgets>
>                <!-- render header -->
>                <platform-specific><html><html-template 
> location="component://app/webapp/app/includes/header.ftl"/></html></platform-specific> 
> 
> 
>                <container id="ecom-mainarea">
>                    <!-- by default will render left-bar only if 
> left/rightbarScreenName value not empty -->
>                   <include-screen name="${leftbarScreenName}" 
> location="${leftbarScreenLocation}"/>
> 
>                    <container style="${MainColumnStyle}">
>                        <!-- render messages -->
>                        <platform-specific><html><html-template 
> location="component://common/webcommon/includes/messages.ftl"/></html></platform-specific> 
> 
>                        <decorator-section-include name="body"/>
>                    </container>
> 
>                    <container style="endcolumns"/>
>                </container>
> 
>                <!-- render footer -->
>                <platform-specific><html><html-template 
> location="component://app/webapp/app/includes/footer.ftl"/></html></platform-specific> 
> 
>            </widgets>
>        </section>
>    </screen>
> 
> -- 
> Tim Ruppert
> HotWax Media
> http://www.hotwaxmedia.com
> 
> o:801.649.6594
> f:801.649.6595
> 
> Adrian Crum wrote:
> 
>> I can't get to the old Jira right now to give you more specific 
>> information. When you check on it, look for Jacopo's comments (and my 
>> response) about additional sections in CommonScreens.xml called 
>> Pre-Template and Post-Template.
>>
>>>>
>>>> We did that here so we could put dynamic content in the title. We 
>>>> added other sections to the GlobalDecorator so that content could be 
>>>> inserted in various places during page construction. Components 
>>>> could then insert their own actions, ftls, etc in those added sections.
>>>>
>>>> For an outdated example, see the CommonScreens.xml file in Jira 174.
>>>
>>>
>>>
> 

Re: Management of Content Snippets on a non-Ecommerce Page

Posted by Tim Ruppert <ti...@hotwaxmedia.com>.
Thanks for the quick response - I'll dig more deeply here and try that 
decorator-section pre-body and let you know how it goes.

Cheers,
Tim

--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

Adrian Crum wrote:
> Since I can't see what you're trying to implement, I can't offer many 
> details. I'm also at a disadvantage because we don't use the eCommerce 
> application here. The changes I proposed were to enhance the back 
> office web UI.
>
> Basically, the idea was to provide "hooks" in the GlobalDecorator so 
> that components could (optionally) insert content in the web page.
>
> If I'm understanding you correctly, you could add a pre-body section 
> to the GlobalDecorator and your component's MainDecorator. Specific 
> screen or form widgets could then call the pre-body section of the 
> MainDecorator.
>
> Your MainDecorator would then have
>
> <decorator-section-include name="pre-body"/>
>
> And your About screen would then have
>
> <decorator-section name="pre-body">
>
> instead of
>
> <decorator-section name="body">
>
> The pre-template section I proposed in Jira 174 was intended to do 
> things like put dynamic content in the page title.
>
>
> Tim Ruppert wrote:
>> Adrian, I've been studying those patch files and like the 
>> pre-template way of staging my data.
>> I guess my next questions for you would be where do you define what 
>> happens in the pre-processor?   Are the multiple content snippets 
>> that make up a single page in any way associated?  What do you add to 
>> the About Screen to add those content snippets - or is it all handled 
>> by the pre-template processing?
>>
>> Much of this content is going to populate something in the leftbar.  
>> Optimally, I would love for the sidedeepcategory to only show up on 
>> the category and detail pages - but have the ability to configure the 
>> content in that bar on standard content-based pages.  Thanks for any 
>> further clarification that you guys can offer.
>>
>> --Tim
>>
>> Here is my very simple definition for the About page:
>>
>>    <screen name="About">
>>        <section>
>>            <actions>
>>                <set field="leftbarScreenName" value="leftbar"/>
>>                <set field="MainColumnStyle" value="center"/>
>>                <set field="title-property" value="About"/>
>>            </actions>
>>            <widgets>
>>               <decorator-screen name="main-decorator" 
>> location="${parameters.mainDecoratorLocation}">
>>                    <decorator-section name="body">
>>                        <sub-content content-id="10001" 
>> assoc-name="About" />
>>                    </decorator-section>
>>                </decorator-screen>
>>            </widgets>
>>          </section>
>>    </screen>     and here is the main-decorator:
>>
>>    <screen name="main-decorator">
>>        <section>
>>            <actions>
>>                <!-- base/top/specific map first, then more common map 
>> added for shared labels -->
>>                <property-map resource="EcommerceUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>                <property-map resource="ContentUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>                <property-map resource="CommonUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>                <property-map resource="ProductUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>                <property-map resource="AccountingUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>                <property-map resource="PartyUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>                <property-map resource="OrderUiLabels" 
>> map-name="uiLabelMap" global="true"/>
>>
>>                <set field="MainColumnStyle" value="nocolumns" 
>> global="true"/>
>>                <set field="layoutSettings.extraHead" value="&lt;link 
>> rel=&quot;stylesheet&quot; 
>> href=&quot;/content/images/contentForum.css&quot; 
>> type=&quot;text/css&quot;/&gt;" global="true"/>
>>                <script 
>> location="component://ecommerce/widget/EcommerceSetup.bsh"/>
>>            </actions>
>>            <widgets>
>>                <!-- render header -->
>>                <platform-specific><html><html-template 
>> location="component://app/webapp/app/includes/header.ftl"/></html></platform-specific> 
>>
>>
>>                <container id="ecom-mainarea">
>>                    <!-- by default will render left-bar only if 
>> left/rightbarScreenName value not empty -->
>>                   <include-screen name="${leftbarScreenName}" 
>> location="${leftbarScreenLocation}"/>
>>
>>                    <container style="${MainColumnStyle}">
>>                        <!-- render messages -->
>>                        <platform-specific><html><html-template 
>> location="component://common/webcommon/includes/messages.ftl"/></html></platform-specific> 
>>
>>                        <decorator-section-include name="body"/>
>>                    </container>
>>
>>                    <container style="endcolumns"/>
>>                </container>
>>
>>                <!-- render footer -->
>>                <platform-specific><html><html-template 
>> location="component://app/webapp/app/includes/footer.ftl"/></html></platform-specific> 
>>
>>            </widgets>
>>        </section>
>>    </screen>
>>
>> -- 
>> Tim Ruppert
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> o:801.649.6594
>> f:801.649.6595
>>
>> Adrian Crum wrote:
>>
>>> I can't get to the old Jira right now to give you more specific 
>>> information. When you check on it, look for Jacopo's comments (and 
>>> my response) about additional sections in CommonScreens.xml called 
>>> Pre-Template and Post-Template.
>>>
>>>>>
>>>>> We did that here so we could put dynamic content in the title. We 
>>>>> added other sections to the GlobalDecorator so that content could 
>>>>> be inserted in various places during page construction. Components 
>>>>> could then insert their own actions, ftls, etc in those added 
>>>>> sections.
>>>>>
>>>>> For an outdated example, see the CommonScreens.xml file in Jira 174.
>>>>
>>>>
>>>>
>>