Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Introduction to Alfresco                     Dashlets                               for beginnersJordi Vilaplana - Compute...
What is a dashlet?"A dashlet is an application that appears in the Alfresco dashboard that presents informationto the user...
How it works?
Files involved - Naming conventionsTo create a dashlet we need to decide three things ● Dashlets name ● HTTP method used t...
Files involved - Naming conventions
Files involved - Naming conventions● mydashlet.get.desc.xml: Descriptor file● mydashlet.get.js: Model file, where we put t...
Files involved - One file at a timemydashlet.get.desc.xml<webscript>  <shortname>My Dashlet</shortname>  <description>A da...
Files involved - One file at a timemydashlet.get.jsfunction main() {  model.name = "Jordi";}main();All what we put inside ...
Files involved - One file at a timemydashlet.get.html.ftl<script type="text/javascript">//<![CDATA[   new Alfresco.widget....
Files involved - One file at a timemydashlet.propertieslabel.title=My Dashletlabel.hello=HelloWe should put all the string...
Deploy to Alfresco ShareCopy all four files inside:<ALF_HOME>/tomcat/shared/classes/alfresco/web-extension/site-webscripts...
Whats next - Where to look nowDashlets can be much more complex...stats-dashlet:http://code.google.com/p/stats-dashlet/sha...
Upcoming SlideShare
Loading in …5
×

Introduction to Alfresco Dashlets

11,239 views

Published on

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

Published in: Technology, Design
  • I have followed, the example in the presentation but my dashlet is not showed in customise user dashboard. I have tried to restart alfresco and refresh web scripts, but still no result. I can see that the dashlet in my script list. What am I doing wrong
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • thanks you
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Introduction to Alfresco Dashlets

  1. 1. Introduction to Alfresco Dashlets for beginnersJordi Vilaplana - Computer Engineer @vjordi gatasuna@gmail.com http://jordiv.com
  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● mydashlet.properties: 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() { model.name = "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}", "${instance.object.id}");//]]</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: ● mydashlet_ca.properties ● mydashlet_es.properties
  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:http://code.google.com/p/stats-dashlet/share-extras:http://code.google.com/p/share-extras/Alfresco Forums:https://forums.alfresco.com/en/Alfresco Wiki:http://wiki.alfresco.com/

×