Developers are able to create new dashlets that can be added to the list of available dashlets. A dashlet is composed of a number of files, one of which is called the descriptor file. The descriptor file is a brief XML document that describes the name, description and availability information about the dashlet.
Alfresco documentation describes how the <family> tag can be used in the descriptor to specify which of the two dashboards the dashlet can appear: on the user, site, or both of the dashboards.
The family tag can take the following values:
- user-dashlet - for use on the User Dashboard
- site-dashlet - for use on the Site Dashboard
- dashlet - for use on either User or Site Dashboards
<family>group:GROUP_ALFRESCO_ADMINISTRATORS</family>
Here we refer to the Alfresco administrators group called ALFRESCO_ADMINISTRATORS. Note that the group name used within Alfresco code prefixes all names with GROUP_. We see the group is referenced here as GROUP_ALFRESCO_ADMINISTRATORS, even though it is displayed as ALFRESCO_ADMINISTRATORS in the Group Browser of the Share UI.
Now, let's consider a specific case. When developing the Formtek Peer Association Extension, we had the need for a dashlet to be available only to administrators from their user dashboards. To enforce both restrictions, we used the following dashlet descriptor file with two family tag elements:
<webscript>
<shortname>Remove Peer Association</shortname>
<description>Removes Formtek Peer Association Metadata</description>
<family>user-dashlet</family>
<family>group:GROUP_ALFRESCO_ADMINISTRATORS</family>
<url>/components/ftkassociations/dashlets/remove</url>
</webscript>
No comments:
Post a Comment