Interface IReportsRepository
- All Superinterfaces:
IReadableRepository
,IWritableRepository
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Registered report. -
Method Summary
Modifier and TypeMethodDescriptiongetArtifactReportsLocation
(IBuildArtifact artifact) Return folder which should hold reports related to given artifact (if known).Will transform given location coming fromgetArtifactReportsLocation(IBuildArtifact)
orgetGroupEntityReportsLocation(IGroupEntity)
to point to .reports subfolder.getGroupEntityReportsLocation
(IGroupEntity groupEntity) Return folder which should hold reports related to given group entity (if known).getRegisteredReports
(IGroupEntity groupEntity) Return list of registered reports.void
Register report.void
unregisterReport
(ILocation location) Unregister report.Methods inherited from interface com.polarion.alm.builder.IReadableRepository
copyToLocalFile, exists, getFileSize, getLastModificationTime, isFile, isFolder, listFolder, readFile
Methods inherited from interface com.polarion.alm.builder.IWritableRepository
copyFromLocalFile, makeFolder, moveFromLocalFile, removeLocation, writeFile
-
Method Details
-
getArtifactReportsLocation
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 isnull
-
getGroupEntityReportsLocation
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 isnull
- See Also:
-
getFolderReportsLocation
Will transform given location coming fromgetArtifactReportsLocation(IBuildArtifact)
orgetGroupEntityReportsLocation(IGroupEntity)
to point to .reports subfolder.It is not specified what happens if given location did not originate from
getArtifactReportsLocation(IBuildArtifact)
orgetGroupEntityReportsLocation(IGroupEntity)
.- Parameters:
loc
- location- Returns:
- transformed location (not
null
) - Throws:
IllegalArgumentException
- if loc isnull
-
registerReport
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 isnull
IllegalArgumentException
- if report's location is not under associated repository object's or build artifact's location
-
unregisterReport
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 isnull
-
getRegisteredReports
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
ofIReportsRepository.IReport
s (notnull
)- Throws:
IllegalArgumentException
- if groupEntity isnull
-