Methods
(static) addSuggestion(itemId, destinationUser, groupIds, visibility, visibilityType, token) → {Item}
Add a new visibility (suggestion) option to an item
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
string | Required by the action: The id of the item object |
destinationUser |
User | Required by the action: The user full object of the user i'm suggesting to |
groupIds |
Array.<string> | Required by the action: Ids of the groups that user belongs to (empty array if no group) |
visibility |
ItemVisibility | Required by the action: The new visibility to insert |
visibilityType |
string | Optional by the action: The type of visibility to insert |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/add-suggestion
Returns:
The updated item object
- Type
- Item
(static) consumeItemByItemid(itemId, token) → {ConsumableItem}
Consume a library obj given the id
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
string | Required: The id of the item to consume |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/consume-item-by-itemId
Returns:
The retrieved Item with the completion details
- Type
- ConsumableItem
(static) countAllAvailableItems(searchedText, itemTypes, techCompetences, softCompetences, argumentsTags, objectTypes, objectTypeSpecializations, languages, clusters, functionalAreas, adminTags, streamTags, levels, langs, referenceApplicationNames, referenceTypes, referenceIds, myOnly, techSkillsOnly, softSkillsOnly, fuzzySearch, invited, certified, token) → {number}
Counts items in the external search engine
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Required: The text provided by the user to start the search |
itemTypes |
string | Array.<string> | Optional: Types that will be used to filter on the items. Only some types of items are searchable (they are defined in the ItemUtils.USER_SEARCHABLE_ITEM_TYPES constant). |
techCompetences |
string | Array.<string> | Optional: Tags ids that user set as filters |
softCompetences |
string | Array.<string> | Optional: Tags ids that user set as filters |
argumentsTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
objectTypes |
string | Array.<string> | Optional: Type of objects that user set as filters |
objectTypeSpecializations |
string | Array.<string> | Optional: Type of specialized objects that user set as filters |
languages |
string | Array.<string> | Optional: Languages that user set as filters |
clusters |
string | Array.<string> | Optional: Tags ids that user set as filters |
functionalAreas |
string | Array.<string> | Optional: Tags ids that user set as filters |
adminTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
streamTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
levels |
string | Array.<string> | Optional: Tags ids that user set as filters |
langs |
string | Array.<string> | Optional: Tags ids that user set as langs |
referenceApplicationNames |
string | Array.<string> | Optional: Application name(s) of the cross-reference objects |
referenceTypes |
string | Array.<string> | Optional: Type(s) of the cross-reference objects |
referenceIds |
string | Array.<string> | Optional: Ids name(s) of the cross-reference objects |
myOnly |
boolean | Optional: If true, it will retrieve the items created by the user |
techSkillsOnly |
boolean | Optional: If set retrieve only specific type of items |
softSkillsOnly |
boolean | Optional: If set retrieve only specific type of items |
fuzzySearch |
string | Optional: If "N" (default) no fuzzy results will be included, if "Y" fuzzy results will be included, if "D" only fuzzy results will be returned (the delta: excluding results from standard search) |
invited |
boolean | Optional: If true, retrieves only the items for which the user has been invited to |
certified |
string | Optional: Char used to force the retrieval of the already certified objects (Y) or not certified object (N) |
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-all-available-items
Returns:
Counter of the items that match the search criteria
- Type
- number
(static) countItems(searchedText, status, clusters, functionalAreas, adminTags, streamTags, levels, langs, objectTypes, objectTypeSpecializations, languages, attributeTypes, attributeValues, itemTypes, techSkillsOnly, softSkillsOnly, ignoreVisibility, includeInheritedVisibilities, noFilter, token) → {number}
Count items in search from the external search engine
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Required by the action: The text provided by the user to start the search |
status |
string | Required by the action: Flag that states if the search must retrive object never viewed by the user (N), already viewed by the user (V) or all (A) |
clusters |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
functionalAreas |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
adminTags |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
streamTags |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
levels |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
langs |
string | Array.<string> | Optional for the action: Tags ids that user set as langs |
objectTypes |
string | Array.<string> | Optional for the action: Type of objects that user set as filters |
objectTypeSpecializations |
string | Array.<string> | Optional for the action: Type of specialized objects that user set as filters |
languages |
string | Array.<string> | Optional for the action: Languages that user set as filters |
attributeTypes |
string | Array.<string> | Optional for the action: The attribute type(s) items must have |
attributeValues |
string | Array.<string> | Optional for the action: The attribute value(s) items must have |
itemTypes |
Array.<string> | Required by the action: ItemType(s) to search (e.g.: ItemTypes.ITEM, ItemTypes.COLLECTION, etc) |
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 |
ignoreVisibility |
boolean | string | Optional for the action: If true the item is loaded even if the user has no right on the object |
includeInheritedVisibilities |
boolean | Optional: include items that has inherited visibilities |
noFilter |
boolean | Optional for the action: if true the search will be unfiltered and we could get all the items you type of, if false it will be necessary to indicate a search filter |
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-items
Returns:
The number of Items that match the search criteria
- Type
- number
(static) getConsumableItemByIdForUser(itemId, withChildsLoaded, childsTreeDepth, originApplicationName, referenceApplicationName, attributeTypesToRetrieve, createEngagement, forPreview, token) → {ConsumableItem}
Retrieves an item with its completion status (referred to the logged user)
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
string | Required: The id of the item to retrieve |
withChildsLoaded |
string | boolean | Optional: If true, the children items will be loaded into the itemChild.childObject field |
childsTreeDepth |
number | Optional: Depth in tree of the childs to retrieve |
originApplicationName |
string | Optional: the origin application name |
referenceApplicationName |
string | Optional: the reference application name |
attributeTypesToRetrieve |
string | Array.<string> | Optional: Types of the item attributes that must be retrive. By default only a small set of attributes will be retrieved, @see {ItemUtils.ItemSchemas.SEARCH_PAGE}. |
createEngagement |
boolean | Optional: if true an open engagement will be created |
forPreview |
boolean | Optional: if true this is the admin that preview the course from the admin console. |
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-consumable-item-by-id-for-user
Returns:
The retrieved Item with the completion details
- Type
- ConsumableItem
(static) getItemPrompterList(itemId, token) → {User}
Load the list of prompter who suggested the object to logged user
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
string | Required by the action: Specify the itemId of suggested Item |
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-item-prompter-list
Returns:
Retrieved prompter list
- Type
- User
(static) getItemsSearchFiltersWithCounters(searchedText, itemTypes, techCompetences, softCompetences, argumentsTags, objectTypes, objectTypeSpecializations, languages, clusters, functionalAreas, adminTags, streamTags, levels, langs, referenceApplicationNames, referenceTypes, referenceIds, techSkillsOnly, softSkillsOnly, fuzzySearch, attributeFilters, token) → {number}
Counts items in the external search engine
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Required: The text provided by the user to start the search |
itemTypes |
string | Array.<string> | Optional: Types that will be used to filter on the items. Only some types of items are searchable (they are defined in the ItemUtils.USER_SEARCHABLE_ITEM_TYPES constant). |
techCompetences |
string | Array.<string> | Optional: Tags ids that user set as filters |
softCompetences |
string | Array.<string> | Optional: Tags ids that user set as filters |
argumentsTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
objectTypes |
string | Array.<string> | Optional: Type of objects that user set as filters |
objectTypeSpecializations |
string | Array.<string> | Optional: Type of specialized objects that user set as filters |
languages |
string | Array.<string> | Optional: Languages that user set as filters |
clusters |
string | Array.<string> | Optional: Tags ids that user set as filters |
functionalAreas |
string | Array.<string> | Optional: Tags ids that user set as filters |
adminTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
streamTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
levels |
string | Array.<string> | Optional: Tags ids that user set as filters |
langs |
string | Array.<string> | Optional: Tags ids that user set as langs |
referenceApplicationNames |
string | Array.<string> | Optional: Application name(s) of the cross-reference objects |
referenceTypes |
string | Array.<string> | Optional: Type(s) of the cross-reference objects |
referenceIds |
string | Array.<string> | Optional: Ids name(s) of the cross-reference objects |
techSkillsOnly |
boolean | Optional: If set retrieve only specific type of items |
softSkillsOnly |
boolean | Optional: If set retrieve only specific type of items |
fuzzySearch |
string | Optional: If "N" (default) no fuzzy results will be included, if "Y" fuzzy results will be included, if "D" only fuzzy results will be returned (the delta: excluding results from standard search) |
attributeFilters |
ComparisonCondition | Array.<ComparisonCondition> | Optional: Filters that will be applied on the attributes of the items (using a subquery for each filter). The type of the comparison to perform on the attributeValue can be specifed on each filter. |
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-items-search-filters-with-counters
Returns:
Counter of the items that match the search criteria
- Type
- number
(static) getItemTitleById(itemId, token) → {string}
Load an Item title from its id. If the Item doesn't exists, it searches into the draft list
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
string | Required by the action: The id of the item title to retrieve |
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-item-title-by-id/:itemId
Returns:
The title of the Item
- Type
- string
(static) getWebinarDayLink(itemId, token) → {WebinarAccessLinks}
Retrieve the SambaLive teacher, support and guest access links
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
string | Required: Id of the day item that is in a webinar stage |
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-webinar-day-link
Returns:
The access links
- Type
- WebinarAccessLinks
(static) getWebinarDaysLinks(itemIds, token) → {Map.<string, WebinarAccessLinks>}
Retrieve the SambaLive teacher, support and guest access links
Parameters:
| Name | Type | Description |
|---|---|---|
itemIds |
string | Array.<string> | Required: Id of the day item that is in a webinar stage |
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-webinar-days-links
Returns:
} Access links mapped by day itemId
- Type
- Map.<string, WebinarAccessLinks>
(static) listAvailableWebinarRooms(accountId, token) → {Array.<WebinarRoom>}
Retrieves the available webinar rooms
Parameters:
| Name | Type | Description |
|---|---|---|
accountId |
string | Array.<string> | Optional: retrieve only the passed accountId |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/list-available-webinar-rooms
Returns:
Array with the retrieved location addresses
- Type
- Array.<WebinarRoom>
(static) listWebinarRoomsInSameConflictTime(startTime, endTime, sambaLiveAccountId, dayIdToIgnore, token) → {WebinarRooms}
Retrieves the webinar rooms in conflict time
Parameters:
| Name | Type | Description |
|---|---|---|
startTime |
Date | Start day time to check if there is a webinar room available |
endTime |
Date | End day time to check if there is a webinar room available |
sambaLiveAccountId |
string | The class used to check if is free |
dayIdToIgnore |
string | Ignore the check of the current day id (Ex: in case of update) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/list-webinar-rooms-in-same-conflict-time
Returns:
The response with the conflict webinar rooms
- Type
- WebinarRooms
(static) searchAllAvailableItems(searchedText, itemTypes, techCompetences, softCompetences, argumentsTags, objectTypes, objectTypeSpecializations, languages, clusters, functionalAreas, adminTags, streamTags, levels, langs, referenceApplicationNames, referenceTypes, referenceIds, techSkillsOnly, softSkillsOnly, withCompletionPercentage, withAverageLikingScore, withChildrenCount, withStartDate, myOnly, fuzzySearch, invited, certified, sorting, originApplicationName, referenceApplicationName, status, openedFromDate, openedToDate, seggestedItems, suggested, useListItemsByAny, useGetMyActivitiesItems, useRentService, fromRecord, numRecords, itemIds, withChildsLoaded, withChildsLoaded, openedOnly, expiredOnly, onlyForMe, attributeRefTypes, attributeRefIds, attributeTypes, itemsPoolAttributeFilters, allData, token) → {Array.<Item>|Array.<ConsumableItem>}
Search items in the external search engine
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Required: The text provided by the user to start the search |
itemTypes |
string | Array.<string> | Optional: Types that will be used to filter on the items. Only some types of items are searchable (they are defined in the ItemUtils.USER_SEARCHABLE_ITEM_TYPES constant). |
techCompetences |
string | Array.<string> | Optional: Tags ids that user set as filters |
softCompetences |
string | Array.<string> | Optional: Tags ids that user set as filters |
argumentsTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
objectTypes |
string | Array.<string> | Optional: Type of objects that user set as filters |
objectTypeSpecializations |
string | Array.<string> | Optional: Type of specialized objects that user set as filters |
languages |
string | Array.<string> | Optional: Languages that user set as filters |
clusters |
string | Array.<string> | Optional: Tags ids that user set as filters |
functionalAreas |
string | Array.<string> | Optional: Tags ids that user set as filters |
adminTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
streamTags |
string | Array.<string> | Optional: Tags ids that user set as filters |
levels |
string | Array.<string> | Optional: Tags ids that user set as filters |
langs |
string | Array.<string> | Optional: Tags ids that user set as langs |
referenceApplicationNames |
string | Array.<string> | Optional: Application name(s) of the cross-reference objects |
referenceTypes |
string | Array.<string> | Optional: Type(s) of the cross-reference objects |
referenceIds |
string | Array.<string> | Optional: Ids name(s) of the cross-reference objects |
techSkillsOnly |
boolean | Optional: If set retrieve only specific type of items |
softSkillsOnly |
boolean | Optional: If set retrieve only specific type of items |
withCompletionPercentage |
boolean | Optional: If true, the completion status of the items (for the current user) will be retrieved too |
withAverageLikingScore |
boolean | Optional: If true, the function will retrieve the average liking score of the items (gathered from the EVENT_COURSE_LIKING engagements) |
withChildrenCount |
boolean | Optional: If true, the function will retrieve the number of the first level of children of the items |
withStartDate |
boolean | Optional: If true, the function will retrieve the start date |
myOnly |
boolean | Optional: If true, it will retrieve the items created by the user |
fuzzySearch |
string | Optional: If "N" (default) no fuzzy results will be included, if "Y" fuzzy results will be included, if "D" only fuzzy results will be returned (the delta: excluding results from standard search) |
invited |
boolean | Optional: If true, retrieves only the items for which the user has been invited to |
certified |
string | Optional: Char used to force the retrieval of the already certified objects (Y) or not certified object (N) |
sorting |
string | Required: Param that specifies which type of sort will be used (S: score desc, D: create date desc, T: title asc). By default, the results will be ordered by title. |
originApplicationName |
string | Optional: the origin application name |
referenceApplicationName |
string | Optional: the reference application name |
status |
string | Optional |
openedFromDate |
string | Optional |
openedToDate |
string | Optional |
seggestedItems |
boolean | Optional: If true, it uses the suggest-items service |
suggested |
boolean | Optional: If true, retrieves only the items suggested to the user |
useListItemsByAny |
boolean | Optional: If true, it uses the list-items-by-any service |
useGetMyActivitiesItems |
boolean | Optional: If true, it uses the get-my-activities-items service |
useRentService |
boolean | Optional: If true, it uses the list-rents-by-any service |
fromRecord |
number | Required: The number of the first record to load (exclusive - 0 to start from the first) |
numRecords |
number | Required: The number of records to load |
itemIds |
string | Array.<string> | Optional for the action: The item id(s) |
withChildsLoaded |
boolean | Optional for the action: If true all childs object are loaded into childObject |
withChildsLoaded |
boolean | Optional for the action: If true all childs object are loaded into childObject |
openedOnly |
boolean | Optional for the action: Limit the check to the rentable items not returned |
expiredOnly |
boolean | Optional for the action: Limit the check to the rentable items that have passed the expectedEndDate |
onlyForMe |
boolean | Optional for the action: Limit the check to the user that made the request |
attributeRefTypes |
string | Array.<string> | Optional for the action: The attribute reference type(s) items must have |
attributeRefIds |
string | Array.<string> | Optional for the action: The attribute reference id(s) items must have |
attributeTypes |
string | Array.<string> | Optional for the action: The attribute type(s) items must have |
itemsPoolAttributeFilters |
ComparisonCondition | Array.<ComparisonCondition> | Optional: Filters used to retrieve the ids of the items to use as pool for the search. If some stages will be retrieved in the pool, thier syllabus will be searched and returned by the service |
allData |
boolean | Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/search-all-available-items
Returns:
The Items list that match the search criteria
- Type
- Array.<Item> | Array.<ConsumableItem>
(static) searchFieldSuggesterForItem(searchedText, numRecords, withSpellCheck, token) → {Array.<string>}
Returns a list of strings that could be used to "automplete" the input box while user is typing. The list includes autocomplete and spellcheck results.
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Required by the action: The text provided by the user to start the search |
numRecords |
number | Required by the action: The number of records to load |
withSpellCheck |
string | Optional for the action: Boolean (true/false) that indicates if add the spell checker to suggested results (default to false) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/search-field-suggester-for-item/:numRecords
Returns:
The Items list that match the search criteria
- Type
- Array.<string>
(static) searchItems(searchedText, status, techCompetences, softCompetences, argumentsTags, clusters, functionalAreas, adminTags, streamTags, levels, langs, objectTypes, objectTypeSpecializations, languages, attributeTypes, attributeValues, techSkillsOnly, softSkillsOnly, itemTypes, fromRecord, numRecords, sorting, ignoreVisibility, withGroupsLoaded, loadInvitedInstead, withAllVisibilitiesLoaded, withChildsLoaded, includeInheritedVisibilities, withParentsLoaded, childsTreeDepth, noFilter, withRegistration, token) → {Array.<Item>}
Search items in the external search engine
Parameters:
| Name | Type | Description |
|---|---|---|
searchedText |
string | Required by the action: The text provided by the user to start the search |
status |
string | Required by the action: Flag that states if the search must retrive object never viewed by the user (N), already viewed by the user (V) or all (A) |
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 |
argumentsTags |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
clusters |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
functionalAreas |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
adminTags |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
streamTags |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
levels |
string | Array.<string> | Optional for the action: Tags ids that user set as filters |
langs |
string | Array.<string> | Optional for the action: Tags ids that user set as langs |
objectTypes |
string | Array.<string> | Optional for the action: Type of objects that user set as filters |
objectTypeSpecializations |
string | Array.<string> | Optional for the action: Type of specialized objects that user set as filters |
languages |
string | Array.<string> | Optional for the action: Languages that user set as filters |
attributeTypes |
string | Array.<string> | Optional for the action: The attribute type(s) items must have |
attributeValues |
string | Array.<string> | Optional for the action: The attribute value(s) items must have |
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 |
itemTypes |
Array.<string> | Required by the action: ItemType(s) to search (e.g.: ItemTypes.ITEM, ItemTypes.COLLECTION, etc) |
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 |
sorting |
string | Required by the action: Flag that indicates which sort will be used (S: score desc, D: create date desc, T: title asc) |
ignoreVisibility |
boolean | string | Optional for the action: If true the item is loaded even if the user has no right on the object |
withGroupsLoaded |
boolean | Optional for the action: If true the groups in visibilities are loaded |
loadInvitedInstead |
boolean | Optional for the action: If true for the visibilities the user data that is load are the ones of the invited person instead of the inviter |
withAllVisibilitiesLoaded |
boolean | Optional for the action: If true all visibilities object will be loaded, otherwise only ones referred to or originted from the passed userId/groupIds |
withChildsLoaded |
boolean | Optional for the action: If true all childs object are loaded into childObject |
includeInheritedVisibilities |
boolean | Optional: include items that has inherited visibilities |
withParentsLoaded |
boolean | Optional: fill top parents in the resulting items |
childsTreeDepth |
number | Optional: depth in tree of childs to retrieve |
noFilter |
boolean | Optional for the action: if true the search will be unfiltered and we could get all the items you type of, if false it will be necessary to indicate a search filter |
withRegistration |
boolean | Optional for the action: If true include item registrations |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/search-items/:fromRecord/:numRecords
Returns:
The Items list that match the search criteria
- Type
- Array.<Item>