Methods
(static) countAnnouncements(searchedText, ignoreVisibility, status, token) → {number}
Count announcements in search from the external search engine
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Optional by the action: The text provided by the user to start the search |
ignoreVisibility |
boolean | Optional by the action: If ignoreVisibility is true retrieve all news not only public or restricted to user or to users' groups |
status |
string | Optional: Status of the news (PUBLISHED, DRAFT) |
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-announcements
Returns:
The number of Items that match the search criteria
- Type
- number
(static) createAnnouncement(publicVisibility, title, description, link, uploadId, onTop, groupIds, userIds, announcement, forceNotification, uploadId, token) → {Announcement}
Function that create an announcement with given langs, attributes and visibilities
Parameters:
| Name | Type | Description |
|---|---|---|
publicVisibility |
boolean | Optional for the action - The flag that specify the announcement status |
title |
string | Required - Title of the announcement |
description |
string | Required - Body of the announcement |
link |
string | Optional - URL for deepen the announcement |
uploadId |
string | Oprionl - ID of the Upload object associated with the announcement image |
onTop |
string | Optional - Set the news to be the ONE on top |
groupIds |
Array.<string> | Optional for the action - The list of the id of groups that will be enable for the announcement |
userIds |
Array.<string> | Optional for the action - The list of the id of users that will be enable for the announcement |
announcement |
Announcement | Required for the action - The announcement entity that will be created |
forceNotification |
string | boolean | Optional by the action: If true, notifications will be sent |
uploadId |
string | Optional - Upload ID linked to the announcement image |
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-announcement
Returns:
The announcement created
- Type
- Announcement
(static) deleteAnnouncement(announcementId, token)
Function that delete logically an announcement
Parameters:
| Name | Type | Description |
|---|---|---|
announcementId |
string | Required for the action - The announcement id of the entity |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/delete-announcement/:announcementId
Returns:
(static) getAllAnnouncements(ignoreVisibility, searchedText, topOnly, status, allData, fromRecord, numRecords, sortCols, sortDirs, token) → {Announcement}
Retrieve a list of announcement with are public o restricted to user or to users' groups
Parameters:
| Name | Type | Description |
|---|---|---|
ignoreVisibility |
boolean | Optional by the action: If ignoreVisibility is true retrieve all news not only public or restricted to user or to users' groups |
searchedText |
string | Optiional by the action: filter the announcements with the searched text params in title |
topOnly |
boolean | Optional by the action: If sortData is true retrieve only the top news |
status |
string | Optiional by the action: filter the announcements with the selected status |
allData |
boolean | string | Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required) |
fromRecord |
number | Required by the action: The number of the first record to load (exclusive - 0 to start from the first) |
numRecords |
number | Required by the action: The number of records to load |
sortCols |
string | Optional by the action: If sortData is true the sortCols specify the colums to sort the result |
sortDirs |
string | Optional by the action: If sortData is true the sortDirs specify the direction of the sorting columns |
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-all-announcements
Returns:
The list of announcements
- Type
- Announcement
(static) getAnnouncementDetails(announcementId, createEngagement, ignoreVisibility, token) → {Announcement}
Retrieve a list of announcement with are public o restricted to user or to users' groups
Parameters:
| Name | Type | Description |
|---|---|---|
announcementId |
string | Required by the action: the id of the announcement |
createEngagement |
boolean | Optional by the action: If true create the engagement with specific event |
ignoreVisibility |
boolean | Optional by the action: If ignoreVisibility is true retrieve all news not only public or restricted to user or to users' groups |
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-announcement-details/:announcementId
Returns:
The list of announcements
- Type
- Announcement
(static) setAnnouncementOnTop(groupIds, announcementId, onTop, revertOthers, token) → {Announcement}
Function that toggle the announcement's onTop flag
Parameters:
| Name | Type | Description |
|---|---|---|
groupIds |
Array.<string> | Optional for the action - The list of the id of groups that will be enable for the announcement |
announcementId |
string | Required for the action - The announcement entity that will be created |
onTop |
boolean | Required for the action - The announcement onTop flag |
revertOthers |
boolean | Optional for the action - if true sets this as the only news on top for the tenant |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/set-announcement-on-top
Returns:
The announcement created
- Type
- Announcement
(static) unreadAnnouncementsIds(ignoreVisibility, alreadyRead, token)
Retrieve a list of announcement with are public o restricted to user or to users' groups
Parameters:
| Name | Type | Description |
|---|---|---|
ignoreVisibility |
boolean | Optional by the action: If ignoreVisibility is true retrieve all news not only public or restricted to user or to users' groups |
alreadyRead |
Array.<string> | Optional by the action: List of announcementId already read from the user during the session to keep the count updated |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/unread-announcements-ids
Returns:
The number
(static) updateAnnouncement(draftOnly, groupIds, userIds, announcement, uploadId, deleteImageAttribute, publicVisibility, token) → {Announcement}
Function that create an announcement with given langs, attributes and visibilities
Parameters:
| Name | Type | Description |
|---|---|---|
draftOnly |
boolean | Optional for the action - The flag that specify the draft mode for the announcement |
groupIds |
Array.<string> | Optional for the action - The list of the id of groups that will be enable for the announcement |
userIds |
Array.<string> | Optional for the action - The list of the id of users that will be enable for the announcement |
announcement |
Announcement | Required for the action - The announcement entity that will be created |
uploadId |
string | Optional - Upload ID linked to the announcement image |
deleteImageAttribute |
boolean | Optional: if true delete current announcement image attribute |
publicVisibility |
boolean | Optional: if true sets the visibility of the announcement to public |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/update-announcement
Returns:
The announcement created
- Type
- Announcement
(static) updateAnnouncementUpload(draftOnly, announcement, token) → {Announcement}
Function that create an announcement with given langs, attributes and visibilities
Parameters:
| Name | Type | Description |
|---|---|---|
draftOnly |
boolean | Optional for the action - The flag that specify the draft mode for the announcement |
announcement |
Announcement | Required for the action - The announcement entity that will be created |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/update-announcement-upload
Returns:
The announcement created
- Type
- Announcement