from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
bookmarkName = "myBookmark"
#create the bookmark. Second argument specifies what to capture
myBookmark = Document.Bookmarks.AddNew(bookmarkName ,BookmarkComponentFlags.FilterSettings)
#extract data from myBookmark (last bookmark in our collection)
print Document.Bookmarks[Document.Bookmarks.Count-1].CreatedBy
#loop bookmarks
bookmarkManager = Application.Document.Context.GetService(BookmarkManager)
for b in bookmarkManager.GetBookmarks():
print b.Name
#search bookmarks (assuming that bookmark exists)
myBookmark = bookmarkManager.Search('name::"myBookmark"')[0]
#apply a bookmark
components = BookmarkComponentFlags.PageConfiguration | BookmarkComponentFlags.FilterOrganization
bookmarkManager.Apply(myBookmark, components)
#delete bookmark
Document.Bookmarks.Remove(myBookmark)
#update bookmark
bookmarkManager.Update(myBookMark)
No comments:
Post a Comment