This is part of GoCloudStorage and not part of the main GoJS library. Storage can be found in the GoJS kit under the projects
folder. See the Storage intro page for more information.
Contains valid instances of GoCloudStorage subclasses. Use at most one instance of each subclass.
The directory path relative to the page in which this instance of GoCloudStorageManager exists, in which the storage service brand icons can be found. The default value is "../goCloudStorageIcons/". Note: If this parameter is supplied, it is used as for the "iconsRelativeDirectory" constructor parameter for each instance this instance of GoCloudStorageManager manages in storages.
Get / set the GoCloudStorage subclass this instance of GoCloudStorageManager is actively managing.
Get / set iconsRelativeDirectory, the directory path relative to the page in which this instance of GoCloudStorageManager exists, in which the storage service brand icons can be found. The default value is "../goCloudStorageIcons/".
Get GoCloudStorageManager menu, from which a user chooses which storage service for this instance of GoCloudStorageManager to actively manage (see currentStorage). This is created (as a blank div) during construction. Its contents are populated during selectStorageService.
Get storages (GoCloudStorage subclass instances) managed by an instance of GoCloudStorageManager. At most, there should be only one instance of each subclass. This is set with a parameter during construction.
Creates a new diagram with currentStorage's default model data (see GoCloudStorage.defaultModel. If currentStorage.isAutoSaving is true, prompt to save it to to currentStorage's storage service. if currentStorage's GoCloudStorage.isAutoSaving is true).
Whether or not to prompt the user to save their current work before creating a new diagram. See more at GoCloudStorage.create. Default value is false.
Returns a Promise that resolves a DiagramFile representing the newly created file (if file was saved).
Get the path to the icon for a given GoCloudStorage.className
Handle an action with the current currentStorage. Possible values for action
can be:
Whether or not to prompt the user to save their current work before creating a new file. Default value is false. See more at GoCloudStorage.create
Hide the storage selection menu
Launches the load interface for currentStorage.
Returns a Promise that resolves with a DiagramFile representing the loaded file.
Launches the remove interface for currentStorage.
Returns a Promise that resolves with a DiagramFile representing the deleted file.
Either launches the save interface for currentStorage or just saves the GoCloudStorage.managedDiagrams' model data to storage at the path supplied in currentStorage's GoCloudStorage.currentDiagramFile.path value, depending on a parameter.
If true, show the save interface for currentStorage. If false, save currentStorage's managedDiagrams' model data to storage. Default value is true.
Returns a Promise that resolves with a DiagramFile representing the saved file.
Display options (storages) supported by this instance of GoCloudStorageManager. Sets currentStorage to user's choice.
Returns a Promise that resolves with the new currentStorage instance
Display a message on the screen for a given number of seconds. Can be used for a variety of purposes, but a common one is to notify users when a file has been loaded / saved / deleted / created by handling the DiagramFile argument in the "then" function of returned Promises (from functions load, create, save, remove) by displaying it as a message.
Message to display
Number of seconds to display the message for. If no value is provided, the message will display for two seconds.
Class for easily saving / loading GoJS Models to / from a user-defined set of Cloud Storage Services with a pre-defined UI.
GoCloudStorageManager holds a set of GoCloudStorage subclass instances (storages) to manage. When one is selected from the storage selection menu, it becomes the currentStorage property, which is used to save / load / delete / create files.