close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2107

Table Of Contents

5.1.3 Predicate Classes

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

Example 5.5. Example for the use of a filter


Predicate classes enable selective display of objects. Depending on the context in which the <Predicate> element is used, different object types can be selected:

  • <Filter>

  • If the <Predicate> element is used in a <Filter> element, the documents shown in the document overview of the Site Manager can be filtered, due to different conditions. Thus, the objects to be filtered are documents of the type hox.corem.editor.proxy.DocumentTypeModel.

  • <Treefilter>

  • If the <Predicate> element is used in a <Treefilter> element, the folders shown in the folder view of the Site Manager can be filtered. The objects to be filtered are folders of the type hox.corem.editor.proxy.ResourceHolder.

  • <DocumentTypes>

  • If a <Predicate> or <DocumentTypePredicate> element is used in a <DocumentTypes> element, the document types which can be created, moved, copied or selected in the document choosers of the Site Manager are filtered. Thus, the objects to be filtered are document types hox.corem.editor.proxy.DocumentTypeModel.

  • <Processes>

  • If the <Predicate> element is used in a <Processes> element, the workflows offered for initiating in the Menu File|New workflow... are filtered. The objects to be filtered are workflows of the type com.coremedia.workflow.WfProcess.

  • <Workflow>

  • If the <Predicate> element is used in a <Workflow> element, the workflows and tasks shown in the sub views My tasks, Offered tasks and My workflows of the Workflow window can be filtered, if the <Predicate> element is used in a <Workflow> element. The objects to be filtered are com.coremedia.workflow.WfProcess and com.coremedia.workflow.WfTask.

Filtering can occur on both the client side and the server side. The predefined filters only run on the server side, while customized filters must run on the client side. This is determined by the remote attribute of the <Filter> element. The default value "true" indicates server-side selection.

Predicates for filtering document types

Default Predicate Filtered objects Description
GenericDocumentTypePredicate

Document types:

hox.corem.editor.proxy.DocumentTypeModel

The default predicate filters the document types which are passed to the predicate class and sorts the remaining document types in alphabetic order. Own predicates must implement the interface com.coremedia.common.util.Predicate<Object>

Table 5.15. Predicate classes for filtering documents types.


Predicates for filtering folders

Default predicate Filtered objects Description
GenericTreePredicate

Folders:

hox.corem.editor.proxy.ResourceHolder

The default comparator filters without read rights. Own predicates must implement com.coremedia.common.util.Predicate<Object>.

Table 5.16. Predicate classes for filtering folders


Predicates for filtering workflows and tasks

Default predicate Sorted objects Description
GenericProcessPredicate

Workflows:

com.coremedia.workflow.WfProcess

The default predicate filters workflows for which no creation right is granted to the user. Own predicates must implement com.coremedia.common.util.Predicate<Object>.
DefaultWorklistPredicate

Workflows:

com.coremedia.workflow.WfProcess

Tasks:

com.coremedia.workflow.WfTask

The default predicate filters tasks and workflows by the three categories: my tasks, offered tasks and my workflows

Own predicates must implement java.lang.Cloneable and must extend hox.corem.editor.workflow.AbstractWorklistPredicate and should extend the default filter hox.corem.editor.workflow.DefaultWorklistPredicate for convenience.

Table 5.17. Predicate classes for filtering workflows


Predicates for filtering documents

The following filters are predefined and can be configured without stating the appropriate package. They can only be used for <Predicate> elements within the <Filter> element. For each predicate, you need to define an attribute name in the <Filter> element. Otherwise, no name for the filter will be shown in the View|Filter menu. You will find the names to use in the next table.

Class

Description

DatePredicate

Filters out documents which are older than the current date minus an offset which can be set, using the attribute relativeOffset. The unit of relativeOffset is milliseconds. You have to set the name of the document property to check, using the attribute name.

Example:

<Explorer name="my-configurable-explorer">

<Filter name="7-days-modified-date-filter>

<Predicate class="DatePredicate" name="modificationDate_" relativeOffset="604800000"/>

</Filter>

...

MapPredicate

Filters out specially defined documents. To do so, two sub elements of <Predicate> are provided.

<FilterMap>

In this element, the attribute document can be used to assign the document type which should be filtered and the attribute property can be used to assign the property which should be evaluated.

<FilterSet>

In this element, the attribute filter can be used to define the string which should be filtered. Only exact matches will be filtered, the check is case-sensitive.

Example:

<Predicate class="MapPredicate">

<FilterMap document="Article" property="Headline"/>

<FilterSet filter="Sports"/>

</Predicate>

All documents of type "Article" with exactly the string "Sports" in the property Headline would be filtered.

If you define a name for this filter in the <Filter> element, you need to create a custom bundle (see Section 4.10, “Localization” for localization) containing this name.

UndeletedPredicate

Filters deleted documents.

You need to set the attribute name of the <Filter> element to undeleted-filter.

PublishedPredicate

Only displays published documents.

You need to set the attribute name of the <Filter> element to "published-filter".

UnapprovedUnpublishedPredicate

Displays documents which have been neither published nor approved.

You need to set the attribute name of the <Filter> element to "unapprovedunpublished-filter".

ToBeApprovedPredicate

Displays documents which have been moved, renamed, marked for deletion or where the latest version has not been approved.

You need to set the attribute name of the <Filter> element to "tobeapproved-filter".

ToBePublishedPredicate

Displays documents which have been moved, renamed, marked for deletion or for which a new version exists. This has been approved but not published yet.

You need to set the attribute name of the <Filter> element to "tobepublished-filter".

Table 5.18. Predicate classes for filtering documents


Own Predicates for filtering documents

Default predicate Sorted objects Description
None

Documents:

hox.corem.editor.proxy.DocumentVersionHolder

Own predicates must implement com.coremedia.common.util.Predicate<Object>.

Table 5.19. Programming own predicates


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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