SlideShare une entreprise Scribd logo
1  sur  38
More Ways of Customizing Alfresco Share 2 Erik Winlöf UI Team, Alfresco twitter: @erikwinlof
Whatwe’ll cover 3 ,[object Object]
Use case: Acme Enterprises™
Future enhancements
(JavaScript tips),[object Object]
<client-debug-autologging>  -  browser logging
<mode>development</mode>  -  fewer restarts & refreshes
Separate Share server  -  quicker restartshttp://blogs.alfresco.com/wp/kevinr/2010/04/07/developer-tips-for-alfresco-share-33/ ,[object Object]
Server JS debugging: WebScriptJavascript debugger
http://localhost:8081/share/page/api/javascript/debugger,[object Object]
 ${TOMCAT_HOME}/shared/classes/alfresco/web-extension /web-extension/share-config-custom.xml /web-extension/custom-slingshot-application-context.xml /web-extension/site-webscripts /site-webscripts-  new webscripts ,[object Object],     (.js, .css, .png etc)
New customisationconcepts= v3.3 6 ,[object Object]
 ${TOMCAT_HOME}/shared/classes/alfresco /web-extension /web-extension/share-config-custom.xml /web-extension/site-webscripts ,[object Object],.jar!/alfresco/web-extension/custom-slingshot-{module}-context.xml .jar!/alfresco/site-webscripts .jar!/META-INF (.js, .css, .png etc)
New customisationconcepts >= v3.4b 7 ,[object Object],Which makes it possible to override .js, .css & .png etc in a .jar file’s META-INF directory  No need anymore to override the templates that import the resources ,[object Object],https://share-extras.googlecode.com/svn/trunk/Site Tags Dashlet/
Usecase: ACME Enterprises™ 8 ,[object Object]
Using collaboration sites for their core projects
Marketing needs sites with event statistics
Uses a 3rd party library: Flot Statistics™,[object Object]
 Changed column layout on “My Tasks”
 Replace “links” component on document details
 New “Marketing” site preset with a custom statistics page,[object Object]
acme header messages & news icon  11 acme.jar!/alfresco/messages/acme.properties header.acme-about.label=About Acme header.acme-about.description=About Acme Enterprises header.acme-news.label=Acme News header.acme-news.description=News about the Acme Company acme.jar!/META-INF/components/images/header/acme-news.png /share/res/components/images/header/acme-news.png
Adding a resource bundle (acme.properties) 12 .jar!/alfresco/web-extension/custom-slingshot-acme-context.xml <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN'    'http://www.springframework.org/dtd/spring-beans.dtd'> <beans>   <bean id="flot.acme.resources"              class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">     <property name="resourceBundles">       <list>         <value>alfresco.messages.acme</value>       </list>     </property>   </bean> </beans>
Whatwe are going to do…. 13 ACME’s Share ,[object Object]
Changed column layout on “My Tasks”
 Replace “links” component on document details
 New “Marketing” site preset with a custom statistics page,[object Object]
Override the My Task lists cell renderer 15 …and place the new method implementation in:  ${TOMCAT_HOME}/shared/lib/acme.jar!/META-INF/acme/components/workflow/task-list.js // Override "icon" column in My Tasks list Alfresco.component.TaskList.prototype.renderCellTaskInfo= function Acme_TL_renderCellTaskInfo(elCell, oRecord, oColumn, oData) { elCell.innerHTML = <custom code goes here>; };
Whatwe are going to do…. 16 ACME’s Share ,[object Object]
 Changed column layout on “My Tasks”
Replace “links” component on document details
 New “Marketing” site preset with a custom statistics page,[object Object]
How a page is rendered… URL: /share/page/site/engineering/{pageId} pages/{pageId}.xml: <template-instance>{templateInstance}</template-instance> template-instances/{templateInstance}.xml: <template>{template}</template> <component>    <region-id>{regionId}</region-id>    <url>{webscriptURL}</url> <component> templates/…/{template}.ftl: <html><@region id=“{regionId}”scope”{scope}”></html> components/webscript.get.desc.xml: <url>{webscriptURL}</url> 18
 … find the scope, region-id & templateinstance… 19 URL: /share/page/site/engineering/document-details pages/document-details.xml: <template-instance>document-details</template-instance> template-instances/document-details.xml: <template>document-details</template> <component>    <region-id>document-links</region-id>    <url>/components/document-details/document-links</url> <component> templates/…/ document-details.ftl: <html><@region id=“document-links” scope”template”></html> components/ document-links.get.desc.xml: <url>/components/document-details/document-links</url>
…and override the componentbinding 20 web-extension/site-data/components/template.document-links.document-details.xml <?xml version='1.0' encoding='UTF-8'?> <component>    <url>/acme/components/document-details/document-syndication</url> </component>
Whatwe are going to do…. 21 ACME’s Share ,[object Object]
 Changed column layout on “My Tasks”
 Replace “links” component on document details

Contenu connexe

Plus de Alfresco Software

Plus de Alfresco Software (20)

Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...Alfresco Day Vienna 2016: Activiti – ein Katalysator für die DMS-Strategie be...
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: Elektronische Geschäftsprozesse auf Basis von Alfre...Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
Alfresco Day Vienna 2016: Elektronische Geschäftsprozesse auf Basis von Alfre...
 
Alfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest APIAlfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest API
 
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Support Tools für die Admin-KonsoleAlfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
 
Alfresco Day Vienna 2016: Entwickeln mit Alfresco
Alfresco Day Vienna 2016: Entwickeln mit AlfrescoAlfresco Day Vienna 2016: Entwickeln mit Alfresco
Alfresco Day Vienna 2016: Entwickeln mit Alfresco
 
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
Alfresco Day Vienna 2016: Activiti goes enterprise: Die Evolution der BPM Sui...
 
Alfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
Alfresco Day Vienna 2016: Partner Lightning Talk: WesternacherAlfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
Alfresco Day Vienna 2016: Partner Lightning Talk: Westernacher
 
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...Alfresco Day Vienna 2016: Bringing Content & Process together with the App De...
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: Partner Lightning Talk - it-novumAlfresco Day Vienna 2016: Partner Lightning Talk - it-novum
Alfresco Day Vienna 2016: Partner Lightning Talk - it-novum
 
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...Alfresco Day Vienna 2016: How to Achieve Digital Flow in the Enterprise - Joh...
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 - Czy możliwe jest spełnienie wszystkich regulacji p...Alfresco Day Warsaw 2016 - Czy możliwe jest spełnienie wszystkich regulacji p...
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: Identyfikacja i podpiselektroniczny - SafranAlfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
Alfresco Day Warsaw 2016: Identyfikacja i podpiselektroniczny - Safran
 
Alfresco Day Warsaw 2016: Advancing the Flow of Digital Business
Alfresco Day Warsaw 2016: Advancing the Flow of Digital BusinessAlfresco Day Warsaw 2016: Advancing the Flow of Digital Business
Alfresco Day Warsaw 2016: Advancing the Flow of Digital Business
 
Alfresco Day Warsaw 2016: Podpis elektroniczny - BMS
Alfresco Day Warsaw 2016: Podpis elektroniczny - BMSAlfresco Day Warsaw 2016: Podpis elektroniczny - BMS
Alfresco Day Warsaw 2016: Podpis elektroniczny - BMS
 
Alfresco Day Warsaw 2016: Next-Generation Business Process Management with Al...
Alfresco Day Warsaw 2016: Next-Generation Business Process Management with Al...Alfresco Day Warsaw 2016: Next-Generation Business Process Management with Al...
Alfresco Day Warsaw 2016: Next-Generation Business Process Management with Al...
 
Alfresco Day Milano 2016 - Demo Data
Alfresco Day Milano 2016 - Demo DataAlfresco Day Milano 2016 - Demo Data
Alfresco Day Milano 2016 - Demo Data
 
Alfresco Day Milano 2016 - Tribunale di Cremona
Alfresco Day Milano 2016 - Tribunale di CremonaAlfresco Day Milano 2016 - Tribunale di Cremona
Alfresco Day Milano 2016 - Tribunale di Cremona
 
Alfresco Day Milano 2016 - Alfresco Product Update
Alfresco Day Milano 2016 - Alfresco Product UpdateAlfresco Day Milano 2016 - Alfresco Product Update
Alfresco Day Milano 2016 - Alfresco Product Update
 
Alfresco Day Milano 2016 - Pernexas
Alfresco Day Milano 2016 - PernexasAlfresco Day Milano 2016 - Pernexas
Alfresco Day Milano 2016 - Pernexas
 
Alfresco Day Milano 2016 - Alfresco Activiti
Alfresco Day Milano 2016 - Alfresco ActivitiAlfresco Day Milano 2016 - Alfresco Activiti
Alfresco Day Milano 2016 - Alfresco Activiti
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 
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
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 
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
 

More Ways of Extending Share

  • 1. More Ways of Customizing Alfresco Share 2 Erik Winlöf UI Team, Alfresco twitter: @erikwinlof
  • 2.
  • 3. Use case: Acme Enterprises™
  • 5.
  • 7. <mode>development</mode> - fewer restarts & refreshes
  • 8.
  • 9. Server JS debugging: WebScriptJavascript debugger
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Using collaboration sites for their core projects
  • 17. Marketing needs sites with event statistics
  • 18.
  • 19. Changed column layout on “My Tasks”
  • 20. Replace “links” component on document details
  • 21.
  • 22. acme header messages & news icon 11 acme.jar!/alfresco/messages/acme.properties header.acme-about.label=About Acme header.acme-about.description=About Acme Enterprises header.acme-news.label=Acme News header.acme-news.description=News about the Acme Company acme.jar!/META-INF/components/images/header/acme-news.png /share/res/components/images/header/acme-news.png
  • 23. Adding a resource bundle (acme.properties) 12 .jar!/alfresco/web-extension/custom-slingshot-acme-context.xml <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <bean id="flot.acme.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent"> <property name="resourceBundles"> <list> <value>alfresco.messages.acme</value> </list> </property> </bean> </beans>
  • 24.
  • 25. Changed column layout on “My Tasks”
  • 26. Replace “links” component on document details
  • 27.
  • 28. Override the My Task lists cell renderer 15 …and place the new method implementation in: ${TOMCAT_HOME}/shared/lib/acme.jar!/META-INF/acme/components/workflow/task-list.js // Override "icon" column in My Tasks list Alfresco.component.TaskList.prototype.renderCellTaskInfo= function Acme_TL_renderCellTaskInfo(elCell, oRecord, oColumn, oData) { elCell.innerHTML = <custom code goes here>; };
  • 29.
  • 30. Changed column layout on “My Tasks”
  • 31. Replace “links” component on document details
  • 32.
  • 33. How a page is rendered… URL: /share/page/site/engineering/{pageId} pages/{pageId}.xml: <template-instance>{templateInstance}</template-instance> template-instances/{templateInstance}.xml: <template>{template}</template> <component> <region-id>{regionId}</region-id> <url>{webscriptURL}</url> <component> templates/…/{template}.ftl: <html><@region id=“{regionId}”scope”{scope}”></html> components/webscript.get.desc.xml: <url>{webscriptURL}</url> 18
  • 34. … find the scope, region-id & templateinstance… 19 URL: /share/page/site/engineering/document-details pages/document-details.xml: <template-instance>document-details</template-instance> template-instances/document-details.xml: <template>document-details</template> <component> <region-id>document-links</region-id> <url>/components/document-details/document-links</url> <component> templates/…/ document-details.ftl: <html><@region id=“document-links” scope”template”></html> components/ document-links.get.desc.xml: <url>/components/document-details/document-links</url>
  • 35. …and override the componentbinding 20 web-extension/site-data/components/template.document-links.document-details.xml <?xml version='1.0' encoding='UTF-8'?> <component> <url>/acme/components/document-details/document-syndication</url> </component>
  • 36.
  • 37. Changed column layout on “My Tasks”
  • 38. Replace “links” component on document details
  • 39.
  • 41. New ”Event Statistics” page
  • 42.
  • 43. presets.xml – bind in the dashlets 24 <components> <!-- dashlets --> <component> <scope>page</scope> <region-id>component-1-1</region-id> <source-id>site/${siteid}/dashboard</source-id> <url>/components/dashlets/docsummary</url> </component> <component> <scope>page</scope> <region-id>component-2-1</region-id> <source-id>site/${siteid}/dashboard</source-id> <url>/components/dashlets/calendar</url> </component> </components>
  • 44. presets.xml – define the pages and theirtitles 25 <page id="site/${siteid}/dashboard"> <properties> <!-- Read by collaboration-navigation.get.js to render links --> <sitePages> [ {"pageId":"documentlibrary"}, {"pageId":"calendar"}, {"pageId":"flot-event-statistics"} ] </sitePages> <pageMetadata> { "calendar": { "titleId":"page.acme-marketing-calendar.title", "descriptionId":"page.acme-marketing-calendar.description” } } </pageMetadata> </properties> </page>
  • 45. Display new preset in create site dialog 26 web-extension/site-webscripts/org/alfresco/modules/create-site.get.js varsitePresets = [ { id: "site-dashboard", name: msg.get("title.collaborationSite") }, { id: "acme-marketing-preset", name: msg.get("title.acme-marketing-site") }]; model.sitePresets = sitePresets;
  • 46. The ”Event Statistics” page 27 title navigation component-{i}
  • 47. templates/…/flot-grid.ftl 28 <#include "org/alfresco/include/alfresco-template.ftl" /> <@templateHeader "transitional"> <@scripttype="text/javascript" src="${url.context}/res/flot/js/flot.js"/> <@scripttype="text/javascript" src="${url.context}/res/flot/js/jquery.js"/> <@scripttype="text/javascript" src="${url.context}/res/flot/js/jquery.flot.js"/> </@> <@templateBody> <div id="alf-hd"> <@region id="header" scope="global" protected=true /> <@region id="title" scope="template" protected=true /> <@region id="navigation" scope="template" protected=true /> </div> <div id="bd"> <#list 1..9 as cid><div style="float: left;"> <@region id="${'component-' + cid}" scope="page" protected=true/> </div></#list> <div style="clear: both;"></div> </div> </@> <@templateFooter> <div id="alf-ft”><@region id="footer" scope="global" protected=true /></div> </@>
  • 48. template-instances/flot-collaboration-grid.xml 29 <?xml version='1.0' encoding='UTF-8'?> <template-instance> <template-type>flot-grid</template-type> <components> <component> <region-id>title</region-id> <url>/components/title/collaboration-title</url> </component> <component> <region-id>navigation</region-id> <url>/components/navigation/collaboration-navigation</url> </component> </components> </template-instance>
  • 49. pages/flot-event-statistics.xml 30 <?xml version='1.0' encoding='UTF-8'?> <page> <id>flot-event-statistics</id> <title>Event Statistics</title> <template-instance>flot-collaboration-grid</template-instance> <authentication>user</authentication> <components> <component> <region-id>component-1</region-id> <url>/flot/components/event-statistics</url> <properties> <title>flot.title.events-last-30-days</title> <days>-30</days> </properties> </component> <component> <region-id>component-2</region-id> <url>/flot/components/event-statistics</url> <properties> <title>flot.title.events-next-7-days</title> <days>7</days> </properties> </component> </components> </page>
  • 50. components/…/event-statistics.get.html.ftl 31 <#assign el=args.htmlid?js_string> <script type="text/javascript">//<![CDATA[ new Flot.component.EventStatistics("${el}").setOptions({ siteId: "${page.url.templateArgs.site!""}", days: ${args.days!7} }).setMessages( ${messages} ); //]]></script> <div id="${el}-body" class="flot-event-statistics"> <h1>${msg(args.title!"header")}</h1> <div id="${el}-chart" style="width: ${args.width!"500px"}; height: ${args.height!"500px"};"></div> <div id="${el}-control" class="control" style="width: ${args.width!"500px"};"></div> <div id="${el}-tooltip" class="tooltip theme-bg-color-2 theme-border-4" style="display: none;"></div> </div>
  • 51. event-statistics.js(client side) 32 Flot.component.EventStatistics= function(htmlId) { Flot.component.EventStatistics.superclass.constructor.call (this, "Flot.component.EventStatistics", htmlId, ["button"]); return this; }; YAHOO.extend(Flot.component.EventStatistics, Alfresco.component.Base, { options: { days: null }, onReady: function () { // Create chart... } });
  • 52.
  • 53. If you need to override client side resources place them in a file named share-extension.jar
  • 54. Prefix with “3rd party” name:
  • 55. pages – flot-event-statistics.xml
  • 56. templates – flot-grid.xml
  • 57. template-instances – flot-collaboration-grid.ftl
  • 58. css selectors - .flot-event-statistics
  • 59. Use packages where possible:
  • 64.
  • 65. Sweep of configuration possibilities & hookpoints
  • 67. I.e “page” overrides “template” but also make “uri” override “template” and “page”. This makes it possible to have “site specific” components on pages.
  • 68.
  • 69. Learn More 36 wiki.alfresco.com forums.alfresco.com twitter: @AlfrescoECM
  • 70. 37 Shape & Color Pallette Normal Text Normal Text Normal Text
  • 71. 38
  • 72. Summary… 39 URL: /share/page/site/{siteId}/flot-event-statistics pages/flot-event-statistics.xml: <template-instance>flot-collaboration-grid</template-instance> <component> <region-id>component-1</region-id> <url>/flot/components/event-statistics</url> <component> template-instances/flot-collaboration-grid.xml: <template>flot-grid</template> <component> <region-id>title</region-id> <url> /components/title/collaboration-title </url> <component> components/…/event-statistics.get.desc.xml: <url>/flot/components/event-statistics</url> components/…/collaboration-title.get.desc.xml: <url> /components/title/collaboration-title </url> templates/…/flot-grid.ftl: <@region id=“title” scope”template”> <@region id=“component-1” scope”page”>

Notes de l'éditeur

  1. No matter what version of Share you use: never modify source files.Instead you copy the originals and place them in the web-extension folder to be overridden! This is true for all versions!What happens is that Share always looks in web-extension for what it wants before it looks in the webapps folder.New functionality is also placed in shared/classes but just above the web-extenstion folder.Client side resources needs to be placed in a new .war file and all templates that references them needs to be overriden in the web-extension folder.