Look a little harder for the reason, and you'll find it. In general it
is more likely that there is a reason than that the person who wrote
it decided it would be fun, or wasn't smart enough to recognize it
could be significantly more simple....
In this case it is so we can configure the screen used per category.
-David
On Jul 26, 2008, at 5:47 AM, Chirag Manocha wrote:
Hello All,
As i was studying the ecommerce application. I found that in
CatalogScreens.xml file the 'category' screen is including one screen
'category-include' and 'category-include' screen is just checking a
condition and including 'categorydetail' screen and in fail widget
just a
short message.
I think all this can be done without 'category-include' screen, but
there
might be some standards for doing this process. I want to know why
these
standards are made.
For ready refernce here is the code for the same :
<screen name="category">
<section>
<actions>
<set field="leftbarScreenName" value="leftbar"/>
<set field="rightbarScreenName" value="rightbar"/>
<set field="MainColumnStyle" value="center"/>
<set field="titleProperty"
value="PageTitleCategoryPage"/>
<script
location="component://order/webapp/ordermgr/WEB-INF/actions/entry/
catalog/Category.groovy"/>
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-screen name="breadcrumbs"/>
<include-screen name="category-include"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="category-include">
<section>
<widgets>
<section>
<condition>
<not><if-empty field-name="productCategory"/
></not>
</condition>
<widgets>
<include-screen name="${detailScreen}"/>
</widgets>
<fail-widgets>
<label
style="head2">${uiLabelMap.ProductCategoryNotFoundforCategoryID}
${productCategoryId}!</label>
</fail-widgets>
</section>
</widgets>
</section>
</screen>
<screen name="categorydetail">
<section>
<actions>
<set field="productsummaryScreen"
value="component://ecommerce/widget/
CatalogScreens.xml#productsummary"/>
<set field="productCategoryLinkScreen"
value="component://ecommerce/widget/
CatalogScreens.xml#ProductCategoryLink"/>
<script
location="component://order/webapp/ordermgr/WEB-INF/actions/entry/
catalog/CategoryDetail.groovy"/>
<entity-and entity-name="ProductCategoryLink"
list-name="productCategoryLinks" use-cache="true" filter-by-
date="true">
<field-map field-name="productCategoryId"
env-name="productCategoryId"/>
<order-by field-name="sequenceNum"/>
</entity-and>
</actions>
<widgets>
<platform-specific><html><html-template
location="component://order/webapp/ordermgr/entry/catalog/
categorydetail.ftl"/></html></platform-specific>
</widgets>
</section>
</screen>
Any pointer will be highly appreciated.
--
Thanks & Regards
Chirag Manocha
Hotwax Media Inc.
(M) +91-982-631-9099