Creation and configuration of the journal

Journal functionality allows to create objects easily, look it through in a tabular style, set displayed data, to filter items and search.

Consider the journal creation on the example of incoming document.

Journal initialization

It’s important to create configuration for the journal in the repo.

Files with journals configuration are usually placed in the following address:

config/alfresco/module/{module-name}-repo/journals/journals-list.xml

The file structure is as follows:  

<?xml version="1.0" encoding="UTF-8"?>
<journals xmlns="http://www.citeck.ru/ecos/journals/1.0">
       <imports>...</imports>

       <journal id="">
             <option name="">...</option>
             <headers>
                    <header key="" default="" searchable="" sortable="" />
             </headers>
       </journal>
</journals>

Journals container including journals configuration.

Journal  node – the configuration of a particular journal, with its unique identifier in the id attribute.

The journal properties are assigned through the option nodes.

The basic properties are:

Headers container includes summary of journal table columns.

Header node corresponds to the column in the table.  May contain following attributes:

All listed attributes, except key, are logical and take on values: true or false.

Example of journal configuration

Consider the journal configuration on the example of incoming document.


<journal id="letters-income">
       <option name="type">letters:income</option>
       <option name="doubleClickId">nodeRef</option>
       <option name="doubleClickLink">card-details?nodeRef={id}</option>
       <option name="formId">filters</option>
       <headers>
             <header key="idocs:documentStatus" default="true" />
             <header key="idocs:registrationDate" default="true" />
             <header key="idocs:registrationNumber" default="true" />
             <header key="tk:kind" default="true" />
             <header key="letters:deliveryMethod" />
             <header key="letters:reporterOrganization" default="true" />
             <header key="letters:letterWriter" default="true" />
             <header key="letters:subdivision" default="true" />
             <header key="letters:receiver" default="true" />
             <header key="idocs:summary" />
             <header key="idocs:note" />
             <header key="idocs:pagesNumber" />
             <header key="idocs:appendixPagesNumber" />
       </headers>
</journal>

Virtual column

The journal can display not only the columns that correspond to the object model, but also a completely arbitrary content. The column with content which are not described in the model, called virtual.

To create a virtual column, need to create the journals-context.xml file on the following address.

config/alfresco/module/{module-name}-repo/context/journals-context.xml

Context file should contain the structure of the following type:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
       <bean id="" parent="ecos.attribute.scriptAttributeRegistrar">
             <property name="name" value=""/>
             <property name="className" value="" />
             <property name="title" value="" />
             <property name="script">
                    <value>{JavaScript Code}</value>
             </property>
       </bean>
       ...
</beans>

More information about data loading into bootstrap you can find in the official documentation link.

To calculate the value of the virtual attribute, need to create bean with the parent attribute, equal  ecos.attribute.scriptAttributeRegistrar.

Your beans should contain 4 required properties:

Next, you need to register a new context file for journals in the module-context.xml, which is located at address:

config/alfresco/module/{module-name}-repo/module-context.xml

Adding following string:

<import resource="classpath:alfresco/module/{module-name}-repo/context/journals-context.xml" />

In conclusion, you need to add a virtual column in the needed journal. This column is set by analogy with others, except one moment: searchable and sortable attributes should be disabled.

Rapid development advices

It is possible to restart the journal configuration without restart of the entire alfresco.

The obligatory requirement for such manipulations is installed javascript-console on the alfresco module.

To reset the configuration of the journal need in  javascript-console run the following command:


services.get('journals.autoDeployer').load('alfresco/module/{module-name}-repo/journals/journals-list.xml');