hybris developer training part ii - commerce - module 09 - wcms

13
6/3/2013 1 1 2 hybris Developer Training Part II - Commerce WCMS

Upload: vikas-kumar

Post on 23-Dec-2015

396 views

Category:

Documents


20 download

DESCRIPTION

njnmnmn

TRANSCRIPT

6/3/2013

1

1

2

hybris Developer Training Part II - Commerce

WCMS

6/3/2013

2

3

WCMS OverviewDEMOCMS Model

hybris Developer Training Part II - Commerce

4What is a WCMS?

A web content management system (WCMS) is a software system which provides website authoring, collaboration and administration tools designed to allow users with little knowledge of web programming ... to create and manage the site's content with relative ease.

platform/core

cms core

cms librarycms cockpit

storefront

WCMS Module

sample storefront

The hybris WCMS stack:

WCMS Overview

6/3/2013

3

5

module

WCMS

WCMS – What’s part of the hybris WCMS module

hybris Platform

cms2

cms2lib cmscockpit

storefront

wishlist

promotions

customerreview

solrfacetsearch

extension

external to wcms

basecommerce

WCMS – What’s part of the hybris WCMS module WCMS Overview

6WCMS: key features

Websites Content Management System

Management of all kinds of pageshomepage, information pages, product, category or search pages

Content personalizationBased in Context Information

Like current user, group, time, product, category

Built-in live editing and previewingChange contents on the fly

Testing with different context information

WCMS Overview

6/3/2013

4

7

Key Benefits WCMSClassic components management:paragraph, banner, link, etc.

Common templates for pages

Independent of any frontend technology

WCMS: key features WCMS Overview

8hybris WCMS: The basic model

Page Templates

Components

Pages

2 column standard 3 column product brand template

text image link list text with image image gallery

Homepage Company Profile Eizo Monitor

Homepage

WCMS Overview

6/3/2013

5

9The hybris WCMS stack: electronics store

Rotating Images

Footer

Cart Summary

Product Carousel

Banners

Navigation

WCMS Overview

10The hybris WCMS stack: CMSCockpit

Shows an abstracted view of the layout

Add components

Cart Summary

Banners

Navigation

Rotating Images

Product Carousel

WCMS Overview

6/3/2013

6

11

WCMS Overview

DEMOCMS Model

hybris Developer Training Part II - Commerce

12Time for a demo..

Demo will show :The CMS Cockpit

Change contents on the fly

Locking / synchronization

Add new components

Live edit for testing

Personalized Pages

WCMS Demo

6/3/2013

7

13

WCMS OverviewDEMO

CMS Model

hybris Developer Training Part II - Commerce

14The data model..

Zoomed in version to follow !

A “view model” –a data structure which represents the fundamental model of a page view.

Also contains catalogs and restrictions

CMS Model

6/3/2013

8

15

basecommerce

platform

Catalog

ContentCatalog

BaseStore

CMSSite **

*

PageTemplate ContentSlotForTemplate

CMSItem

1..*

ContentSlotName

1..*

ContentSlot

1

AbstractPage

ContentSlotForPage

CMSRelation

1..*

ContentPage

CatalogPage

CategoryPage ProductPage

Custom

AbstractCMSComponent

SimpleCMSComponent

AbstractCMSComponentContainer

CMSLinkComponent

CMSImageComponent

CMSParagraphComponent Custom

CMSNavigationNode

*

*

AbstractRestriction

CMSProductRestriction

CMSTimeRestriction

CMSUserGroup

Restriction

CMSCategoryRestriction

Custom

Catalog

Product

User

UserGroup

CMSCatalogRestriction

Platform

*

CMSUserRestriction

*

*

Category

CMSItem

The data model.. CMS Model

16WCMS – CMSSite

Assigned to one or more BaseStores

BaseStore defines the product/classification catalogs

ContentCatalog defines the content catalogs

Allows Content Versioning

CMSSite as starting point

basecommerce

platform

Catalog

ContentCatalogBaseStore CMSSite**

*

CMS Model

6/3/2013

9

17WCMS – CMS Components

CMS Components represent the smallest piece of information that can be displayed on a page

AbstractCMSComponent

SimpleCMSComponent AbstractCMSComponentContainer

CMSLinkComponent CMSImageComponent CMSParagraphComponent Custom

CMS Model

18WCMS – PageTemplates

PageTemplate defines ContentSlotNames which are the placeholders for content which applies to all pages with that template

PageTemplates can be assigned with concrete ContentSlots(via the typed relation: ContentSlotForTemplates)

Pages with concrete ContentSlots will display that content automatically. Content is linked, not copied

PageTemplate

ContentSlotName ContentSlotForTemplate ContentSlot

CMSItem

1..* 1..*

1

CMS Model

6/3/2013

10

19WCMS – Pages

A Page represents a single web page

Every Page is bound to exactly one PageTemplate

ContentSlots are the containers for Components

ContentSlots are assigned to the page via the typed relation ContentSlotForPage

PageTemplate

AbstractPage ContentSlotForPage ContentSlot

ContentPage CatalogPage CategoryPage ProductPage Custom

1..*

1..* 1

CMS Model

20WCMS – CMS Restrictions

Restrictions can be bound to pages and components

AbstractPage

AbstractRestriction

AbstractCMSComponent

CMSProductRestriction

CMSTimeRestriction

CMSUserRestriction

CMSUserGroupRestriction

CMSCategoryRestriction

Custom

Catalog

Product

User

UserGroup

Category

CMSCatalogRestriction

Platform

*

*

*

*

*

*

*

CMS Model

6/3/2013

11

21Custom CMS Restrictions (1)

Step 1

Type definition

Step 2

Restriction evaluator implementation

<itemtype code="CMSWeekDayRestriction"extends="AbstractRestriction"  ...

public class CMSWeekDayRestrictionEvaluatorimplements CMSRestrictionEvaluator<CMSWeekDayRestrictionModel>

{@Overridepublic boolean evaluate(

final CMSWeekDayRestrictionModel weekDayRestriction,final RestrictionData context)

{…

CMS Model

22Custom CMS Restrictions (2)

Step 3

Evaluator bean definition

Step 4

Evaluator mapping bean definition

<bean id="cmsWeekDayRestrictionEvaluator"  ...

<bean id="cmsWeekDayRestrictionEvaluatorMapping"class="de.hybris.platform.cms2.servicelayer.services.

evaluator.CMSRestrictionEvaluatorMapping"scope="tenant">

<property name="restrictionTypeCode"value="CMSWeekDayRestriction" />

<property name="restrictionEvaluator"ref="cmsWeekDayRestrictionEvaluator" />

</bean>

CMS Model

6/3/2013

12

23WCMS - Flow

Browser hybrismyshop.com

CMSSiteFilter /*

PageController

Slots

Components

Component-Ctrl

HTML

URL

addSession: SiteModel

Page (default.jsp)

Tag-Library

Tag-Library

1. Tag-Library

Service-L

ayer

Data

component-xyz.jsp

for…each

for…each

2. Spring

2. Spring

1.

3.

4.

CMS Model

24WCMS – Controlling the frontend

The CMSComponent Tag <cms:component/>

render()

Component has its own SpringMVC Controller?

Delegate to CMSDefaultController

Return to view <ComponentName>.jsp

Delegate to custom ComponentController

yes

Write all editor properties in the model //Do funky stuff

CMSComponentCMSComponent

no

CMS Model

6/3/2013

13

25Controlling the frontend

A component is the smallest unit of content we can provide

If we disregard the Site / Page / Slot call stack, and just create the URL for an individual component we get this (for example):

http://electronics.local.9001/store/view/MinicartComponentController?componentUid=MiniCart

This URL calls a MiniCartComponentController directly

Note how the shorter lifecycle shows the content delivered for one “piece of content”

CMS Model

26