SlideShare a Scribd company logo
Customizing Share
  Document Previews
               Will Abson
Senior Integrations Engineer and Share
          Extras Project Lead
Upfront Notes
● This session will be recorded
● Type questions into the chat panel
● See me at DevCon
Agenda
● Background on Document Previews
● Web Preview implementation
● Hands-on customization examples from
  Share Extras Media Viewers project
What are Document Previews?
● Rich view of the (document) content
● Found on the Document Details page
● May render the content itself or a rendition
Changes in Alfresco 4
● More screen space for previews
● Support for more formats
● Extend the default set
The web-preview Component
web-preview Implementation
As it was in Alfresco 3
Web Tier                    Client-side (Web Browser)


  document-details            Alfresco.WebPreview

   web-preview.get




Web Scripts / Spring Surf   YUI2 / Share JS Framework




Can override but but not extend
web-preview Implementation
New implementation in Alfresco 4
Web Tier                    Client-side (Web Browser)


  document-details            Alfresco.WebPreview       Plugins

   web-preview.get




Web Scripts / Spring Surf   YUI2 / Share JS Framework




Extend via client-side Plugin classes
OOTB WebPreview Plugins
Flash                                        Non-Flash
Flash                                        Audio
FlashFox                                     Image
StrobeMediaPlayback                          Video
WebPreviewer

(See the code in webapps/share/components/preview )
Plugin Configuration and Order
● Held in component configuration file web-
    preview.get.config.xml
● Allows setting of plugin configuration
  attributes
● Determines the order in which plugins are
  used (since multiple plugins could be used
  for a particular content item)
(See the code in webapps/share/components/preview/web-preview.js )
Plugin Order
The order in which plugins are used may be...
● Statically configured
  ○ Via component configuration (previous slide)
  ○ Based on MIME type or 'thumbnail' definitions
  ○ Results in a list of plugins to be tried for a content
    item
● Dynamically determined at run time
  ○ Plugins are given the opportunity to 'test' a content
    item
  ○ Based on <anything>, e.g. browser type/version
  ○ If they say 'no', the next plugin in turn is used
Sample Component Configuration
Plugin applicability determined by <condition> element attributes
Plugin configuration determined by <plugin> element attributes

<config>
  <plugin-conditions>
     <condition mimeType="video/mp4" thumbnail="imgpreview">
           <plugin poster="imgpreview" posterFileSuffix=".png">StrobeMediaPlayback</plugin>
           <plugin poster="imgpreview" posterFileSuffix=".png">FlashFox</plugin>
           <plugin poster="imgpreview" posterFileSuffix=".png">Video</plugin>
     </condition>


     <condition mimeType="video/m4v" thumbnail="imgpreview">
           ...
     </condition>


     ...


  </plugin-conditions>
<config>
Implementing Custom Plugins
We need to implement
1. Custom plugin class
2. Localized strings for the UI
3. Presentation resources (images, CSS, etc.)
We need to configure
● Viewer registration in component
   configuration
Example: Inline PDF Viewer
File PDF.js




(Note: Not enabled in Media Viewers add-on,
but 'Embed' plugin does a similar job)
Example: Inline PDF Viewer
● The usual Share object prototype approach
  is used
● Property attributes can be used to
  customize behaviour
● Function report() returns null if the plugin
  can be used or a string if not indicating the
  reason
● Function display() returns a string
  containing HTML markup or null if Dom
  manipulation has already been used
Example: Custom Flash Video Player
File FLVPlayer.js
Example: Custom Flash Video Player
To pull in the custom JavaScript file
FLVPlayer.js containing our plugin class,
either
● Declare a custom DocLib JS dependency
  <config evaluator="string-compare" condition="DocLibCustom">
     <dependencies>
        <js src="/extras/components/preview/FLVPlayer.js" />
     </dependencies>
  </config>

● Or use an Extensibility Module to add the
  dependencies onto web-preview.get.head.ftl
  ○   But see http://blogs.alfresco.com/wp/ddraper/2012/05/24/customizing-
      share-javascript-widget-instantiation-part-2/ if targetting 4.1+
Example: Custom Flash Video Player
CSS files can be brought in at the same time as
the JavaScript files
Example: Custom Flash Video Player
To pull in our custom UI labels, either
● Use a Spring bean to expand the global
  message scope
  <config evaluator="string-compare" condition="DocLibCustom">
     <dependencies>
        <js src="/extras/components/preview/pdf.js" />
     </dependencies>
  </config>

● Or use an Extensibility Module to add the
  messages onto web-preview.get.properties
Example: Custom Flash Video Player
Lastly we must configure the web-preview.get
component to use the FLVPlayer plugin
    <condition mimeType="video/mp4">
       <plugin>FLVPlayer</plugin>
    </condition>
Example: pdf.js Viewer
Summary
● The Web Preview component is an
  important part of Share
● Alfresco 4 allows us to display our content in
  new and interesting ways
   ○ Or, display content that is not supported OOTB
● We can re-use our existing Share
  customization skills to bring in powerful tools
  such as pdf.js
Questions?

More Related Content

ODP
Packaging DNN extensions
PPTX
Mage Titans USA 2016 M2 deployment
ODP
Considerations with Writing JavaScript in your DotNetNuke site
PDF
Integration Testing with Behat drupal
PPT
Meet Magento Belarus 2015: Jurģis Lukss
PDF
Oleh Kobchenko - Configure Magento 2 to get maximum performance
PDF
Best Practices in Component Development for MODX
PDF
ICEfaces EE - Enterprise-ready JSF Ajax Framework
Packaging DNN extensions
Mage Titans USA 2016 M2 deployment
Considerations with Writing JavaScript in your DotNetNuke site
Integration Testing with Behat drupal
Meet Magento Belarus 2015: Jurģis Lukss
Oleh Kobchenko - Configure Magento 2 to get maximum performance
Best Practices in Component Development for MODX
ICEfaces EE - Enterprise-ready JSF Ajax Framework

What's hot (20)

PDF
Introduction to Google Chrome Extensions Development
ODP
Joomla Basics
PPTX
Meet Magento Belarus 2015: Mladen Ristić
PDF
DevHub 3 - Composer plus Magento
PDF
Dependency management in Magento with Composer
PPTX
Responsive browser-based video recording and playback
PPTX
Sergii Shymko: Magento 2: Composer for Extensions Distribution
PDF
Magento 2 Seminar - Anton Kril - Magento 2 Summary
PDF
The journey of mastering Magento 2 for Magento 1 developers
PPTX
Cross browser web development
ODP
Problemen oplossen in Joomla - Joomladagen 2014
PDF
Sergii Shymko - Code migration tool for upgrade to Magento 2
PDF
Chromium ui framework(shared)
PDF
Perforce CMS
PPTX
An overview on Developing Chrome Extensions
PPT
QED Reddo
PDF
Android Chromium Rendering Pipeline
PDF
How To Install Magento 2 (updated for the latest version)
PDF
Flexbox
Introduction to Google Chrome Extensions Development
Joomla Basics
Meet Magento Belarus 2015: Mladen Ristić
DevHub 3 - Composer plus Magento
Dependency management in Magento with Composer
Responsive browser-based video recording and playback
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Magento 2 Seminar - Anton Kril - Magento 2 Summary
The journey of mastering Magento 2 for Magento 1 developers
Cross browser web development
Problemen oplossen in Joomla - Joomladagen 2014
Sergii Shymko - Code migration tool for upgrade to Magento 2
Chromium ui framework(shared)
Perforce CMS
An overview on Developing Chrome Extensions
QED Reddo
Android Chromium Rendering Pipeline
How To Install Magento 2 (updated for the latest version)
Flexbox
Ad

Viewers also liked (8)

PDF
Alfresco Day BeNelux: Customer Success Showcase - Credendo Group
PPTX
Building Content-Rich Java Apps in the Cloud with the Alfresco API
PPTX
The Power of Drupal and Alfresco Together
PPTX
Intro to Alfresco for Developers
PPTX
Getting Started with CMIS
PPT
Intro To Alfresco Part 1
PPT
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
PPTX
Alfresco Day Benelux Inholland studentendossier
Alfresco Day BeNelux: Customer Success Showcase - Credendo Group
Building Content-Rich Java Apps in the Cloud with the Alfresco API
The Power of Drupal and Alfresco Together
Intro to Alfresco for Developers
Getting Started with CMIS
Intro To Alfresco Part 1
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco Day Benelux Inholland studentendossier
Ad

Similar to Tech talk live custom content viewers in alfresco share (20)

PDF
What's New in Nuxeo Platform 7.3
PDF
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
KEY
An Introduction to Maven and Flex
PPT
Maven 2.0 - Project management and comprehension tool
PDF
Expanding XPages with Bootstrap Plugins for Ultimate Usability
PPTX
Installing Plug-ins
PPTX
Improving build solutions dependency management with webpack
PPTX
FactPub Chrome Extension - Developer's Guide -
PDF
Setup ColdFusion application using fusebox mvc architecture
PPTX
Custom plugin
PPTX
Grails Custom Plugin
PPTX
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
PPTX
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
PPT
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
PPT
BP501 - Building and deploying custom IBM sametime connect client installatio...
PPTX
Grails plugin development
PPTX
Apache Maven - eXo VN office presentation
PDF
Spring Native and Spring AOT
ODP
EmbbededGF@JavaOneHyd
PPTX
VueJs Workshop
What's New in Nuxeo Platform 7.3
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
An Introduction to Maven and Flex
Maven 2.0 - Project management and comprehension tool
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Installing Plug-ins
Improving build solutions dependency management with webpack
FactPub Chrome Extension - Developer's Guide -
Setup ColdFusion application using fusebox mvc architecture
Custom plugin
Grails Custom Plugin
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
BP501 - Building and deploying custom IBM sametime connect client installatio...
Grails plugin development
Apache Maven - eXo VN office presentation
Spring Native and Spring AOT
EmbbededGF@JavaOneHyd
VueJs Workshop

More from Alfresco Software (20)

PPTX
Alfresco Day Benelux Hogeschool Inholland Records Management application
PPTX
Alfresco Day BeNelux: Customer Success Showcase - Saxion Hogescholen
PPTX
Alfresco Day BeNelux: Customer Success Showcase - Gemeente Amsterdam
PPTX
Alfresco Day BeNelux: The success of Alfresco
PDF
Alfresco Day BeNelux: Digital Transformation - It's All About Flow
PDF
Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
PDF
Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
PDF
Alfresco Day Vienna 2016: Alfrescos neue Rest API
PDF
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
PDF
Alfresco Day Vienna 2016: Entwickeln mit Alfresco
PDF
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
PDF
Alfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
PDF
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
PDF
Alfresco Day Vienna 2016: Partner Lightning Talk - it-novum
PDF
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
PDF
Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...
PDF
Alfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
PDF
Alfresco Day Warsaw 2016: Advancing the Flow of Digital Business
PDF
Alfresco Day Warsaw 2016: Podpis elektroniczny - BMS
PDF
Alfresco Day Warsaw 2016: Next-Generation Business Process Management with Al...
Alfresco Day Benelux Hogeschool Inholland Records Management application
Alfresco Day BeNelux: Customer Success Showcase - Saxion Hogescholen
Alfresco Day BeNelux: Customer Success Showcase - Gemeente Amsterdam
Alfresco Day BeNelux: The success of Alfresco
Alfresco Day BeNelux: Digital Transformation - It's All About Flow
Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
Alfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Entwickeln mit Alfresco
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
Alfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
Alfresco Day Vienna 2016: Partner Lightning Talk - it-novum
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...
Alfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
Alfresco Day Warsaw 2016: Advancing the Flow of Digital Business
Alfresco Day Warsaw 2016: Podpis elektroniczny - BMS
Alfresco Day Warsaw 2016: Next-Generation Business Process Management with Al...

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation theory and applications.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Spectroscopy.pptx food analysis technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Approach and Philosophy of On baking technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Artificial Intelligence
Encapsulation theory and applications.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
sap open course for s4hana steps from ECC to s4
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
NewMind AI Weekly Chronicles - August'25-Week II
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine learning based COVID-19 study performance prediction
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectroscopy.pptx food analysis technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative analysis of optical character recognition models for extracting...
Approach and Philosophy of On baking technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf

Tech talk live custom content viewers in alfresco share

  • 1. Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
  • 2. Upfront Notes ● This session will be recorded ● Type questions into the chat panel ● See me at DevCon
  • 3. Agenda ● Background on Document Previews ● Web Preview implementation ● Hands-on customization examples from Share Extras Media Viewers project
  • 4. What are Document Previews? ● Rich view of the (document) content ● Found on the Document Details page ● May render the content itself or a rendition
  • 5. Changes in Alfresco 4 ● More screen space for previews ● Support for more formats ● Extend the default set
  • 7. web-preview Implementation As it was in Alfresco 3 Web Tier Client-side (Web Browser) document-details Alfresco.WebPreview web-preview.get Web Scripts / Spring Surf YUI2 / Share JS Framework Can override but but not extend
  • 8. web-preview Implementation New implementation in Alfresco 4 Web Tier Client-side (Web Browser) document-details Alfresco.WebPreview Plugins web-preview.get Web Scripts / Spring Surf YUI2 / Share JS Framework Extend via client-side Plugin classes
  • 9. OOTB WebPreview Plugins Flash Non-Flash Flash Audio FlashFox Image StrobeMediaPlayback Video WebPreviewer (See the code in webapps/share/components/preview )
  • 10. Plugin Configuration and Order ● Held in component configuration file web- preview.get.config.xml ● Allows setting of plugin configuration attributes ● Determines the order in which plugins are used (since multiple plugins could be used for a particular content item) (See the code in webapps/share/components/preview/web-preview.js )
  • 11. Plugin Order The order in which plugins are used may be... ● Statically configured ○ Via component configuration (previous slide) ○ Based on MIME type or 'thumbnail' definitions ○ Results in a list of plugins to be tried for a content item ● Dynamically determined at run time ○ Plugins are given the opportunity to 'test' a content item ○ Based on <anything>, e.g. browser type/version ○ If they say 'no', the next plugin in turn is used
  • 12. Sample Component Configuration Plugin applicability determined by <condition> element attributes Plugin configuration determined by <plugin> element attributes <config> <plugin-conditions> <condition mimeType="video/mp4" thumbnail="imgpreview"> <plugin poster="imgpreview" posterFileSuffix=".png">StrobeMediaPlayback</plugin> <plugin poster="imgpreview" posterFileSuffix=".png">FlashFox</plugin> <plugin poster="imgpreview" posterFileSuffix=".png">Video</plugin> </condition> <condition mimeType="video/m4v" thumbnail="imgpreview"> ... </condition> ... </plugin-conditions> <config>
  • 13. Implementing Custom Plugins We need to implement 1. Custom plugin class 2. Localized strings for the UI 3. Presentation resources (images, CSS, etc.) We need to configure ● Viewer registration in component configuration
  • 14. Example: Inline PDF Viewer File PDF.js (Note: Not enabled in Media Viewers add-on, but 'Embed' plugin does a similar job)
  • 15. Example: Inline PDF Viewer ● The usual Share object prototype approach is used ● Property attributes can be used to customize behaviour ● Function report() returns null if the plugin can be used or a string if not indicating the reason ● Function display() returns a string containing HTML markup or null if Dom manipulation has already been used
  • 16. Example: Custom Flash Video Player File FLVPlayer.js
  • 17. Example: Custom Flash Video Player To pull in the custom JavaScript file FLVPlayer.js containing our plugin class, either ● Declare a custom DocLib JS dependency <config evaluator="string-compare" condition="DocLibCustom"> <dependencies> <js src="/extras/components/preview/FLVPlayer.js" /> </dependencies> </config> ● Or use an Extensibility Module to add the dependencies onto web-preview.get.head.ftl ○ But see http://blogs.alfresco.com/wp/ddraper/2012/05/24/customizing- share-javascript-widget-instantiation-part-2/ if targetting 4.1+
  • 18. Example: Custom Flash Video Player CSS files can be brought in at the same time as the JavaScript files
  • 19. Example: Custom Flash Video Player To pull in our custom UI labels, either ● Use a Spring bean to expand the global message scope <config evaluator="string-compare" condition="DocLibCustom"> <dependencies> <js src="/extras/components/preview/pdf.js" /> </dependencies> </config> ● Or use an Extensibility Module to add the messages onto web-preview.get.properties
  • 20. Example: Custom Flash Video Player Lastly we must configure the web-preview.get component to use the FLVPlayer plugin <condition mimeType="video/mp4"> <plugin>FLVPlayer</plugin> </condition>
  • 22. Summary ● The Web Preview component is an important part of Share ● Alfresco 4 allows us to display our content in new and interesting ways ○ Or, display content that is not supported OOTB ● We can re-use our existing Share customization skills to bring in powerful tools such as pdf.js