Basic configuration - softwareloop/alfresco-inboxes GitHub Wiki
Alfresco-inboxes is an Alfresco plugin that provides an inbox view inside Share,
implemented using the new Aikau framework. This page explains how to
customise it using the configuration file inboxes.get.config.xml
.
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.
The configuration file is called inboxes.get.config.xml
and is located in the
source distribution under:
config/alfresco/web-extension/site-webscripts/softwareloop/inboxes/
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:
$ALF_HOME/tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/site-webscripts/softwareloop/inboxes/
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.
The XML structure is the following:
- a root
inboxes
element contains one or moregroup
elements - a
group
element contains one or moreinbox
elements - an
inbox
element contains exactly onequery
element
<inboxes>
<group id="my-documents">
<inbox id="drafts" iconClass="foundicon-paper-clip">
<query><![CDATA[
SELECT d.*, t.*
FROM cmis:document AS d
JOIN cm:titled AS t on d.cmis:objectId = t.cmis:objectId
WHERE contains(d, 'PATH:"/app:company_home/st:sites/cm:swsdp/cm:documentLibrary/cm:Meeting_x0020_Notes/*"')
]]></query>
</inbox>
<!-- other inbox definitions -->
</group>
<!-- other group definitions -->
</inboxes>
Just to familiarise with the xml structure, let's delete the default content and start from scratch with a minimal configuration:
<inboxes>
<group id="First group">
<inbox id="An inbox">
<query></query>
</inbox>
<inbox id="Another inbox">
<query></query>
</inbox>
</group>
<group id="Second group">
<inbox id="Yet another inbox">
<query></query>
</inbox>
</group>
</inboxes>
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. The Translations page explains how to translate the titles in other languages using i18n.
The inbox counter currently displays an "ERR" value, which prompts us to move on to the next configuration step.
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:
<query><![CDATA[
SELECT d.*, t.*
FROM cmis:document AS d
JOIN cm:titled AS t on d.cmis:objectId = t.cmis:objectId
WHERE contains(d, 'PATH:"/app:company_home/st:sites/cm:swsdp/cm:documentLibrary/cm:Meeting_x0020_Notes/*"')
]]></query>
Save the 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.
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 iconClass
attribute.
Repeat for all inboxes. This should give you the final inboxes.get.config.xml
:
<inboxes>
<group id="First group">
<inbox id="An inbox" iconClass="foundicon-idea">
<query><![CDATA[
SELECT d.*, t.*
FROM cmis:document AS d
JOIN cm:titled AS t on d.cmis:objectId = t.cmis:objectId
WHERE contains(d, 'PATH:"/app:company_home/st:sites/cm:swsdp/cm:documentLibrary/cm:Meeting_x0020_Notes/*"')
]]></query>
</inbox>
<inbox id="Another inbox" iconClass="foundicon-clock">
<query><![CDATA[
SELECT d.*, t.*
FROM cmis:document AS d
JOIN cm:titled AS t on d.cmis:objectId = t.cmis:objectId
WHERE contains(d, 'PATH:"/app:company_home/st:sites/cm:swsdp/cm:documentLibrary/cm:Meeting_x0020_Notes/*"')
]]></query>
</inbox>
</group>
<group id="Second group">
<inbox id="Yet another inbox" iconClass="foundicon-phone">
<query><![CDATA[
SELECT d.*, t.*
FROM cmis:document AS d
JOIN cm:titled AS t on d.cmis:objectId = t.cmis:objectId
WHERE contains(d, 'PATH:"/app:company_home/st:sites/cm:swsdp/cm:documentLibrary/cm:Meeting_x0020_Notes/*"')
]]></query>
</inbox>
</group>
</inboxes>
Save, refresh the web scripts, reload the page, and... TA-DA! a fully configured set of inboxes:
More example CMIS queries.
If you're not familiar with CMIS, you can experiment with it using Alfresco's node browser which is available on all installations if you log in as an administrator.