close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2210

Table Of Contents

5.2.3 Configuring Document Types

Using these elements, the document types of CoreMedia CMS can be configured.

  • The documents usable in the editor (creating by the menu File|New Resource ..., copy, move etc.) via the sub element <DocumentTypePredicate> or <Predicate>.

  • The sorting of the document types shown in the query view, the resource chooser and in the menu File|New Resource ... via the sub element <Comparator>.

  • The initiators and validators which should be used with document fields via the sub element <PropertyType>.

<DocumentTypes>

Child elements: <DocumentType>*, <DocumentTypePredicate>?, <Predicate>?, <Comparator>?

Parent elements: <Editor>

<Editor>
 <DocumentTypes>
  .
  .
 </DocumentTypes>
</Editor>

Example 5.21. Example for the DocumentTypes element


This element of the XML file is used to combine the elements for the document types configuration.

The element has no attributes. If no <DocumentTypes> element is defined, all document types for which the user has the appropriate rights will be shown (except of abstract document types) and will be arranged alphabetically.

<DocumentType>

Child elements: <PropertyType>*

Parent elements: <DocumentTypes>, <DocumentTypePredicate>, <Predicate>

<Editor>
 <DocumentTypes>
   <DocumentType name="Article">
     <PropertyType name="Text">
      .
      .
     </PropertyType>
      .
      .
   </DocumentType>
   .
   .
 </DocumentTypes>
</Editor

Example 5.22. Example of a DocumentType element


This element of the XML file designates the following features:

  • The documents usable in the editor via the parent element <Predicate>.

  • The initiators and validators which should be used with document fields via the sub element <PropertyType>.

The element has one attributes. If no <DocumentType> element is defined, all document types will be shown (except of abstract document types) and will be arranged alphabetically.

Attribute

Description

name

The name of the document type.

Table 5.47. Attribute of the DocumentType element


<PropertyType>

Child elements: <Validator>?, <Initializer>?, <ModelClass>?

Parent elements: <DocumentType>

   <DocumentType name="Article">
     <PropertyType name="Source" initialValue="Internally">
       <Validator class="NotEmpty2"/>
     </PropertyType>
      .
      .
   </DocumentType>

Example 5.23. Example of a PropertyType element


This element is used to provide initializers (or initial values) and validators (or valid pattern) for the properties of the document defined in <DocumentType>.

Attribute

Description

name

This attribute is used for configuring the name of the property which should be initialized or validated.

initialValue

Using this attribute, the value can be entered with which the property is initialized. See Section 5.1.6, “Initializer Classes” for more details.

validPattern

This attribute is used for entering a regular expression against which the content of the property is checked.

Table 5.48. Attributes of the <PropertyType> element


The following table shows the regular expressions which can be used with the attribute validPattern.

Regular expression

Description

.

Matches any character except newline.

[a-z0-9]

Matches any single character of the set.

[^a-z0-9]

Matches any single character not in set.

\d

Matches a digit, that is, [0-9].

\w

Matches an alphanumeric character, that is, [a-zA-Z0-9_].

\W

Matches a non-word, that is [^a-zA-Z0-9_].

\metachar

Matches the character itself, that is, \|, \*, \+.

x?

Matches 0 or 1 x's, where x is any of the above.

x*

Matches 0 or more x's.

x+

Matches 1 or more x's.

x{m,n}

Matches at least m x's but no more than n.

foo|bar

Matches one of foo or bar.

(x)

Brackets a regular expression.

Table 5.49. Regular patterns to use with the attribute validPattern


<Validator>

Child elements: %varies;

Parent elements: <PropertyType>

<PropertyType name="Author">
 <Validator class="MyValidator" myattribute="myvalue"/>
 .
 .  
 
</PropertyType>

Example 5.24. Example of the Validator element.


This element is used for setting validator classes which tests, when a document is checked in, whether certain conditions about the content of the document are fulfilled. It is possible to hand over parameters to the class via attributes of the element.

Attribute

Description

class

This attribute gives the name of the class which checks the content of the field for desired properties. This test is carried out when check in. See Section 5.1.7, “Validator Classes” for predefined classes.

%varies;

This entity stands for further configuration possibilities which depend on the API of the class . The specific configuration possibilities must be obtained from your developers.

Table 5.50. Attributes of the element <Validator>


<Initializer>

Child elements: %varies;

Parent elements: <PropertyType>

<PropertyType name="Author">
 <Initializer class="myInitializer" 
    myattribute="myvalue" />
 .
 .  
 
</PropertyType>

Example 5.25. Example of the Initializer element


Initializer fill the fields of a newly created document with default values. With the element a class for initializing can be provided. Parameters can be handed to the class via attributes of the element (see the code example above).

Attribute

Description

class

This attribute gives the class which presets the fields on initialization of the document. See Section 5.1.6, “Initializer Classes” for predefined classes.

%varies;

This entity stands for further configuration possibilities which depend on the API of the class . The specific configuration possibilities must be obtained from your developers.

Table 5.51. Attributes of the element <Initializer>


<ModelClass>

Child elements:

Parent elements: <PropertyType>

<PropertyType name="Time">
	<ModelClass class="MyPropertyModel"/>
	.
	.
</PropertyType>

Example 5.26. Element ModelClass


The ModelClass element allows you to configure the class from which instances for property values are created. The class attribute is the class name of the property model class, which must have a public no-arg constructor, that is, setting 'class' to 'xxx' corresponds to Class.forName("xxx") on which newInstance() is called to create new property models. An unqualified ModelClass class will be looked up in the package hox.corem.editor.proxy.

Attribute

Description

class

This attribute defines the class which is used to instantiate objects of the property value.

Table 5.52. Attribute of the element ModelClass


<Comparator>

Child elements: %varies;

Parent elements: <DocumentTypes>, <ColumnDefinition>, <TreeSorter>, <Processes>, <NamedDocumentVersionComparator>

<Editor>
 <DocumentTypes>
   <Comparator 
class="hox.corem.editor.generic.GenericDocumentTypeComparator"/>
  .
  .
 </DocumentTypes>
  .
 <Explorer name="FirstExplorer">
   <TreeSorter>
     <Comparator class="my.comparator"/>
   </TreeSorter>
 </Explorer>
</Editor

Example 5.27. Example for sorting the offered document types and the folders in the folder view.


This element of the XML file is used for sorting items:

  • The document types shown when creating a new document in the Site Manager when used in <DocumentTypes>.

  • The folders shown in the folder view when used in <TreeSorter>.

  • The elements shown in a column of the document view, when used in <ColumnDefinition>.

  • The workflow menu entries when used in <Processes>.

  • The worklist when used in <ColumnDefinition> of <TableDefinition> of <Workflow>.

Attribute

Description

class

Name of the class in which the sorting comparator is defined. The class must contain a public constructor without arguments and must implement an interface depending on the objects to sort (see the API documentation and Section 5.1.8, “Comparator Classes”).

Table 5.53. Attribute of element <Comparator>


<DocumentTypePredicate>

Child elements: <DocumentType>*, %varies;

Parent elements: <DocumentTypes>

<DocumentTypes>
    <DocumentTypePredicate class="MyPredicate"/>
          .
          .
</DocumentTypes>

Example 5.28. Example for the DocumentTypePredicate element


You can configure the predicate for filtering document types with the <DocumentTypePredicate> element. The configured predicate defines the document types which can be used in the editor (which can be created, copied, moved, for example). Opposed to a predicate configured with the <Predicate> element in the <DocumentTypes> element, the <DocumentTypePredicate> also affects abstract types that can be selected in the editor's query and search views. Note, that you must not use both <Predicate> and <DocumentTypePredicate> elements in the <DocumentTypes> element.

Section 5.1.3, “Predicate Classes” describes the provided classes to filter document types.

Attribute Description
class Name of the class with the predicate for filtering. Own classes must implement the interface java.util.function.Predicate<Object> to filter document types, which are represented by instances of class hox.corem.editor.proxy.DocumentTypeModel. If you enter no class attribute, the default predicate is used as described in Section 5.1.3, “Predicate Classes”.

Table 5.54. Attributes of the DocumentTypePredicate element


<Predicate>

Child elements: <DocumentType>*, %varies;

Parent elements: <Filter>, <TreeFilter>, <DocumentTypes>, <Processes>, <Workflow>

<Filter name="deleted-filter">
        <Predicate class="UndeletedPredicate"/>
                .
                .                
</Filter>

Example 5.29. Example for the Predicate element used in a Filter element


The predicate for filtering is entered with the <Predicate> element. The provided filter classes are described in Section 5.1.3, “Predicate Classes”. Different objects can be filtered:

  • The documents shown in the document overview of the Site Manager can be filtered, due to different conditions, if the <Predicate> element is used in a <Filter> element.

  • The folders shown in the folder view of the Site Manager can be filtered, if the <Predicate> element is used in a <Treefilter> element.

  • The document types which can be used in the editor (which can be, for example, created, copied, moved), if the <Predicate> element is used in a <DocumentTypes> element. That is the document types defined in the <DocumentType> element inside the <Predicate> element are no longer accessible (negative list).

  • The workflows offered for initiating in the Menu File|New workflow... can be filtered, if the <Predicate> element is used in a <Processes> element.

  • The workflows and tasks shown in the sub views My tasks, Offered tasks and My workflows of the Workflow window can be filtered by custom predicates, if the <Predicate> element is used in a <Workflow> element.

Attribute

Description

class

Name of the class with the predicate for filtering. Own classes must implement the interface java.util.function.Predicate<Object>. Depending on the parent elements different object types will be filtered (see Section 4.6, “Program Own Predicate Classes”). If you enter no class attribute the default predicates are used as described in Section 5.1.3, “Predicate Classes”.

Table 5.55. Attribute of the Predicate element


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.