LinksHelper

@Service
open class LinksHelper : LinksBaseHelper<T>

The LinksHelper class is useful to manage all the RefyLink database operations

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected val ATTACH_LINK_TO_COLLECTIONS_QUERY: String = "REPLACE INTO collections_links(collection_id,link_id) VALUES "
ATTACH_LINK_TO_COLLECTIONS_QUERY the query used to attach link to collections
Link copied to clipboard
private val ATTACH_LINK_TO_TEAMS_QUERY: String = "REPLACE INTO teams_links(team_id,link_id) VALUES "
ATTACH_LINK_TO_TEAMS_QUERY the query used to attach link to teams
Link copied to clipboard
private val COMMA: String = ","
COMMA comma character
Link copied to clipboard
private val DETACH_LINK_FROM_COLLECTIONS_QUERY: String = "DELETE FROM collections_links WHERE link_id='%s' AND collection_id IN ("
DETACH_LINK_FROM_COLLECTIONS_QUERY the query used to detach link from collections
Link copied to clipboard
private val DETACH_LINK_FROM_TEAMS_QUERY: String = "DELETE FROM teams_links WHERE link_id='%s' AND team_id IN ("
DETACH_LINK_FROM_TEAMS_QUERY the query used to detach link from teams
Link copied to clipboard
protected open var entityManager: EntityManager
entityManager entity manager helper
Link copied to clipboard
@Autowired
private open var linksRepository: LinksRepository
linksRepository instance for the links 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
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 createLink(userId: String, linkId: String, title: String, description: String, referenceLink: String)
Method to save a new link
Link copied to clipboard
open fun deleteLink(linkId: String)
Method to delete a link
Link copied to clipboard
open fun editLink(userId: String, linkId: String, title: String, description: String, referenceLink: String)
Method to edit a new link
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
open fun getAllUserLinks(userId: String): List<RefyLink>
Method to get all the user's links, included the links shared in the teams and in the collections shared in the teams
Link copied to clipboard
open fun getItemIfAllowed(userId: String, linkId: String): RefyLink
Method used to get an item if the user is authorized
Link copied to clipboard
open fun getUserLinks(userId: String): HashSet<String>
Method to get the user's owned links identifiers
Link copied to clipboard
Method to get the user's owned links
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
open fun manageLinkCollections(linkId: String, collections: List<String>)
Method to manage the collections where the link is shared
Link copied to clipboard
open fun manageLinkTeams(linkId: String, teams: List<String>)
Method to manage the teams where the link is shared