Available services
The customization SDK contains several UI services that you can inject as require dependencies. These services are located in the sdk/services namespace.
UrlService (sdk/services/urlService)
| Method name | Method return type | Description |
|---|---|---|
getSdkUrl(relativeUrl) | string | This method returns a full URL from a specified relative URL. It is useful in situations where you need to refer to an image or to other resources that are packed together with your customization. The |
DialogService (sdk/services/dialog/dialogService)
| Method name | Method return type | Description |
|---|---|---|
showDialog(templateLoader, templateId, options) | promise | This method is used to display modal dialog boxes.
This method returns a promise. The result of the promise is an object that has the following structure:
Example:
|
changeCurrentDialogOptions(options) | void | Use this method to change the look and feel of an existing modal dialog box and call it after an existing modal dialog box has been displayed. The options parameter has the same format as the one used in the |
closeDialog | void | Use this method to close an existing modal dialog box and call it after an existing modal dialog box has been displayed. |
DialogSize (sdk/services/dialog/DialogSize)
SmallMediumLarge
DialogResult (sdk/services/dialog/DialogResult)
OKCANCEL
AjaxService (sdk/services/ajaxService)
| Method name | Method return type | Description |
|---|---|---|
getData(apiCall, options) | promise | This method performs a GET operation on the REST API. The
Here is an example of options for a tasks GET call that returns a list of tasks:
|
postData(apiCall, data) | promise | This method performs a POST operation on the REST API. The
For example:
|
putData(apiCall, data) | promise | This method performs a PUT operation on the REST API. The
For example:
|
deleteData(apiCall, data) | promise | This method performs a DELETE operation on the REST API. The apiCall parameter specifies which endpoint should be used. The data parameter specifies the entity to be deleted.
For example:
|
patchData(apiCall, data) | promise | This method performs a PATCH operation on the REST API. The apiCall parameter specifies which endpoint should be used. The data parameter specifies the JSON data to be patched.
For example:
|
ApiCall (sdk/services/ApiCall)
| Method name | Method return type | Description |
|---|---|---|
withParams(param1, param2, ...) | ApiCall | This method fills parameter values for parameterized endpoints.
For example, to GET a specific project, you would make a call to the following endpoint: /projects/%s, where %s is the project ID.
|
ApiCall - REST API endpoint correspondence):
ApiCall.PROJECT_GROUP_STATISTICS= "/projectGroups/statistics"ApiCall.PROJECT_STATISTICS= "/projects/statistics"ApiCall.PROJECTS= "/projects"ApiCall.PROJECT_COMPLETE= "/projects/complete"ApiCall.PROJECT_CANCEL= "/projects/cancel"ApiCall.PROJECT_STEP_REDO= "/projects/redo"ApiCall.PROJECT= "/projects/%s"ApiCall.PROJECTSEARCH= "/projects/search"ApiCall.PROJECT_SCOPING= "/projects/%s/scoping"ApiCall.PROJECT_GROUP_SCOPING= "/projectGroups/%s/scoping"ApiCall.SCOPING_ASSETS= "/projects/%s/scopedAssets"ApiCall.TASKS= "/tasks"ApiCall.TASK= "/tasks/%s"ApiCall.TASK_HISTORY= "/taskHistory?taskId=%s"ApiCall.TASKSEARCH= "/tasks/search?fields=%s"ApiCall.TASK_CLAIM= "/tasks/claim"ApiCall.TASK_UNCLAIM= "/tasks/unclaim"ApiCall.TASK_INCLUDE_COST= "/tasks/includeCost"ApiCall.TASK_EXCLUDE_COST= "/tasks/excludeCost"ApiCall.TASK_STEP_COMPLETE= "/tasks/complete"ApiCall.TASK_STEP_CHANGE_ASSIGNEES= "/tasks/changeAssignees"ApiCall.MOVE_TASKS= "/tasks/move"ApiCall.IMPORT_TASKS= "/tasks/import"ApiCall.EXPORT_TASKS= "/tasks/export"ApiCall.TASK_STEP_REDO= "/tasks/redo"ApiCall.TASKS_FOR_PROJECT= "/tasks?projectId=%s"ApiCall.CANCEL_TASKS= "/tasks/cancel"ApiCall.PROJECT_ATTRIBUTES= "/projectAttributes"ApiCall.PROJECT_TYPES= "/projectTypes"ApiCall.PROJECT_TYPE= "/projectTypes/%s"ApiCall.RFQS= "/rfqs"ApiCall.USER_PROFILE_PREFS= "/users/me/profilePreferences"ApiCall.USER_MULTISEARCH_FILTERS= "/searchFilters"ApiCall.USER_MULTISEARCH_CREATE_FILTER= "/searchFilters?key=%s"ApiCall.USER_MULTISEARCH_MANAGE_FILTER= "/searchFilters/%s?key=%s"ApiCall.USER_DETAILS= "/users/me/details"ApiCall.PROJECT_GROUP= "/projectGroups/%s"ApiCall.PROJECT_GROUP_CUSTOM_ATTRIBUTES= "/projectGroups/%s?fields=%s"ApiCall.PROJECT_GROUPS= "/projectGroups"ApiCall.PROJECT_GROUPS_SEARCH= "/projectGroups/search?fields=%s"ApiCall.FILES= "/files"ApiCall.DOWNLOAD_ASSETS= "/files/assets"ApiCall.DOWNLOAD_ASSET= "/files/asset"ApiCall.VERIFY_DOWNLOAD_ASSETS= "/files/assets/verify"ApiCall.CLIENTS= "/clients"ApiCall.LOCALES= "/locales"ApiCall.COLUMNS= "/columns"ApiCall.CREATE_PROJECT= "/projectGroups/create"ApiCall.ATTRIBUTES= "/attributeDefinitions"ApiCall.ATTRIBUTE_VALUES= "/attributeValues"ApiCall.USER_ACTION_PERMISSIONS= "/users/me/permissions"ApiCall.PROJECT_DETAILS= "/projects/%s/details"ApiCall.PROJECT_GROUP_DETAILS= "/projectGroups/%s/details"ApiCall.WORKFLOWS= "/workflows"ApiCall.WORKFLOW= "/workflows/%s"ApiCall.WORKFLOW_IMAGE= "/workflows/%s/image"ApiCall.JOB= "/jobs/%s"ApiCall.JOBS= "/jobs"ApiCall.NOTIFICATIONS= "/notifications"ApiCall.DOWNLOAD= "/download/%s"ApiCall.ATTRIBUTE_ATTACHMENT= "/files/attachments"ApiCall.TRANSLATE_IN_STUDIO_JOBS= "/jobs/%s"ApiCall.CONFIG= "/config"ApiCall.EXPORT= "/export"ApiCall.USERS= "/users"ApiCall.ROLES= "/workflowRoles"ApiCall.LINGUISTIC_FILTERS= "/linguisticFilters"ApiCall.ISSUES= "/issues"ApiCall.USER_STATISTICS= "/users/me/statistics"ApiCall.ANNOUNCEMENTS= "/announcements"ApiCall.CUSTOMIZATIONS= "/customizations"ApiCall.DOWNLOAD_SCOPING_INFO= "/projects/%s/scoping/download"ApiCall.DOWNLOAD_PG_SCOPING_INFO= "/projectGroups/%s/scoping/download"ApiCall.COST_MODEL= "/costModels"ApiCall.QUALITY_MODEL= "/qualityModels"ApiCall.WORKGROUPS= "/workgroups"ApiCall.CREATE_PROJECT_FOR_TASK= "/projects/createForTask"ApiCall.ADAPTER_CONFIGURATIONS= "/adapterConfigurations"ApiCall.ADAPTER_CONFIGURATION= "/adapterConfigurations/%s"ApiCall.GET_ADAPTER_CONFIGURATION= "/adapterConfigurations/%s?adapterName=%s"
ProjectsViewService (sdk/services/views/projectsViewService)
| Method name | Method return type | Description |
|---|---|---|
getSelectedProjectsIds() | array | This method returns an array with the IDs of the currently selected projects. |
getSelectedProjectGroupsIds() | array | This method returns an array with the IDs of the currently selected project groups. |
getVisibleProjectIds() | array | This method returns an array with the IDs of the currently visible projects. |
getVisibleProjectGroupsIds() | array | This method returns an array with the IDs of the currently visible project groups. |
getVisibleColumns() | array | This method returns an array with the metadata of the currently visible columns. |
TasksViewService (sdk/services/views/tasksViewService)
| Method name | Method return type | Description |
|---|---|---|
getSelectedTasksIds() | array | This method returns an array with the IDs of the currently selected tasks. |
getVisibleTasksIds() | array | This method returns an array with the IDs of the currently visible tasks. |
getVisibleColumns() | array | This method returns an array with the metadata of the currently visible columns. |
getTasksParent() | object | This method returns an object with the current task's parent type and ID. |
MessageBus (sdk/services/messaging/messageBus)
| Method name | Method return type | Description |
|---|---|---|
subscribe(onMessageCallback, messageType) | void | The onMessageCallback parameter specifies a function to be executed when the event occurs. The messageType parameter specifies the type of event to which to subscribe. |
MessageType (sdk/services/messaging/messageType)
MessageBus.
| Method name | Description |
|---|---|
TasksDataLoaded | Shown when the information about tasks has finished loading on the Tasks page.
|
SelectedTasksChanged | Shown when the current task selection has changed on the Tasks page. |
ProjectsDataLoaded | Shown when the information about projects has finished loading on the Projects page.
|
SelectedProjectsChanged | Shown when the current project selection has changed on the Projects page. |