This article provides a code snippet to retrieve the URL's of a given library item for example the WEB Client URL. To test the below script, open an analysis from the Library in the Spotfire Client and then execute the script in the analysis
Introduction
Below is a code snippet to retrieve the URL's of a given library item for example the WEB Client URL. To test the below script, open an analysis from the Library in the Spotfire Client and then execute the script in the analysis
Code Sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Framework.Library import * #retrieve the libraryItem libraryManager = Application.GetService[LibraryManager](); analysisPath = "Sales and Marketing" (foundItem, aLibraryItem) = libraryManager.TryGetItem(analysisPath, LibraryItemType.Analysis, LibraryItemRetrievalOption.IncludePath) if foundItem: print "Found the given Library Item" libraryLinks = libraryManager.Links; (found, webURI) = libraryLinks.TryGetWebPlayerUri(aLibraryItem, LibraryLinksOption.Path) print "The Web URI of the given library item is: ",webURI.AbsoluteUri (found, clientURI) = libraryLinks.TryGetUri(aLibraryItem, LibraryLinksOption.Path); print "The client URI of the given library item is: ",clientURI.AbsoluteUri print else: print "No item found"
References
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.