SlideShare a Scribd company logo
Extending Studio
eZ Conference 2017 | London | 08.06.2017
About Us
Kamil Musiał
PHP Symfony Developer
@kkmusial
Piotr Nalepa
Senior UI Developer
@sunpietro
We are from eZ Systems Polska | Katowice
What is eZ Platform EE?
eZ Platform EE is the extended version
of eZ Platform containing:
• The Studio,
• Flex Workflow,
• Form Builder,
• Date Based Publishing,
• Recommendation Engine.
The Studio - features
Using the Studio you can:
• Preview live website,
• Create landing pages using blocks,
• Manage landing pages,
• Schedule content display,
• Build forms.
The Studio – live website preview
The Studio – landing page management
The Studio – content scheduling
The Studio – Form Builder
eZ Platform EE – features in the Content Editor
• Flex Workflow,
• Date Based Publishing
Content Editor - Flex Workflow
Content Editor - Date Based Publishing
Date Based Publishing – CRON config
Using ezsystems-cron bundle:
date_based_published.cron.publish_scheduled:
class: '%date_based_published.cron.publish_scheduled.class%'
tags:
- { name: console.command }
- { name: ezpublish.cron.job, schedule: '* * * * *' }
Changes publication status based on a publication date in CRON job.
eZ Platform development stack
PHP (Symfony) & JavaScript (YUI3)
So how to extend eZ Platform EE?
Adding new landing page blocks 1/2
To create new blocks you have to:
• Configure blocks definitions by implementing PHP classes,
• Or, use the YAML configuration (the newest thing!).
Create block in PHP - Twig
(ezblock.html.twig)
{{ text_field }}
Create block in PHP - BlockType class
• implements interface:
EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageM
odelBlockType
or
• extend abstract boilerplate:
EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageM
odelAbstractBlockType
Create block in PHP - BlockType class
Methods to implement:
• getTemplateParameters(BlockValue $blockValue): array,
• createBlockDefinition(): BlockDefinition,
• checkAttributesStructure(array $attributes)
Create block in PHP - BlockType class
getTemplateParameters(BlockValue $blockValue): array
• contains logic,
• return values for view
Create block in PHP - BlockType class
createBlockDefinition(): BlockDefinition()
Returns a definition containing block parameters and array of its attributes:
EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageDe
finitionBlockDefinition
Create block in PHP - BlockType class
BlockAttributeDefinition
Block form contains fields based on attribute type.
Available types:
• integer,
• string,
• text,
• embed,
• select (supports multiple select)
Developer can create new attribute types - look at DemoBundle
Create block in PHP - BlockType class
public function createBlockDefinition()
{
return new BlockDefinition(
'ezblock', // Block type (unique)
'eZ Block', // Name of block
'default', // Block category (currently unsupported)
'ezblock.svg', // icon for thumbnail
[], // extra views that can be hardcoded
[
new BlockAttributeDefinition(
'text_field', // Attribute's ID (unique)
'Text field', // Attribute' name
'text', // Attribute's type
'/[^s]/', // regex for frontend validation
'Sample content', // regex validation fail message
true, // is field required?
false, // should this attribute input be displayed inline to the
previous?
[], // default value
[] // available options (for select)
),
]
);
}
Create block in PHP - BlockType class
checkAttributesStructure(array $attributes)
• advanced attribute validation (after front end validation) - 3rd party APIs, DB calls
etc.
• throws exception for invalid attributes:
EzSystemsLandingPageFieldTypeBundleExceptionInvalidBlockAttributeExcep
tion
Create block in YAML - Twig - no changes
(ezblock.html.twig)
{{ text_field }}
Create block in YAML - Config
Extended Simplified
blocks:
ezblock:
initialize: true
name: ezblock
category: default
thumbnail: ezblock.svg
views:
default:
template:
ezblock.html.twig
name: Default view
attributes:
text_field:
name: Text Field
type: text
regex: /.*/
regexErrorMessage: 'error'
blocks:
ezblock:
initialize: true
thumbnail: ezblock.svg
views: ezblock.html.twig
attributes:
text_field: text
Create block in YAML
Form:
Create block in YAML
Rendered block:
Create block in YAML + PHP
initialize: false
class EzBlock extends ConfigurableBlockType
{
public function getTemplateParameters(BlockValue $blockValue)
{
$attributes = $blockValue->getAttributes();
$attributes['text_field'] .= " Additional info";
return $attributes;
}
}
ez_systems.landing_page.block.ez_block:
class:
EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageModelBlockEzBlock
tags:
- { name: landing_page_field_type.block_type, alias: ezblock }
arguments:
- '@ezpublish.landing_page.block_definition_factory'
Create block in YAML + PHP
Rendered block:
The JS app structure
App
Services +
plugins
Views +
plugins
The communication between JS app layers
• From the bottom to top: addTarget() when creating a new view instance,
• Invoke the fire() method to send an event up to services,
• Using callbacks
Adding new landing page blocks 2/2
To implement custom UI for new blocks you have to (in JavaScript):
• Create a plugin that adds new blocks definitions to landing page creator/editor,
• Create custom views for each new kind of blocks,
• Create custom config popups for each new kind of blocks.
Creating a JS plugin to add new block definition
Y.my.Plugin.AddEzBlockView = Y.Base.create('addEzBlockViewPlugin',
Y.Plugin.Base, [], {
initializer: function () {
this.get('host').addBlock('ezblock', Y.my.EzBlockView);
},
}, {
NS: 'addEzBlockViewPlugin'
});
Y.eZ.PluginRegistry.registerPlugin(Y.my.Plugin.AddEzBlockView, [
'landingPageCreatorView',
'dynamicLandingPageCreatorView',
'dynamicLandingPageEditorView'
]);
Creating a landing page block JS view
Y.my.EzBlockView = Y.Base.create('myEzBlockView', Y.eZS.BlockView, [], {
}, {
ATTRS: {
viewClassName: {
value: 'my.EzBlockView',
readOnly: true
},
editForm: {
valueFn: function () {
return new Y.my.EzBlockConfigFormView({bubbleTargets:
this});
}
}
}
});
Creating a block config popup JS view
Y.my.EzBlockConfigFormView = Y.Base.create('myEzBlockConfigFormView',
Y.eZS.BlockPopupFormView, [], {
anyKindOfMagicMethod: function () {}
});
Adding new fields to Form Builder
To add new fields custom UI to Form Builder you have to (in JavaScript):
• Create a plugin that adds new fields definitions to the Form Builder,
• Create custom views for each new kind of fields,
• Create custom config form for each new kind of fields.
Creating a JS plugin to add new field definition
Y.my.Plugin.AddCustomFieldView =
Y.Base.create('addCustomFieldViewPlugin', Y.Plugin.Base, [], {
initializer: function () {
this.get('host').addFormFieldViewsMapItem('customField',
Y.my.CustomFieldView);
},
}, {
NS: 'addCustomFieldViewPlugin'
});
Y.eZ.PluginRegistry.registerPlugin(Y.my.Plugin.AddCustomFieldView,
['fbFieldsTabView']);
Creating a form builder field JS view
Y.my.CustomFormFieldView = Y.Base.create('customFormFieldView',
Y.fb.BaseFormFieldView, [], {
}, {
ATTRS: {
type: {
value: 'custom'
},
configForm: {
valueFn: function () {
return new Y.my.CustomFormFieldConfigFormView({
bubbleTargets: this,
viewModel: this.get('model')
});
}
},
}
});
Creating a form builder field config form JS view
Y.my.CustomFormFieldConfigFormView =
Y.Base.create('myCustomFormFieldConfigFormView',
Y.fb.FormFieldConfigFormView, [], {
anyKindOfMagicMethod: function () {}
});
eZ Platform EE v2
Additional resources
https://ezplatform.com/Blog/Extending-eZ-Studio-with-new-blocks
https://ezplatform.com/Blog/Learn-how-to-implement-a-custom-UI-for-Landing-Page-block-
configuration-popup
http://yuilibrary.com/yui/docs/api/
Thank you!
Questions?
Contact us on Twitter:
@sunpietro | @kkmusial

More Related Content

What's hot

SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
Sencha
 
Zk doc1
Zk doc1Zk doc1
Zk doc1
Rupalli Das
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
Francisco Ribeiro
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
Joey Kudish
 
Expressjs
ExpressjsExpressjs
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendStefano Zanetti
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
Joey Kudish
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
Cognizant
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
Visual Engineering
 
Utiliser Webpack dans une application Symfony
Utiliser Webpack dans une application SymfonyUtiliser Webpack dans une application Symfony
Utiliser Webpack dans une application Symfony
Alain Hippolyte
 
Two scoops of django 1.6 - Ch7, Ch8
Two scoops of django 1.6  - Ch7, Ch8Two scoops of django 1.6  - Ch7, Ch8
Two scoops of django 1.6 - Ch7, Ch8
flywindy
 
Symfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.jsSymfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.js
X-Coding IT Studio
 
Express JS
Express JSExpress JS
Express JS
Alok Guha
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
David Carr
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
Tim Donohue
 
Creating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemCreating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemAzharul Haque Shohan
 
Geb presentation
Geb presentationGeb presentation
Geb presentation
Ivar Østhus
 
Zend Framework 2 - presentation
Zend Framework 2 - presentationZend Framework 2 - presentation
Zend Framework 2 - presentationyamcsha
 

What's hot (20)

SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
 
Zk doc1
Zk doc1Zk doc1
Zk doc1
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
Expressjs
ExpressjsExpressjs
Expressjs
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
 
Utiliser Webpack dans une application Symfony
Utiliser Webpack dans une application SymfonyUtiliser Webpack dans une application Symfony
Utiliser Webpack dans une application Symfony
 
Two scoops of django 1.6 - Ch7, Ch8
Two scoops of django 1.6  - Ch7, Ch8Two scoops of django 1.6  - Ch7, Ch8
Two scoops of django 1.6 - Ch7, Ch8
 
Symfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.jsSymfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.js
 
Express JS
Express JSExpress JS
Express JS
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
 
Creating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemCreating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login System
 
Geb presentation
Geb presentationGeb presentation
Geb presentation
 
Zend Framework 2 - presentation
Zend Framework 2 - presentationZend Framework 2 - presentation
Zend Framework 2 - presentation
 
Banquet 50
Banquet 50Banquet 50
Banquet 50
 

Similar to Extending Studio

Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...
Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...
Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...
eZ Systems
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
Maurizio Vitale
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in react
Imran Sayed
 
Web Worker, Service Worker and Worklets
Web Worker, Service Worker and WorkletsWeb Worker, Service Worker and Worklets
Web Worker, Service Worker and Worklets
Keshav Gupta
 
Introducing coServ
Introducing coServIntroducing coServ
Introducing coServ
Ben Lue
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
James Thomas
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
 
What's New in Visual Studio 2008
What's New in Visual Studio 2008What's New in Visual Studio 2008
What's New in Visual Studio 2008
Acend Corporate Learning
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
rafaqathussainc077
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with React
Imran Sayed
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
Mark Leusink
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
Claudio Procida
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframework
maltiyadav
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
DataLeader.io
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Anupam Ranku
 

Similar to Extending Studio (20)

Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...
Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...
Extending Studio - Piotr Nalepa & Kamil Musiał - Presentation at eZ Conferenc...
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in react
 
Web Worker, Service Worker and Worklets
Web Worker, Service Worker and WorkletsWeb Worker, Service Worker and Worklets
Web Worker, Service Worker and Worklets
 
Introducing coServ
Introducing coServIntroducing coServ
Introducing coServ
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
What's New in Visual Studio 2008
What's New in Visual Studio 2008What's New in Visual Studio 2008
What's New in Visual Studio 2008
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with React
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframework
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 

More from Piotr Nalepa

Building Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web ComponentsBuilding Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web Components
Piotr Nalepa
 
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
Piotr Nalepa
 
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Piotr Nalepa
 
Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?
Piotr Nalepa
 
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
Piotr Nalepa
 
Semantyka w tworzeniu stron www prezentacja
Semantyka w tworzeniu stron www   prezentacjaSemantyka w tworzeniu stron www   prezentacja
Semantyka w tworzeniu stron www prezentacjaPiotr Nalepa
 

More from Piotr Nalepa (6)

Building Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web ComponentsBuilding Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web Components
 
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
 
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
 
Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?
 
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
 
Semantyka w tworzeniu stron www prezentacja
Semantyka w tworzeniu stron www   prezentacjaSemantyka w tworzeniu stron www   prezentacja
Semantyka w tworzeniu stron www prezentacja
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 

Extending Studio

  • 1. Extending Studio eZ Conference 2017 | London | 08.06.2017
  • 2. About Us Kamil Musiał PHP Symfony Developer @kkmusial Piotr Nalepa Senior UI Developer @sunpietro
  • 3. We are from eZ Systems Polska | Katowice
  • 4. What is eZ Platform EE? eZ Platform EE is the extended version of eZ Platform containing: • The Studio, • Flex Workflow, • Form Builder, • Date Based Publishing, • Recommendation Engine.
  • 5. The Studio - features Using the Studio you can: • Preview live website, • Create landing pages using blocks, • Manage landing pages, • Schedule content display, • Build forms.
  • 6. The Studio – live website preview
  • 7. The Studio – landing page management
  • 8. The Studio – content scheduling
  • 9. The Studio – Form Builder
  • 10. eZ Platform EE – features in the Content Editor • Flex Workflow, • Date Based Publishing
  • 11. Content Editor - Flex Workflow
  • 12. Content Editor - Date Based Publishing
  • 13. Date Based Publishing – CRON config Using ezsystems-cron bundle: date_based_published.cron.publish_scheduled: class: '%date_based_published.cron.publish_scheduled.class%' tags: - { name: console.command } - { name: ezpublish.cron.job, schedule: '* * * * *' } Changes publication status based on a publication date in CRON job.
  • 14. eZ Platform development stack PHP (Symfony) & JavaScript (YUI3)
  • 15. So how to extend eZ Platform EE?
  • 16. Adding new landing page blocks 1/2 To create new blocks you have to: • Configure blocks definitions by implementing PHP classes, • Or, use the YAML configuration (the newest thing!).
  • 17. Create block in PHP - Twig (ezblock.html.twig) {{ text_field }}
  • 18. Create block in PHP - BlockType class • implements interface: EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageM odelBlockType or • extend abstract boilerplate: EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageM odelAbstractBlockType
  • 19. Create block in PHP - BlockType class Methods to implement: • getTemplateParameters(BlockValue $blockValue): array, • createBlockDefinition(): BlockDefinition, • checkAttributesStructure(array $attributes)
  • 20. Create block in PHP - BlockType class getTemplateParameters(BlockValue $blockValue): array • contains logic, • return values for view
  • 21. Create block in PHP - BlockType class createBlockDefinition(): BlockDefinition() Returns a definition containing block parameters and array of its attributes: EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageDe finitionBlockDefinition
  • 22. Create block in PHP - BlockType class BlockAttributeDefinition Block form contains fields based on attribute type. Available types: • integer, • string, • text, • embed, • select (supports multiple select) Developer can create new attribute types - look at DemoBundle
  • 23. Create block in PHP - BlockType class public function createBlockDefinition() { return new BlockDefinition( 'ezblock', // Block type (unique) 'eZ Block', // Name of block 'default', // Block category (currently unsupported) 'ezblock.svg', // icon for thumbnail [], // extra views that can be hardcoded [ new BlockAttributeDefinition( 'text_field', // Attribute's ID (unique) 'Text field', // Attribute' name 'text', // Attribute's type '/[^s]/', // regex for frontend validation 'Sample content', // regex validation fail message true, // is field required? false, // should this attribute input be displayed inline to the previous? [], // default value [] // available options (for select) ), ] ); }
  • 24. Create block in PHP - BlockType class checkAttributesStructure(array $attributes) • advanced attribute validation (after front end validation) - 3rd party APIs, DB calls etc. • throws exception for invalid attributes: EzSystemsLandingPageFieldTypeBundleExceptionInvalidBlockAttributeExcep tion
  • 25. Create block in YAML - Twig - no changes (ezblock.html.twig) {{ text_field }}
  • 26. Create block in YAML - Config Extended Simplified blocks: ezblock: initialize: true name: ezblock category: default thumbnail: ezblock.svg views: default: template: ezblock.html.twig name: Default view attributes: text_field: name: Text Field type: text regex: /.*/ regexErrorMessage: 'error' blocks: ezblock: initialize: true thumbnail: ezblock.svg views: ezblock.html.twig attributes: text_field: text
  • 27. Create block in YAML Form:
  • 28. Create block in YAML Rendered block:
  • 29. Create block in YAML + PHP initialize: false class EzBlock extends ConfigurableBlockType { public function getTemplateParameters(BlockValue $blockValue) { $attributes = $blockValue->getAttributes(); $attributes['text_field'] .= " Additional info"; return $attributes; } } ez_systems.landing_page.block.ez_block: class: EzSystemsLandingPageFieldTypeBundleFieldTypeLandingPageModelBlockEzBlock tags: - { name: landing_page_field_type.block_type, alias: ezblock } arguments: - '@ezpublish.landing_page.block_definition_factory'
  • 30. Create block in YAML + PHP Rendered block:
  • 31. The JS app structure App Services + plugins Views + plugins
  • 32. The communication between JS app layers • From the bottom to top: addTarget() when creating a new view instance, • Invoke the fire() method to send an event up to services, • Using callbacks
  • 33. Adding new landing page blocks 2/2 To implement custom UI for new blocks you have to (in JavaScript): • Create a plugin that adds new blocks definitions to landing page creator/editor, • Create custom views for each new kind of blocks, • Create custom config popups for each new kind of blocks.
  • 34. Creating a JS plugin to add new block definition Y.my.Plugin.AddEzBlockView = Y.Base.create('addEzBlockViewPlugin', Y.Plugin.Base, [], { initializer: function () { this.get('host').addBlock('ezblock', Y.my.EzBlockView); }, }, { NS: 'addEzBlockViewPlugin' }); Y.eZ.PluginRegistry.registerPlugin(Y.my.Plugin.AddEzBlockView, [ 'landingPageCreatorView', 'dynamicLandingPageCreatorView', 'dynamicLandingPageEditorView' ]);
  • 35. Creating a landing page block JS view Y.my.EzBlockView = Y.Base.create('myEzBlockView', Y.eZS.BlockView, [], { }, { ATTRS: { viewClassName: { value: 'my.EzBlockView', readOnly: true }, editForm: { valueFn: function () { return new Y.my.EzBlockConfigFormView({bubbleTargets: this}); } } } });
  • 36. Creating a block config popup JS view Y.my.EzBlockConfigFormView = Y.Base.create('myEzBlockConfigFormView', Y.eZS.BlockPopupFormView, [], { anyKindOfMagicMethod: function () {} });
  • 37. Adding new fields to Form Builder To add new fields custom UI to Form Builder you have to (in JavaScript): • Create a plugin that adds new fields definitions to the Form Builder, • Create custom views for each new kind of fields, • Create custom config form for each new kind of fields.
  • 38. Creating a JS plugin to add new field definition Y.my.Plugin.AddCustomFieldView = Y.Base.create('addCustomFieldViewPlugin', Y.Plugin.Base, [], { initializer: function () { this.get('host').addFormFieldViewsMapItem('customField', Y.my.CustomFieldView); }, }, { NS: 'addCustomFieldViewPlugin' }); Y.eZ.PluginRegistry.registerPlugin(Y.my.Plugin.AddCustomFieldView, ['fbFieldsTabView']);
  • 39. Creating a form builder field JS view Y.my.CustomFormFieldView = Y.Base.create('customFormFieldView', Y.fb.BaseFormFieldView, [], { }, { ATTRS: { type: { value: 'custom' }, configForm: { valueFn: function () { return new Y.my.CustomFormFieldConfigFormView({ bubbleTargets: this, viewModel: this.get('model') }); } }, } });
  • 40. Creating a form builder field config form JS view Y.my.CustomFormFieldConfigFormView = Y.Base.create('myCustomFormFieldConfigFormView', Y.fb.FormFieldConfigFormView, [], { anyKindOfMagicMethod: function () {} });
  • 43. Thank you! Questions? Contact us on Twitter: @sunpietro | @kkmusial