Class WorkbasketReportBuilderImpl
- java.lang.Object
-
- pro.taskana.monitor.internal.reports.WorkbasketReportBuilderImpl
-
- All Implemented Interfaces:
Report.Builder<MonitorQueryItem,TimeIntervalColumnHeader>,TimeIntervalReportBuilder<WorkbasketReport.Builder,MonitorQueryItem,TimeIntervalColumnHeader>,WorkbasketReport.Builder
public class WorkbasketReportBuilderImpl extends Object implements WorkbasketReport.Builder
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>classificationCategoriesprotected List<String>classificationIdsprotected List<H>columnHeadersprotected WorkingDaysToDaysConverterconverterprotected List<String>domainsprotected List<String>excludedClassificationIdsprotected booleaninWorkingDaysprotected MonitorMappermonitorMapperprotected List<TaskState>statesprotected InternalTaskanaEnginetaskanaEngineprotected List<String>workbasketIds
-
Constructor Summary
Constructors Constructor Description WorkbasketReportBuilderImpl(InternalTaskanaEngine taskanaEngine, MonitorMapper monitorMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WorkbasketReport.Builder_this()WorkbasketReportbuildReport()WorkbasketReportbuildReport(TaskTimestamp timestamp)Builds the given report.BclassificationCategoryIn(List<String> classificationCategories)Adds a list of classificationCategories to the builder.BclassificationIdIn(List<String> classificationIds)Adds a list of classificationIds to the builder.WorkbasketReport.BuildercombinedClassificationFilterIn(List<CombinedClassificationFilter> combinedClassificationFilter)Adds a list ofCombinedClassificationFilterto 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.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 the report into 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, 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
-
converter
protected WorkingDaysToDaysConverter converter
-
-
Constructor Detail
-
WorkbasketReportBuilderImpl
public WorkbasketReportBuilderImpl(InternalTaskanaEngine taskanaEngine, MonitorMapper monitorMapper)
-
-
Method Detail
-
buildReport
public WorkbasketReport buildReport() throws NotAuthorizedException, InvalidArgumentException
- Specified by:
buildReportin interfaceReport.Builder<MonitorQueryItem,TimeIntervalColumnHeader>- Specified by:
buildReportin interfaceWorkbasketReport.Builder- Throws:
NotAuthorizedExceptionInvalidArgumentException
-
buildReport
public WorkbasketReport buildReport(TaskTimestamp timestamp) throws InvalidArgumentException, NotAuthorizedException
Description copied from interface:TimeIntervalReportBuilderBuilds the given report.- Specified by:
buildReportin interfaceTimeIntervalReportBuilder<WorkbasketReport.Builder,MonitorQueryItem,TimeIntervalColumnHeader>- Specified by:
buildReportin interfaceWorkbasketReport.Builder- Parameters:
timestamp- The task timestamp of interest- Returns:
- The build report
- Throws:
InvalidArgumentException- if an error occursNotAuthorizedException- if the user has no rights to access the monitor
-
combinedClassificationFilterIn
public WorkbasketReport.Builder combinedClassificationFilterIn(List<CombinedClassificationFilter> combinedClassificationFilter)
Description copied from interface:WorkbasketReport.BuilderAdds a list ofCombinedClassificationFilterto the builder. The created report contains only tasks with a pair of a classificationId for a task and a classificationId for the corresponding attachment in this list.- Specified by:
combinedClassificationFilterInin interfaceWorkbasketReport.Builder- Parameters:
combinedClassificationFilter- a list of combinedClassificationFilter- Returns:
- the WorkbasketReportBuilder
-
_this
protected WorkbasketReport.Builder _this()
-
determineGroupedBy
protected String determineGroupedBy()
-
getCombinedClassificationFilter
protected List<CombinedClassificationFilter> getCombinedClassificationFilter()
-
withColumnHeaders
public B withColumnHeaders(List<H> columnHeaders)
Description copied from interface:TimeIntervalReportBuilderAdds a list TimeIntervalColumnHeaders to the builder to subdivide the report into 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 workbasket id 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
-
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 NotAuthorizedException, InvalidArgumentException
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 task timestamp of interest- Returns:
- the list of all taskIds
- Throws:
NotAuthorizedException- if the user has no rights to access the monitorInvalidArgumentException- if the column headers are not initialized
-
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 customField whose values should appear in the list- Returns:
- the list of all custom attribute values
- Throws:
NotAuthorizedException- if the user has no rights to access the monitor
-
-