You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2007/02/19 12:40:51 UTC
svn commit: r509167 - in /ofbiz/trunk/applications: ecommerce/data/
ecommerce/webapp/ecommerce/catalog/ ecommerce/widget/
order/webapp/ordermgr/WEB-INF/actions/entry/catalog/
order/webapp/ordermgr/entry/catalog/
Author: jonesde
Date: Mon Feb 19 03:40:46 2007
New Revision: 509167
URL: http://svn.apache.org/viewvc?view=rev&rev=509167
Log:
Added ProductCategoryLink screenlet, included from the categorydetail screen; this is based on the work by Ashish in Jira #OFBIZ-737, but includes a number of cleanups and a bit of a re-write to use more of the ProductCategoryLink entity's data; also added some demo data for testing and demonstration
Added:
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl (with props)
Modified:
ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml
ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl
Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml?view=diff&rev=509167&r1=509166&r2=509167
==============================================================================
--- ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml (original)
+++ ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml Mon Feb 19 03:40:46 2007
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
-->
<entity-engine-xml>
@@ -149,7 +149,18 @@
sequenceNum="1" prodCatalogCategoryTypeId="PCCT_BROWSE_ROOT"/>
<ProdCatalogCategory prodCatalogId="TestCatalog" productCategoryId="TSTLTDADMIN" fromDate="2001-05-13 12:00:00.0"
sequenceNum="1" prodCatalogCategoryTypeId="PCCT_ADMIN_ALLW"/>
-
+
+ <ProductCategoryLink productCategoryId="100" linkSeqId="01" fromDate="2001-05-13 12:00:00.0"
+ titleText="See LGPL Gizmos" detailText="The LGPL license may be more restrictive than you would like, but we think you will like the gizmo anyway!"
+ imageUrl="/images/products/small/handshake_01.png"
+ sequenceNum="2" linkTypeEnumId="PCLT_SEARCH_PARAM"
+ linkInfo="SEARCH_CATEGORY_ID1=100&SEARCH_SUB_CATEGORIES1=Y&SEARCH_FEAT1=8000&sortOrder=SortKeywordRelevancy&sortAscending=N"/>
+ <ProductCategoryLink productCategoryId="100" linkSeqId="02" fromDate="2001-05-13 12:00:00.0"
+ titleText="Go To Google" detailText="If you cannot find the gizmo you want here, try it on Google."
+ imageUrl="http://www.google.com/intl/en_ALL/images/logo.gif"
+ sequenceNum="1" linkTypeEnumId="PCLT_ABS_URL"
+ linkInfo="http://www.google.com/"/>
+
<Product productId="GZ-1000" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Tiny Gizmo" internalName="Tiny Gizmo" description="The smallest gizmo in town." longDescription="This gizmo is very small and runs on solar power." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
<Product productId="GZ-1001" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Nan Gizmo" internalName="Nan Gizmo" description="Indian style Nan gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
<Product productId="GZ-1004" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Rainbow Gizmo" internalName="Rainbow Gizmo" description="The only multi-colored gizmo" longDescription="This is the original multi-colored gizmo, only available from OFBiz!" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl?view=auto&rev=509167
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl (added)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl Mon Feb 19 03:40:46 2007
@@ -0,0 +1,44 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<#if requestAttributes.productCategoryLink?has_content>
+<#assign productCategoryLink = requestAttributes.productCategoryLink>
+<#if productCategoryLink.detailSubScreen?has_content>
+ ${screens.render(productCategoryLink.detailSubScreen)}
+<#else>
+ <#if productCategoryLink.linkTypeEnumId == "PCLT_SEARCH_PARAM">
+ <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, "keywordsearch?" + productCategoryLink.linkInfo)/>
+ <#elseif productCategoryLink.linkTypeEnumId == "PCLT_ABS_URL">
+ <#assign linkUrl = productCategoryLink.linkInfo?if_exists/>
+ </#if>
+ <div class="productcategorylink">
+ <#if productCategoryLink.imageUrl?has_content>
+ <div class="smallimage">
+ <a href="${linkUrl}"><img src="<@o...@ofbizContentUrl>" alt="${productCategoryLink.titleText?default("Link Image")}"/></a>
+ </div>
+ </#if>
+ <#if productCategoryLink.titleText?has_content>
+ <a href="${linkUrl}" class="linktext">${productCategoryLink.titleText}</a>
+ </#if>
+ <#if productCategoryLink.detailText?has_content>
+ <div class="tabletext">${productCategoryLink.detailText}</div>
+ </#if>
+ </div>
+</#if>
+</#if>
Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml?view=diff&rev=509167&r1=509166&r2=509167
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml Mon Feb 19 03:40:46 2007
@@ -200,15 +200,29 @@
<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.bsh"/>
+ <entity-and entity-name="ProductCategoryLink" list-name="productCategoryLinks">
+ <field-map field-name="productCategoryId" env-name="parameters.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>
-
+ <screen name="ProductCategoryLink">
+ <section>
+ <actions>
+ </actions>
+ <widgets>
+ <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/catalog/ProductCategoryLink.ftl"/></html></platform-specific>
+ </widgets>
+ </section>
+ </screen>
+
<screen name="product">
<section>
<actions>
Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh?view=diff&rev=509167&r1=509166&r2=509167
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/categorydetail.bsh Mon Feb 19 03:40:46 2007
@@ -73,7 +73,7 @@
}
// set this as a last viewed
-categoryId = request.getAttribute("productCategoryId");
+categoryId = parameters.get("productCategoryId");
int LAST_VIEWED_TO_KEEP = 10; // modify this to change the number of last viewed to keep
lastViewedCategories = session.getAttribute("lastViewedCategories");
if (lastViewedCategories == null) {
Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl?view=diff&rev=509167&r1=509166&r2=509167
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl Mon Feb 19 03:40:46 2007
@@ -48,6 +48,15 @@
</#if>
</#if>
+<#if productCategoryLinkScreen?has_content && productCategoryLinks?has_content>
+ <div class="productcategorylink-container">
+ <#list productCategoryLinks as productCategoryLink>
+ ${setRequestAttribute("productCategoryLink",productCategoryLink)}
+ ${screens.render(productCategoryLinkScreen)}
+ </#list>
+ </div>
+</#if>
+
<#if productCategoryMembers?has_content>
<div class="product-prevnext">
<#-- Start Page Select Drop-Down -->