`

Shopizer网站模版

 
阅读更多

Store templates make usage of JSTL (http://www.oracle.com/technetwork/java/index-jsp-135995.html), Struts 2 tag libraries (http://struts.apache.org/2.0.14/docs/tag-reference.html) and custom Shopizer’s tag libraries. Anyone familiar with JSTL and having minimal Struts 2 knowledge will be able to understand how store front templates are rendered.

The system uses mainly Struts 2 tags <s: tags for getting objects in the HttpRequest, HttpSession and in the current action class. It also uses forms and logic tasks to interact with business entities exposed through the current Action class. The system will use JSTL tags <c: for display logic in the JSP and finally Shopizer’s tags <sm: where Struts 2 and JSTL does not apply such as retrieving objects from the cache etc…

Store front template files can be found in sm-shop\WebContent\catalog\templates\<TEMPLATE MODULE NAME>. There are exactly 15 files used in the template plus portlets files specific to the template that can be found in sm-shop\WebContent\catalog\templates\<TEMPLATE MODULE NAME>\portlets. There are approximately 5 portlet files per template.

Store layout

All pages are assembled following a specific layout that can be found in sm-shop\WebContent\layout\catalogDefault.jsp and pages compositions are defined in sm-shop\WebContent\WEB-INF\tiles-catalog.xml. There are 6 important page compositions which make the whole store front which are:

landing : Store front landing Page. The url to this page is **http://<host>/shop/landing**
category : Main categories and sub category pages. The url to this page is **http://<host>/shop/catagory/SEO-FRIENDLY-URL**
product : Product detail Page. The url to this page is **http://<host>/shop/product/SEO-FRIENDLY-URL**
search : Search results Page. The url to this page is **http://<host>/shop/page?search=<query string>**
contact : Contact us page. The url to this page is **http://<host>/shop/contact**
contentpage : Custom page holder. The url to this page is **http://<host>/shop/content/SEO-FRIENDLY-URL**
<definition name="landing" template="/layout/catalogDefault.jsp">
    <put-attribute name="page" value="landing" type="string"/>
    <put-attribute name="openWrapper" value="/layout/catalog/openWrapper.jsp"/>
    <put-attribute name="header" value="/layout/catalog/header.jsp"/>
    <put-attribute name="openBody" value="/layout/catalog/openBody.jsp" />
    <put-attribute name="body" value="/layout/catalog/landing.jsp"/>
    <put-attribute name="closeBody" value="/layout/catalog/closeBody.jsp"/>
    <put-attribute name="closeWrapper" value="/layout/catalog/closeWrapper.jsp"/>
    <put-attribute name="footer" value="/layout/catalog/footer.jsp"/>
</definition>
 
 
<definition name="category" template="/layout/catalogDefault.jsp">
   	 <put-attribute name="page" value="category" type="string"/>
   	 <put-attribute name="openWrapper" value="/layout/catalog/openWrapper.jsp"/>
        <put-attribute name="header" value="/layout/catalog/header.jsp"/>
        <put-attribute name="openBody" value="/layout/catalog/openBody.jsp"/>
        <put-attribute name="body" value="/layout/catalog/category.jsp"/>
        <put-attribute name="closeBody" value="/layout/catalog/closeBody.jsp"/>
        <put-attribute name="closeWrapper" value="/layout/catalog/closeWrapper.jsp"/>
        <put-attribute name="footer" value="/layout/catalog/footer.jsp"/>
</definition>
 
 
 
<definition name="product" template="/layout/catalogDefault.jsp">
   	<put-attribute name="page" value="product" type="string"/>
   	<put-attribute name="openWrapper" value="/layout/catalog/openWrapper.jsp"/>
        <put-attribute name="header" value="/layout/catalog/header.jsp"/>
        <put-attribute name="openBody" value="/layout/catalog/openBody.jsp"/>
        <put-attribute name="body" value="/layout/catalog/product.jsp"/>
        <put-attribute name="closeBody" value="/layout/catalog/closeBody.jsp"/>
        <put-attribute name="closeWrapper" value="/layout/catalog/closeWrapper.jsp"/>
        <put-attribute name="footer" value="/layout/catalog/footer.jsp"/>
</definition>
 
 
<definition name="search" template="/layout/catalogDefault.jsp">
    	<put-attribute name="page" value="search" type="string"/>
    	<put-attribute name="openWrapper" value="/layout/catalog/openWrapper.jsp"/>
        <put-attribute name="header" value="/layout/catalog/header.jsp"/>
        <put-attribute name="openBody" value="/layout/catalog/openBody.jsp"/>
        <put-attribute name="body" value="/layout/catalog/search.jsp"/>
        <put-attribute name="closeBody" value="/layout/catalog/closeBody.jsp"/>
        <put-attribute name="closeWrapper" value="/layout/catalog/closeWrapper.jsp"/>
        <put-attribute name="footer" value="/layout/catalog/footer.jsp"/>
</definition>
 
 
<definition name="search" template="/layout/catalogDefault.jsp">
    	<put-attribute name="page" value="search" type="string"/>
    	<put-attribute name="openWrapper" value="/layout/catalog/openWrapper.jsp"/>
        <put-attribute name="header" value="/layout/catalog/header.jsp"/>
        <put-attribute name="openBody" value="/layout/catalog/openBody.jsp"/>
        <put-attribute name="body" value="/layout/catalog/search.jsp"/>
        <put-attribute name="closeBody" value="/layout/catalog/closeBody.jsp"/>
        <put-attribute name="closeWrapper" value="/layout/catalog/closeWrapper.jsp"/>
        <put-attribute name="footer" value="/layout/catalog/footer.jsp"/>
</definition>
 
 
<definition name="contentpage" template="/layout/catalogDefault.jsp">
    	<put-attribute name="page" value="pagelink" type="string"/>
    	<put-attribute name="openWrapper" value="/layout/catalog/openWrapper.jsp"/>
        <put-attribute name="header" value="/layout/catalog/header.jsp"/>
        <put-attribute name="openBody" value="/layout/catalog/openBody.jsp"/>
        <put-attribute name="body" value="/layout/catalog/page.jsp"/>
        <put-attribute name="closeBody" value="/layout/catalog/closeBody.jsp"/>
        <put-attribute name="closeWrapper" value="/layout/catalog/closeWrapper.jsp"/>
        <put-attribute name="footer" value="/layout/catalog/footer.jsp"/>
</definition>

Layout assembly

Page Header

The page header (header.jsp) contains usually the store logo or the store name. It also contains top level categories, sometimes a header banner, account links, mini shopping cart information, informational links and language toggling functionalities.

Thi code block contains the logic for displaying the store logo

<a href="<sm:url scheme="http" namespace="/" action="landing" />"
   <s:if test="#request.STORE.storelogo!= null && #request.STORE.storelogo!= ''">
   <!-- TL TO REPLACE MERCHANT LOGO IF ANY -->
	<div class="<YOUR CSS CLASS FOR LOGO>">
          <img src="<s:property value="#request.STORE.logoPath" />" border="0" 
          alt="<s:property value="#request.STORE.storeName" />"></div>
   </s:if>
   <s:else>
	<div class="<YOUR CSS CLASS FOR STORE NAME>"><s:property value="#request.STORE.storename" /></div>
   </s:else>
</a>

Portlets

The notion of portlets exist for custom boxed content that can be added to specific places in store front pages. Portlets can be custome or can be specific to the template. The administration panel (sm-central) allows the creation of custom portlets that can be assigned to spcific place holders or positions on the store front generated site. There are also pre-built portlets configured specificaly for the template. Those portlets can be enabled / disabled from the administration panel (sm-central) in the portlet area. Those pre-built portlets are :

  1. Mini shopping cart portlet : This mini shopping cart is used in the store front as a summary to the system complete shopping cart
  2. Logon portlet : Displays credentials logon box and system registration links
  3. Accepted payments portlet : Gathers payment information configured in the administration panel and displays a summary of accepted payments
  4. Shipping portlet : Gathers shipping information and determines an esimate based on geo-location. Will also display shipping carrier
  5. Search portlet : Displays a search box

A list of pre-built portlet can be displayed using the following code

    <jsp:include page="/common/stockportletlist.jsp" /> 

Custom Portlets can be grouped to be displayed in a given position. This code can be used to display a list of custom portlet configured for a specific position

    <s:set name="PORTLETS_POSITION" scope="request" value="2"/>
    <jsp:include page="/common/customportletlist.jsp" />
    
    //here are the positions available
    //public final static int LABEL_POSITION_LEFT = 1;
    //public final static int LABEL_POSITION_RIGHT = 2;
    //public final static int LABEL_POSITION_BOTTOM_LANDING = 3;
    //public final static int LABEL_POSITION_BOTTOM_CATEGORY = 4;
    //public final static int LABEL_POSITION_BOTTOM_PRODUCTS = 5; 

It is possible to check if a pre-built portlet has been selected from the administration tool (sm-central)

<s:if test="#request.STORE_FRONT_PORTLETS_MAP['minicartportlet']!=null">

   Your html code
</s:if>


//prebuilt portlets are minicartportlet, logonportlet, acceptedpaymentsportlet, searchportlet and shippingportlet

Top main categories

Top main categories are 'usualy' displayed in the header of a web site. The following code will iterate and display childs of ROOT category

    <sm:topcategories merchantId="${merchantId}" maxCategories="8">
	<c:choose>
	   <c:when test="${session.mainUrl != null && category.categoryId==session.mainUrl.categoryId}">
		 <a href="${unSecuredDomain}${contextPath}/category/${category.categoryDescription.url}" 
                  class="class="nav-link-selected">
	   </c:when>
	   <c:otherwise>
		<a href="${unSecuredDomain}${contextPath}/category/${category.categoryDescription.url}" class="nav-link">
	   </c:otherwise>
	</c:choose>
	<div class="nav-left"><div class="nav-right">${category.name}</div></div></a>
	${break}
    </sm:topcategories>

Left menu categories

Sub categories of a root category are usually displayed on the left menu on each listing page. The following block of code will display a selected menu item sub categories.

<div class="side-nav">
<s:if test="categories!=null && categories.size>0" >
  <ul>
	<s:iterator value="categories" status="count">
	<s:if test="lineage==categoryLineage">
	<li>
		<s:if test="#session.subCategory!=null && #session.subCategory.categoryId==id.categoryId">
			<a href="<%=request.getContextPath()%>/category/${categoryDescription.url}" class="selected">                     class="selected">
		</s:if>
		<s:else>
			<a href="<%=request.getContextPath()%>/category/${categoryDescription.url}">
		</s:else>
		<s:property value="name" /></a>
	</li>
	</s:if>
	</s:iterator>
  </ul>
  &nbsp;
</s:if>
</div>

More details will be available soon

分享到:
评论

相关推荐

    shopizer-2.0.5 源码包

    shopizer-2.0.5 源码包,github下载太慢,给需要的朋友。

    shopizer-master.zip

    Shopizer是一个利用Hibernate、Spring、Struts2、jQuery等技术开发的Web销售管理和电子商务内容管理系统(CMS)。提供了必要的网上销售电子商务工具包括:购物车,库存管理,付款和运输,订单管理,在线发票和电子...

    Shopizer最新源代码,电子商务系统

    Shopizer是一个利用Hibernate、Spring、SpringMVC、jQuery等技术开发的Web销售管理和电子商务内容管理系统(CMS)。提供了必要的网上销售电子商务工具包括:购物车,库存管理,付款和运输,订单管理,在线发票和电子...

    shopizer 2.0最新版本源代码(2014/7/26)

    shopizer是一个利用Hibernate、Spring、Struts2、jQuery等技术开发的Web销售管理和电子商务内容管理系统(CMS)

    shopizer源码2.0.2

    Shopizer是一个使用Hibernate、Spring、Struts2、jQuery等技术框架开发的基于Web的销售管理和电子商务内容管理系统(CMS)。主要功能包括:购物车,库存管理,付款和运输,订单管理,在线发票和订单跟踪。

    shopizer:电商框架

    购物者 Shopizer 是一款免费的开源 Java 电子商务软件,非常适合每个在线商店或企业。 使用开箱即用的安全、... 要了解更多信息,请查看 [Shopizer 网站] Shopizer 提供 Web 和移动电子商务应用程序、工具和 API,用

    shopizer 1.1.5 目前最新版本源代码(2013/10)

    shopizer 1.1.5 目前最新版本源代码(2013/10)

    shopizer:Shopizer Java电子商务软件

    Shopizer(适用于Java 1.8 +) Java开源电子商务软件购物车目录搜索查看行政REST API参见演示(jsp): 参见演示(角度): 即将推出获取代码: 克隆存储库: $ git clone git://github....如果您是第一次使用Github,...

    shopizer-1.1.3-src 商店管理系统

    商店管理系统,资源共享,需要自取,欢迎交流

    Shopizer java e-commerce software.zip

    Shopizer java e-commerce software.zip

    shopizer-shop-reactjs

    该项目是通过。 可用脚本 在项目目录中,可以运行: 使用NPM npm i npm run dev ...泊坞窗运行-e“ APP_MERCHANT =默认” -e“ APP_BASE_URL = ” -it --rm -p 80:80 shopizerecomm / shopizer-shop-reactjs

    shopizer-catalogue-service:Shopizer目录微服务生态系统

    shopizer微服务生态系统WIP TODO将仓库重命名为shopizer-microservices要求Java 8回购包含以下内容: 购物者购物者模型购物者目录服务购物者目录价格服务购物者目录rdbms启动器细节shopizer:父BON shopizer-common...

    ShopPatin:店铺Patin

    购物者 Shopizer是免费的开源Java电子商务软件,非常适合... 要了解更多信息,请访问[Shopizer网站] Shopizer提供Web和移动电子商务应用程序,工具和API,用于建立很棒的在线商店! 敏捷 社区 可移植性 ![i1] ![i2]

    Shopizer:Java商业购物车-开源

    Shopizer 2.0现在可用! 使用-Spring MVC -Spring Security -Hibernate -Elasticsearch Shopizer构建,是一种企业Java销售管理和购物车软件-在线目录-购物车-订单履行-在线发票

    shopizer_4test

    Shopizer 2.2.0(适用于Java 1.8 +) Java开源电子商务软件 购物车 目录 搜索 查看 行政 REST API 观看演示: 要获取代码: 克隆存储库:$ git clone git://github.com/shopizer-ecommerce/shopizer.git 如果...

    Shopizer注册

    Shopizer注册

    w3school.CHM 最新整理2013/10/28

    下载整理了最新的w3school教材 2013/10/28

    Shopizer搜索

    购物者搜索在shopizer中使用对Elasticsearch的搜索包装集成在购物程序中

    shopizerTEST

    Shopizer(适用于Java 1.8 +) Java开源电子商务软件购物车目录搜索退房行政REST API参见演示(jsp): 参见演示(角度): 即将推出获取代码: 克隆存储库: $ git clone git://github....如果这是您第一次使用Github...

    shopizer:励合化工商城项目-服务器端

    shopizer励合化工商城项目-服务器端简介基于国外商城框架shopizer修改

Global site tag (gtag.js) - Google Analytics