Alfresco Share setup: header, actions, sites

Introduction

This document describes the configuration of the Share web application. Directions include header (upper menu) settings, document actions, and sites for users’ teamwork.

Share configuration files

Share configuration is carried out with standard configuration files in the XML format. This is the structure of such files:


<alfresco-config>
    <config ...>
...
    </config>
</alfresco-config>


alfresco-config – container unit, that contains configs. config – is a configuration unit.

Configuration unit could have the following attributes:

  • replace (boolean) – indicates if the given config overrides the previously defined one;
  • evaluator (string) – used together with condition. Indicates, that the config is applied when the condition is met. Value is the type of checking (node-type, model-type, string-compare, etc.);
  • condition (string) – value that is required.

Configuration files situated in the site-config folder are applied automatically. The apply procedure is as follows:

  1. alfresco/site-config/;
  2. alfresco/web-extension/site-config/;
  3. share-environment.xml.

Header

This section describes setting up the header of a page. A header contains user’s menu, page heading, and navigation.


The settings are changed in the alfresco/web-extension/site-config/custom/header.xml file. In order for the new settings to take place, Share application must be restarted.  This file is a standard share configuration file.

Configuration is under the container tag header. Here is an example of the configuration file, header.xml:


<alfresco-config>
    <config replace="true">
        <header>
            <legacy-mode-enabled>true</legacy-mode-enabled>
            <app-items>
                <item type="link" id="my-dashboard">{userdashboardpage}</item>
                <item type="js" id="sites">Alfresco.module.AllSites</item>
                <item type="js" id="create-variants">Citeck.module.CreateVariants</item>
                <item type="link" id="journals2" label="Journals" description="Current site journals" icon="journals.png">/site/{lastsite}/journals2/list/main</item>
                <item type="container" id="more">
                    <container-group id="my" label="">
                        <item type="link" id="task-journals" label="Task journals" icon="my-tasks.png">/journals2/list/tasks</item>
                        <item type="link" id="my-workflows">/my-workflows</item>
                        <item type="link" id="global_journals2" label="Guides" description="Guides" icon="journals.png">/journals2/list/main</item>
                    </container-group>
                </item>
                <item type="container" id="admin-tools" label="Admin tools" permission="admin">
                    <container-group id="tools" permission="admin" label="">
                        <item type="link" id="application">/console/admin-console/application
                        </item>
                        <item type="link" id="groups">/console/admin-console/groups</item>
                        <item type="link" id="users">/console/admin-console/users</item>
                        <item type="link" id="overdue-tasks">/overdue-tasks</item>
                        <item type="link" id="repository">/repository</item>
                        <item type="link" id="meta_journals" label="Journal setup" description="Journal setup" icon="journals.png">/journals2/list/meta</item>
                        <item type="link" id="templates">/templates</item>
                        <item type="link" id="orgstruct">/orgstruct</item>
                        <item type="link" id="more">/console/admin-console/</item>
                    </container-group>
                </item>
            </app-items>
            <user-items>
                <item type="container" id="user" icon="" description="">
                    <container-group id="usermenu" label="">
                        <item type="user" id="status">{userprofilepage}</item>
                        <item type="link" id="my-profile">{userprofilepage}</item>
                        <item type="link" id="make-available" condition="user.properties.available === false">/components/delegate/make-available?available=true</item>
                        <item type="link" id="make-notavailable" condition="user.properties.available === true || user.properties.available === null">/components/delegate/make-available?available=false</item>
                        <item type="link" id="change-password" condition="user.capabilities.isMutable">/user/change-password
                        </item>
                        <item type="link" id="logout" condition="!context.externalAuthentication">/dologout</item>
                    </container-group>
                </item>
            </user-items>
            <dependencies>
                <css src="/modules/create-site.css" />
                <css src="/modules/header/all-sites.css" />
                <css src="/modules/header/document-types.css" />
                <js src="/modules/create-site.js" />
                <js src="/modules/header/all-sites.js" />
                <js src="/modules/header/site-page-link.js" />
                <js src="/jquery/jquery-1.6.2-min.js" />
                <js src="/modules/common/ie_fix.js" />
                <js src="/modules/header/document-types.js" />
                <js src="/modules/header/create-variants.js" />
            </dependencies>
        </header>
 
    </config>
 
</alfresco-config>


These are the main configuration elements:

  • app-items – main menu;
  • user-items – user’s menu;
  • container-group – grouping menu items;
  • item – menu item. There are types of these:
    • link – link (relative to /share/page)
    • js – javascript-processor
      • Alfresco.module.Sites – standard site menu
      • Alfresco.module.AllSites – ECOS site menu
      • Citeck.module.CreateVariants – creation options
  • container – cascading menu.

In the item entry there are variables:

  • icon – situated in …/share/components/images/header;
  • label – caption for the menu entry;
  • description – popup description;
  • id – sets icon, label и description at the same time:
    • icon = {id}.png;
    • label = header.{id}.label – from localization;
    • description = header.{id}.description.

Document Library

Used to set up document actions. Configuration file: alfresco/web-extension/site-config/custom/doc-lib.xml.


Here is the action configuration example.


<action id="document-add-income-doc" type="pagelink" icon="plus" label="actions.create-income.label">
   <param name="page">node-create?type=letters:income&amp;param_outcome={node.nodeRef}</param>
   <permissions>
          <permission allow="true">Write</permission>
   </permissions>
<evaluator>evaluator.doclib.letters.outcome</evaluator>
</action>


action – root tag for action description. Has the following set of attributes:

  • id – identification;
  • type – type of action, that will occur during pressing:
    • link – random link;
    • pagelink – link relative to /share/page;
    • javascript – javascript action handler;
    • icon – icon;
    • label –label of action.

The param tag depends on the action type and describes what needs to be done. Its value could be page, href or function. Then inside there is a link to the inner page, outer link or a javascript function name accordingly.

Permissions – access rights granted to the user in order for him to see the action.

Evaluators – random operators, set in the alfresco/web-extension/*-context.xml file. The action is displayed when all evaluators returned true.

In order to define what actions are displayed and where – the actionGroup config is used.


<actionGroup id="document-details">
   <action index="200" id="document-print" />
   <action index="99" id="custom-manage-permissions" />
   <action index="450" id="document-fill-template" />
   <action index="500" id="document-start-statement" />
</actionGroup>


Index represents action ordering.

Sites

Site is the adjustable system division that consists of documents, calendar, blogs, wikis, etc. Every site user has a specific role granting him permissions.

The site can be created via upper menu: Menu – Sites – Create site

  • Name – user name;
  • URL name – identifier;
  • Type – defines the homepage view

 

Site settings are on the /share/page/site/{siteid}/customise-site page.


On this page one can set up site theme and pages. Additional info

Additional Share configuration info is available on the following wiki page: https://wiki.alfresco.com/wiki/Alfresco_Share.