Create Configurable Dashlet For Alfresco Share

First we will create a very simple dashlet and we will extend that to be configurable.

Copy these files into the "tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\dashlets" folder.

HelloWorldDashlet.get.html.ftl

image1.jpg

HelloWorldDashlet.get.desc.xml

image2.jpg

HelloWorldDashlet.get.js

image3.jpg

The output of the code above is:

image4.jpg

Now we will configure the "welcome" message. For this we need to make changes to this HelloWorldDashlet.

Add a configuration file for HelloWorldDashlet as "HelloWorldDashlet.get.config.xml".

HelloWorldDashlet.get.config.xml

image5.jpg

Make the following change in the HelloWorldDashlet.get.js file.

  1. Read the greeting message from the "HelloWorldDashlet.get.config.xml" file.
  2. Add the greeting message into the model.

    image6.jpg

Now for the changes in the "HelloWorldDashlet.get.html.ftl" file.

Add the following "<script type ="text/javascript"> a </script>" part.

image7.jpg

Please find the attached source code.

Hope this helps someone.

Up Next
    Ebook Download
    View all
    Learn
    View all