New Client Config &Extension Points in Share     Dave Draper @_DaveDraper                !
Background•  Alfresco Share was not originally intended   as a platform•  Spring Surf did not provide any extension   mech...
Goals (for 4.0)•  Ensure that Spring Surf continues to be   compatible with previous Alfresco   releases (i.e. Avoid branc...
Goals (for next major release)•  Make customizing client-side JavaScript   widgets simpler•  Convert Share WebScripts to c...
Solution Overview•  Two distinct approaches to extension  o  Customization by targeting existing files  o  Customization t...
File Customization•  Works with Templates or WebScripts•  Can extend i18n properties, JavaScript   controllers & FreeMarke...
What Can You Do With This?•  Modify Surf templates to add, remove,   modify Component bindings•  Change display labels•  M...
Sub-Components•  A Sub-Component maps to a WebScript•  Only AdvancedComponents support Sub-   Components  o  Only Share 4....
Sub-Component Evaluations•  A Sub-Component can have zero or more   Evaluations•  Each Evaluation can use zero or more   E...
What Can You Do With This?•  Add, remove and modify the content   within a Component•  Have a Component display different ...
Extensions & Modules•  An “Extension” can contain zero or more “Modules”•  An Extension can be configured within the appli...
Benefits•  Easy to add new coarse grained content   to existing Share pages•  Easy to override i18n properties for   WebSc...
Restrictions (in 4.0)•  Still difficult to extend JavaScript widgets   for fine grained changes•  Limited use of <@markup>...
Additional Tooling•  “SurfBug”: identifies the Spring Surf   elements on each page:  o  Sub-Components & Component binding...
Additional Dependency Handling•  Use <dependencies> element as a child   of <customization> element in Module   configurat...
Share Configuration Support•  Available from 4.0.2•  Use of <configurations> element as a   child of <module> element•  Al...
Demos
Adding New Content(Method 1)
Create some content...WebScript DescriptorWebScript Template
Target Area Of Share...
Define new Sub-Component...
Deploy Module...
Result...
Hiding Existing Content(Method 1)
Target Sub-Component to hide...
Result...
Conditional Hide
Create an Evaluator...
Make the Evaluator a Spring Bean...org.springframework.extensions.surf.spring-surf-extensibility-context.xml
Specify the Evaluator...
Result...
Adding New Content(Method 2)
Target a TemplateInstance...
Define a customization...
Create the customization file...(in specified package)
Define a Component to bind to new Region...(re-using the WebScript from the earlier example to providecontent)
Result...
Hiding Existing Content(Method 2)
Remove the Region...(Same target, different action)Other actions are available...  § “after”  § “modify”
Override i18n Properties
Find the property...
Define a customization...
Create the customization file...Note that the location of a WebScript customization is at adifferent path root than for Te...
Result...
Override JavaScript Controller
Identify JavaScript model properties...
Define a customization...
Create The Customization File...
Result...
Other Demos (if time allows)•    Site conditional Flash upload•    User conditional help•    Additional dependencies•    D...
Other Customizations…•  Re-order entire pages (add + remove   regions)•  Auto readme (see Blog post)•  PeerBind Chat Servi...
Additional Reading•  Lots more in-depth information and   tutorials available at:   http://blogs.alfresco.com/wp/ddraper• ...
Upcoming SlideShare
Loading in...5
×

Tech Talk Live on Share Extensibility

3,689

Published on

Slide deck to accompany Tesch Talk Live on New Client Config and Extension Points in Alfresco Share

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,689
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
100
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Tech Talk Live on Share Extensibility"

  1. 1. New Client Config &Extension Points in Share Dave Draper @_DaveDraper !
  2. 2. Background•  Alfresco Share was not originally intended as a platform•  Spring Surf did not provide any extension mechanism•  Difficult to identify use cases
  3. 3. Goals (for 4.0)•  Ensure that Spring Surf continues to be compatible with previous Alfresco releases (i.e. Avoid branching)•  Minimize Share code changes•  Provide the ability to easily extend Share without copying and pasting code•  Provide extensions through simple JAR deployment
  4. 4. Goals (for next major release)•  Make customizing client-side JavaScript widgets simpler•  Convert Share WebScripts to common “boiler-plate” template•  Move dependency requests into WebScript “.html.ftl” files•  Remove Share WebScript “.head.ftl” files
  5. 5. Solution Overview•  Two distinct approaches to extension o  Customization by targeting existing files o  Customization through Component configuration•  Creation of in-memory output model o  Provides opportunity to amend default output o  Each FreeMarker template gets an output model o  Models can are nested•  Introduction of Sub-Components o  Solves 1-1 Region to Component mapping problem
  6. 6. File Customization•  Works with Templates or WebScripts•  Can extend i18n properties, JavaScript controllers & FreeMarker templates•  FreeMarker extensions depend upon custom directives –  <@region> & <@markup> –  Entirely abstract framework – scope for adding new directives
  7. 7. What Can You Do With This?•  Modify Surf templates to add, remove, modify Component bindings•  Change display labels•  Modify the content displayed by updating the model
  8. 8. Sub-Components•  A Sub-Component maps to a WebScript•  Only AdvancedComponents support Sub- Components o  Only Share 4.0 uses AdvancedComponents by default o  Configurable through Surf configuration•  Legacy configuration conversion o  Components become Sub-Components•  Support for dynamic evaluation of parameters against request
  9. 9. Sub-Component Evaluations•  A Sub-Component can have zero or more Evaluations•  Each Evaluation can use zero or more Evaluators•  If all Evaluators are successful then Evaluation overrides Sub-Component defaults•  WebScript URL, properties and index can be overridden
  10. 10. What Can You Do With This?•  Add, remove and modify the content within a Component•  Have a Component display different content dynamically based on request information (e.g. The Site being accessed, the current User)
  11. 11. Extensions & Modules•  An “Extension” can contain zero or more “Modules”•  An Extension can be configured within the application (e.g. Portlet extension) or externally in a JAR (e.g. RM extension)•  Three deployment modes “auto”, “enable-auto-deploy” and “manual” (manual is default)•  Default module configuration can be overridden when deployed•  Modules can be dynamically deployed and removed without server restart.
  12. 12. Benefits•  Easy to add new coarse grained content to existing Share pages•  Easy to override i18n properties for WebScripts•  Scope for future enhancements using in- memory output model (i.e. new FreeMarker directives)
  13. 13. Restrictions (in 4.0)•  Still difficult to extend JavaScript widgets for fine grained changes•  Limited use of <@markup> directive in Share•  Sub-Component extensions only work with WebScripts•  Limited control over module overrides at deployment
  14. 14. Additional Tooling•  “SurfBug”: identifies the Spring Surf elements on each page: o  Sub-Components & Component bindings, properties & evaluation results o  Contributing file paths o  WebScript information o  Customization data (i.e. use of extensibility directives)
  15. 15. Additional Dependency Handling•  Use <dependencies> element as a child of <customization> element in Module configuration: <dependencies> <css>/res/demo/dependencies/ styles.css</css> <js>/res/demo/dependencies/ script.js</js> </dependencies>
  16. 16. Share Configuration Support•  Available from 4.0.2•  Use of <configurations> element as a child of <module> element•  Allows dynamically evaluated Share configuration changes (i.e. that would typically be found in “share-config.xml”)•  MUST include all configuration – it is not an augment capability
  17. 17. Demos
  18. 18. Adding New Content(Method 1)
  19. 19. Create some content...WebScript DescriptorWebScript Template
  20. 20. Target Area Of Share...
  21. 21. Define new Sub-Component...
  22. 22. Deploy Module...
  23. 23. Result...
  24. 24. Hiding Existing Content(Method 1)
  25. 25. Target Sub-Component to hide...
  26. 26. Result...
  27. 27. Conditional Hide
  28. 28. Create an Evaluator...
  29. 29. Make the Evaluator a Spring Bean...org.springframework.extensions.surf.spring-surf-extensibility-context.xml
  30. 30. Specify the Evaluator...
  31. 31. Result...
  32. 32. Adding New Content(Method 2)
  33. 33. Target a TemplateInstance...
  34. 34. Define a customization...
  35. 35. Create the customization file...(in specified package)
  36. 36. Define a Component to bind to new Region...(re-using the WebScript from the earlier example to providecontent)
  37. 37. Result...
  38. 38. Hiding Existing Content(Method 2)
  39. 39. Remove the Region...(Same target, different action)Other actions are available... § “after” § “modify”
  40. 40. Override i18n Properties
  41. 41. Find the property...
  42. 42. Define a customization...
  43. 43. Create the customization file...Note that the location of a WebScript customization is at adifferent path root than for TemplateInstance customizations!
  44. 44. Result...
  45. 45. Override JavaScript Controller
  46. 46. Identify JavaScript model properties...
  47. 47. Define a customization...
  48. 48. Create The Customization File...
  49. 49. Result...
  50. 50. Other Demos (if time allows)•  Site conditional Flash upload•  User conditional help•  Additional dependencies•  Document Library extension
  51. 51. Other Customizations…•  Re-order entire pages (add + remove regions)•  Auto readme (see Blog post)•  PeerBind Chat Service (see David Webster’s blog)•  Resource Management module•  Portlet module•  ...
  52. 52. Additional Reading•  Lots more in-depth information and tutorials available at: http://blogs.alfresco.com/wp/ddraper•  Alfresco Surf Development Forum•  More blogs to come!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×