SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Mehr von Alkacon Software GmbH & Co. KG

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 Alkacon Software GmbH & Co. KG
 
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 containersAlkacon Software GmbH & Co. KG
 
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 portalsAlkacon Software GmbH & Co. KG
 
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 GruntAlkacon Software GmbH & Co. KG
 
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-TSAlkacon Software GmbH & Co. KG
 
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, ...Alkacon Software GmbH & Co. KG
 
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.5Alkacon Software GmbH & Co. KG
 

Mehr von 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
 

Kürzlich hochgeladen

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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 WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 TerraformAndrey Devyatkin
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 FMESafe Software
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Kürzlich hochgeladen (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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