Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Introduction to Alfresco Dashlets

The basics to understand and create an Alfresco dashlet for the Share interface.

  • Sé el primero en comentar

Introduction to Alfresco Dashlets

  1. 1. Introduction to Alfresco Dashlets for beginnersJordi Vilaplana - Computer Engineer @vjordi
  2. 2. What is a dashlet?"A dashlet is an application that appears in the Alfresco dashboard that presents informationto the user." My Sites dashlet
  3. 3. How it works?
  4. 4. Files involved - Naming conventionsTo create a dashlet we need to decide three things ● Dashlets name ● HTTP method used to call the dashlet ● Presentation format for the responseAll dashlet files start with the name of the dashlet
  5. 5. Files involved - Naming conventions
  6. 6. Files involved - Naming conventions● mydashlet.get.desc.xml: Descriptor file● mydashlet.get.js: Model file, where we put the logic● mydashlet.get.html.ftl: View file for the presentation● Properties file
  7. 7. Files involved - One file at a timemydashlet.get.desc.xml<webscript> <shortname>My Dashlet</shortname> <description>A dashlet that does nothing</description> <family>user-dashlet</family> <url>/jordiv/components/dashlets/mydashlet</url></webscript> ● shortname: A user-friendly name ● description: A short description ● family: One of user-dashlet, site-dashlet or dashlet ● url: URL used to access the dashlet
  8. 8. Files involved - One file at a timemydashlet.get.jsfunction main() { = "Jordi";}main();All what we put inside the model variable will be availablein the view.
  9. 9. Files involved - One file at a timemydashlet.get.html.ftl<script type="text/javascript">//<![CDATA[ new Alfresco.widget.DashletResizer("${args.htmlid}", "${}");//]]</script><div class="dashlet"> <div class="title">${msg("label.title")}</div> <div class="body scrollable"> <p>${msg("label.hello")} ${name!}!</p> </div></div>We can access the strings defined in the properties filesusing the msg variable, and use variables from the model
  10. 10. Files involved - One file at a timemydashlet.propertieslabel.title=My Dashletlabel.hello=HelloWe should put all the strings of our dashlet in theproperties file, so it can be easily translatedSupport for more languages can be added creating moreproperties files: ● ●
  11. 11. Deploy to Alfresco ShareCopy all four files inside:<ALF_HOME>/tomcat/shared/classes/alfresco/web-extension/site-webscripts/com/jordiv/Replace com/jordiv by your domainRestart Alfresco Share or click the "Refresh Web Scripts" button (http://<server>:8080/share/page/index) and it will be available in userscustomize dashboardThis is not the best way to deploy a dashlet into Alfresco Share, just thesimplest one
  12. 12. Whats next - Where to look nowDashlets can be much more complex...stats-dashlet: Forums: Wiki: