Search in sources :

Example 1 with RptReportRendererDto

use of eu.bcvsolutions.idm.rpt.api.dto.RptReportRendererDto in project CzechIdMng by bcvsolutions.

the class DefaultReportManager method toDto.

private RptReportRendererDto toDto(ReportRenderer renderer) {
    RptReportRendererDto dto = new RptReportRendererDto();
    // 
    dto.setId(renderer.getName());
    dto.setName(renderer.getName());
    dto.setModule(renderer.getModule());
    dto.setDescription(AutowireHelper.getBeanDescription(renderer.getClass()));
    dto.setDisabled(renderer.isDisabled());
    dto.setFormat(renderer.getFormat());
    dto.setExtension(renderer.getExtension());
    // 
    return dto;
}
Also used : RptReportRendererDto(eu.bcvsolutions.idm.rpt.api.dto.RptReportRendererDto)

Example 2 with RptReportRendererDto

use of eu.bcvsolutions.idm.rpt.api.dto.RptReportRendererDto in project CzechIdMng by bcvsolutions.

the class DefaultReportManager method getRenderers.

@Override
public List<RptReportRendererDto> getRenderers(String reportName) {
    List<RptReportRendererDto> renderers = new ArrayList<>();
    context.getBeansOfType(RendererRegistrar.class).entrySet().stream().filter(renderer -> {
        return enabledEvaluator.isEnabled(renderer.getValue());
    }).forEach(registrarBean -> {
        String[] rendererNames = registrarBean.getValue().register(reportName);
        if (rendererNames != null) {
            for (String rendererName : rendererNames) {
                ReportRenderer renderer = reportRendererRegistry.getPluginFor(rendererName);
                if (enabledEvaluator.isEnabled(renderer)) {
                    renderers.add(toDto(renderer));
                }
            }
        }
    });
    return renderers;
}
Also used : ReportRenderer(eu.bcvsolutions.idm.rpt.api.renderer.ReportRenderer) PluginRegistry(org.springframework.plugin.core.PluginRegistry) ReportEventType(eu.bcvsolutions.idm.rpt.api.event.ReportEvent.ReportEventType) Autowired(org.springframework.beans.factory.annotation.Autowired) Enabled(eu.bcvsolutions.idm.core.security.api.domain.Enabled) ReportManager(eu.bcvsolutions.idm.rpt.api.service.ReportManager) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) AutowireHelper(eu.bcvsolutions.idm.core.api.utils.AutowireHelper) RptReportRendererDto(eu.bcvsolutions.idm.rpt.api.dto.RptReportRendererDto) RptModuleDescriptor(eu.bcvsolutions.idm.rpt.RptModuleDescriptor) Service(org.springframework.stereotype.Service) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) ImmutableMap(com.google.common.collect.ImmutableMap) LongRunningTaskManager(eu.bcvsolutions.idm.core.scheduler.api.service.LongRunningTaskManager) LongRunningFutureTask(eu.bcvsolutions.idm.core.scheduler.api.dto.LongRunningFutureTask) EnabledEvaluator(eu.bcvsolutions.idm.core.security.api.service.EnabledEvaluator) RptReportExecutorDto(eu.bcvsolutions.idm.rpt.api.dto.RptReportExecutorDto) Collectors(java.util.stream.Collectors) ApplicationContext(org.springframework.context.ApplicationContext) ReportExecutor(eu.bcvsolutions.idm.rpt.api.executor.ReportExecutor) RptReportDto(eu.bcvsolutions.idm.rpt.api.dto.RptReportDto) Objects(java.util.Objects) List(java.util.List) RptRenderedReportDto(eu.bcvsolutions.idm.rpt.api.dto.RptRenderedReportDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) RptReportService(eu.bcvsolutions.idm.rpt.api.service.RptReportService) Comparator(java.util.Comparator) ReportEvent(eu.bcvsolutions.idm.rpt.api.event.ReportEvent) RendererRegistrar(eu.bcvsolutions.idm.rpt.api.renderer.RendererRegistrar) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Assert(org.springframework.util.Assert) ReportRenderer(eu.bcvsolutions.idm.rpt.api.renderer.ReportRenderer) ArrayList(java.util.ArrayList) RptReportRendererDto(eu.bcvsolutions.idm.rpt.api.dto.RptReportRendererDto)

Aggregations

RptReportRendererDto (eu.bcvsolutions.idm.rpt.api.dto.RptReportRendererDto)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 CoreResultCode (eu.bcvsolutions.idm.core.api.domain.CoreResultCode)1 EntityEvent (eu.bcvsolutions.idm.core.api.event.EntityEvent)1 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)1 EntityEventManager (eu.bcvsolutions.idm.core.api.service.EntityEventManager)1 AutowireHelper (eu.bcvsolutions.idm.core.api.utils.AutowireHelper)1 LongRunningFutureTask (eu.bcvsolutions.idm.core.scheduler.api.dto.LongRunningFutureTask)1 LongRunningTaskManager (eu.bcvsolutions.idm.core.scheduler.api.service.LongRunningTaskManager)1 Enabled (eu.bcvsolutions.idm.core.security.api.domain.Enabled)1 EnabledEvaluator (eu.bcvsolutions.idm.core.security.api.service.EnabledEvaluator)1 RptModuleDescriptor (eu.bcvsolutions.idm.rpt.RptModuleDescriptor)1 RptRenderedReportDto (eu.bcvsolutions.idm.rpt.api.dto.RptRenderedReportDto)1 RptReportDto (eu.bcvsolutions.idm.rpt.api.dto.RptReportDto)1 RptReportExecutorDto (eu.bcvsolutions.idm.rpt.api.dto.RptReportExecutorDto)1 ReportEvent (eu.bcvsolutions.idm.rpt.api.event.ReportEvent)1 ReportEventType (eu.bcvsolutions.idm.rpt.api.event.ReportEvent.ReportEventType)1 ReportExecutor (eu.bcvsolutions.idm.rpt.api.executor.ReportExecutor)1 RendererRegistrar (eu.bcvsolutions.idm.rpt.api.renderer.RendererRegistrar)1 ReportRenderer (eu.bcvsolutions.idm.rpt.api.renderer.ReportRenderer)1