ProjectsHelper

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

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Record class used ad payload for the addProject request

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 COMMA: String = ","
COMMA comma character
Link copied to clipboard
protected open var entityManager: EntityManager
entityManager entity manager helper
Link copied to clipboard
protected val INSERT_JOINING_QR_CODE_MEMBERS: String = "INSERT INTO joining_qrcode_members(id,role,email) VALUES "
INSERT_JOINING_QR_CODE_MEMBERS the query used to insert the members invited in a project with a JoiningQRCode
Link copied to clipboard
protected val JOIN_MEMBERS_QUERY: String = "REPLACE INTO project_members(id,member_id) VALUES "
JOIN_MEMBERS_QUERY the query used to join members in a project
Link copied to clipboard
joiningQRCodeRepository instance for the joining qrcodes repository
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
notificationsRepository instance useful to manage the notifications
Link copied to clipboard
val PROFILES_DIRECTORY: String = "profiles"
Link copied to clipboard
@Autowired
private open var projectsRepository: ProjectsRepository
projectsRepository instance for the projects repository
Link copied to clipboard
protected val RELATIONSHIP_VALUES_SLICE: String = "(?, ?)"
RELATIONSHIP_VALUES_SLICE query part to insert in the join table new row
Link copied to clipboard
@Autowired
private open var releasesHelper: ReleasesHelper
releasesHelper helper to manage the releases database operations
Link copied to clipboard
private val REMOVE_MEMBERS_QUERY: String = "DELETE FROM project_members WHERE id='%s' AND member_id IN ("
REMOVE_MEMBERS_QUERY the query used to remove members from a project
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
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 ROUND_BRACKET: String = ")"
ROUND_BRACKET round bracket character
Link copied to clipboard
private val SINGLE_QUOTE: String = "'"
SINGLE_QUOTE single quote character
Link copied to clipboard
protected val TUPLE_VALUES_SLICE: String = "(?, ?, ?)"
TUPLE_VALUES_SLICE query part to insert in the join table new row

Functions

Link copied to clipboard
open fun addProject(name: String, logo: MultipartFile, members: ArrayList<String>, projectId: String, authorId: String): JSONObject
Method to add a new project
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 createJoiningQrcode(QRCodeId: String, projectId: String, invitedMembers: List<JSONObject>): String
Method to create a new joining qrcode
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
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 deleteJoiningQrcode(joiningQRCode: JoiningQRCode)
Method to delete a joining qrcode
Link copied to clipboard
open fun deleteLogoResource(logoId: String): Boolean
Method to delete a project logo
Link copied to clipboard
Link copied to clipboard
open fun deleteProject(authorId: String, project: Project)
Method to delete a project and all the data related to it
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
open fun editProject(name: String, logo: MultipartFile, members: List<String>, project: Project)
Method to edit an existing project
Link copied to clipboard
protected open fun <I> executeDeleteBatch(deleteQuery: String, itemToDeleteId: String, values: List<I>)
Method to execute a batch query to delete items
Link copied to clipboard
protected open fun <I> executeInsertBatch(insertQuery: String, valuesSlice: String, values: Collection<I>, batchQuery: EquinoxItemsHelper.BatchQuery)
Method to execute a batch query to insert items
Link copied to clipboard
@TestOnly
open fun getItemIfAllowed(userId: String, itemId: String): T
Method used to get an item if the user is authorized
Link copied to clipboard
Method to get an existing joining qrcode by its identifier
Link copied to clipboard
Method to get an existing joining qrcode by its textual join code
Link copied to clipboard
open fun getProject(userId: String, projectId: String): Project
Method to get a project
Link copied to clipboard
Method to get the project of a NovaUser
Link copied to clipboard
open fun getSuffixResource(resource: MultipartFile): String
Link copied to clipboard
open fun joinMember(joiningQRCode: JoiningQRCode, email: String, memberId: String)
Method to join a new member in a project
Link copied to clipboard
protected open fun manageItems(workflow: EquinoxItemsHelper.ItemsManagementWorkflow, itemId: String, ids: List<String>)
protected open fun manageItems(workflow: EquinoxItemsHelper.ItemsManagementWorkflow, valuesSlice: String, itemId: String, ids: List<String>, batchQuery: EquinoxItemsHelper.BatchQuery)
Method to manage the items of an item to a container
Link copied to clipboard
private open fun manageProjectMembers(project: Project, editedMembers: List<String>)
Link copied to clipboard
open fun markMemberAsTester(projectId: String, memberId: String)
Method to mark a member as Tester of the project
Link copied to clipboard
open fun removeMember(projectId: String, memberId: String)
Method to remove a member from a project
Link copied to clipboard
open fun removeMemberFromMailingList(joiningQRCode: JoiningQRCode, email: String)
Method to remove a member from the mailing list of the joining qrcode.
Link copied to clipboard
open fun saveResource(resource: MultipartFile, path: String)