Projects Service

@Service
open class ProjectsService : EquinoxItemsHelper, PandoroResourcesManager

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

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxItemsHelper

Constructors

Link copied to clipboard
@Autowired
constructor(projectsRepository: ProjectsRepository, groupsRepository: GroupsRepository, groupMembersRepository: GroupMembersRepository, changelogsNotifier: ChangelogsNotifier)
Constructor used to init the service

Properties

Link copied to clipboard
changelogsNotifier instance used to notify a changelog event
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
groupMembersRepository instance for the group members repository
Link copied to clipboard
groupsRepository instance for the groups repository
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
projectsRepository instance for the projects repository
Link copied to clipboard
val RESOURCES_KEY: String = "resources"
Link copied to clipboard
val RESOURCES_PATH: String = "resources/"

Functions

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: Collection<out Any>, columns: Array<@NotNull String>)
Link copied to clipboard
protected open fun <V> batchInsert(command: EquinoxItemsHelper.InsertCommand, table: String, batchQuery: EquinoxItemsHelper.BatchQuery<V>)
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
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
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 saveResource(resource: MultipartFile, path: String)
Link copied to clipboard
protected open fun <V> syncBatch(model: EquinoxItemsHelper.SyncBatchModel, table: String, batchQuery: EquinoxItemsHelper.BatchQuery<V>)
Link copied to clipboard
open fun updateProjectVersion(userId: String, projectId: String, updateVersion: String)
Method used to update the version of the project as the version of the latest published update
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