Jump to content
  • How to create a new folder in the Spotfire Library in Spotfire® using IronPython


    This article contains sample script to create a folder in Spotfire Library via Iron Python

    Introduction

    Sample script to create a folder in Spotfire Library via Iron Python

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    # Import namespaces
    from Spotfire.Dxp.Framework.Library import *
    
    libraryManager = Document.GetService(LibraryManager)
    
    myparentFolder = '/Tibco/'
    mynewSubFolder = 'spotfire'
    
    parentFolderExists, folder = libraryManager.TryGetItem(myparentFolder, LibraryItemType.Folder)
    
    if parentFolderExists:
       subfolderExists, subfolder = libraryManager.TryGetItem(mynewSubFolder + '/', LibraryItemType.Folder)
       if not subfolderExists:
           libraryManager.CreateFolder(folder, mynewSubFolder, LibraryItemMetadataSettings())
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...