Managing Bookmarks
Application users can manage bookmarks either in the Files repository, or directly in the analytic application with the help of their application designer.
To manage your bookmarks go to
. You first select a bookmark, then follow these steps to edit, share, and delete a bookmark as needed:-
Select (Edit) to change the name and type (Personal or Global) of the bookmark.
-
Select (Share) to share the personal bookmark with other application users or teams.
-
Select (Delete) to delete a bookmark you no longer need.
When you share an analytic application with other users, only global bookmarks will be shared. Personal bookmarks won't be included.
To search for a specific bookmark, enter the bookmark name in the search box. To narrow down the filter scope, choose Valid Bookmarks, Invalid Bookmarks, or All Bookmarks from the dropdown list to the left of the search box.
As an application designer you can also leverage the following APIs to allow application users to directly save, list, or delete bookmarks in an analytic application:
save(bookmarkName: string, isGlobal: boolean, override?: boolean): BookmarkInfo // Save bookmark based on current state of application with "Personal" or "Global" visibility. getAll(): BookmarkInfo[] // Returns all valid bookmarks of current application. getAppliedBookmark(): BookmarkInfo // Returns the bookmark which is applied to current application. getVersion(): integer // Returns current bookmark version of application. deleteBookmark(bookmark: string|BookmarkInfo): boolean // Deletes specified bookmark of application.
Here are some script examples that show how to enable application users to save, list, and delete bookmarks in view mode.
In this example, you want to design an application that allows application users to capture the states of their application and save them as bookmarks.
First, in addition to the scripting object BookmarkSet_1, add an input field (InputField_1) and a button (Button_1) to the Canvas.
Then write the following script for Button_1:
var name = InputField_1.getValue(); BookmarkSet_1.save(name, true, true); // Create a bookmark with the name input in the input field. Meanwhile allow global visibility and will override existing bookmarks if the name duplicates.
Furthermore in this example, you want to allow application users to list all the available bookmarks and remove any bookmark.
First, in addition to the scripting object BookmarkSet_1, add a dropdown (Dropdown_1) and another button (Button_2) to the Canvas.
Then write the following scripts for the widgets:
For Dropdown_1:
var bookmarks = BookmarkSet_1.getAll(); Dropdown_1.removeAllItems(); for (var i=0; i < bookmarks.length;++i) { Dropdown_1.addItem(bookmarks[i].id, bookmarks[i].name); } if (bookmarks.length > 0) { Dropdown_1.getSelectedKey(); }
For Button_2:
BookmarkSet_1.deleteBookmark(Dropdown_1.getSelectedKey());
When application users select the dropdown box, all the available bookmarks will be listed. And if they click the Remove Bookmark button, the bookmark chosen in the dropdown will be deleted.