Class ReportTemplatesService

java.lang.Object
org.qubership.atp.ram.services.CrudService<ReportTemplate>
org.qubership.atp.ram.services.ReportTemplatesService

@Service public class ReportTemplatesService extends CrudService<ReportTemplate>
  • Field Details

  • Constructor Details

    • ReportTemplatesService

      public ReportTemplatesService()
  • Method Details

    • repository

      protected org.springframework.data.mongodb.repository.MongoRepository<ReportTemplate,UUID> repository()
      Specified by:
      repository in class CrudService<ReportTemplate>
    • getTemplatesByProjectId

      public List<ReportTemplate> getTemplatesByProjectId(UUID projectUuid)
    • deleteByUuid

      public void deleteByUuid(UUID uuid)
    • getDefaultTemplate

      public ReportTemplate getDefaultTemplate()
      system default Report Template with hidden UUID to avoid its modification via rest api.
      Returns:
      default Report Template object
    • getActiveTemplateByProjectId

      public ReportTemplate getActiveTemplateByProjectId(UUID projectId)
      Search and return first available active Report Template for project. If it is unavailable Default Report Template SYSTEM_DEFAULT_TEMPLATE_UUID is returned.
      Parameters:
      projectId - projectId of the Project associated with Report Templates.
      Returns:
      report template object ReportTemplate
    • save

      public ReportTemplate save(ReportTemplate reportTemplate)
      Overrides:
      save in class CrudService<ReportTemplate>
    • update

      public ReportTemplate update(UUID projectId, ReportTemplate reportTemplate)
      Update report template.
      Parameters:
      projectId - project identifier
      reportTemplate - updated report template content
      Returns:
      updated report template
    • getReportTemplateWidgetTemplate

      public String getReportTemplateWidgetTemplate(WidgetType widget) throws IOException
      Get report template widget template content.
      Parameters:
      widget - widget type
      Returns:
      template content
      Throws:
      IOException - if cannot find template resource file