SlideShare a Scribd company logo
1 of 34
Download to read offline
THE SLICK, YAML-BASED

CONFIGURATION BY FILE
IN MAGNOLIA 5.4
#mconf15
Basel, 11 June 2015
Photo Credit:
Mikaël
Geljić
SENIOR SOFTWARE
ENGINEER

MAGNOLIA
@mikaelgeljic
SPECIAL STAGES
Configuration by File, the story
The new configuration (framework)
YAML format and integration
Demo
#registries #definitions #configSources #YAML
CONFIGURATION BY FILE
THE STORY
Photo Credit:
THE MASTER PLAN
Magnolia 5.4, a release for developers
Overarching stories:
- Configure by file (or code)
- Trouble-free and safe configuration
- Develop sites without knowing Java
- Streamline working with resources
#easeOfDevelopment #lightModules
"LIGHT MODULES"
Maven module
<maven-module-name>/
├── pom.xml
└── src/
└── main/
├── java/
└── resources/
├── META-INF/
│ └── magnolia/
│ └── module-name.xml
└── <module-name>/
├── apps/
├── dialogs/
│ └── myDialog.yaml
├── resources/
└── templates/
├── components/
│ ├── myComponent.ftl
│ └── myComponent.yaml
└── pages/
├── myTemplate.ftl
└── myTemplate.yaml

Light module
${magnolia.resources.dir}/
└── <module-name>/
├── apps/
├── dialogs/
│ └── myDialog.yaml
├── resources/
└── templates/
├── components/
│ ├── myComponent.ftl
│ └── myComponent.yaml
└── pages/
├── myTemplate.ftl
└── myTemplate.yaml
Photo Credit:
WHY CONFIG BY FILE?
Hassles with JCR config
Lengthily crafted in the Configuration app
verbose raw JCR exports: bootstrap files
"persisted flavor of config"
- painful while developing (merge changes, wipe repo)
- painful to upgrade, version-handlers
CONFIG BY FILE
A lean, readable format: YAML
Ease of editing
Config files next to template scripts, all in one place
File observation, instant changes
Easier collaboration for dev teams (diff, no import/export)
Greater validation capabilities
Photo Credit:
DATE FIELD CONFIG, BOOTSTRAP FILE
DATE FIELD CONFIG, YAML FILE
THE NEW CONFIGURATION

(FRAMEWORK)
Photo Credit:
REGISTRIES IN MAGNOLIA
Collect various types of elements in the system
- e.g. templates, dialogs, apps
Up to 5.3
- no common ancestor, all duplicated!
- paired with so-called (observing) managers
- knows nothing if bean resolution fails
REGISTRY OUTLOOK (5.3)
JCR
Managers
Node2Bean
Registries
Server
config
Modules
config
JCR Config
app
💩
💩
REGISTRY OUTLOOK (5.4)
JCR
Configuration Sources
File
Node2Bean
Registries
Server
config
Modules
config




Code
{}
Map2Bean
Config app
THE REGISTRY API
Registry
- type()
- metadataBuilder()
- register()
- getProvider()
info.magnolia.config.registry
Metadata
id, module, location
DefinitionProvider
bean, isValid
Raw view
map representation
DEFINITION ID (STRATEGIES)
Reference string glueing definitions together
- e.g. in template dialog: mte:components/textImage
Two approaches
module + relativePath
- e.g. for templates, dialogs
- <sample-module>:pages/article
name
- e.g. for apps, field-types
- pages, assets
Sample Registry impl
@Singleton
public class FieldTypeDefinitionRegistry extends
AbstractRegistry<FieldTypeDefinition> {
@Override
public DefinitionType type() {
return DefinitionTypes.FIELD_TYPE;
}
@Override
public DefinitionMetadataBuilder newMetadataBuilder() {
return DefinitionMetadataBuilder.usingNameAsId();
}
}
THE CONFIGURATION SOURCE
Replaces old managers
Binds itself to a Registry
ConfigurationSourceFactory
• JCR / YAML default binding settings (conventions)
e.g. in module start
configSourceFactory.yaml().bindWithDefaults(dialogRegistry);
MINISTER OF REGISTRIES
RegistryFacade
Query definitions by module, source or type
Guice multi-bindings to the rescue
RegistryFacade
info.magnolia.config.registry
TemplateRegistry DialogRegistry AppRegistry
THE CONFIG OVERVIEW APP
SHOWTIME
Photo Credit:
SHOWTIME
Photo Credit:
YAML FORMAT AND INTEGRATION
Photo Credit:
YAML: THE SPEC
yaml.org/spec/1.1/
indentation over enclosure marks
scalars, sequences, mappings
key : value
title : Magnolia 5.4
year : 2015
boolean : true

F1Teams:
- Ferrari
- Williams
- Lotus

subApps:
browser:
class: (...)
actions:
addItem : (...)
editItem: (...)
imageProvider:
class: (...)
INTEGRATION WITH CONFIG
Collect "resources" by matching pattern
- e.g. <module>/<deftype>/<relPath>/<name>.yaml
NamedDefinition
- name property is inferred from file name
- may still be overridden in file
- e.g. <module>/apps/resources.yaml
Map2Bean
YAML VS. JCR
YAML JCR
Map2Bean Node2Bean
bean instantiation as per target-types, class property, type-mappings
!include, references, merge keys extends
sequences, mappings nodes/sub-nodes for both lists/maps
LISTS VS. MAPS
public interface TabDefinition {
List<FieldDefinition> getFields();
}
fields:
- name: title
class: info.magnolia.ui.form.field.definition.TextFieldDefinition
- name: text
class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
Photo Credit:
LISTS VS. MAPS
public interface DialogDefinition {
Map<String, ActionDefinition> getActions();
}
actions:
commit:
class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
cancel:
class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition
Photo Credit:
ADVANCED YAML
document references
- same document only
browser
contentConnector: &contentConnector
implementationClass: info.magnolia.resources.app.ResourcesContentConnector
detail:
contentConnector: *contentConnector
ADVANCED YAML
merge keys
- good for appending
- not suited for merging nested structures
fields:
- &codeField
name: content
class: info.magnolia.ui.form.field.definition.CodeFieldDefinition
fileNameProperty: name
height: 500
- <<: *codeField
readOnly: true
MODULARIZING YAML FILES
The !include directive
- Magnolia-specific, at YAML-reader level
- caters to external file reference
columns:
- name: name
class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
- !include /resources-app/generic/column/originName.yaml
THE JOURNEY ONLY BEGINS
Updated selected registries so far
- renderers, templates
- dialogs, apps, fieldTypes, mediaeditors, messageViews
Will move more typical configurations to registries
- e.g. appLauncherLayout, server config
Will productize and bundle the Config Overview app
How about auto-suggest?
THANK YOU!
QUESTIONS?
Photo Credit:
@mikaelgeljic
#mconf15
Basel, 11 June 2015

More Related Content

Viewers also liked

Docker OpenStack Cloud Foundry
Docker OpenStack Cloud FoundryDocker OpenStack Cloud Foundry
Docker OpenStack Cloud FoundryAnimesh Singh
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on DockerBen Hall
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionRobert Reiz
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 
Intro to Codefresh YAML
Intro to Codefresh YAML  Intro to Codefresh YAML
Intro to Codefresh YAML Codefresh
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java DevelopersNGINX, Inc.
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleRobert Reiz
 

Viewers also liked (8)

Docker OpenStack Cloud Foundry
Docker OpenStack Cloud FoundryDocker OpenStack Cloud Foundry
Docker OpenStack Cloud Foundry
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Intro to Codefresh YAML
Intro to Codefresh YAML  Intro to Codefresh YAML
Intro to Codefresh YAML
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & Ansible
 

Similar to The slick YAML based configuration by file in Magnolia 5.4

Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemTim Ellison
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Alessandro Molina
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest servicesIoan Eugen Stan
 
Spring first in Magnolia CMS - Spring I/O 2015
Spring first in Magnolia CMS - Spring I/O 2015Spring first in Magnolia CMS - Spring I/O 2015
Spring first in Magnolia CMS - Spring I/O 2015Tobias Mattsson
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfoliocummings49
 
Storage Plug-ins
Storage Plug-ins Storage Plug-ins
Storage Plug-ins buildacloud
 
CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara NetApp
 
Spring and Web Content Management
Spring and Web Content ManagementSpring and Web Content Management
Spring and Web Content ManagementZak Greant
 
Getting Healthy with Magnolia, Blossom and Spring
Getting Healthy with Magnolia, Blossom and SpringGetting Healthy with Magnolia, Blossom and Spring
Getting Healthy with Magnolia, Blossom and SpringMagnolia
 
Silverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternSilverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternDerek Novavi
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom Joshua Long
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
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
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsArtur Cistov
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails DevelopersEdureka!
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patternsamitarcade
 

Similar to The slick YAML based configuration by file in Magnolia 5.4 (20)

Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module System
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA Austria
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Little Gems in TYPO3 v12
Little Gems in TYPO3 v12Little Gems in TYPO3 v12
Little Gems in TYPO3 v12
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
 
Spring first in Magnolia CMS - Spring I/O 2015
Spring first in Magnolia CMS - Spring I/O 2015Spring first in Magnolia CMS - Spring I/O 2015
Spring first in Magnolia CMS - Spring I/O 2015
 
Slim3 quick start
Slim3 quick startSlim3 quick start
Slim3 quick start
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfolio
 
Storage Plug-ins
Storage Plug-ins Storage Plug-ins
Storage Plug-ins
 
CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara
 
Spring and Web Content Management
Spring and Web Content ManagementSpring and Web Content Management
Spring and Web Content Management
 
Getting Healthy with Magnolia, Blossom and Spring
Getting Healthy with Magnolia, Blossom and SpringGetting Healthy with Magnolia, Blossom and Spring
Getting Healthy with Magnolia, Blossom and Spring
 
Silverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternSilverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel Pattern
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
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!
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery Internals
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patterns
 

More from Magnolia

The SEO Workflow
The SEO WorkflowThe SEO Workflow
The SEO WorkflowMagnolia
 
Magnolia 6 release walkthrough
Magnolia 6 release walkthroughMagnolia 6 release walkthrough
Magnolia 6 release walkthroughMagnolia
 
Buzzword bingo: The real deal behind omnichannel, personalization and headless
Buzzword bingo: The real deal behind  omnichannel, personalization and headlessBuzzword bingo: The real deal behind  omnichannel, personalization and headless
Buzzword bingo: The real deal behind omnichannel, personalization and headlessMagnolia
 
Developing Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficientlyDeveloping Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficientlyMagnolia
 
Integrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer ExperienceIntegrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer ExperienceMagnolia
 
Customer Engagement in the Digital Era
Customer Engagement in the Digital EraCustomer Engagement in the Digital Era
Customer Engagement in the Digital EraMagnolia
 
The Age of the IOT & Digital Business
The Age of the IOT & Digital BusinessThe Age of the IOT & Digital Business
The Age of the IOT & Digital BusinessMagnolia
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureMagnolia
 
A modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at AtlassianA modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at AtlassianMagnolia
 
Magnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynoteMagnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynoteMagnolia
 
Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4Magnolia
 
Launching Magnolia on demand
Launching Magnolia on demandLaunching Magnolia on demand
Launching Magnolia on demandMagnolia
 
Front-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites fasterFront-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites fasterMagnolia
 
Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?Magnolia
 
Magnolia and the IOT
Magnolia and the IOTMagnolia and the IOT
Magnolia and the IOTMagnolia
 
Internationalization for globalized enterprise websites
Internationalization for globalized enterprise websitesInternationalization for globalized enterprise websites
Internationalization for globalized enterprise websitesMagnolia
 
The new visana website how to fit a square peg into a round hole
The new visana website   how to fit a square peg into a round holeThe new visana website   how to fit a square peg into a round hole
The new visana website how to fit a square peg into a round holeMagnolia
 
Solving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approachSolving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approachMagnolia
 
Extending Magnolia with our solutions
Extending Magnolia with our solutionsExtending Magnolia with our solutions
Extending Magnolia with our solutionsMagnolia
 
Boost your online e commerce with magnolia
Boost your online e commerce with magnoliaBoost your online e commerce with magnolia
Boost your online e commerce with magnoliaMagnolia
 

More from Magnolia (20)

The SEO Workflow
The SEO WorkflowThe SEO Workflow
The SEO Workflow
 
Magnolia 6 release walkthrough
Magnolia 6 release walkthroughMagnolia 6 release walkthrough
Magnolia 6 release walkthrough
 
Buzzword bingo: The real deal behind omnichannel, personalization and headless
Buzzword bingo: The real deal behind  omnichannel, personalization and headlessBuzzword bingo: The real deal behind  omnichannel, personalization and headless
Buzzword bingo: The real deal behind omnichannel, personalization and headless
 
Developing Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficientlyDeveloping Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficiently
 
Integrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer ExperienceIntegrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer Experience
 
Customer Engagement in the Digital Era
Customer Engagement in the Digital EraCustomer Engagement in the Digital Era
Customer Engagement in the Digital Era
 
The Age of the IOT & Digital Business
The Age of the IOT & Digital BusinessThe Age of the IOT & Digital Business
The Age of the IOT & Digital Business
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices Architecture
 
A modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at AtlassianA modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at Atlassian
 
Magnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynoteMagnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynote
 
Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4
 
Launching Magnolia on demand
Launching Magnolia on demandLaunching Magnolia on demand
Launching Magnolia on demand
 
Front-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites fasterFront-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites faster
 
Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?
 
Magnolia and the IOT
Magnolia and the IOTMagnolia and the IOT
Magnolia and the IOT
 
Internationalization for globalized enterprise websites
Internationalization for globalized enterprise websitesInternationalization for globalized enterprise websites
Internationalization for globalized enterprise websites
 
The new visana website how to fit a square peg into a round hole
The new visana website   how to fit a square peg into a round holeThe new visana website   how to fit a square peg into a round hole
The new visana website how to fit a square peg into a round hole
 
Solving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approachSolving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approach
 
Extending Magnolia with our solutions
Extending Magnolia with our solutionsExtending Magnolia with our solutions
Extending Magnolia with our solutions
 
Boost your online e commerce with magnolia
Boost your online e commerce with magnoliaBoost your online e commerce with magnolia
Boost your online e commerce with magnolia
 

Recently uploaded

The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 

Recently uploaded (20)

The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 

The slick YAML based configuration by file in Magnolia 5.4

  • 1. THE SLICK, YAML-BASED
 CONFIGURATION BY FILE IN MAGNOLIA 5.4 #mconf15 Basel, 11 June 2015 Photo Credit:
  • 3. SPECIAL STAGES Configuration by File, the story The new configuration (framework) YAML format and integration Demo #registries #definitions #configSources #YAML
  • 5. THE MASTER PLAN Magnolia 5.4, a release for developers Overarching stories: - Configure by file (or code) - Trouble-free and safe configuration - Develop sites without knowing Java - Streamline working with resources #easeOfDevelopment #lightModules
  • 6. "LIGHT MODULES" Maven module <maven-module-name>/ ├── pom.xml └── src/ └── main/ ├── java/ └── resources/ ├── META-INF/ │ └── magnolia/ │ └── module-name.xml └── <module-name>/ ├── apps/ ├── dialogs/ │ └── myDialog.yaml ├── resources/ └── templates/ ├── components/ │ ├── myComponent.ftl │ └── myComponent.yaml └── pages/ ├── myTemplate.ftl └── myTemplate.yaml
 Light module ${magnolia.resources.dir}/ └── <module-name>/ ├── apps/ ├── dialogs/ │ └── myDialog.yaml ├── resources/ └── templates/ ├── components/ │ ├── myComponent.ftl │ └── myComponent.yaml └── pages/ ├── myTemplate.ftl └── myTemplate.yaml
  • 7. Photo Credit: WHY CONFIG BY FILE? Hassles with JCR config Lengthily crafted in the Configuration app verbose raw JCR exports: bootstrap files "persisted flavor of config" - painful while developing (merge changes, wipe repo) - painful to upgrade, version-handlers
  • 8. CONFIG BY FILE A lean, readable format: YAML Ease of editing Config files next to template scripts, all in one place File observation, instant changes Easier collaboration for dev teams (diff, no import/export) Greater validation capabilities Photo Credit:
  • 9. DATE FIELD CONFIG, BOOTSTRAP FILE
  • 10. DATE FIELD CONFIG, YAML FILE
  • 12. REGISTRIES IN MAGNOLIA Collect various types of elements in the system - e.g. templates, dialogs, apps Up to 5.3 - no common ancestor, all duplicated! - paired with so-called (observing) managers - knows nothing if bean resolution fails
  • 14. REGISTRY OUTLOOK (5.4) JCR Configuration Sources File Node2Bean Registries Server config Modules config 
 
 Code {} Map2Bean Config app
  • 15. THE REGISTRY API Registry - type() - metadataBuilder() - register() - getProvider() info.magnolia.config.registry Metadata id, module, location DefinitionProvider bean, isValid Raw view map representation
  • 16. DEFINITION ID (STRATEGIES) Reference string glueing definitions together - e.g. in template dialog: mte:components/textImage Two approaches module + relativePath - e.g. for templates, dialogs - <sample-module>:pages/article name - e.g. for apps, field-types - pages, assets
  • 17. Sample Registry impl @Singleton public class FieldTypeDefinitionRegistry extends AbstractRegistry<FieldTypeDefinition> { @Override public DefinitionType type() { return DefinitionTypes.FIELD_TYPE; } @Override public DefinitionMetadataBuilder newMetadataBuilder() { return DefinitionMetadataBuilder.usingNameAsId(); } }
  • 18. THE CONFIGURATION SOURCE Replaces old managers Binds itself to a Registry ConfigurationSourceFactory • JCR / YAML default binding settings (conventions) e.g. in module start configSourceFactory.yaml().bindWithDefaults(dialogRegistry);
  • 19. MINISTER OF REGISTRIES RegistryFacade Query definitions by module, source or type Guice multi-bindings to the rescue RegistryFacade info.magnolia.config.registry TemplateRegistry DialogRegistry AppRegistry
  • 23. YAML FORMAT AND INTEGRATION Photo Credit:
  • 24. YAML: THE SPEC yaml.org/spec/1.1/ indentation over enclosure marks scalars, sequences, mappings key : value title : Magnolia 5.4 year : 2015 boolean : true
 F1Teams: - Ferrari - Williams - Lotus
 subApps: browser: class: (...) actions: addItem : (...) editItem: (...) imageProvider: class: (...)
  • 25. INTEGRATION WITH CONFIG Collect "resources" by matching pattern - e.g. <module>/<deftype>/<relPath>/<name>.yaml NamedDefinition - name property is inferred from file name - may still be overridden in file - e.g. <module>/apps/resources.yaml Map2Bean
  • 26. YAML VS. JCR YAML JCR Map2Bean Node2Bean bean instantiation as per target-types, class property, type-mappings !include, references, merge keys extends sequences, mappings nodes/sub-nodes for both lists/maps
  • 27. LISTS VS. MAPS public interface TabDefinition { List<FieldDefinition> getFields(); } fields: - name: title class: info.magnolia.ui.form.field.definition.TextFieldDefinition - name: text class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition Photo Credit:
  • 28. LISTS VS. MAPS public interface DialogDefinition { Map<String, ActionDefinition> getActions(); } actions: commit: class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition cancel: class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition Photo Credit:
  • 29. ADVANCED YAML document references - same document only browser contentConnector: &contentConnector implementationClass: info.magnolia.resources.app.ResourcesContentConnector detail: contentConnector: *contentConnector
  • 30. ADVANCED YAML merge keys - good for appending - not suited for merging nested structures fields: - &codeField name: content class: info.magnolia.ui.form.field.definition.CodeFieldDefinition fileNameProperty: name height: 500 - <<: *codeField readOnly: true
  • 31. MODULARIZING YAML FILES The !include directive - Magnolia-specific, at YAML-reader level - caters to external file reference columns: - name: name class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition - !include /resources-app/generic/column/originName.yaml
  • 32.
  • 33. THE JOURNEY ONLY BEGINS Updated selected registries so far - renderers, templates - dialogs, apps, fieldTypes, mediaeditors, messageViews Will move more typical configurations to registries - e.g. appLauncherLayout, server config Will productize and bundle the Config Overview app How about auto-suggest?