info.magnolia.module.shop.paragraphs
Class ShopParagraphModel

java.lang.Object
  extended by info.magnolia.rendering.model.RenderingModelImpl<RD>
      extended by info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel<info.magnolia.rendering.template.TemplateDefinition>
          extended by info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>
              extended by info.magnolia.module.shop.paragraphs.ShopParagraphModel
All Implemented Interfaces:
info.magnolia.module.templatingkit.templates.STKRenderingModel<info.magnolia.rendering.template.TemplateDefinition>, info.magnolia.rendering.model.RenderingModel<info.magnolia.rendering.template.TemplateDefinition>
Direct Known Subclasses:
ShopKeywordSearchResultParagraphModel, ShoppingCartParagraphModel, ShopProductSearchResultParagraphModel

public class ShopParagraphModel
extends info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>

Shop paragraph model, used on productdetail and productlist paragraphs.

Author:
tmiyar

Field Summary
protected static String[] ALLOWED_IMAGE_TYPES
           
 
Fields inherited from class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel
DEFAULT_SITEROOT_TEMPLATE_CATEGORY, stkFunctions, templatingFunctions
 
Fields inherited from class info.magnolia.rendering.model.RenderingModelImpl
content, contentMap, definition, parentModel
 
Fields inherited from interface info.magnolia.rendering.model.RenderingModel
SKIP_RENDERING
 
Constructor Summary
ShopParagraphModel(javax.jcr.Node content, info.magnolia.rendering.template.TemplateDefinition definition, info.magnolia.rendering.model.RenderingModel<?> parent, info.magnolia.module.templatingkit.functions.STKTemplatingFunctions stkFunctions, info.magnolia.templating.functions.TemplatingFunctions templatingFunctions, info.magnolia.module.templatingkit.STKModule stkModule)
           
 
Method Summary
protected  void filter(List<javax.jcr.Node> itemList)
           
 String getCurrencyFormatting()
           
 String getCurrencyTitle()
           
 Collection<javax.jcr.Node> getItems()
           
protected  int getMaxResults()
           
 Collection<javax.jcr.Node> getOptions(javax.jcr.Node option)
           
 Collection<javax.jcr.Node> getOptionSets(javax.jcr.Node product)
           
 javax.jcr.Node getProduct()
          Gets product selected from the url, using selector.
 String getProductDetailPageLink(javax.jcr.Node product)
           
 TemplateProductPriceBean getProductPriceBean(javax.jcr.Node product)
           
protected  Double getProductPriceByCategory(javax.jcr.Node product, String priceCategoryUUID)
           
 ShoppingCart getShoppingCart()
           
 String getShoppingCartLink()
          returns the link to the shopping cart page based on template category-subcategory.
 javax.jcr.Node getSiteRoot()
           
 javax.jcr.Node getTaxByUUID(String uuid)
           
protected  List<javax.jcr.Node> search()
           
protected  void sort(List<javax.jcr.Node> itemList)
           
 
Methods inherited from class info.magnolia.module.templatingkit.templates.components.AbstractItemListModel
getCategoryName, getPager, getRepository, getSearchRoot, getSubcategoryName
 
Methods inherited from class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel
getSite
 
Methods inherited from class info.magnolia.rendering.model.RenderingModelImpl
execute, getContent, getDef, getDefinition, getNode, getParent, getRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.rendering.model.RenderingModel
execute, getContent, getDefinition, getNode, getParent, getRoot
 

Field Detail

ALLOWED_IMAGE_TYPES

protected static final String[] ALLOWED_IMAGE_TYPES
Constructor Detail

ShopParagraphModel

public ShopParagraphModel(javax.jcr.Node content,
                          info.magnolia.rendering.template.TemplateDefinition definition,
                          info.magnolia.rendering.model.RenderingModel<?> parent,
                          info.magnolia.module.templatingkit.functions.STKTemplatingFunctions stkFunctions,
                          info.magnolia.templating.functions.TemplatingFunctions templatingFunctions,
                          info.magnolia.module.templatingkit.STKModule stkModule)
Method Detail

getShoppingCart

public ShoppingCart getShoppingCart()

getSiteRoot

public javax.jcr.Node getSiteRoot()
Specified by:
getSiteRoot in interface info.magnolia.module.templatingkit.templates.STKRenderingModel<info.magnolia.rendering.template.TemplateDefinition>
Overrides:
getSiteRoot in class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel<info.magnolia.rendering.template.TemplateDefinition>

getProduct

public javax.jcr.Node getProduct()
Gets product selected from the url, using selector.


getProductPriceBean

public TemplateProductPriceBean getProductPriceBean(javax.jcr.Node product)

getOptionSets

public Collection<javax.jcr.Node> getOptionSets(javax.jcr.Node product)

getOptions

public Collection<javax.jcr.Node> getOptions(javax.jcr.Node option)

getCurrencyTitle

public String getCurrencyTitle()

getCurrencyFormatting

public String getCurrencyFormatting()

getTaxByUUID

public javax.jcr.Node getTaxByUUID(String uuid)

getProductPriceByCategory

protected Double getProductPriceByCategory(javax.jcr.Node product,
                                           String priceCategoryUUID)
                                    throws javax.jcr.ValueFormatException,
                                           javax.jcr.RepositoryException
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getShoppingCartLink

public String getShoppingCartLink()
returns the link to the shopping cart page based on template category-subcategory.


getProductDetailPageLink

public String getProductDetailPageLink(javax.jcr.Node product)

filter

protected void filter(List<javax.jcr.Node> itemList)
Specified by:
filter in class info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>

getMaxResults

protected int getMaxResults()
Specified by:
getMaxResults in class info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>

sort

protected void sort(List<javax.jcr.Node> itemList)
Specified by:
sort in class info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>

search

protected List<javax.jcr.Node> search()
                               throws javax.jcr.RepositoryException
Overrides:
search in class info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>
Throws:
javax.jcr.RepositoryException

getItems

public Collection<javax.jcr.Node> getItems()
                                    throws javax.jcr.RepositoryException
Overrides:
getItems in class info.magnolia.module.templatingkit.templates.components.AbstractItemListModel<info.magnolia.rendering.template.TemplateDefinition>
Throws:
javax.jcr.RepositoryException


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.