Products | Versions |
---|---|
Spotfire Service for Python | All versions |
This article explains how to update bookmarks using Bookarmark Update API via IronPython scripts.
Updating the bookmarks using Bookmark API can be easily achieved using iron python scripts. An instance for the service name BookmarkManager can be created and its internal method Update() can be called for updating the bookmarks.
Below is the sample code -
def save_bookmark( book_mark, name ): bookmark_manager = Application.GetService(BookmarkManager) if book_mark is None: book_mark = bookmark_manager.AddNew( name, BookmarkComponentFlags.All ) bookmark_manager.SetPublicVisibility( book_mark, True ) else: bookmark_manager.Update(book_mark) bookmark_manager.SetPublicVisibility( book_mark, True )
def save_bookmark( book_mark, name ): bookmark_manager = Application.GetService(BookmarkManager) if book_mark is None: book_mark = bookmark_manager.AddNew( name, BookmarkComponentFlags.All ) bookmark_manager.SetPublicVisibility( book_mark, True ) else: updatedBookmark = bookmark_manager.Update(book_mark) bookmark_manager.SetPublicVisibility( updatedBookmark, True )