SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
codecentric AG
A technical approach to OpenCms
responsive web design
Henning Treu
codecentric AG
„I’m wondering:
Is there a built-in way to automatically downscale large images on upload (or perhaps
upon “create image resource”)? (For example, if the image exceeds a 1000x1000 px
bounding box.)
If not, can I avoid touching core classes in OpenCms if I was to create such functionality
myself? (Or: Can I add-on a custom “create image resource” handler class? How do I
make OpenCms use it?)“
Recently in the opencms-dev list...
30.09. - 01.10.2013
Paul-Inge Flakstad, opencms-dev mailing list
codecentric AG
Henning Treu
IT Consultant
§
With codecentric since 2012
§
M. Sc. Computer Science, 2007 University Düsseldorf
§
34 years
§
Married, 2 kids
About me
30.09. - 01.10.2013
codecentric AG
Software and IT Consulting
§
Java Experts – Technologie Leadership
– Agile Software Factory
– Enterprise Software Development
§
Java Performance Solutions
– AppDynamics
§
IT Consulting
– Continuous Delivery
– Big Data
– Agile Coaching
§
Technologie Partners
– Atlassian
– AppDynamics
– NeoTechnologies (neo4j)
– Vaadin
– VMWare (springframework)
About codecentric AG
30.09. - 01.10.2013
codecentric AG
Agenda
• RWD Overview
• RWD Image Problem
• OpenCms Requirements
• OpenCms Implementation
• Client Implementation
• Demo
• Outlook
30.09. - 01.10.2013
codecentric AG
Responsive Web Design Overview
What´s it all about?
§
Deliver the same HTML to every client
§
No server side device detection
§
Looks good for every viewport width (after heavy browser optimization)
– Adds huge complexity to CSS
– CSS media queries to request device capabilities
●
width
●
height
●
resolution
●
orientation
§
Tons of responsive frameworks
– Twitter Bootstrap
– ZURB foundation
§
Example: mashable.com
30.09. - 01.10.2013
codecentric AG
Example: mashable.com
Desktop
30.09. - 01.10.2013
codecentric AG
Example: mashable.com
Tablet
30.09. - 01.10.2013
codecentric AG
Example: mashable.com
Smartphone
30.09. - 01.10.2013
codecentric AG
Example: mashable.com
Smartphone
30.09. - 01.10.2013
codecentric AG
Responsive Web Design Overview
What´s it all about?
Facts!
§
On average, 60% of data of a Website is images
§
72% of websites send the same data to both desktop and mobile users
Mat Marquis, RICG, Sep. 10th 2013
30.09. - 01.10.2013
codecentric AG
Responsive Web Design Overview
What´s it all about?
Facts!
http://httparchive.org/interesting.php?a=All&l=Sep%2015%202013
30.09. - 01.10.2013
codecentric AG
Responsive Web Design Overview
Why does it matter?
http://www.smartinsights.com/
30.09. - 01.10.2013
codecentric AG
Images in Responsive Web Design
It´s not one-size-fits-all
§
deliver different images according to screen width/resolution and bandwidth
– bandwidth: not feasible right now
§
deliver different images for smaller screens
– scaled versions
– cropped versions (art direction)
§
deliver higher resolution for high density displays
30.09. - 01.10.2013
codecentric AG
Images in Responsive Web Design
Example for Scaled Images
(cc) http://www.ormsconnect.co.za/2012/10/the-skyline-of-shanghai-by-black-station/
30.09. - 01.10.2013
codecentric AG
Images in Responsive Web Design
Example for Cropped Images
30.09. - 01.10.2013
codecentric AG
Images in Responsive Web Design
What's the problem after all?
§
No native HTML or browser support
§
Specs for proposed <picture> tag not ready for production (draft 24)
§
Easy for CSS background images: media queries
– but no easy integration with OpenCms
30.09. - 01.10.2013
codecentric AG
OpenCms Requirements
no-frills
§
Don´t affect editors workflow too much
§
Don´t affect designers workflow too much
§
Seamless integration in OpenCms: like „normal“ images
§
Auto scale images on upload
§
Link scaled versions to original
– Publish in publish
– Delete in delete
– Move on Move (+rename)
30.09. - 01.10.2013
codecentric AG
OpenCms Implementation
Action class and listeners
§
Register listeners in module action class
– Listen for content creation, publishing, deleting, moving
§
Create a set of scaled images on image upload
– Always upload the best resolution available
– auto-scale image to predefined widths
●
OpenCms image scaler
●
Fixed .scaledImages folder with naming schema
30.09. - 01.10.2013
codecentric AG
Client Implementation
<span data-picture data-alt="alternative text for responsive images">
<span data-src="small.jpg"></span>
<span data-src="medium.jpg" data-media="(min-width: 401px)"></span>
<span data-src="large.jpg" data-media="(min-width: 800px)"></span>
<span data-src="xlarge.jpg" data-media="(min-width: 1000px)"></span>
<!-- Fallback content for non-JS browsers. -->
<noscript>
<img src="small.jpg" alt="alternative text for fallback">
</noscript>
</span>
HTML and JavaScript polyfill
§
picturefill by Scott Jehl © 2012 – mimics the proposed <picture> element
§
https://github.com/scottjehl/picturefill
30.09. - 01.10.2013
codecentric AG
OpenCms – Client Connection
Responsive image JSP tag
§
Custom tag to replace <img>
§
Takes the same src parameter
§
Writes the picturefill to the page
– Breakpoints for media queries hard coded at the moment
§
Looks up scaled images in the .scaledImage folder
– Naming schema based lookup
30.09. - 01.10.2013
codecentric AG
Demo
Live Demo...
30.09. - 01.10.2013
codecentric AG
Outlook
What's to come?
§
picturefill with caching support
§
Better sync of resources
§
Configurable breakpoints
§
More robust JavaScript
§
Open source release?
30.09. - 01.10.2013
codecentric AG
The End
Thank you very much.
30.09. - 01.10.2013

Contenu connexe

Plus de Alkacon Software GmbH & Co. KG

Plus de Alkacon Software GmbH & Co. KG (20)

OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5OpenCms Days 2016:   Keynote - Introducing OpenCms 10.5
OpenCms Days 2016: Keynote - Introducing OpenCms 10.5
 
OpenCms Days 2015 OpenCms X marks the spot
OpenCms Days 2015 OpenCms X marks the spotOpenCms Days 2015 OpenCms X marks the spot
OpenCms Days 2015 OpenCms X marks the spot
 
OpenCms Days 2015 Next generation repository
OpenCms Days 2015  Next generation repositoryOpenCms Days 2015  Next generation repository
OpenCms Days 2015 Next generation repository
 
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
 
OpenCms Days 2015 OCEE explained
OpenCms Days 2015 OCEE explainedOpenCms Days 2015 OCEE explained
OpenCms Days 2015 OCEE explained
 
OpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and JenkinsOpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and Jenkins
 
OpenCms Days 2015 Modern templates with nested containers
OpenCms Days 2015 Modern templates with nested containersOpenCms Days 2015 Modern templates with nested containers
OpenCms Days 2015 Modern templates with nested containers
 
OpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCmsOpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCms
 
OpenCms Days 2015 Advanced Solr Searching
OpenCms Days 2015 Advanced Solr SearchingOpenCms Days 2015 Advanced Solr Searching
OpenCms Days 2015 Advanced Solr Searching
 
OpenCms Days 2015 OpenGovernment
OpenCms Days 2015 OpenGovernmentOpenCms Days 2015 OpenGovernment
OpenCms Days 2015 OpenGovernment
 
OpenCms Days 2015 OpenCms at erarta
OpenCms Days 2015 OpenCms at erarta OpenCms Days 2015 OpenCms at erarta
OpenCms Days 2015 OpenCms at erarta
 
OpenCms Days 2015 How do you develop for OpenCms?
OpenCms Days 2015 How do you develop for OpenCms?OpenCms Days 2015 How do you develop for OpenCms?
OpenCms Days 2015 How do you develop for OpenCms?
 
OpenCms Days 2015 Arkema, a leading chemicals company
OpenCms Days 2015 Arkema, a leading chemicals companyOpenCms Days 2015 Arkema, a leading chemicals company
OpenCms Days 2015 Arkema, a leading chemicals company
 
OpenCms Days 2014 - How Techem handles international customer portals
OpenCms Days 2014 - How Techem handles international customer portalsOpenCms Days 2014 - How Techem handles international customer portals
OpenCms Days 2014 - How Techem handles international customer portals
 
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and GruntOpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
 
OpenCms Days 2014 - OpenCms cloud setup with the FI-TS
OpenCms Days 2014 - OpenCms cloud setup with the FI-TSOpenCms Days 2014 - OpenCms cloud setup with the FI-TS
OpenCms Days 2014 - OpenCms cloud setup with the FI-TS
 
OpenCms Days 2014 - OpenCms Module Development and Deployment with IntelliJ, ...
OpenCms Days 2014 - OpenCms Module Development and Deployment with IntelliJ, ...OpenCms Days 2014 - OpenCms Module Development and Deployment with IntelliJ, ...
OpenCms Days 2014 - OpenCms Module Development and Deployment with IntelliJ, ...
 
OpenCms Days 2014 - OpenCms 9 - A video tube?
OpenCms Days 2014 - OpenCms 9 - A video tube?OpenCms Days 2014 - OpenCms 9 - A video tube?
OpenCms Days 2014 - OpenCms 9 - A video tube?
 
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
 
OpenCms Days 2014 - Updating to OpenCms 9.5
OpenCms Days 2014 - Updating to OpenCms 9.5OpenCms Days 2014 - Updating to OpenCms 9.5
OpenCms Days 2014 - Updating to OpenCms 9.5
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

OpenCms Days 2013 - A technical approach to OpenCms responsive web design

  • 1. codecentric AG A technical approach to OpenCms responsive web design Henning Treu
  • 2. codecentric AG „I’m wondering: Is there a built-in way to automatically downscale large images on upload (or perhaps upon “create image resource”)? (For example, if the image exceeds a 1000x1000 px bounding box.) If not, can I avoid touching core classes in OpenCms if I was to create such functionality myself? (Or: Can I add-on a custom “create image resource” handler class? How do I make OpenCms use it?)“ Recently in the opencms-dev list... 30.09. - 01.10.2013 Paul-Inge Flakstad, opencms-dev mailing list
  • 3. codecentric AG Henning Treu IT Consultant § With codecentric since 2012 § M. Sc. Computer Science, 2007 University Düsseldorf § 34 years § Married, 2 kids About me 30.09. - 01.10.2013
  • 4. codecentric AG Software and IT Consulting § Java Experts – Technologie Leadership – Agile Software Factory – Enterprise Software Development § Java Performance Solutions – AppDynamics § IT Consulting – Continuous Delivery – Big Data – Agile Coaching § Technologie Partners – Atlassian – AppDynamics – NeoTechnologies (neo4j) – Vaadin – VMWare (springframework) About codecentric AG 30.09. - 01.10.2013
  • 5. codecentric AG Agenda • RWD Overview • RWD Image Problem • OpenCms Requirements • OpenCms Implementation • Client Implementation • Demo • Outlook 30.09. - 01.10.2013
  • 6. codecentric AG Responsive Web Design Overview What´s it all about? § Deliver the same HTML to every client § No server side device detection § Looks good for every viewport width (after heavy browser optimization) – Adds huge complexity to CSS – CSS media queries to request device capabilities ● width ● height ● resolution ● orientation § Tons of responsive frameworks – Twitter Bootstrap – ZURB foundation § Example: mashable.com 30.09. - 01.10.2013
  • 11. codecentric AG Responsive Web Design Overview What´s it all about? Facts! § On average, 60% of data of a Website is images § 72% of websites send the same data to both desktop and mobile users Mat Marquis, RICG, Sep. 10th 2013 30.09. - 01.10.2013
  • 12. codecentric AG Responsive Web Design Overview What´s it all about? Facts! http://httparchive.org/interesting.php?a=All&l=Sep%2015%202013 30.09. - 01.10.2013
  • 13. codecentric AG Responsive Web Design Overview Why does it matter? http://www.smartinsights.com/ 30.09. - 01.10.2013
  • 14. codecentric AG Images in Responsive Web Design It´s not one-size-fits-all § deliver different images according to screen width/resolution and bandwidth – bandwidth: not feasible right now § deliver different images for smaller screens – scaled versions – cropped versions (art direction) § deliver higher resolution for high density displays 30.09. - 01.10.2013
  • 15. codecentric AG Images in Responsive Web Design Example for Scaled Images (cc) http://www.ormsconnect.co.za/2012/10/the-skyline-of-shanghai-by-black-station/ 30.09. - 01.10.2013
  • 16. codecentric AG Images in Responsive Web Design Example for Cropped Images 30.09. - 01.10.2013
  • 17. codecentric AG Images in Responsive Web Design What's the problem after all? § No native HTML or browser support § Specs for proposed <picture> tag not ready for production (draft 24) § Easy for CSS background images: media queries – but no easy integration with OpenCms 30.09. - 01.10.2013
  • 18. codecentric AG OpenCms Requirements no-frills § Don´t affect editors workflow too much § Don´t affect designers workflow too much § Seamless integration in OpenCms: like „normal“ images § Auto scale images on upload § Link scaled versions to original – Publish in publish – Delete in delete – Move on Move (+rename) 30.09. - 01.10.2013
  • 19. codecentric AG OpenCms Implementation Action class and listeners § Register listeners in module action class – Listen for content creation, publishing, deleting, moving § Create a set of scaled images on image upload – Always upload the best resolution available – auto-scale image to predefined widths ● OpenCms image scaler ● Fixed .scaledImages folder with naming schema 30.09. - 01.10.2013
  • 20. codecentric AG Client Implementation <span data-picture data-alt="alternative text for responsive images"> <span data-src="small.jpg"></span> <span data-src="medium.jpg" data-media="(min-width: 401px)"></span> <span data-src="large.jpg" data-media="(min-width: 800px)"></span> <span data-src="xlarge.jpg" data-media="(min-width: 1000px)"></span> <!-- Fallback content for non-JS browsers. --> <noscript> <img src="small.jpg" alt="alternative text for fallback"> </noscript> </span> HTML and JavaScript polyfill § picturefill by Scott Jehl © 2012 – mimics the proposed <picture> element § https://github.com/scottjehl/picturefill 30.09. - 01.10.2013
  • 21. codecentric AG OpenCms – Client Connection Responsive image JSP tag § Custom tag to replace <img> § Takes the same src parameter § Writes the picturefill to the page – Breakpoints for media queries hard coded at the moment § Looks up scaled images in the .scaledImage folder – Naming schema based lookup 30.09. - 01.10.2013
  • 23. codecentric AG Outlook What's to come? § picturefill with caching support § Better sync of resources § Configurable breakpoints § More robust JavaScript § Open source release? 30.09. - 01.10.2013
  • 24. codecentric AG The End Thank you very much. 30.09. - 01.10.2013