SlideShare a Scribd company logo
What is Diazo?

            Douwe van der Meij

   Goldmund, Wyldebeast & Wunderliebe
vandermeij@gw20e.com
@douwevandermeij
Introduction
Diazo
● With Diazo you can theme websites
  ○ Your own website
  ○ Someone else's website
  ○ Any website
    ■ On any technology
How?
Diazo
● Website HTML
  ○ Content provider
● Design HTML
  ○ Theme provider


● Together:
  ○ Themed website
Diazo
● All about merging (X)HTML
  ○ In a convenient way
Why (this presentation)?
● Legacy websites
● Legacy HTML templates
● New era of front-end "frameworks"
  ○ Media queries
    ■ Twitter Bootstrap
    ■ Skeleton
● Improved MVC
● Responsibility
● Flexibility
Background
Diazo concept




                http://docs.diazo.org/en/latest/index.html
Model Driven Engineering
● Ever heard of MDE?
Metamodeling
● Meta Object Facility (MOF)
  ○ Proposed by OMG                                              Metametamodel
                                                        M3:
● MOF metamodeling stack                                             level


                                                        M2:      Metamodel level



                                                        M1:         Model level



                                                        M0:          Real world




               Object Management Group (OMG). (2002, april 3). Meta Object Facility (MOF) Specification.
Metamodeling
● Mappings

      M3:      EBNF       M3:       XML



      M2:   Programming   M2:   XML schema
              language


      M1:      Code       M1:   XML document



      M0:    Real world   M0:    Real world
Model transformations

                                                  Transformation
                                                     language

                                                             written in

                                    uses          Transformation           uses
            Metamodel A                                                                    Metamodel B
                                                   specification

                      instance of                            executed by                             instance of


                                                  Transformation
               Model A                                                                        Model B
                                    input             engine               output
         source                                                                                       target



Kurtev, I. (2008). State of the Art of QVT: A Model Transformation Language Standard. In Applications of Graph Transformations with
                                                     Industrial Relevance (Vol. 5088/2008, pp. 377‐393). Springer Berlin / Heidelberg.
Model transformations

M2:                 Transformation
      Metamodel A                    Metamodel B
                       language




M1:                 Transformation
        Model A      specification     Model B




M0:                 Transformation
                        engine
Model transformations
M3:                             Metametamodel

                  conforms to                        conforms to
                                       conforms to

M2:                             Transformation
      Metamodel A                                              Metamodel B
                                   language




M1:                             Transformation
        Model A                  specification                     Model B




M0:                             Transformation
                                    engine
Model transformations
M3:                      XML          ● Traditional XSLT

M2:   HTML theme A        XSL            HTML theme B




M1:                  Transformation
       Website A      specification       Website B




M0:                  Transformation
                         engine
Model transformations
M3:                       XML




      HTML theme A
M2:    HTML theme A        XSL         HTML theme B




       Website A      Transformation
M1:     Website A                       Website B
                       specification




M0:                   Transformation
                          engine
Diazo according to MDE
M3:                       XML




      HTML theme A
M2:                    Diazo syntax   HTML theme B
       HTML theme B



      Content site A
M1:                    Diazo rules      Website
        Theme site B



M0:                       Diazo
Diazo explained
● Two HTML sites
  ○ A content system
  ○ A theme
● One set of rules

● Regardless of pre-processors
  ○ Underlying dynamic systems
Why should we use it?
Case 1
Designers vs. developers
Designers
● At some point a designer delivers a design
  ○ Drawing (PSD)
  ○ Sliced / not sliced
  ○ HTML + CSS + JS
Developers
● Develop features
● Minimal / functional design

● Integrate the design into the application
   ○ Convert HTML pages into templates (Django)
   ○ Alter existing CSS (Plone)
Responsibility
● The designer delivers HTML + CSS

● Problem: Clearly in CSS
  ○ Designer is responsible
  ○ A developer will fix the problem


● Result:
  ○ Developer is responsible
Model View Controller


                         Templates
        View
                            Code
                        representation
      Controller

       Model
Model View Controller

                        View

                        Diazo

   application                         design


                 View           View

         Controller

            Model
Diazo stack
● An extra level of abstraction

● Diazo offers an interface between designers
  and developers
Case 2
Re-style an existing website
● The existing website works perfectly

● Possible problems when re-styling (the old
  way):
  ○ Risk in losing functionality
  ○ Website is written in another language
  ○ No templates
Re-style an existing website
● Diazo only needs the HTML output of the
  existing website

● The existing website remains available
● Easy re-style again with Diazo
● Multiple designs for a single website, at the
  same time
Tooling
Plone themes
● Download the example themes
  ○ https://intranet.gw20e.com/diazo-themes
  ○ https://intranet.gw20e.com/new-diazo-theme
Plone
Plone.app.theming
Plone.app.theming
Plone.app.theming
Plone.app.theming
Plone.app.theming
Plone.app.theming
Plone.app.theming
Diazo replace rule

  <replace
     theme="//div[@id='content']/div[1]/h2/a"
     css:content="h1#parent-fieldname-title"
     />
Is it really that simple?
Unfortunately not...
Advanced Diazo
● Be careful with your selectors

     <replace
        theme="//div[@id='content']/div[1]/h2/a"
        css:content="h1#parent-fieldname-title"
        />
Advanced Diazo
● Fine tune your rules

  <replace
     theme="//div[@id='content']/div[1]/h2/a"
     css:content="h1#parent-fieldname-title"
     />


  <replace
     theme-children="//div[@id='content']/div[1]/h2"
     content="//h1[@id='parent-fieldname-title']/text()"
     />
Advanced Diazo
● Fine tune your rules

  <replace
     theme="//div[@id='content']/div[1]/h2/a"
     css:content="h1#parent-fieldname-title"
     />


  <replace
     theme-children="//div[@id='content']/div[1]/h2"
     content="//h1[@id='parent-fieldname-title']/text()"
     />
Advanced Diazo
Changing the navigation
         tabs
Advanced Diazo



<ul>
   <li   class="current_page_item"><a href="#">Homepage</a></li>
   <li   class=""><a href="#">Services</a></li>
   <li   class=""><a href="#">Portfolio</a></li>
   <li   class=""><a href="#">About</a></li>
   <li   class=""><a href="#">Contact</a></li>
</ul>
Advanced Diazo



  <ul>
     <li   class="selected"><a href="#">Home</a></li>
     <li   class="plain"><a href="#">News</a></li>
     <li   class="plain"><a href="#">Events</a></li>
     <li   class="plain"><a href="#">Users</a></li>
  </ul>
Advanced Diazo
● The easy way
     <replace
        css:theme="div#menu ul"
        css:content="ul#portal-globalnav"
        />




● Add extra CSS (file)
  ○ Class "selected" → "current_page_item"
Advanced Diazo
● The advanced way
   ○ http://pastebin.com/4HaG3KRx
<replace css:theme-children="div#menu ul">
   <xsl:for-each select="//ul[@id='portal-globalnav']/li">
       <xsl:element name="li">
          <xsl:if test="./@class = 'selected'">
              <xsl:attribute name="class">
                 current_page_item
              </xsl:attribute>
          </xsl:if>
          <xsl:copy-of select="./a" />
       </xsl:element>
   </xsl:for-each>
</replace>
                          ● No extra CSS needed
Conclusion
Conclusion
● XSLT wrapper
   ○ XSLT reborn
● Seamless integration
   ○ Proxy all your websites
● Higher level of abstraction
● Fallback to regular XSLT
   ○ If all else fails
● State-of-the-art technology
   ○ Lack of tooling
   ○ Widely adopted in the Plone community
Future work
Future work
● Feature requests / bugs
  ○ Filter out comments in XSL
  ○ Easier replace rules for dynamic elements while
    preserving theme attributes
  ○ More visual way to create rules
    ■ Also apart from Plone.app.theming
  ○ <xsl:template> doesn't work in embedded
    <rules>
● Sprints
● Fork it
  ○ https://github.com/plone/diazo
Additional workshop
       content
Creating a new Diazo
       theme
Create a new Diazo theme
● Go to:
  ○ http://www.freecsstemplates.org/
● Pick one!
Create a new Diazo theme
● Unzip the file
● Open the folder
● Create the following files:
   ○ manifest.cfg
   ○ rules.xml
   ○ preview.png (optional)
Create a new Diazo theme
● Zip the folder
Plone.app.theming
Plone themes
● Download the new example theme
  ○ https://intranet.gw20e.com/new-diazo-theme
Mark's blog
Blog article
● Mark van Lent wrote a blog article about the
  workshop
  ○ http://www.vlent.nl/weblog/2012/12/14/workshop-
    theming-with-diazo/

More Related Content

Similar to What is diazo

2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch
IBM
 
Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...
Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...
Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...
majid lotfinia
 
Cg 2011
Cg 2011Cg 2011
Cg 2011
ClarkTony
 
Model-Driven Software Engineering in Practice - Chapter 10 - Managing models
Model-Driven Software Engineering in Practice - Chapter 10 - Managing modelsModel-Driven Software Engineering in Practice - Chapter 10 - Managing models
Model-Driven Software Engineering in Practice - Chapter 10 - Managing models
Jordi Cabot
 
QtModeling - bringing metamodeling features into the KDE world
QtModeling - bringing metamodeling features into the KDE worldQtModeling - bringing metamodeling features into the KDE world
QtModeling - bringing metamodeling features into the KDE world
Sandro Andrade
 
CityGML Integration Into the ArcGIS Platform
CityGML Integration Into the ArcGIS PlatformCityGML Integration Into the ArcGIS Platform
CityGML Integration Into the ArcGIS Platform
Safe Software
 
Cleaning up Sitecore Controllers
Cleaning up Sitecore ControllersCleaning up Sitecore Controllers
Cleaning up Sitecore Controllers
Tobias Studer
 
Testing Model Transformations
Testing Model TransformationsTesting Model Transformations
Testing Model Transformations
miso_uam
 
Blender for ArchViz.pdf
Blender for ArchViz.pdfBlender for ArchViz.pdf
Blender for ArchViz.pdf
shan_1900
 
What's Next for MLflow in 2019
What's Next for MLflow in 2019What's Next for MLflow in 2019
What's Next for MLflow in 2019
Anyscale
 
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Marco Brambilla
 
Sig A&D - MDA
Sig A&D - MDASig A&D - MDA
Sig A&D - MDA
David Meijers
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
Horacio Gonzalez
 
Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED
NA000000
 
Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016
Karthik Murugesan
 
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
PAPIs.io
 
Web technologies: Model Driven Engineering
Web technologies: Model Driven EngineeringWeb technologies: Model Driven Engineering
Web technologies: Model Driven Engineering
Piero Fraternali
 
Migrating from Magento 1 to Magento 2
Migrating from Magento 1 to Magento 2Migrating from Magento 1 to Magento 2
Migrating from Magento 1 to Magento 2
Matthias Glitzner-Zeis
 
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroRESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
PyData
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Yury Kisliak
 

Similar to What is diazo (20)

2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch
 
Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...
Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...
Model-To-Text Transformation Language chapter 9 – J Cabot model driven engine...
 
Cg 2011
Cg 2011Cg 2011
Cg 2011
 
Model-Driven Software Engineering in Practice - Chapter 10 - Managing models
Model-Driven Software Engineering in Practice - Chapter 10 - Managing modelsModel-Driven Software Engineering in Practice - Chapter 10 - Managing models
Model-Driven Software Engineering in Practice - Chapter 10 - Managing models
 
QtModeling - bringing metamodeling features into the KDE world
QtModeling - bringing metamodeling features into the KDE worldQtModeling - bringing metamodeling features into the KDE world
QtModeling - bringing metamodeling features into the KDE world
 
CityGML Integration Into the ArcGIS Platform
CityGML Integration Into the ArcGIS PlatformCityGML Integration Into the ArcGIS Platform
CityGML Integration Into the ArcGIS Platform
 
Cleaning up Sitecore Controllers
Cleaning up Sitecore ControllersCleaning up Sitecore Controllers
Cleaning up Sitecore Controllers
 
Testing Model Transformations
Testing Model TransformationsTesting Model Transformations
Testing Model Transformations
 
Blender for ArchViz.pdf
Blender for ArchViz.pdfBlender for ArchViz.pdf
Blender for ArchViz.pdf
 
What's Next for MLflow in 2019
What's Next for MLflow in 2019What's Next for MLflow in 2019
What's Next for MLflow in 2019
 
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...
 
Sig A&D - MDA
Sig A&D - MDASig A&D - MDA
Sig A&D - MDA
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
 
Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED
 
Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016
 
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
 
Web technologies: Model Driven Engineering
Web technologies: Model Driven EngineeringWeb technologies: Model Driven Engineering
Web technologies: Model Driven Engineering
 
Migrating from Magento 1 to Magento 2
Migrating from Magento 1 to Magento 2Migrating from Magento 1 to Magento 2
Migrating from Magento 1 to Magento 2
 
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroRESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 

Recently uploaded

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
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
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.
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
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
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
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
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 

Recently uploaded (20)

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
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
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
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
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
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 

What is diazo

  • 1. What is Diazo? Douwe van der Meij Goldmund, Wyldebeast & Wunderliebe vandermeij@gw20e.com @douwevandermeij
  • 3. Diazo ● With Diazo you can theme websites ○ Your own website ○ Someone else's website ○ Any website ■ On any technology
  • 5. Diazo ● Website HTML ○ Content provider ● Design HTML ○ Theme provider ● Together: ○ Themed website
  • 6. Diazo ● All about merging (X)HTML ○ In a convenient way
  • 7. Why (this presentation)? ● Legacy websites ● Legacy HTML templates ● New era of front-end "frameworks" ○ Media queries ■ Twitter Bootstrap ■ Skeleton ● Improved MVC ● Responsibility ● Flexibility
  • 9. Diazo concept http://docs.diazo.org/en/latest/index.html
  • 10. Model Driven Engineering ● Ever heard of MDE?
  • 11. Metamodeling ● Meta Object Facility (MOF) ○ Proposed by OMG Metametamodel M3: ● MOF metamodeling stack level M2: Metamodel level M1: Model level M0: Real world Object Management Group (OMG). (2002, april 3). Meta Object Facility (MOF) Specification.
  • 12. Metamodeling ● Mappings M3: EBNF M3: XML M2: Programming M2: XML schema language M1: Code M1: XML document M0: Real world M0: Real world
  • 13. Model transformations Transformation language written in uses Transformation uses Metamodel A Metamodel B specification instance of executed by instance of Transformation Model A Model B input engine output source target Kurtev, I. (2008). State of the Art of QVT: A Model Transformation Language Standard. In Applications of Graph Transformations with Industrial Relevance (Vol. 5088/2008, pp. 377‐393). Springer Berlin / Heidelberg.
  • 14. Model transformations M2: Transformation Metamodel A Metamodel B language M1: Transformation Model A specification Model B M0: Transformation engine
  • 15. Model transformations M3: Metametamodel conforms to conforms to conforms to M2: Transformation Metamodel A Metamodel B language M1: Transformation Model A specification Model B M0: Transformation engine
  • 16. Model transformations M3: XML ● Traditional XSLT M2: HTML theme A XSL HTML theme B M1: Transformation Website A specification Website B M0: Transformation engine
  • 17. Model transformations M3: XML HTML theme A M2: HTML theme A XSL HTML theme B Website A Transformation M1: Website A Website B specification M0: Transformation engine
  • 18. Diazo according to MDE M3: XML HTML theme A M2: Diazo syntax HTML theme B HTML theme B Content site A M1: Diazo rules Website Theme site B M0: Diazo
  • 19. Diazo explained ● Two HTML sites ○ A content system ○ A theme ● One set of rules ● Regardless of pre-processors ○ Underlying dynamic systems
  • 20. Why should we use it?
  • 23. Designers ● At some point a designer delivers a design ○ Drawing (PSD) ○ Sliced / not sliced ○ HTML + CSS + JS
  • 24. Developers ● Develop features ● Minimal / functional design ● Integrate the design into the application ○ Convert HTML pages into templates (Django) ○ Alter existing CSS (Plone)
  • 25. Responsibility ● The designer delivers HTML + CSS ● Problem: Clearly in CSS ○ Designer is responsible ○ A developer will fix the problem ● Result: ○ Developer is responsible
  • 26. Model View Controller Templates View Code representation Controller Model
  • 27. Model View Controller View Diazo application design View View Controller Model
  • 28. Diazo stack ● An extra level of abstraction ● Diazo offers an interface between designers and developers
  • 30. Re-style an existing website ● The existing website works perfectly ● Possible problems when re-styling (the old way): ○ Risk in losing functionality ○ Website is written in another language ○ No templates
  • 31. Re-style an existing website ● Diazo only needs the HTML output of the existing website ● The existing website remains available ● Easy re-style again with Diazo ● Multiple designs for a single website, at the same time
  • 33. Plone themes ● Download the example themes ○ https://intranet.gw20e.com/diazo-themes ○ https://intranet.gw20e.com/new-diazo-theme
  • 34. Plone
  • 42. Diazo replace rule <replace theme="//div[@id='content']/div[1]/h2/a" css:content="h1#parent-fieldname-title" />
  • 43. Is it really that simple?
  • 45. Advanced Diazo ● Be careful with your selectors <replace theme="//div[@id='content']/div[1]/h2/a" css:content="h1#parent-fieldname-title" />
  • 46. Advanced Diazo ● Fine tune your rules <replace theme="//div[@id='content']/div[1]/h2/a" css:content="h1#parent-fieldname-title" /> <replace theme-children="//div[@id='content']/div[1]/h2" content="//h1[@id='parent-fieldname-title']/text()" />
  • 47. Advanced Diazo ● Fine tune your rules <replace theme="//div[@id='content']/div[1]/h2/a" css:content="h1#parent-fieldname-title" /> <replace theme-children="//div[@id='content']/div[1]/h2" content="//h1[@id='parent-fieldname-title']/text()" />
  • 50. Advanced Diazo <ul> <li class="current_page_item"><a href="#">Homepage</a></li> <li class=""><a href="#">Services</a></li> <li class=""><a href="#">Portfolio</a></li> <li class=""><a href="#">About</a></li> <li class=""><a href="#">Contact</a></li> </ul>
  • 51. Advanced Diazo <ul> <li class="selected"><a href="#">Home</a></li> <li class="plain"><a href="#">News</a></li> <li class="plain"><a href="#">Events</a></li> <li class="plain"><a href="#">Users</a></li> </ul>
  • 52. Advanced Diazo ● The easy way <replace css:theme="div#menu ul" css:content="ul#portal-globalnav" /> ● Add extra CSS (file) ○ Class "selected" → "current_page_item"
  • 53. Advanced Diazo ● The advanced way ○ http://pastebin.com/4HaG3KRx <replace css:theme-children="div#menu ul"> <xsl:for-each select="//ul[@id='portal-globalnav']/li"> <xsl:element name="li"> <xsl:if test="./@class = 'selected'"> <xsl:attribute name="class"> current_page_item </xsl:attribute> </xsl:if> <xsl:copy-of select="./a" /> </xsl:element> </xsl:for-each> </replace> ● No extra CSS needed
  • 55. Conclusion ● XSLT wrapper ○ XSLT reborn ● Seamless integration ○ Proxy all your websites ● Higher level of abstraction ● Fallback to regular XSLT ○ If all else fails ● State-of-the-art technology ○ Lack of tooling ○ Widely adopted in the Plone community
  • 57. Future work ● Feature requests / bugs ○ Filter out comments in XSL ○ Easier replace rules for dynamic elements while preserving theme attributes ○ More visual way to create rules ■ Also apart from Plone.app.theming ○ <xsl:template> doesn't work in embedded <rules> ● Sprints ● Fork it ○ https://github.com/plone/diazo
  • 59. Creating a new Diazo theme
  • 60. Create a new Diazo theme ● Go to: ○ http://www.freecsstemplates.org/ ● Pick one!
  • 61. Create a new Diazo theme ● Unzip the file ● Open the folder ● Create the following files: ○ manifest.cfg ○ rules.xml ○ preview.png (optional)
  • 62. Create a new Diazo theme ● Zip the folder
  • 64. Plone themes ● Download the new example theme ○ https://intranet.gw20e.com/new-diazo-theme
  • 66. Blog article ● Mark van Lent wrote a blog article about the workshop ○ http://www.vlent.nl/weblog/2012/12/14/workshop- theming-with-diazo/