LinksCollectionsHelper

The LinksCollectionsHelper class is useful to manage all the LinksCollection database operations

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected val ATTACH_COLLECTION_TO_LINKS_QUERY: String = "REPLACE INTO collections_links(link_id,collection_id) VALUES "
ATTACH_COLLECTION_TO_LINKS_QUERY the query used to attach links to a collection
Link copied to clipboard
private val ATTACH_COLLECTION_TO_TEAM_QUERY: String = "REPLACE INTO collections_teams(team_id,collection_id) VALUES "
ATTACH_COLLECTION_TO_TEAM_QUERY the query used to share a collection with teams
Link copied to clipboard
@Autowired
private open var collectionsRepository: CollectionsRepository
collectionsRepository instance for the collections repository
Link copied to clipboard
private val COMMA: String = ","
COMMA comma character
Link copied to clipboard
private val DETACH_COLLECTION_FROM_LINKS_QUERY: String = "DELETE FROM collections_links WHERE collection_id='%s' AND link_id IN ("
DETACH_COLLECTION_FROM_LINKS_QUERY the query used to detach links from a collection
Link copied to clipboard
private val DETACH_COLLECTION_FROM_TEAMS_QUERY: String = "DELETE FROM collections_teams WHERE collection_id='%s' AND team_id IN ("
DETACH_COLLECTION_FROM_TEAMS_QUERY the query used to remove a collection from teams
Link copied to clipboard
protected open var entityManager: EntityManager
entityManager entity manager helper
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
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 createCollection(userId: String, collectionId: String, color: String, title: String, description: String, links: List<String>)
Method to create a collection
Link copied to clipboard
open fun deleteCollection(collectionId: String)
Method to delete a collection
Link copied to clipboard
open fun editCollection(userId: String, collectionId: String, color: String, title: String, description: String, links: List<String>)
Method to edit a collection
Link copied to clipboard
protected open fun <I> executeDeleteBatch(deleteQuery: String, itemToDeleteId: String, values: List<I>)
Method to execute a batch query to delete attachments
Link copied to clipboard
protected open fun <I> executeInsertBatch(insertQuery: String, valuesSlice: String, values: Collection<I>, batchQuery: RefyItemsHelper.BatchQuery)
Method to execute a batch query to insert attachments
Link copied to clipboard
Method to get all the user's collections, included the collections shared in the teams
Link copied to clipboard
open fun getItemIfAllowed(userId: String, collectionId: String): LinksCollection
Method used to get an item if the user is authorized
Link copied to clipboard
Method to get the user's owned collections identifiers
Link copied to clipboard
Method to get the user's owned collections
Link copied to clipboard
protected open fun manageAttachments(workflow: RefyItemsHelper.AttachmentsManagementWorkflow, valuesSlice: String, itemId: String, ids: List<String>, batchQuery: RefyItemsHelper.BatchQuery)
Method to manage the attachments of an item to a container
Link copied to clipboard
private open fun manageCollectionLinks(collection: LinksCollection, links: List<String>)
open fun manageCollectionLinks(collectionId: String, links: List<String>)
Method to manage the links attached to the collection
Link copied to clipboard
open fun manageCollectionTeams(collectionId: String, teams: List<String>)
Method to manage the teams where the collection is shared