Class DmsRelationCounter
java.lang.Object
ch.tocco.nice2.rest.documents.impl.resources.DmsRelationCounter
- All Implemented Interfaces:
CustomRelationCounter
Custom relation counter for the DMS relation
Issues with the default implementation of the MultiCountResource:
- number of folders are ignored
- resources with field_model != null are not counted
- resources in a folder are counted
Add an efficient implementation which counts the correct number (= same as the count of the dms list) of resources
and folders on the root level. Any element in folders are ignored. Resources with field_model != null are correctly counted.
Execute queries privileged because the permissions are checked before
-
Constructor Summary
ConstructorDescriptionDmsRelationCounter
(SecurityManager securityManager, Context context, QueryBuilderFactory queryBuilderFactory) -
Method Summary
-
Constructor Details
-
DmsRelationCounter
public DmsRelationCounter(SecurityManager securityManager, Context context, QueryBuilderFactory queryBuilderFactory)
-
-
Method Details
-
getCount
- Specified by:
getCount
in interfaceCustomRelationCounter
- Returns:
- the number of related entities
-
supports
- Specified by:
supports
in interfaceCustomRelationCounter
- Returns:
- `true` if this
CustomRelationCounter
supports the given relation name.
-