Journals in the Citeck ECOS


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:

  • type — the journal type which define what document type will be in the journal. Usually it corresponds to the journal ID.
  • doubleClickId — the document ID, which will be used in the doubleClickLink attribute.
  • doubleClickLink —the link used for the document opening when clicking string twice.

Headers container includes summary of journal table columns.

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

  • In the key attribute names, which should be from the names space listed in the imports part, are indicated.
  • Using default attribute you can specify the attributes that will be displayed by default.
  • To use the sorting on the selected column, need to activate the attribute sortable, then clicking on the column header you can sort the list of objects.
  • The search could find records, focusing on the value of the selected column, it is sufficient to activate the searchable attribute. This field will be indexed.

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:

  • name — the name of the property.
  • className — define the type in which property is defined. It can be type or aspect.
  • title — the item title.
  • Script property should contain inserted value node, which, in its turn, will contain the text of the script for computing the value. The keyword node is available, referring to the whole item.  Thus we can use all properties and associations to create necessary column. Need to use Qname both in the name and in the className. 

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');