Groups Helper

The GroupsHelper class is useful to manage all the groups 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
@Autowired
private open var changelogsRepository: ChangelogsRepository
changelogsRepository instance for the changelogs project_repository
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 groupsRepository: GroupsRepository
groupsRepository instance for the groups project_repository
Link copied to clipboard
@Autowired
private open var membersRepository: GroupMembersRepository
membersRepository instance for the members of a group project_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
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 usersRepository: PandoroUsersRepository
usersRepository instance for the users project_repository

Functions

Link copied to clipboard
open fun acceptGroupInvitation(groupId: String, changelogId: String, user: PandoroUser)
Method to accept a group invitation
Link copied to clipboard
open fun addMembers(groupName: String, members: List<String>, groupId: String)
Method to add a list of members to a group
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 changeMemberRole(memberId: String, groupId: String, role: Role)
Method to change the role of a member
Link copied to clipboard
open fun createGroup(author: PandoroUser, groupId: String, group: GroupDTO)
Method to create a group
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 declineGroupInvitation(groupId: String, changelogId: String, user: PandoroUser)
Method to decline a group invitation
Link copied to clipboard
open fun deleteGroup(memberId: String, groupId: String)
Method to delete a group
Link copied to clipboard
Method to delete a group logo
Link copied to clipboard
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 editGroup(author: PandoroUser, groupId: String, group: GroupDTO)
Method to create a group
Link copied to clipboard
open fun editMembers(requester: String, groupId: String, groupName: String, members: List<String>)
Method to edit the members list of a group
Link copied to clipboard
open fun editProjects(groupId: String, projects: ArrayList<String>)
Method to edit the projects list of a group
Link copied to clipboard
private open fun filterMembers(members: List<String>): List<PandoroUser>
Link copied to clipboard
Method to get the user's groups list
Link copied to clipboard
open fun getGroup(userId: String, groupId: String): Group
Method to get the user's group by its id
Link copied to clipboard
open fun getGroupMember(groupId: String, user: PandoroUser): GroupMember
open fun getGroupMember(groupId: String, userId: String): GroupMember
Method to get a group member
Link copied to clipboard
open fun getGroups(userId: String, page: Int, pageSize: Int, authoredGroups: Boolean, groupName: String, roles: List<String>): PaginatedResponse<Group>
Method to get the user's groups list
Link copied to clipboard
open fun getSuffixResource(resource: MultipartFile): String
Link copied to clipboard
open fun groupExists(userId: String, groupName: String): Boolean
Method to check whether the user's group exists
Link copied to clipboard
open fun leaveGroup(memberId: String, group: Group)
Method to leave from a group
Link copied to clipboard
private open fun onSync(groupId: String, projects: List<String>, currentProjects: List<String>)
Link copied to clipboard
open fun removeMember(memberId: String, groupId: String)
Method to remove a member from a group
Link copied to clipboard
open fun saveResource(resource: MultipartFile, path: String)
Link copied to clipboard
protected open fun <V> syncBatch(container: EquinoxItemsHelper.SyncBatchContainer, table: String, targetId: String, updatedData: List<V>, batchQuery: EquinoxItemsHelper.BatchQuery)