Package io.jmix.reports.impl.repository
Class ReportRepositoryImpl
java.lang.Object
io.jmix.reports.impl.repository.ReportRepositoryImpl
- All Implemented Interfaces:
ReportRepository
@Component("report_ReportRepository")
public class ReportRepositoryImpl
extends Object
implements ReportRepository
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AccessManagerprotected final AnnotatedReportHolderprotected final DataManagerprotected final EntityStatesprotected final Metadataprotected final MsgBundleToolsprotected final AnnotatedReportScannerprotected final ReportSecurityManagerprotected final ReportsPersistenceprotected final RepositoryUtilprotected final ResourceRoleRepositoryprotected final RoleAssignmentRepositorystatic final StringFetch plan enough to passing report to the running engine. -
Constructor Summary
ConstructorsConstructorDescriptionReportRepositoryImpl(AnnotatedReportHolder annotatedReportHolder, AnnotatedReportScanner reportScanner, DataManager dataManager, ReportsPersistence reportsPersistence, RepositoryUtil repositoryUtil, MsgBundleTools msgBundleTools, ReportSecurityManager reportSecurityManager, ResourceRoleRepository resourceRoleRepository, RoleAssignmentRepository roleAssignmentRepository, EntityStates entityStates, Metadata metadata, AccessManager accessManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsReportByCode(String reportCode) Checks if there are any reports with the given code.booleanexistsReportByGroup(ReportGroup group) Checks if any reports are connected to the given group.Load all known reports.intgetTotalCount(ReportFilter filter) Calculate total count of reports that conform to passed filter.voidhandleApplicationStartedEvent(org.springframework.boot.context.event.ApplicationStartedEvent event) protected booleaninputValueMetaClassSatisfies(Report report, MetaClass inputValueMetaClass, ReportRepositoryImpl.FilteringContext filteringContext) protected booleanloadForRunningByCode(String reportCode) Load by code a full report object with all details, suitable for passing it to the rendering engine.loadList(ReportLoadContext loadContext) Load list of reports, with filtering, pagination and sorting options available.loadReportIdByCode(String reportCode) Loads report id by its code.loadReportsFromDatabase(ReportFilter filter) protected booleanoutputTypeSatisfies(Report report, ReportOutputType outputType) reloadForRunning(Report report) reloadTemplateForRunning(ReportTemplate template) protected booleanroleSatisfies(Report report, org.springframework.security.core.userdetails.UserDetails user, ReportRepositoryImpl.FilteringContext filteringContext) Saves Report entity to the database.protected booleanviewIdSatisfies(Report report, String viewId)
-
Field Details
-
RUN_FETCH_PLAN
Fetch plan enough to passing report to the running engine.- See Also:
-
annotatedReportHolder
-
reportScanner
-
dataManager
-
reportsPersistence
-
repositoryUtil
-
msgBundleTools
-
reportSecurityManager
-
resourceRoleRepository
-
roleAssignmentRepository
-
entityStates
-
metadata
-
accessManager
-
-
Constructor Details
-
ReportRepositoryImpl
public ReportRepositoryImpl(AnnotatedReportHolder annotatedReportHolder, AnnotatedReportScanner reportScanner, DataManager dataManager, ReportsPersistence reportsPersistence, RepositoryUtil repositoryUtil, MsgBundleTools msgBundleTools, ReportSecurityManager reportSecurityManager, ResourceRoleRepository resourceRoleRepository, RoleAssignmentRepository roleAssignmentRepository, EntityStates entityStates, Metadata metadata, AccessManager accessManager)
-
-
Method Details
-
getAllReports
Description copied from interface:ReportRepositoryLoad all known reports. Returned entities aren't guaranteed to have all internal structure loaded, only basic properties. When necessary, reload the entity usingReportRepository.reloadForRunning(Report)method.- Specified by:
getAllReportsin interfaceReportRepository- Returns:
- list of reports with only basic properties loaded
-
loadList
Description copied from interface:ReportRepositoryLoad list of reports, with filtering, pagination and sorting options available. Returned entities aren't guaranteed to have all internal structure loaded, only basic properties. When necessary, reload the entity usingReportRepository.reloadForRunning(Report)method.- Specified by:
loadListin interfaceReportRepository- Parameters:
loadContext- context containing filtering, pagination and sorting options- Returns:
- list of reports with only basic properties loaded
-
viewIdSatisfies
-
roleSatisfies
protected boolean roleSatisfies(Report report, @Nullable org.springframework.security.core.userdetails.UserDetails user, ReportRepositoryImpl.FilteringContext filteringContext) -
inputValueMetaClassSatisfies
protected boolean inputValueMetaClassSatisfies(Report report, @Nullable MetaClass inputValueMetaClass, ReportRepositoryImpl.FilteringContext filteringContext) -
outputTypeSatisfies
-
getTotalCount
Description copied from interface:ReportRepositoryCalculate total count of reports that conform to passed filter.- Specified by:
getTotalCountin interfaceReportRepository- Parameters:
filter- object with filter values- Returns:
- count of suitable reports
-
loadReportsFromDatabase
-
loadForRunningByCode
Description copied from interface:ReportRepositoryLoad by code a full report object with all details, suitable for passing it to the rendering engine.- Specified by:
loadForRunningByCodein interfaceReportRepository- Parameters:
reportCode- report's unique code- Returns:
- full report object with all details, or null if no such report
-
existsReportByCode
Description copied from interface:ReportRepositoryChecks if there are any reports with the given code.- Specified by:
existsReportByCodein interfaceReportRepository- Parameters:
reportCode- report code- Returns:
- true if a report with this code exists, false otherwise
-
loadReportIdByCode
Description copied from interface:ReportRepositoryLoads report id by its code.- Specified by:
loadReportIdByCodein interfaceReportRepository- Parameters:
reportCode- report code.- Returns:
Optionalid for report.
-
existsReportByGroup
Description copied from interface:ReportRepositoryChecks if any reports are connected to the given group.- Specified by:
existsReportByGroupin interfaceReportRepository- Parameters:
group- report group- Returns:
- true if there is a report connected to this group, false otherwise
-
save
Description copied from interface:ReportRepositorySaves Report entity to the database.- Specified by:
savein interfaceReportRepository- Parameters:
report- report entity instance- Returns:
- saved instance
-
reloadForRunning
- Specified by:
reloadForRunningin interfaceReportRepository
-
reloadTemplateForRunning
- Specified by:
reloadTemplateForRunningin interfaceReportRepository
-
isReadPermitted
protected boolean isReadPermitted() -
handleApplicationStartedEvent
@EventListener public void handleApplicationStartedEvent(org.springframework.boot.context.event.ApplicationStartedEvent event)
-