6/3/2013
1
2
hybris De Develope veloperr Training Part Part II II - Comme Commerce rce
WCMS
1
6/3/2013
3
WCMS Overview DEMO CMS Model
hybris Developer Training Part II - Commerce
What is a WCMS?
WCMS Overview
4
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.
The hybris WCMS stack: storefront cms cockpit
sample storefront
cms library
WCMS Module c ms c or e platform/core
2
6/3/2013
WCMS – What’s part of the hybris WCMS module
WCMS Overview
5
WCMS – What’s part of the hybris WCMS module extension solrfacetsearch promotions
storefront
wishlist
module
external to wcms
WCMS customerreview cms2lib
cmscockpit
cms2
basecommerce
hybris Platform
WCMS: key features
WCMS Overview
6
Websites Content Management System Management of all kinds of pages homepage, information pages, product, category or search pages
Content personalization Based in Context Information Like current user, group, time, product, category
Built-in live editing and previewing Change contents on the fly Testing with different context information
3
6/3/2013
WCMS: key features
WCMS Overview
7
WCMS Overview
8
Key Benefits WCMS Classic components management: paragraph, banner, link, etc.
Common templates for pages Independent of any frontend technology
hybri s WCMS: The basic m odel
Page Templ ates
… 2 column standard
3 column p roduct
brand t emplate
Pages
Homepage
Company Profile
Eizo Monitor
Components
… text
image
link list
text with image
image gallery
4
6/3/2013
The hybris WCMS stack: electronics store
Navigation
WCMS Overview
9
Cart Summary
Rotating Images
Banners
Product Carousel
Footer
The hybris WCMS stack: CMSCockpit
WCMS Overview
10
Shows an abstracted view of the layout Add components
Cart Summary Navigation
Rotating Images Banners
Product Carousel
5
6/3/2013
11
WCMS Overview
DEMO CMS Model
hybris Developer Training Part II - Commerce
Time for a demo..
WCMS Demo
12
Demo will show : The CMS Cockpit Change contents on the fly Locking / synchronization Add new components Live edit for testing Personalized Pages
6
6/3/2013
13
WCMS Overview DEMO
CMS Model
hybris Developer Training Part II - Commerce
The data model..
CMS Model
14
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
7
6/3/2013
WCMS – CMS Component s
CMS Model
17
AbstractCMSComponent
SimpleCMSComponent
CMSLinkComponent
CMSImageComponent
AbstractCMSComponentContainer
CMSParagraphComponent
Custom
CMS Components represent the smallest piece of information that can be displayed on a page
WCMS – PageTemplates
CMS Model
18
CMSItem
PageTemplate 1..*
1..* 1
ContentSlotName
ContentSlotForTemplate
ContentSlot
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
9
6/3/2013
WCMS – Pages
CMS Model
19
PageTemplate 1..*
AbstractPage
ContentPage
CatalogPage
CategoryPage
1..*
1
ContentSlotForPage
ProductPage
ContentSlot
Custom
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
WCMS – CMS Restric tions
CMS Model
20
Platform
AbstractPage
*
CMSCatalog Restriction
Abstract Restriction AbstractCMSComponent
*
CMSProduct Restriction
Catalog
* Product
*
CMSTime Restriction CMSUser Restriction CMSUserGroup Restriction CMSCategory Restriction
User
* UserGroup
* Category
*
Custom
Restrictions can be bound to pages and components
10
6/3/2013
Custom CMS Restrictions (1)
CMS Model
21
Step 1 Type definition
...
Step 2
Restriction evaluator implementation public class CMSWeekDayRestrictionEvaluator implements CMSRestrictionEvaluator
{ @Override public boolean evaluate( final CMSWeekDayRestrictionModel weekDayRestriction, final RestrictionData context) { …
Custom CMS Restrictions (2)
CMS Model
22
Step 3 Evaluator bean definition
...
Step 4 Evaluator mapping bean definition
11
6/3/2013
WCMS - Flow
CMS Model
myshop.com
Browser
23
hybris URL
1.
addSession: SiteModel
CMSSi teFi lt er
/*
2. Spring
Page (default.js p) Tag-Library
PageController for…each
S e r v i c e L a y e r
Slots Tag-Library
for…each
Components 1. Tag-Library
component-xyz.jsp
2. Spring
Component-Ctrl
3.
4.
HTML
WCMS – Controlling the frontend
Data
CMS Model
24
The CMSComponent Tag render()
CMSComponent
Component has its own SpringMVC Controller? no
Delegate to CMSDefaultController Write all editor properties in the model
yes
Delegate to custom ComponentController //Do funky stuff
Return to view .jsp
12
6/3/2013
Controlling the frontend
CMS Model
25
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/MinicartComponentC ontroller?componentUid=MiniCart
This URL calls a MiniCartComponentController directly Note how the shorter lifecycle shows the content delivered for one “piece of content”
26
13