Projects Helper

The ProjectsHelper class is useful to manage all the projects database operations

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
private val _IN_CLAUSE_: String = " IN "
Link copied to clipboard
val _VALUES_: String = " VALUES "
Link copied to clipboard
val _WHERE_: String = " WHERE "
Link copied to clipboard
@Autowired
protected open var changelogsCreator: ChangelogsCreator
changelogsCreator the changelogs creator helper
Link copied to clipboard
Link copied to clipboard
val COMMA: String = ","
Link copied to clipboard
val DELETE_FROM_: String = "DELETE FROM "
Link copied to clipboard
protected open var entityManager: EntityManager
Link copied to clipboard
GROUP_LOGOS_DIRECTORY the folder where the group logos will be saved
Link copied to clipboard
@Autowired
private open var groupMembersRepository: GroupMembersRepository
groupMembersRepository instance for the group members repository
Link copied to clipboard
@Autowired
private open var groupsRepository: GroupsRepository
groupsRepository instance for the groups repository
Link copied to clipboard
@Autowired
private open var notesRepository: NotesRepository
notesRepository instance for the notes repository
Link copied to clipboard
Link copied to clipboard
val PROFILES_DIRECTORY: String = "profiles"
Link copied to clipboard
PROJECT_ICONS_DIRECTORY the folder where the project icons will be saved
Link copied to clipboard
PROJECT_NAME_PATTERN the pattern to validate the project names values
Link copied to clipboard
private val PROJECT_NAME_REGEX: String = "^[a-zA-Z0-9_-]{1,15}$"
PROJECT_NAME_REGEX regex to validate the project name
Link copied to clipboard
PROJECT_VERSION_PATTERN the pattern to validate the project version
Link copied to clipboard
private val PROJECT_VERSION_REGEX: String = "^v?(?:\d+[-.]?)+(-[a-zA-Z]+\d*)?$"
PROJECT_VERSION_REGEX regex to validate the project version
Link copied to clipboard
@Autowired
private open var projectsRepository: ProjectsRepository
projectsRepository instance for the projects repository
Link copied to clipboard
Link copied to clipboard
val RESOURCES_KEY: String = "resources"
Link copied to clipboard
val RESOURCES_PATH: String = "resources/"
Link copied to clipboard
val SINGLE_QUOTE: String = "'"
Link copied to clipboard
@Autowired
private open var updatesRepository: UpdatesRepository
updatesRepository instance for the updates repository

Functions

Link copied to clipboard
open fun addChangeNote(userId: String, noteId: String, contentNote: String, updateId: String)
Method to add a change note to an update
Link copied to clipboard
private open fun addGroupsToAProject(groups: List<String>, projectId: String)
Method to add groups list to a project
Link copied to clipboard
protected open fun batchDelete(table: String, values: List<List<out Any>>, columns: Array<String>)
Link copied to clipboard
protected open fun batchInsert(command: EquinoxItemsHelper.InsertCommand, table: String, values: List<out Any>, batchQuery: EquinoxItemsHelper.BatchQuery, columns: Array<String>)
Link copied to clipboard
open fun changeNoteExists(updateId: String, noteId: String): Boolean
Method to check whether a change note exists
Link copied to clipboard
open fun createGroupLogoResource(resource: MultipartFile, resourceId: String): String
Method to create the pathname for a group logo
Link copied to clipboard
open fun createProfileResource(resource: MultipartFile, resourceId: String): String
Link copied to clipboard
open fun createProjectIconResource(resource: MultipartFile, resourceId: String): String
Method to create the pathname for a project icon
Link copied to clipboard
open fun createResource(resource: MultipartFile, resourcesDirectory: String, resourceId: String): String
Link copied to clipboard
open fun deleteChangeNote(updateId: String, noteId: String)
Method to delete a change note
Link copied to clipboard
Method to delete a group logo
Link copied to clipboard
Link copied to clipboard
open fun deleteProject(userId: String, projectId: String)
Method to delete a user's project
Link copied to clipboard
Method to delete a project icon
Link copied to clipboard
open fun deleteResource(resourcesDirectory: String, resourceId: String): Boolean
Link copied to clipboard
open fun deleteUpdate(projectId: String, updateId: String, userId: String)
Method to delete an update
Link copied to clipboard
open fun editChangeNote(userId: String, noteId: String, contentNote: String)
Method to edit an existing change note of an update
Link copied to clipboard
private open fun extractProjectFilters(rawFilters: Set<String>): Pair<String, Set<String>>
Method to select from the raw filter the specific values of the different filters
Link copied to clipboard
Method to get the user's authored projects list
Link copied to clipboard
open fun getInDevelopmentProjects(userId: String, page: Int, pageSize: Int, filters: Set<String>): PaginatedResponse<Project>
Method to get the user's IN_DEVELOPMENT projects list
Link copied to clipboard
open fun getProject(userId: String, projectId: String): Project
Method to get the user's project by its id
Link copied to clipboard
open fun getProjectById(projectId: String): Project
Method to get the user's project by its id
Link copied to clipboard
open fun getProjects(userId: String, page: Int, pageSize: Int, filters: Set<String>): PaginatedResponse<Project>
Method to get the user's projects list
Link copied to clipboard
open fun getSuffixResource(resource: MultipartFile): String
Link copied to clipboard
open fun markChangeNoteAsDone(updateId: String, noteId: String, userId: String)
Method to mark as done a change note
Link copied to clipboard
open fun markChangeNoteAsToDo(updateId: String, noteId: String)
Method to mark as to-do a change note
Link copied to clipboard
open fun publishUpdate(projectId: String, updateId: String, userId: String, updateVersion: String)
Method to publish an existing update
Link copied to clipboard
open fun saveResource(resource: MultipartFile, path: String)
Link copied to clipboard
open fun scheduleUpdate(updateId: String, targetVersion: String, changeNotes: List<String>, projectId: String, userId: String)
Method to schedule a new update
Link copied to clipboard
open fun startUpdate(projectId: String, updateId: String, userId: String)
Method to start an existing update
Link copied to clipboard
protected open fun <V> syncBatch(container: EquinoxItemsHelper.SyncBatchContainer, table: String, targetId: String, updatedData: List<V>, batchQuery: EquinoxItemsHelper.BatchQuery)
Link copied to clipboard
open fun targetVersionExists(projectId: String, targetVersion: String): Boolean
Method to check whether an update with the target project_version inserted already exists
Link copied to clipboard
open fun updateExists(projectId: String, updateId: String): ProjectUpdate
Method to fetch and check if an update exists
Link copied to clipboard
open fun workWithProject(userId: String, projectId: String, project: ProjectDTO, isAdding: Boolean)
Method to work with a project, add or edit operation are executed