Class ClassificationReportBuilderImpl
- java.lang.Object
-
- pro.taskana.monitor.internal.reports.ClassificationReportBuilderImpl
-
- All Implemented Interfaces:
ClassificationReport.Builder,Report.Builder<MonitorQueryItem,TimeIntervalColumnHeader>,TimeIntervalReportBuilder<ClassificationReport.Builder,MonitorQueryItem,TimeIntervalColumnHeader>
public class ClassificationReportBuilderImpl extends Object implements ClassificationReport.Builder
The implementation of ClassificationReportBuilder.
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]classificationCategoriesprotected String[]classificationIdsprotected List<H>columnHeadersprotected String[]domainsprotected String[]excludedClassificationIdsprotected booleaninWorkingDaysprotected MonitorMappermonitorMapperprotected TaskState[]statesprotected InternalTaskanaEnginetaskanaEngineprotected String[]workbasketIdsprotected WorkingTimeCalculatorworkingTimeCalculator
-
Constructor Summary
Constructors Constructor Description ClassificationReportBuilderImpl(InternalTaskanaEngine taskanaEngine, MonitorMapper monitorMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClassificationReport.Builder_this()ClassificationReport.DetailedClassificationReportbuildDetailedReport()Returns a ClassificationReport.DetailedClassificationReport containing all tasks after applying the filters.ClassificationReport.DetailedClassificationReportbuildDetailedReport(TaskTimestamp timestamp)ClassificationReportbuildReport()ClassificationReportbuildReport(TaskTimestamp timestamp)Builds the Report for the specified TaskTimestamp.BclassificationCategoryIn(List<String> classificationCategories)Adds a list of classificationCategories to the builder.BclassificationIdIn(List<String> classificationIds)Adds a list of classificationIds to the builder.BcustomAttributeIn(TaskCustomField customField, String... strings)Adds the values of a certain TaskCustomField for exact matching to the builder.BcustomAttributeLike(TaskCustomField customField, String... strings)Adds the values of a certain TaskCustomField for pattern matching to the builder.BcustomAttributeNotIn(TaskCustomField customField, String... strings)Excludes the values of a certain TaskCustomField to the builder.BcustomIntAttributeIn(TaskCustomIntField customIntField, Integer... values)Adds the values of a certain TaskCustomIntField for exact matching to the builder.BcustomIntAttributeNotIn(TaskCustomIntField customIntField, Integer... values)Excludes the values of a certain TaskCustomIntField to the builder.BcustomIntAttributeNotWithin(TaskCustomIntField customIntField, IntInterval... values)Exclude ranges of TaskCustomIntField for matching to the builder.BcustomIntAttributeWithin(TaskCustomIntField customIntField, IntInterval... values)Adds ranges of TaskCustomIntField for matching to the TimeIntervalReportBuilder.protected StringdetermineGroupedBy()BdomainIn(List<String> domains)Adds a list of domains to the builder.BexcludedClassificationIdIn(List<String> excludedClassificationIds)Adds a list of excludedClassificationIds to the builder.protected List<CombinedClassificationFilter>getCombinedClassificationFilter()BinWorkingDays()If this filter is used, the days of the Report are counted in working days.List<String>listCustomAttributeValuesForCustomAttributeName(TaskCustomField taskCustomField)Returns a list of all values of an entered custom field that are in the Report.List<String>listTaskIdsForSelectedItems(List<SelectedItem> selectedItems, TaskTimestamp timestamp)Returns a list of all taskIds of the Report that are in the list of selected items.BstateIn(List<TaskState> states)Adds a list of states to the builder.BwithColumnHeaders(List<H> columnHeaders)Adds a list TimeIntervalColumnHeaders to the Builder to subdivide theReportinto clusters.BworkbasketIdIn(List<String> workbasketIds)Adds a list of workbasket ids to the builder.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface pro.taskana.monitor.api.reports.TimeIntervalReportBuilder
classificationCategoryIn, classificationIdIn, customAttributeIn, customAttributeLike, customAttributeNotIn, customIntAttributeIn, customIntAttributeNotIn, customIntAttributeNotWithin, customIntAttributeWithin, domainIn, excludedClassificationIdIn, inWorkingDays, listCustomAttributeValuesForCustomAttributeName, listTaskIdsForSelectedItems, stateIn, withColumnHeaders, workbasketIdIn
-
-
-
-
Field Detail
-
taskanaEngine
protected InternalTaskanaEngine taskanaEngine
-
monitorMapper
protected MonitorMapper monitorMapper
-
columnHeaders
protected List<H extends TimeIntervalColumnHeader> columnHeaders
-
inWorkingDays
protected boolean inWorkingDays
-
workbasketIds
protected String[] workbasketIds
-
states
protected TaskState[] states
-
classificationCategories
protected String[] classificationCategories
-
domains
protected String[] domains
-
classificationIds
protected String[] classificationIds
-
excludedClassificationIds
protected String[] excludedClassificationIds
-
workingTimeCalculator
protected WorkingTimeCalculator workingTimeCalculator
-
-
Constructor Detail
-
ClassificationReportBuilderImpl
public ClassificationReportBuilderImpl(InternalTaskanaEngine taskanaEngine, MonitorMapper monitorMapper)
-
-
Method Detail
-
buildReport
public ClassificationReport buildReport() throws InvalidArgumentException, NotAuthorizedException
- Specified by:
buildReportin interfaceClassificationReport.Builder- Specified by:
buildReportin interfaceReport.Builder<MonitorQueryItem,TimeIntervalColumnHeader>- Throws:
InvalidArgumentExceptionNotAuthorizedException
-
buildReport
public ClassificationReport buildReport(TaskTimestamp timestamp) throws InvalidArgumentException, NotAuthorizedException
Description copied from interface:TimeIntervalReportBuilderBuilds the Report for the specified TaskTimestamp.- Specified by:
buildReportin interfaceClassificationReport.Builder- Specified by:
buildReportin interfaceTimeIntervalReportBuilder<ClassificationReport.Builder,MonitorQueryItem,TimeIntervalColumnHeader>- Parameters:
timestamp- The TaskTimestamp of interest- Returns:
- The build Report
- Throws:
InvalidArgumentException- if an error occursNotAuthorizedException- if the current user is not member of TaskanaRole.MONITOR or TaskanaRole.ADMIN
-
buildDetailedReport
public ClassificationReport.DetailedClassificationReport buildDetailedReport() throws InvalidArgumentException, NotAuthorizedException
Description copied from interface:ClassificationReport.BuilderReturns a ClassificationReport.DetailedClassificationReport containing all tasks after applying the filters. If the column headers are set the report is subdivided into clusters. ItsFoldableRows contain an additional list of Rows for the classifications of the attachments of the tasks.- Specified by:
buildDetailedReportin interfaceClassificationReport.Builder- Returns:
- the DetailedClassificationReport
- Throws:
InvalidArgumentException- if the column headers are not initializedNotAuthorizedException- if the current user is not member of TaskanaRole.MONITOR or TaskanaRole.ADMIN
-
buildDetailedReport
public ClassificationReport.DetailedClassificationReport buildDetailedReport(TaskTimestamp timestamp) throws InvalidArgumentException, NotAuthorizedException
- Specified by:
buildDetailedReportin interfaceClassificationReport.Builder- Throws:
InvalidArgumentExceptionNotAuthorizedException
-
_this
protected ClassificationReport.Builder _this()
-
determineGroupedBy
protected String determineGroupedBy()
-
withColumnHeaders
public B withColumnHeaders(List<H> columnHeaders)
Description copied from interface:TimeIntervalReportBuilderAdds a list TimeIntervalColumnHeaders to the Builder to subdivide theReportinto clusters.- Specified by:
withColumnHeadersin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
columnHeaders- the column headers the Report should consist of.- Returns:
- the TimeIntervalReportBuilder
-
inWorkingDays
public B inWorkingDays()
Description copied from interface:TimeIntervalReportBuilderIf this filter is used, the days of the Report are counted in working days.- Specified by:
inWorkingDaysin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Returns:
- the TimeIntervalReportBuilder
-
workbasketIdIn
public B workbasketIdIn(List<String> workbasketIds)
Description copied from interface:TimeIntervalReportBuilderAdds a list of workbasket ids to the builder. The created Report contains only Tasks with a workbasketId in this list.- Specified by:
workbasketIdInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
workbasketIds- a list of workbasket ids- Returns:
- the TimeIntervalReportBuilder
-
stateIn
public B stateIn(List<TaskState> states)
Description copied from interface:TimeIntervalReportBuilderAdds a list of states to the builder. The created Report contains only Tasks with a state in this list.- Specified by:
stateInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
states- a list of states- Returns:
- the TimeIntervalReportBuilder
-
classificationCategoryIn
public B classificationCategoryIn(List<String> classificationCategories)
Description copied from interface:TimeIntervalReportBuilderAdds a list of classificationCategories to the builder. The created Report contains only Tasks with a category in this list.- Specified by:
classificationCategoryInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
classificationCategories- a list of classificationCategories- Returns:
- the TimeIntervalReportBuilder
-
classificationIdIn
public B classificationIdIn(List<String> classificationIds)
Description copied from interface:TimeIntervalReportBuilderAdds a list of classificationIds to the builder. The created Report contains only Tasks with a classificationId in this list.- Specified by:
classificationIdInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
classificationIds- a list of classificationIds- Returns:
- the TimeIntervalReportBuilder
-
excludedClassificationIdIn
public B excludedClassificationIdIn(List<String> excludedClassificationIds)
Description copied from interface:TimeIntervalReportBuilderAdds a list of excludedClassificationIds to the builder. The created Report contains only Tasks with a classificationId NOT in this list.- Specified by:
excludedClassificationIdInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
excludedClassificationIds- a list of excludedClassificationIds- Returns:
- the TimeIntervalReportBuilder
-
domainIn
public B domainIn(List<String> domains)
Description copied from interface:TimeIntervalReportBuilderAdds a list of domains to the builder. The created Report contains only Tasks with a domain in this list.- Specified by:
domainInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
domains- a list of domains- Returns:
- the TimeIntervalReportBuilder
-
customAttributeIn
public B customAttributeIn(TaskCustomField customField, String... strings) throws InvalidArgumentException
Description copied from interface:TimeIntervalReportBuilderAdds the values of a certain TaskCustomField for exact matching to the builder.The created Report contains only Tasks with a custom attribute value exactly matching one of the items in the List.
- Specified by:
customAttributeInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customField- the specified TaskCustomFieldstrings- the values the specified custom attribute should match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
InvalidArgumentException- if filter values are not given
-
customAttributeNotIn
public B customAttributeNotIn(TaskCustomField customField, String... strings) throws InvalidArgumentException
Description copied from interface:TimeIntervalReportBuilderExcludes the values of a certain TaskCustomField to the builder.The created Report contains only Tasks with a custom attribute value not matching one of the items in the List.
- Specified by:
customAttributeNotInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customField- the specified TaskCustomFieldstrings- the values the specified custom attribute should not match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
InvalidArgumentException- if filter values are not given
-
customIntAttributeIn
public B customIntAttributeIn(TaskCustomIntField customIntField, Integer... values) throws InvalidArgumentException
Description copied from interface:TimeIntervalReportBuilderAdds the values of a certain TaskCustomIntField for exact matching to the builder.The created Report contains only Tasks with a custom attribute value exactly matching one of the items in the List.
- Specified by:
customIntAttributeInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customIntField- the specified TaskCustomIntFieldvalues- the values the specified customIntField should match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
InvalidArgumentException- if filter values are not given
-
customIntAttributeNotIn
public B customIntAttributeNotIn(TaskCustomIntField customIntField, Integer... values) throws InvalidArgumentException
Description copied from interface:TimeIntervalReportBuilderExcludes the values of a certain TaskCustomIntField to the builder.The created Report contains only Tasks with a custom attribute value not matching one of the items in the List.
- Specified by:
customIntAttributeNotInin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customIntField- the specified TaskCustomIntFieldvalues- the values the specified customIntFields should not match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
InvalidArgumentException- if filter values are not given
-
customIntAttributeWithin
public B customIntAttributeWithin(TaskCustomIntField customIntField, IntInterval... values) throws IllegalArgumentException
Description copied from interface:TimeIntervalReportBuilderAdds ranges of TaskCustomIntField for matching to the TimeIntervalReportBuilder.The created Report contains only Tasks with a customIntField value being inside the range of one of the items in the list.
- Specified by:
customIntAttributeWithinin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customIntField- the specified TaskCustomIntFieldvalues- the values the specified customIntField should match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
IllegalArgumentException
-
customIntAttributeNotWithin
public B customIntAttributeNotWithin(TaskCustomIntField customIntField, IntInterval... values) throws IllegalArgumentException
Description copied from interface:TimeIntervalReportBuilderExclude ranges of TaskCustomIntField for matching to the builder.The created report contains only Tasks with a customIntField value being not inside the range of one of the items in the list.
- Specified by:
customIntAttributeNotWithinin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customIntField- the specified TaskCustomIntFieldvalues- the values the specified customIntField should match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
IllegalArgumentException
-
customAttributeLike
public B customAttributeLike(TaskCustomField customField, String... strings) throws InvalidArgumentException
Description copied from interface:TimeIntervalReportBuilderAdds the values of a certain TaskCustomField for pattern matching to the builder.The created Report contains only Tasks with a custom attribute value pattern-matching one of the items in the list. They will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
- Specified by:
customAttributeLikein interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
customField- the specified TaskCustomFieldstrings- the values the specified custom attribute should match- Returns:
- the modified TimeIntervalReportBuilder
- Throws:
InvalidArgumentException- if filter values are not given
-
listTaskIdsForSelectedItems
public List<String> listTaskIdsForSelectedItems(List<SelectedItem> selectedItems, TaskTimestamp timestamp) throws InvalidArgumentException, NotAuthorizedException
Description copied from interface:TimeIntervalReportBuilderReturns a list of all taskIds of the Report that are in the list of selected items.- Specified by:
listTaskIdsForSelectedItemsin interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
selectedItems- a list of selectedItemstimestamp- the TaskTimestamp of interest- Returns:
- the list of all taskIds
- Throws:
InvalidArgumentException- if the column headers are not initializedNotAuthorizedException- if the current user is not member of TaskanaRole.MONITOR or TaskanaRole.ADMIN
-
listCustomAttributeValuesForCustomAttributeName
public List<String> listCustomAttributeValuesForCustomAttributeName(TaskCustomField taskCustomField) throws NotAuthorizedException
Description copied from interface:TimeIntervalReportBuilderReturns a list of all values of an entered custom field that are in the Report.- Specified by:
listCustomAttributeValuesForCustomAttributeNamein interfaceTimeIntervalReportBuilder<B extends TimeIntervalReportBuilder<B,I,H>,I extends AgeQueryItem,H extends TimeIntervalColumnHeader>- Parameters:
taskCustomField- the TaskCustomField whose values should appear in the list- Returns:
- the list of all custom attribute values
- Throws:
NotAuthorizedException- if the current user is not member of TaskanaRole.MONITOR or TaskanaRole.ADMIN
-
getCombinedClassificationFilter
protected List<CombinedClassificationFilter> getCombinedClassificationFilter()
-
-