Alfresco-inboxes is an Alfresco plugin that provides an inbox view inside Share, implemented using the new Aikau framework. In this post I’ll explain how to customise it using the configuration file
What can be configured
You can configure:
- the number and titles of the inbox groups
- the number and titles of the inboxes
- the CMIS query that defines an inbox’s content
- the inbox icons
In practical terms, if you look at the default page:
- the two groups “My documents” and “Archives”,
- the 8 inboxes “Drafts”, “For my approval”, “Overdue”, etc,
- the queries that produce the results that you see on the right side of the page and that are summarised in the counter near the inbox
- the icons (paper clip, inbox, clock, etc )
… are all the result of configuration and can be changed easily.
Step 1: locate the configuration file
The configuration file is called
inboxes.get.config.xml and is located in the source distribution under:
If you change the file, you’ll have to rebuild and reinstall the amp. If the amp is already installed, the config file will be located under:
You can modify this file directly so you don’t have to reinstall the amp or restart Alfresco. However, after each modification, remember to force Alfresco to reload it by visiting http://localhost:8080/share/service/index and clicking on the “Refresh Web Scripts” button.
Step 2: study the XML structure
The XML structure is the following:
- a root
inboxeselement contains one or more
groupelement contains one or more
inboxelement contains exactly one
Step 3: define groups and inboxes
Just to familiarise with the xml structure, let’s delete the default content and start from scratch with a minimal configuration:
Save the file, refresh the web scripts, reload the page. You should now see the new configuration applied:
The id attribute is used as the group/inbox title. In a later post I’ll explain how to translate the titles in different languages using i18n.
The inbox counter currently displays an “ERR” value, which prompts us to move on to the next configuration step.
Step 4: write the CMIS queries
The content of an inbox is defined by a CMIS query. A CMIS query is similar to an SQL query but its purpose is to retrieve lists of documents and it follows a different syntax.
As an example, let’s write a query that retrieves all the documents in the “Meeting Notes” folder under the “swsdp” demo site available on all Alfresco installations:
inboxes.get.config.xml file, refresh the web scripts and reload the page. You should now see the inbox counter displaying the correct value and the corresponding list of documents on the right side of the page.
Step 5: add the inbox icons
Alfresco-inboxes includes the “general set” of the ZURB Foundation icons. Pick an icon that you like and write down its name (e.g. “idea”). Prepend “foundicon-” to the name (e.g. “foundicon-idea”) – this will be the value for the
Repeat for all inboxes. This should give you our final
Save, refresh web scripts, reload the page, and… TA-DA! a fully configured set of inboxes:
A post on example CMIS queries.
If you’re now familiar with CMIS, I recommend you experiment with it using Alfresco’s node browser which is available on all installations if you log in as an administrator.