Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Note: The dashboard described here is the Alfresco Explorer Dashboard and not the Alfresco Share Dashboard.
Web Client CustomizationWeb Scripts
From Alfresco 1.4 the 'My Alfresco' area of the web-client UI is known as the Dashboard. It is a configurable area where a user can select from various pre-configured layouts and construct their own page from a list of pre-configured components. A consultant can configure, remove and add new JSP layouts and make them available to users. Developers and consultants can write new components and make them available for selection by users when they are configuring their pages.
The available dashboard layouts are configured inside the dashboards/layouts web-client config XML section:
<config evaluator='string-compare' condition='Dashboards'>
<dashboards>
<layouts>
<layout id='default' columns='1' column-length='5' image='/images/icons/layout_single_column.gif'
label-id='layout_single_label' description-id='layout_single_desc'
jsp='/jsp/dashboards/layouts/single-column.jsp' />
<layout id='narrow-right-2column' columns='2' column-length='4' image='/images/icons/layout_narrow_right_2column.gif'
label-id='layout_narrow_right_label' description-id='layout_narrow_right_desc'
jsp='/jsp/dashboards/layouts/narrow-right-2column.jsp' />
...
</layouts>
...
</dashboards>
</config>
Each layout element has several mandatory attributes:
The components that can be selected for display within a layout column known as dashlets. The available dashlets are configured inside the dashboards/dashlets web-client config XML section:
<config evaluator='string-compare' condition='Dashboards'>
<dashboards>
...
<dashlets>
<dashlet id='getting-started' label-id='dashlet_gettingstarted_label'
description-id='dashlet_gettingstarted_desc'
jsp='/jsp/dashboards/dashlets/getting-started.jsp' allow-narrow='false' />
...
</dashlets>
</dashboards>
</config>
Each dashlet element has several mandatory attributes:
By default two components are displayed for all users. They are the getting-started and tasks-dodo dashlets. In Alfresco 2.1 this is configurable can be overriden in the usual way:
<dashboards>
...
<default-dashlets>
<dashlet id='getting-started' />
<dashlet id='tasks-todo' />
</default-dashlets>
...
</dashboards>
Override the default-dashlets section to change the dashboard as seen by users when they first access the system.
Thanks to the improved JavaScript API in Alfresco 2.1, it is now also possible for a capable admin user to modify the dashboard configuration for users in the system via JavaScript code. For example, an admin user could execute the following script to reset all personal user dashboard preferences back to the default:
var people = search.luceneSearch('TYPE:cm\\:person');
for each (p in people)
{
logger.log('Found user: ' + p.properties.userName);
if (p.hasAspect('app:configurable'))
{
var config = p.childAssocs['app:configurations'][0];
var prefs = config.childrenByXPath('app:preferences');
if (prefs.length == 1)
{
var preferences = prefs[0];
if (preferences.properties['app:dashboard'] != null)
{
preferences.properties['app:dashboard'] = null;
preferences.save();
logger.log(' preferences found and cleared.');
}
}
}
}
Note this script will fail if you have more than 1000 users in your system, as the lucene search will return at most 1000 entries!
Each dashlet component consists of a JSP fragment itself containing JSF UI components. Dashlets are like any other JSP in the web-client except a few rules and restrictions should be followed when constructing them:
<f:view>
and <h:form>
tags, therefore the dashlet should not include those tags itself.<f:verbatim>
JSF tag.A very simple example of a dashlet JSP page might be as follows:
<h:outputText style='font-weight:bold' value='Getting Started' />
<f:verbatim>
</f:verbatim>
<h:graphicImage value='/images/logo/AlfrescoLogo32.gif' width='32' height='32' />
A dashlet can contain any JSF components as appropriate and call any registered JSF managed beans as usual for a page.
Dashlet components can contain any selection of JSF components, including the Template component. This means it is possible to use the results of a FreeMarker template as the dashlet contents. A very simple example dashlet page:
<r:template template='/alfresco/templates/my_docs.ftl' />
The example above loads the template from the classpath. To display a template stored in the repo, copy the NodeRef of the template file and create the page as follows, paste your NodeRef value into the 'template' attribute in the example:
<r:template template='workspace://SpacesStore/e4d1c727-e98b-11da-821a-936824f635fe' />
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.