Friday, August 30, 2013

Alfresco Share : Create a configurable dashlet


How to make dashlet as configurable

 The aim of this post is to help you understand how to make your dashlet as configurable.

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

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

HelloWorldDashlet.get.html.ftl



HelloWorldDashlet.get.desc.xml



HelloWorldDashlet.get.js


Output of the above code




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


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

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




Changes in HelloWorldDashlet.get.html.ftl file

Add the below <script type =”text/javascript”> …. </script> part.




Hope this helps someone.

No comments:

Post a Comment