Class: FileBrowsingDialog

FileBrowsingDialog

new FileBrowsingDialog(optionsopt)

Browsing dialog for files in a remote file repository. The file repositories suitable to be browsed using this dialog contain files that can be identified by URLs. The URLs should be composed of two parts:
  • The file repository URL. E.g. the URL of a branch of a GitHub project, or an WebDAV server. When editing a file, browsing for external references link: images, content references, DITA Maps happens in the repository of the edited file. However, when trying to open or create a new file, the users should be allowed to change the file repository that they are using.
  • The path to the file. In order to change the file path, users can navigate the hierarchical of the repository.
Parameters:
Name Type Attributes Description
options sync.api.FileBrowsingDialog.Options <optional>
The options used to configure the File Browsing Dialog.
Source:

Extends

Classes

FileRepositoryConnectionConfigurator
FolderEntryDescriptor
UserActionRequiredEvent

Members

(static) EventTypes :string

Event types generated by the File Browser.
Type:
  • string
Properties:
Name Type Description
USER_ACTION_REQUIRED string
Source:

Methods

applyNewConfiguration(options)

Apply the configuration given from API.
Parameters:
Name Type Description
options sync.api.FileBrowsingDialog.Options The options chosen by the user.
Source:

chooseFile(e)

Choose the current file and dismiss the dialog. Note: If the we are trying to overwrite an existing file, issue an warning before.
Parameters:
Name Type Description
e goog.events.Event The dialog select event, or null if the OK button was not clicked.
Source:

chooseUrl(context, chosen, purpose)

Invokes the URL chooser.
Parameters:
Name Type Description
context sync.api.UrlChooser.Context The context in which the chooser is invoked - it contains information like the type of the resource that we want the user to choose: image, external xml file, etc.
chosen sync.api.UrlChooser~urlChosen The function to be called with the result of the choice.
purpose sync.api.UrlChooser.Purpose The purpose the chooser is invoked with.
Overrides:
Source:

finish(url)

Finish the dialog by choosing the given url.
Parameters:
Name Type Description
url string The choosen url.
Source:

getEventTarget() → {goog.events.EventTarget}

Getter for the url chooser's event target.
Source:
Returns:
target the object on which to listen for url chooser specific events.
Type
goog.events.EventTarget

refresh()

Refresh the url chooser. Refresh the url chooser in case the chooser does not reflect the actual resource state.
Source:

saveFile(fileURL, suggestedFileName, callback)

Saves the file given file. IMPORTANT: Please consider overriding sync.api.UrlChooser#chooseUrl instead of this one. The default implementation for this method uses sync.api.UrlChooser#chooseUrl to determine the save location. An use-case for this method is to re-use a 'saver' widget which already takes care of the saving itself.
Parameters:
Name Type Description
fileURL string the URL of the file to be saved.
suggestedFileName string the proposed name for the new file.
callback sync.api.UrlChooser~fileSaved the callback to be called with the saved file url.
Inherited From:
Source:

supports(type) → {boolean}

Checks whether the URL chooser supports choosing a given type of resource sync.api.UrlChooser.Type. If not supported, the default UI (which is usually a text-field) will be presented to the user.
Parameters:
Name Type Description
type sync.api.UrlChooser.Type The type of the URL to be chosen.
Overrides:
Source:
Returns:
true if the chooser supports the given type.
Type
boolean

supportsOperation(purpose) → {boolean}

Needs to be implemented to reflect whether the chooser suports the given operation: save or choose.
Parameters:
Name Type Description
purpose sync.api.UrlChooser.Purpose The operation.
Overrides:
Source:
Returns:
true if the given operation is supported.
Type
boolean

Type Definitions

Options

options The options used to configure the file browsing dialog.
Type:
  • Object
Source:

ConnectionConfigured(optionsopt)

Function called when the connection configuration is ready.
Parameters:
Name Type Attributes Description
options sync.api.FileBrowsingDialog.Options <optional>
The options used to re-initialize the dialog.
Source:

listFolderFunction(folderUrl, successCalback, failureCallback)

Callback that returns the contents of the given folder.
Parameters:
Name Type Description
folderUrl string The URL of the folder to list.
successCalback sync.api.FileBrowsingDialog~listFolderSuccessCallback The function to call when the folder listing is available.
failureCallback function The function to call when there was a failure retrieving folder content, passing in the exception.
Source:

listFolderSuccessCallback(folderEntries)

Callback that receives the folder entries.
Parameters:
Name Type Description
folderEntries Array.<sync.api.FileBrowsingDialog.FolderEntryDescriptor> The list of the URLs of the folder entries.
Source: