Jump to content
  • How to Add, Apply and Remove a Bookmark using IronPython in Spotfire®


    This article explains how to Add, Apply and Remove a Bookmark using IronPython in Spotfire®

    Introduction

    This example shows How to add, apply and remove a Bookmark using IronPython in TIBCO Spotfire®

    Code sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    #Add a new Bookmark:
    
    from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
    from Spotfire.Dxp.Application import BookmarkComponentFlags  
    
    # Get the Bookmark Manager as a service
    bookmarkManager = Application.GetService(BookmarkManager)
    
    # Create a new Bookmark:
    bookmarkManager.AddNew("NewBookmark", BookmarkComponentFlags.All)	
    
    
    # Apply a Bookmark:
    
    from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
    bookmarkManager = Application.GetService(BookmarkManager)
    
    # Search the BookmarkManager service for a bookamrk matching our name
    bookMark = bookmarkManager.Search('name::"Reset Filters (To B)"')
    
    if bookMark.Count == 1:
        bookmarkManager.Apply(bookMark[0])
    	
    # Remove all the Bookmarks:
    
    from Spotfire.Dxp.Application import BookmarkComponentFlags  
    from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
    
    bookmarkManager = Application.Document.Context.GetService(BookmarkManager)
    
    for b in bookmarkManager.GetBookmarks():
    	bookmarkManager.Remove(b);
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...