Management of Content Snippets on a non-Ecommerce Page

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Management of Content Snippets on a non-Ecommerce Page

Tim Ruppert
So, as I asked the board before - I have successfully gotten content
pages to display and skinned most portions of one of the ofbiz instances
I'm currently working on.  The process as I documented it looked kinda
like this:

1. Go to Content->Content->Create New
2. Fill Out form for "App Content Root"
--- Document
--- Content Name - App Content Root
3. Click Create
4. Go to Content->DataResource-> Create New
5. Fill out form
--- Data Resource Type Id = Long Text
--- Locale - en_US
--- Resource Name - FAQ (for example)
--- MIME Type Id - text/html
6. Click Create
7. Fill out electronic text
8. Go to Content->Content->Create New (again)
9. Fill Out form
--- Document
--- Content Name - FAQ
--- Locale - en_US
--- MIME - text/html
10. Go to Content->Content->Edit Content (on App Content Root)
11. Add Association - fill out form
--- Content ID to - ID of FAQ Content
--- Content Assoc Type Id - Sub Section
--- Map Key - FAQ
12. Click Create
13. Go to CommonScreens.xml
14. Create FAQ from login using the assoc-name of FAQ to get that Map ID
from the root ID of 10001
15. Go to controller.xml
16. Add request-map and view map for FAQ
<request-map uri="FAQ">
  <security https="false" auth="false"/>
  <response name="success" type="view" value="FAQ"/>
</request-map>
<view-map name="FAQ" type="screen"
page="component://app/widget/CommonScreens.xml#FAQ"/>

Under widgets in the CommonScreens.xml#FAQ I use this to load the content:

               <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <sub-content content-id="10001" assoc-name="FAQ" />
                    </decorator-section>
                </decorator-screen>

This got me a page that displayed perfectly.  My question at this
juncture is how do you make it so that content page has multiple
configurable pieces of content (for example META information, policy
information, sidebar content, etc) that can be displayed throughout the
screen?  I know basically how to handle this on the eCommerce side of
the app, but I'm just a little confused on the static side.

Do I just need to play with the decorator and add another section and
associate it the same way this body piece was?  Is there a way to
associate a "Page" (like FAQ) with multiple pieces of content so that
you only have to tell it which top level Map Key to use and it will sort
out?

Anyways, I'll keep playing around with the options I mentioned below,
but anyone with any insight.

Cheers,
Tim

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

o:801.649.6594
f:801.649.6595

Reply | Threaded
Open this post in threaded view
|

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

Tim Ruppert
I'm just reposting this as the questions I had were pretty far into the
message.  If anyone has any ideas - it would be a big help to hear how
your solving this particular problem:

---
My question at this juncture is how do you make it so that content page
which has multiple configurable pieces of content (for example META
information, policy information, sidebar content, etc) that can be
displayed throughout the screen?  I know basically how to handle this on
the eCommerce side of the app, but I'm just a little confused on the
static side.

Do I just need to play with the decorator and add another section and
associate it the same way this body piece was?  Is there a way to
associate a "Page" (like FAQ) with multiple pieces of content so that
you only have to tell it which top level Map Key to use and it will sort
out?
---

Tim Ruppert wrote:

> So, as I asked the board before - I have successfully gotten content
> pages to display and skinned most portions of one of the ofbiz
> instances I'm currently working on.  The process as I documented it
> looked kinda like this:
>
> 1. Go to Content->Content->Create New
> 2. Fill Out form for "App Content Root"
> --- Document
> --- Content Name - App Content Root
> 3. Click Create
> 4. Go to Content->DataResource-> Create New
> 5. Fill out form
> --- Data Resource Type Id = Long Text
> --- Locale - en_US
> --- Resource Name - FAQ (for example)
> --- MIME Type Id - text/html
> 6. Click Create
> 7. Fill out electronic text
> 8. Go to Content->Content->Create New (again)
> 9. Fill Out form
> --- Document
> --- Content Name - FAQ
> --- Locale - en_US
> --- MIME - text/html
> 10. Go to Content->Content->Edit Content (on App Content Root)
> 11. Add Association - fill out form
> --- Content ID to - ID of FAQ Content
> --- Content Assoc Type Id - Sub Section
> --- Map Key - FAQ
> 12. Click Create
> 13. Go to CommonScreens.xml
> 14. Create FAQ from login using the assoc-name of FAQ to get that Map
> ID from the root ID of 10001
> 15. Go to controller.xml
> 16. Add request-map and view map for FAQ
> <request-map uri="FAQ">
>  <security https="false" auth="false"/>
>  <response name="success" type="view" value="FAQ"/>
> </request-map>
> <view-map name="FAQ" type="screen"
> page="component://app/widget/CommonScreens.xml#FAQ"/>
>
> Under widgets in the CommonScreens.xml#FAQ I use this to load the
> content:
>
>               <decorator-screen name="main-decorator"
> location="${parameters.mainDecoratorLocation}">
>                    <decorator-section name="body">
>                        <sub-content content-id="10001"
> assoc-name="FAQ" />
>                    </decorator-section>
>                </decorator-screen>
>
> This got me a page that displayed perfectly.  My question at this
> juncture is how do you make it so that content page has multiple
> configurable pieces of content (for example META information, policy
> information, sidebar content, etc) that can be displayed throughout
> the screen?  I know basically how to handle this on the eCommerce side
> of the app, but I'm just a little confused on the static side.
>
> Do I just need to play with the decorator and add another section and
> associate it the same way this body piece was?  Is there a way to
> associate a "Page" (like FAQ) with multiple pieces of content so that
> you only have to tell it which top level Map Key to use and it will
> sort out?
>
> Anyways, I'll keep playing around with the options I mentioned below,
> but anyone with any insight.
>
> Cheers,
> Tim
>
Reply | Threaded
Open this post in threaded view
|

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

Adrian Crum
Tim Ruppert wrote:
> Do I just need to play with the decorator and add another section and
> associate it the same way this body piece was?  Is there a way to
> associate a "Page" (like FAQ) with multiple pieces of content so that
> you only have to tell it which top level Map Key to use and it will sort
> out?

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.

Reply | Threaded
Open this post in threaded view
|

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

Tim Ruppert
Thanks, Adrian - I'll take a look at that this afternoon.

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

o:801.649.6594
f:801.649.6595

Adrian Crum wrote:

> Tim Ruppert wrote:
>> Do I just need to play with the decorator and add another section and
>> associate it the same way this body piece was?  Is there a way to
>> associate a "Page" (like FAQ) with multiple pieces of content so that
>> you only have to tell it which top level Map Key to use and it will
>> sort out?
>
> 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.
Reply | Threaded
Open this post in threaded view
|

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

Adrian Crum
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.


Tim Ruppert wrote:

> Thanks, Adrian - I'll take a look at that this afternoon.
>
> --
> Tim Ruppert
> HotWax Media
> http://www.hotwaxmedia.com
>
> o:801.649.6594
> f:801.649.6595
>
> Adrian Crum wrote:
>
>> Tim Ruppert wrote:
>>
>>> Do I just need to play with the decorator and add another section and
>>> associate it the same way this body piece was?  Is there a way to
>>> associate a "Page" (like FAQ) with multiple pieces of content so that
>>> you only have to tell it which top level Map Key to use and it will
>>> sort out?
>>
>>
>> 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.
>
>
Reply | Threaded
Open this post in threaded view
|

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

Tim Ruppert
I will - I will.  I got to it, so no worries on the Old Jira not being
reachable.

Cheers,
Tim

--
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.
>
>
> Tim Ruppert wrote:
>
>> Thanks, Adrian - I'll take a look at that this afternoon.
>>
>> --
>> Tim Ruppert
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> o:801.649.6594
>> f:801.649.6595
>>
>> Adrian Crum wrote:
>>
>>> Tim Ruppert wrote:
>>>
>>>> Do I just need to play with the decorator and add another section
>>>> and associate it the same way this body piece was?  Is there a way
>>>> to associate a "Page" (like FAQ) with multiple pieces of content so
>>>> that you only have to tell it which top level Map Key to use and it
>>>> will sort out?
>>>
>>>
>>> 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.
>>
>>
Reply | Threaded
Open this post in threaded view
|

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

Tim Ruppert
In reply to this post by Adrian Crum
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.
>>
>>
Reply | Threaded
Open this post in threaded view
|

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

Adrian Crum
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.
>>>
>>>
>>>
>
Reply | Threaded
Open this post in threaded view
|

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

Tim Ruppert
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.
>>>>
>>>>
>>>>
>>