corporateacademy-like

Methods

(static) addCourseToBookmarks(courseId, token) → {boolean}

Add a course to the user's bookmarks

Parameters:
Name Type Description
courseId string

Required: the courseId of the course to add to the bookmarks

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/add-course-to-bookmarks
Returns:

True if correctly added, false if the course was already present in the bookmarks

Type
boolean

(static) countBookmarkedCourses(fromDate, toDate, token) → {number}

Retrieve the count of the looged user's bookmarked courses

Parameters:
Name Type Description
fromDate Date

Optional: Minimum creationDate of the bookmark

toDate Date

Optional: Maximum creationDate of the bookmark

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/count-bookmarked-courses
Returns:

User's bookmarked courses count

Type
number

(static) createLike(like, referenceId, referenceType, originApplicationName, referenceApplicationName, token) → {Like}

Create a new like

Parameters:
Name Type Description
like Like

Required by the action: The like object with alla relevant data set

referenceId string

Optional by the action: Specify the referenceId of the linked entity

referenceType string

Optional by the action: Specify the reference type of the linked entity

originApplicationName string

Optional for the action

referenceApplicationName string

Optional for the action

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-like
Returns:

The new created like object

Type
Like

(static) deleteLikeById(likeId, originApplicationName, token)

Logically delete a like

Parameters:
Name Type Description
likeId string

Required by the action: The likeId of the object

originApplicationName string

Optional for the action

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP DELETE /rest-api/corporateacademy-mediator/delete-like-by-id/:likeId
Returns:

null

(static) getBookmarkedCatalogCourses(searchedText, categories, clusters, functionalAreas, levels, types, softSkils, techSkils, objectTypes, techCompetences, softCompetences, streamTags, withCountLibraryItems, techSkillsOnly, softSkillsOnly, matchWithUserFunctionalArea, wishlistableOnly, mineOnly, voluntaryTrainingOnly, institutionalTrainingOnly, withBookmarkStatus, fromDate, toDate, fromRecord, numRecords, allData, token) → {PaginationWrapper.<Course>}

Retrieve the bookmarked courses of the logged user. The result will be formatted with the get-catalog-courses response pattern (with clusters, order, etc).

Parameters:
Name Type Description
searchedText string

Optional for the action: The text to search within course title and descriptions

categories string | Array.<string>

Optional for the action: The list of categories to filter

clusters string | Array.<string>

Optional for the action: The list of clusters to filter

functionalAreas string | Array.<string>

Optional for the action: The list of functionalAreas to filter

levels string | Array.<string>

Optional for the action: The list of levels to filter

types string | Array.<string>

Optional for the action: The list of types to filter

softSkils string | Array.<string>

Optional for the action: The list of softSkils to filter

techSkils string | Array.<string>

Optional for the action: The list of techSkils to filter

objectTypes string | Array.<string>

Optional for the action: Type of objects that user set as filters

techCompetences string | Array.<string>

Optional for the action: Tags ids that user set as filters

softCompetences string | Array.<string>

Optional for the action: Tags ids that user set as filters

streamTags string | Array.<string>

Optional for the action: The list of streamTags to filter

withCountLibraryItems string | boolean

Optional by the action: If true, it will retrieved the count of the Library Items that matches with the cluster

techSkillsOnly string | boolean

Optional for the action: If set retrieve only specific type of items

softSkillsOnly string | boolean

Optional for the action: If set retrieve only specific type of items

matchWithUserFunctionalArea string | boolean

Optional for the action: If set, retrieves only the courses with a tag equal to the user.chief field

wishlistableOnly string | boolean

Optional for the action: If set, retrieves only the courses that can be added to a wishlist

mineOnly boolean

Optional for the action: If set, retrieves only the courses where the logged user is involved as invited/preregistered/confirmed (with overbooking too)

voluntaryTrainingOnly boolean

Optional for the action: If set, retrieves only the courses with a voluntary type of course flow (taken from configuration file)

institutionalTrainingOnly boolean

Optional for the action: If set, retrieves only the courses with a institutional type of course flow (taken from configuration file)

withBookmarkStatus boolean

Optional for the action: If true, a property "bookmarked" will be added to every course, telling if the course is in the user's bookmarks

fromDate Date

Optional: Minimum creationDate of the bookmark

toDate Date

Optional: Maximum creationDate of the bookmark

fromRecord number

Required (if not allData): Pagination's offset

numRecords number

Required (if not allData): Pagination's page size

allData boolean

Optional (if not fromRecord and numRecords): flag used to avoid pagination

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-bookmarked-catalog-courses/:fromRecord/:numRecords
Returns:

User's bookmarked courses wrapped in an object with the count of the total rows

Type
PaginationWrapper.<Course>

(static) getBookmarkedCourses(fromDate, toDate, fromRecord, numRecords, allData, token) → {PaginationWrapper.<Course>}

Retrieve the bookmarked courses of the logged user

Parameters:
Name Type Description
fromDate Date

Optional: Minimum creationDate of the bookmark

toDate Date

Optional: Maximum creationDate of the bookmark

fromRecord number

Required (if not allData): Pagination's offset

numRecords number

Required (if not allData): Pagination's page size

allData boolean

Optional (if not fromRecord and numRecords): flag used to avoid pagination

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-bookmarked-courses/:fromRecord/:numRecords
Returns:

User's bookmarked courses wrapped in an object with the count of the total rows

Type
PaginationWrapper.<Course>

(static) getLikesCountsByTypesAndReference(referenceId, referenceType, likeType, originApplicationName, referenceApplicationName, token) → {LikeTotals}

Load the counts of all like and dislike gained by an object for the specifc type(s) passed

Parameters:
Name Type Description
referenceId string

Required by the action: Specify the referenceId of the linked entity

referenceType string

Required by the action: Specify the reference type of the linked entity

likeType string | Array.<string>

Required by the action: Specify the like type(s)

originApplicationName string

Optional for the action

referenceApplicationName string

Optional for the action

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-likes-counts-by-types-and-reference
Returns:

Like counts

Type
LikeTotals

(static) getMyLikeByTypeAndReference(referenceId, referenceType, likeType, originApplicationName, referenceApplicationName, token) → {Like}

Load the like of the specific type expressed by the users. It's supposed to be only one!

Parameters:
Name Type Description
referenceId string

Required by the action: Specify the referenceId of the linked entity

referenceType string

Required by the action: Specify the reference type of the linked entity

likeType string

Required by the action: Specify the like type

originApplicationName string

Optional for the action

referenceApplicationName string

Optional for the action

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-my-like-by-type-and-reference
Returns:

My Like for this object

Type
Like

(static) removeCourseFromBookmarks(courseId, token) → {boolean}

Remove a course form the user's bookmarks

Parameters:
Name Type Description
courseId string

Required: the courseId of the course to reomve form the bookmarks

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/remove-course-from-bookmarks
Returns:

True if correctly removed, false if the course wasn't in the bookmarks

Type
boolean