Interface IReportsRepository

All Superinterfaces:
IReadableRepository, IWritableRepository

public interface IReportsRepository extends IReadableRepository, IWritableRepository
Reports repository.

List of registered reports should be stored in per-artifact (or per-project/per-group if artifact is not specified) .reports/reports.xml:

 <reports>
   <report id="#reportId"
              name="#name"
              description="#description"
              link="#location: relative to group/project/artifact location"/>
   ...<report>...
 </reports>
 

Single-file reports should go directly to getArtifactReportsLocation(IBuildArtifact) or getGroupEntityReportsLocation(IGroupEntity) or to .reports subfolder. Reports represented by folders must go to .reports subfolder. Location .reports/reports.xml is reserved and can be even made unaccessible through this reports repository interface.

Instead of manually using .reports, use getFolderReportsLocation(ILocation).

Version:
$Revision$ $Date$
Author:
Stepan Roh, Polarion Software
  • Method Details

    • getArtifactReportsLocation

      ILocation getArtifactReportsLocation(IBuildArtifact artifact)
      Return folder which should hold reports related to given artifact (if known).

      Typically it is root folder for root, project group folder for project groups and PROJECT_NAME/GROUP_ID/ARTIFACT_ID/REPOSITORY_TAG for the rest (all locations are relative to parent location making it hierarchical).

      Parameters:
      artifact - build artifact
      Returns:
      folder location or null
      Throws:
      IllegalArgumentException - if artifact is null
    • getGroupEntityReportsLocation

      ILocation getGroupEntityReportsLocation(IGroupEntity groupEntity)
      Return folder which should hold reports related to given group entity (if known).
      Parameters:
      groupEntity - project or project group
      Returns:
      folder location or null
      Throws:
      IllegalArgumentException - if groupEntity is null
      See Also:
    • getFolderReportsLocation

      ILocation getFolderReportsLocation(ILocation loc)
      Will transform given location coming from getArtifactReportsLocation(IBuildArtifact) or getGroupEntityReportsLocation(IGroupEntity) to point to .reports subfolder.

      It is not specified what happens if given location did not originate from getArtifactReportsLocation(IBuildArtifact) or getGroupEntityReportsLocation(IGroupEntity).

      Parameters:
      loc - location
      Returns:
      transformed location (not null)
      Throws:
      IllegalArgumentException - if loc is null
    • registerReport

      void registerReport(IReportsRepository.IReport report)
      Register report.

      Registering already registered location or report with the same id (in one group, project or artifact) will unregister it first.

      Existence of given report (resource location) is not checked.

      Parameters:
      report - report to register
      Throws:
      IllegalArgumentException - if report is null
      IllegalArgumentException - if report's location is not under associated repository object's or build artifact's location
    • unregisterReport

      void unregisterReport(ILocation location)
      Unregister report.

      Ignored if report is unknown.

      Removing resource located by report's location will not unregister the report.

      Unregistering report will not remove the resource located by report's location.

      Parameters:
      location - location of report to unregister
      Throws:
      IllegalArgumentException - if location is null
    • getRegisteredReports

      List getRegisteredReports(IGroupEntity groupEntity)
      Return list of registered reports.

      List is ordered by registration time (from oldest to newest) with the exception that if it is project with artifacts then reports are in unspecified order (reports for one artifact are still ordered by registration time).

      Parameters:
      groupEntity - project or project group
      Returns:
      List of IReportsRepository.IReports (not null)
      Throws:
      IllegalArgumentException - if groupEntity is null