ReportsProvider

The ReportsProvider class is useful to create and provide the reports for the releases

Author

N7ghtm4r3 - Tecknobit

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val ASSETS_DIRECTORY: String = "assets"
ASSETS_DIRECTORY the assets directory where are stored the assets of the releases uploaded
Link copied to clipboard
private val BREAK_LINE: String = "<br>"
BREAK_LINE constant of the break line html tag
Link copied to clipboard
private open var currentRelease: Release
currentRelease the release on which create its report
Link copied to clipboard
val LOGOS_DIRECTORY: String = "logos"
LOGOS_DIRECTORY the logos directory where are stored the logos of the projects
Link copied to clipboard
private val mantis: Mantis
mantis helper to manage the multi-language of the report
Link copied to clipboard
private val PDF_EXTENSION: String = ".pdf"
PDF_EXTENSION extension to apply to the reports files
Link copied to clipboard
val PROFILES_DIRECTORY: String = "profiles"
Link copied to clipboard
val PROJECT_LOGO_TAG: String = "<project_logo>"
PROJECT_LOGO_TAG the tag to indicate where is the project logo and where place the real value
Link copied to clipboard
val PROJECT_NAME_TAG: String = "<project_name>"
PROJECT_NAME_TAG the tag to indicate where is the project name and where place the real value
Link copied to clipboard
val RELEASE_CREATION_DATE_TAG: String = "<release_creation_date>"
RELEASE_CREATION_DATE_TAG the tag to indicate where is the release creation date and where place the real value
Link copied to clipboard
val RELEASE_EVENTS_TAG: String = "<release_events>"
RELEASE_EVENTS_TAG the tag to indicate where are the release events and where place the real value
Link copied to clipboard
val RELEASE_NOTES_TAG: String = "<release_notes>"
RELEASE_NOTES_TAG the tag to indicate where are the release notes and where place the real value
Link copied to clipboard
val RELEASE_STATUS_TAG: String = "<release_status>"
RELEASE_STATUS_TAG the tag to indicate where is the release status and where place the real value
Link copied to clipboard
val RELEASE_VERSION_TAG: String = "<release_version>"
RELEASE_VERSION_TAG the tag to indicate where is the release version and where place the real value
Link copied to clipboard
private open var reportName: String
reportName the report name
Link copied to clipboard
val REPORTS_DIRECTORY: String = "reports"
REPORTS_DIRECTORY the reports directory where are stored the reports of the releases created
Link copied to clipboard
private open var reportTemplate: String
reportTemplate the report template to use and where place the real instead of the tags
Link copied to clipboard
val RESOURCES_KEY: String = "resources"
Link copied to clipboard
val RESOURCES_PATH: String = "resources/"
Link copied to clipboard
val RESOURCES_REPORTS_PATH: String = "resources/reports/"
RESOURCES_REPORTS_PATH the complete reports path from resources directory
Link copied to clipboard
private val SLASH: String = "/"
SLASH the slash character
Link copied to clipboard
private val timeFormatter: TimeFormatter
timeFormatter the formatter used to format the timestamp values
Link copied to clipboard
private val UNDERSCORE: String = "_"
UNDERSCORE the underscore character
Link copied to clipboard
val VERSION_REGEX: String = "v\. "
VERSION_REGEX the regex to clear the version of a release

Functions

Link copied to clipboard
open fun createAssetResource(resource: MultipartFile, resourceId: String): String
Method to create the pathname for an asset
Link copied to clipboard
open fun createLogoResource(resource: MultipartFile, resourceId: String): String
Method to create the pathname for a project logo
Link copied to clipboard
open fun createProfileResource(resource: MultipartFile, resourceId: String): String
Link copied to clipboard
private open fun createReport()
Method to create the release report No-any params required
Link copied to clipboard
open fun createReportResource(resource: MultipartFile, resourceId: String): String
Method to create the pathname for a report
Link copied to clipboard
open fun createResource(resource: MultipartFile, resourcesDirectory: String, resourceId: String): String
Link copied to clipboard
open fun deleteAssetResource(assetId: String): Boolean
Method to delete an asset
Link copied to clipboard
open fun deleteLogoResource(logoId: String): Boolean
Method to delete a project logo
Link copied to clipboard
Link copied to clipboard
private open fun deleteReleaseReportIfExists()
Method to delete a report if an existing report already exists and is different from the current release status
Link copied to clipboard
open fun deleteReportResource(reportId: String): Boolean
Method to delete a report
Link copied to clipboard
open fun deleteResource(resourcesDirectory: String, resourceId: String): Boolean
Link copied to clipboard
private open fun formatReportName(): String
Method to format the name for the report No-any params required
Link copied to clipboard
open fun getReleaseReport(release: Release): String
Method to create the report for a release
Link copied to clipboard
private open fun getStatusComment(status: Release.ReleaseStatus): String
Method to get the comment related to the release status
Link copied to clipboard
open fun getSuffixResource(resource: MultipartFile): String
Link copied to clipboard
private open fun insertHeader()
Method to insert the header of the report, so insert, replacing the related tags, the project logo, project name, release version, the creation date of the release, the current status of the release and the notes of the release.
Link copied to clipboard
private open fun insertLogo(project: Project): String
Method to insert the project logo replacing the related tag
Link copied to clipboard
private open fun insertReleaseEvents()
Method to insert and create the structure for the events of the release replacing the related tag No-any params required
Link copied to clipboard
Method to create the release status badge
Link copied to clipboard
private open fun removeVersionPrefix(): String
Method to clear the version of a Release using the VERSION_REGEX No-any params required
Link copied to clipboard
open fun saveResource(resource: MultipartFile, path: String)
Link copied to clipboard
private open fun setCurrentRelease(currentRelease: Release)
Method to set the current release details