How to use screen widget type decorator for CMS

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

How to use screen widget type decorator for CMS

Vinay Agarwal
Hello,

I can't seem to make widget type decorator work with CMS (details below). I
tried changing decorator-section-include to decoratedContent but that didn't
work either (no body displayed). I would appreciate any guidance. Thanks in
advance.

Regards,
Vinay Agarwal

-----------Errors when I try displaying GZM_DEMO_HOME (the head and left bar
paints fine)
Error calling event: org.ofbiz.webapp.event.EventHandlerException: Problems
processing event: org.ofbiz.base.util.GeneralRuntimeException: Error
rendering content: org.ofbiz.base.util.GeneralException: Error rendering
screen
[component://site/webapp/site/screens/common/CommonScreens.xml#main-decorator]:
java.lang.NullPointerException (null) (Error rendering screen
[component://site/webapp/site/screens/common/CommonScreens.xml#main-decorator]:
java.lang.NullPointerException (null)) (Error rendering content:
org.ofbiz.base.util.GeneralException: Error rendering screen
[component://grayzilla/webapp/grayzilla/screens/common/CommonScreens.xml#main-decorator]:
java.lang.NullPointerException (null) (Error rendering screen
[component://grayzilla/webapp/grayzilla/screens/common/CommonScreens.xml#main-decorator]:
java.lang.NullPointerException (null)))

--------------Screen Widget decorator defined as
    <screen name="main-decorator">
        <section>
            <widgets>
                        <decorator-section-include name="body"/>
            </widgets>
        </section>
    </screen>

------------Content entities defined as

    <Content contentId="GZM_PPOINT" contentTypeId="WEB_SITE_PUB_PT"
contentName="site Publish Point" description=""/>
    <WebSiteContent webSiteId="siteMain" contentId="GZM_PPOINT"
webSiteContentTypeId="PUBLISH_POINT" fromDate="2001-01-01 00:00:00"/>

    <!-- Main Decorator -->
    <DataResource dataResourceId="GZM_MAIN_DEC"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED"
objectInfo="component://site/webapp/site/screens/common/CommonScreens.xml#main-decorator"/>
    <Content contentId="GZM_DEC" contentTypeId="DECORATOR" contentName="site
Main Decorator" dataResourceId="GZM_MAIN_DEC"/>
    <ContentPurpose contentId="GZM_DEC" contentPurposeTypeId="SECTION"/>

    <!-- Top content page, not -->
    <DataResource dataResourceId="GZM_DEMO_HOME"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="FTL"
objectInfo="component://cmssite/webapp/cmssite/DemoHome.ftl"/>
    <Content contentId="GZM_DEMO_HOME" contentTypeId="DOCUMENT"
decoratorContentId="GZM_DEC" contentName="Test Home Page"
dataResourceId="GZM_DEMO_HOME"/>
    <ContentPurpose contentId="GZM_DEMO_HOME"
contentPurposeTypeId="SECTION"/>
    <ContentAssoc contentId="GZM_PPOINT" contentIdTo="GZM_DEMO_HOME"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
    <WebSiteContent webSiteId="siteMain" contentId="GZM_DEMO_HOME"
webSiteContentTypeId="DEFAULT_PAGE" fromDate="2001-01-01 00:00:00"/>

_________________________________________________________________
More photos, more messages, more storage—get 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507

Reply | Threaded
Open this post in threaded view
|

RE: How to use screen widget type decorator for CMS

Vinay Agarwal
I got around the issue by creating a screen like that for blogs in
ecommerce. Thanks.
Vinay

-----Original Message-----
From: Vinay Agarwal [mailto:[hidden email]]
Sent: Friday, May 18, 2007 5:08 PM
To: [hidden email]
Subject: How to use screen widget type decorator for CMS

Hello,

I can't seem to make widget type decorator work with CMS (details below). I
tried changing decorator-section-include to decoratedContent but that didn't

work either (no body displayed). I would appreciate any guidance. Thanks in
advance.

Regards,
Vinay Agarwal

-----------Errors when I try displaying GZM_DEMO_HOME (the head and left bar

paints fine)
Error calling event: org.ofbiz.webapp.event.EventHandlerException: Problems
processing event: org.ofbiz.base.util.GeneralRuntimeException: Error
rendering content: org.ofbiz.base.util.GeneralException: Error rendering
screen
[component://site/webapp/site/screens/common/CommonScreens.xml#main-decorato
r]:
java.lang.NullPointerException (null) (Error rendering screen
[component://site/webapp/site/screens/common/CommonScreens.xml#main-decorato
r]:
java.lang.NullPointerException (null)) (Error rendering content:
org.ofbiz.base.util.GeneralException: Error rendering screen
[component://grayzilla/webapp/grayzilla/screens/common/CommonScreens.xml#mai
n-decorator]:
java.lang.NullPointerException (null) (Error rendering screen
[component://grayzilla/webapp/grayzilla/screens/common/CommonScreens.xml#mai
n-decorator]:
java.lang.NullPointerException (null)))

--------------Screen Widget decorator defined as
    <screen name="main-decorator">
        <section>
            <widgets>
                        <decorator-section-include name="body"/>
            </widgets>
        </section>
    </screen>

------------Content entities defined as

    <Content contentId="GZM_PPOINT" contentTypeId="WEB_SITE_PUB_PT"
contentName="site Publish Point" description=""/>
    <WebSiteContent webSiteId="siteMain" contentId="GZM_PPOINT"
webSiteContentTypeId="PUBLISH_POINT" fromDate="2001-01-01 00:00:00"/>

    <!-- Main Decorator -->
    <DataResource dataResourceId="GZM_MAIN_DEC"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED"
objectInfo="component://site/webapp/site/screens/common/CommonScreens.xml#ma
in-decorator"/>
    <Content contentId="GZM_DEC" contentTypeId="DECORATOR" contentName="site

Main Decorator" dataResourceId="GZM_MAIN_DEC"/>
    <ContentPurpose contentId="GZM_DEC" contentPurposeTypeId="SECTION"/>

    <!-- Top content page, not -->
    <DataResource dataResourceId="GZM_DEMO_HOME"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="FTL"
objectInfo="component://cmssite/webapp/cmssite/DemoHome.ftl"/>
    <Content contentId="GZM_DEMO_HOME" contentTypeId="DOCUMENT"
decoratorContentId="GZM_DEC" contentName="Test Home Page"
dataResourceId="GZM_DEMO_HOME"/>
    <ContentPurpose contentId="GZM_DEMO_HOME"
contentPurposeTypeId="SECTION"/>
    <ContentAssoc contentId="GZM_PPOINT" contentIdTo="GZM_DEMO_HOME"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
    <WebSiteContent webSiteId="siteMain" contentId="GZM_DEMO_HOME"
webSiteContentTypeId="DEFAULT_PAGE" fromDate="2001-01-01 00:00:00"/>

_________________________________________________________________
More photos, more messages, more storage-get 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migratio
n_HM_mini_2G_0507


Reply | Threaded
Open this post in threaded view
|

RE: How to use screen widget type decorator for CMS

David Garrett
In reply to this post by Vinay Agarwal
CMS content with SCREEN_COMBINED decorator

Does anyone know if I am wrong or does a CMS problem exist?

It seems it is not possible to create a content page with CMS which is
decorated by a SCREEN_COMBINED as opposed to the sample data which uses an
FTL decorator. To be more precise I *think* the problem arises when the
decorator has the following widget: <decorator-section-include name="body"/>

My guess is that the "body" is null from the textData at line 649 in
DataResourceWorker.java (I don't know why!)

org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
[component://ecommerce/widget/CommonScreens.xml#main-decorator]:
java.lang.NullPointerException (null)
org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:149)
org.ofbiz.content.data.DataResourceWorker.renderDataResourceAsText(DataResou
rceWorker.java:668)
org.ofbiz.content.content.ContentWorker.renderContentAsText(ContentWorker.ja
va:231)
org.ofbiz.content.content.ContentWorker.renderContentAsText(ContentWorker.ja
va:219)
org.ofbiz.content.cms.CmsEvents.cms(CmsEvents.java:214)
...

I have tried a variety of different simple decorators all with the
<decorator-section-include name="body"/>


The URL I used was ...
http://localhost:8080/cmssite/cms/CMSS_DEMO_PAGE_TST1


Here is the test data I tried...
<entity-engine-xml>

    <!-- screen decorator -->
    <DataResource dataResourceId="CMSS_MAIN_DEC_SCN"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED"
 
objectInfo="component://ecommerce/widget/CommonScreens.xml#main-decorator"/>
    <Content contentId="CMSS_DEC_SCN" contentTypeId="DECORATOR"
contentName="CMS Site Main Decorator - Screen"
dataResourceId="CMSS_MAIN_DEC_SCN"/>
    <ContentPurpose contentId="CMSS_DEC_SCN"
contentPurposeTypeId="SECTION"/>
   
    <Content contentId="CMSS_DEMO_PAGE1_SCN" contentTypeId="DOCUMENT"
decoratorContentId="CMSS_DEC_SCN" contentName="CMS Site Demo Page 1 -
Screen" dataResourceId="CMSS_DEMO_PAGE1"/>
    <ContentPurpose contentId="CMSS_DEMO_PAGE1_SCN"
contentPurposeTypeId="SECTION"/>
    <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_PAGE1_SCN"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
    <ContentAssoc contentId="CMSS_DEMO_PAGE1_SCN"
contentIdTo="CMSS_DEMO_PAGE1_1" contentAssocTypeId="SUB_CONTENT"
mapKey="sub1" fromDate="2001-01-01 00:00:00"/>
    <ContentAssoc contentId="CMSS_DEMO_PAGE1_SCN"
contentIdTo="CMSS_DEMO_PAGE1_2" contentAssocTypeId="SUB_CONTENT"
mapKey="sub2" fromDate="2001-01-01 00:00:00"/>

   
    <DataResource dataResourceId="CMSS_DEMO_PAGE_TST1"
dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="FTL" />
    <ElectronicText dataResourceId="CMSS_DEMO_PAGE_TST1">
        <textData><![CDATA[
            <div>Screen test content</div>
            ]]></textData>
    </ElectronicText>
    <Content contentId="CMSS_DEMO_PAGE_TST1" contentTypeId="DOCUMENT"
decoratorContentId="CMSS_DEC_SCN" contentName="CMS Site Demo Page Screen
TST1" dataResourceId="CMSS_DEMO_PAGE_TST1"/>
    <ContentPurpose contentId="CMSS_DEMO_PAGE_TST1"
contentPurposeTypeId="SECTION"/>
    <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_PAGE_TST1"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>

</entity-engine-xml>



I think Vinay's suggestion below was to use direct access to content like
the following blog example from BlogScreens.xml#CommonBlog ...
  <container style="blogtext">
     <sub-content map-key="SUMMARY" content-id="${blog.contentId}"/>
  </container>
This may work but it is quite inflexible.

Any suggestions as to what I should do to fix/resolve this issue.

Thanks








> -----Original Message-----
> From: Vinay Agarwal [mailto:[hidden email]]
> Sent: Sunday, 20 May 2007 1:32 AM
> To: [hidden email]
> Subject: RE: How to use screen widget type decorator for CMS
>
> I got around the issue by creating a screen like that for
> blogs in ecommerce. Thanks.
> Vinay
>
> -----Original Message-----
> From: Vinay Agarwal [mailto:[hidden email]]
> Sent: Friday, May 18, 2007 5:08 PM
> To: [hidden email]
> Subject: How to use screen widget type decorator for CMS
>
> Hello,
>
> I can't seem to make widget type decorator work with CMS
> (details below). I tried changing decorator-section-include
> to decoratedContent but that didn't
>
> work either (no body displayed). I would appreciate any
> guidance. Thanks in advance.
>
> Regards,
> Vinay Agarwal
>
> -----------Errors when I try displaying GZM_DEMO_HOME (the
> head and left bar
>
> paints fine)
> Error calling event:
> org.ofbiz.webapp.event.EventHandlerException: Problems
> processing event:
> org.ofbiz.base.util.GeneralRuntimeException: Error rendering
> content: org.ofbiz.base.util.GeneralException: Error
> rendering screen
> [component://site/webapp/site/screens/common/CommonScreens.xml
> #main-decorato
> r]:
> java.lang.NullPointerException (null) (Error rendering screen
> [component://site/webapp/site/screens/common/CommonScreens.xml
> #main-decorato
> r]:
> java.lang.NullPointerException (null)) (Error rendering content:
> org.ofbiz.base.util.GeneralException: Error rendering screen
> [component://grayzilla/webapp/grayzilla/screens/common/CommonS
> creens.xml#mai
> n-decorator]:
> java.lang.NullPointerException (null) (Error rendering screen
> [component://grayzilla/webapp/grayzilla/screens/common/CommonS
> creens.xml#mai
> n-decorator]:
> java.lang.NullPointerException (null)))
>
> --------------Screen Widget decorator defined as
>     <screen name="main-decorator">
>         <section>
>             <widgets>
>                         <decorator-section-include name="body"/>
>             </widgets>
>         </section>
>     </screen>
>
> ------------Content entities defined as
>
>     <Content contentId="GZM_PPOINT" contentTypeId="WEB_SITE_PUB_PT"
> contentName="site Publish Point" description=""/>
>     <WebSiteContent webSiteId="siteMain" contentId="GZM_PPOINT"
> webSiteContentTypeId="PUBLISH_POINT" fromDate="2001-01-01 00:00:00"/>
>
>     <!-- Main Decorator -->
>     <DataResource dataResourceId="GZM_MAIN_DEC"
> dataResourceTypeId="URL_RESOURCE"
> dataTemplateTypeId="SCREEN_COMBINED"
> objectInfo="component://site/webapp/site/screens/common/Common
> Screens.xml#ma
> in-decorator"/>
>     <Content contentId="GZM_DEC" contentTypeId="DECORATOR"
> contentName="site
>
> Main Decorator" dataResourceId="GZM_MAIN_DEC"/>
>     <ContentPurpose contentId="GZM_DEC"
> contentPurposeTypeId="SECTION"/>
>
>     <!-- Top content page, not -->
>     <DataResource dataResourceId="GZM_DEMO_HOME"
> dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="FTL"
> objectInfo="component://cmssite/webapp/cmssite/DemoHome.ftl"/>
>     <Content contentId="GZM_DEMO_HOME" contentTypeId="DOCUMENT"
> decoratorContentId="GZM_DEC" contentName="Test Home Page"
> dataResourceId="GZM_DEMO_HOME"/>
>     <ContentPurpose contentId="GZM_DEMO_HOME"
> contentPurposeTypeId="SECTION"/>
>     <ContentAssoc contentId="GZM_PPOINT" contentIdTo="GZM_DEMO_HOME"
> contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
>     <WebSiteContent webSiteId="siteMain" contentId="GZM_DEMO_HOME"
> webSiteContentTypeId="DEFAULT_PAGE" fromDate="2001-01-01 00:00:00"/>
>
> _________________________________________________________________
> More photos, more messages, more storage-get 2GB with Windows
> Live Hotmail.
> http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_
TAGHM_migratio
> n_HM_mini_2G_0507
>
>
>