- Since:
- 1.0.39
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Mixes In
Members
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/CloudSyncService.properties"}]
- Source:
-
widgetsForAuthenticationDialog
-
This is the widget model that will be use for the authentication dialog.
- Source:
-
widgetsForSyncDialog
-
This is the widget model that will be use for the creating the sync.
- Source:
Methods
-
getTenantOptions(payload)
-
This is provided for the purpose of generating a list of the tenants that the user has access to.
Parameters:
Name Type Description payload
object The options request payload - Source:
-
getTenantSiteOptions(payload)
-
This is provided for the purpose of generating a list of the sites on a particular tenant that the user has access to.
Parameters:
Name Type Description payload
object The options request payload - Source:
-
getTenantSitePath(payload)
-
This is provided for the purpose of retrieving path tree data for a particular site on a particular tenant.
Parameters:
Name Type Description payload
object The options request payload - Source:
-
onCloudAuthentication(payload)
-
This processes requests to authenticate a user against the cloud. The payload provided is expected to contain "username" and "password" attributes to perform the authentication with.
Parameters:
Name Type Description payload
object The authentication payload object - Source:
-
onCloudAuthenticationFailure(response, originalRequestConfig)
-
This is the failure call back for onCloudAuthentication. It publishes a request to display a prompt to indicate to the user that authentication was not successful.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
-
onCloudAuthenticationReponse(response, originalRequestConfig)
-
This is the callback for the XHR request made from the onCloudSyncRequest function. This will be called regardless of whether or not the current user is authenticated (as even if the user is not authenticated then an HTTP status code of 200 will be returned). If the response indicates that the user is not authenticated then a dialog will be shown to allow the user to authenticate.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
- module:alfresco/services/DialogService#event:ALF_CREATE_FORM_DIALOG_REQUEST
-
onCloudAuthenticationReponseFailure(response, originalRequestConfig)
-
This is the failure callback for the XHR request made from the onCloudSyncRequest function. It will only be called when the request fails (e.g. because the server cannot be reached) rather than the user not being authenticated.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
-
onCloudAuthenticationSuccess(response, originalRequestConfig)
-
This is the success call back for onCloudAuthentication. It processes the result to get the authenticated user name and the requested nodes to sync and then calls showCloudLocationPicker.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
-
onCloudSyncConfirmation(payload)
-
This is the function that is called to actually put the sync in place.
Parameters:
Name Type Description payload
object The payload containing the details of the sync to create. - Source:
-
onCloudSyncFailure(response, originalRequestConfig)
-
Handles Cloud sync failures by publishing a request to display a failure notification prompt.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
-
onCloudSyncRequest(payload)
-
This makes a request to the Alfresco Repository to see if the current user is authenticated against the Alfresco Cloud. Assuming that the Alfresco Repository is available then the onCloudAuthenticationReponse function will always be called as the result (this will then determine whether or not the user needs to provide Alfresco Cloud credentials or just select a location to sync with).
Parameters:
Name Type Description payload
object The payload for the sync request - Source:
-
onCloudSyncSuccess(response, originalRequestConfig)
-
This is the success call back for onCloudSyncConfirmation. It publishes a topic indicating success so that the sync dialog can be closed.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
- module:alfresco/core/topics#event:SYNC_TO_CLOUD_SUCCESS
-
optionsProgress(response, originalRequestConfig)
-
Handles progress updates by doing nothing.
Parameters:
Name Type Description response
object originalRequestConfig
object - Since:
- 1.0.94
- Source:
-
processTenantOptions(response, originalRequestConfig)
-
This is the success call back for getTenantOptions. It processes the raw data to create an array of the tenants that the user has permission to sync content to.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
-
registerSubscriptions()
-
Sets up the subscriptions for the CommentService
- Source:
Listens to Events:
- module:alfresco/core/topics#event:CLOUD_AUTHENTICATION_REQUEST
- module:alfresco/core/topics#event:GET_CLOUD_PATH
- module:alfresco/core/topics#event:GET_CLOUD_SITES
- module:alfresco/core/topics#event:GET_CLOUD_TENANTS
- module:alfresco/core/topics#event:INIT_CLOUD_SYNC
- module:alfresco/core/topics#event:SYNC_TO_CLOUD
-
showCloudLocationPicker(data)
-
Publishes a request to show a form dialog containing the the widgetsForSyncDialog model.
Parameters:
Name Type Description data
object The data about the nodes requested to be sync'd - Source:
Fires:
- module:alfresco/services/DialogService#event:ALF_CREATE_FORM_DIALOG_REQUEST