8 Replies Latest reply on Dec 14, 2011 12:07 PM by manfriday

    getAllSubfolders ?

    manfriday Hot Shot

      Hi,

       

      I am working on a filed in presentation..

      What I want to do it feed it a default folder and populate drop down with all of the subfolders.

       

      I dont see a getAllFolders or getAllSubFolders action.

       

      is there any way to do what I am trying to accomplish?

       

      Thanks

       

      Jason

        • 1. Re: getAllSubfolders ?
          tschoergez Master
          VMware EmployeesUser ModeratorsvExpert

          Which Folders are you referring to?

          Workflow Folders in vCO?

          Or Host/VM/Datastore-Folder in vCenter?

           

          For both you can try to find some scripting examples in the library how to traverse these recursivly.

          (For Workflow Folder for instance there are some com.vmware.webview.getallXXXX of category actions)

          Regards,

          Joerg

          • 2. Re: getAllSubfolders ?
            manfriday Hot Shot

            Sorry for my lack of clarity.

             

            I am looking for VM fodlers in vCenter.

             

            Essentially what I have is folder structure something like this:

            WINDOWS

                      Webservers

                      File/Print Servers

                      Database servers

                      etc..

             

            I want to specify the WINDOWS folder, and then have the user choose here to place his newly created VM, by choosing one of the subfolders.

             

            I didn't see any sort of action that seemed to get all of the subfolders of a folder. I'll look again though.

            • 3. Re: getAllSubfolders ?
              cdecanini_ Virtuoso
              VMware Employees

              There is a presentation properties called "select a root object to be shown in the chooser".

              You can create an attribute with specifying the root folder and use it in this property.

               

              Christophe.

              1 person found this helpful
              • 4. Re: getAllSubfolders ?
                manfriday Hot Shot

                So, I created an attribute, called "WSSFolder, made it a type VC:VmFolder, and assigned the Top level "WINDOWS" folder to it.

                 

                In the presentation for the field I want the user to select, I chose 'Specify a root object to be shown in the chooser', and for the value i tried #WSSFolder.

                 

                That didnt seem to work.  Am I not understnading how to use this field?

                • 5. Re: getAllSubfolders ?
                  cdecanini_ Virtuoso
                  VMware Employees

                  I have just did it and it works for me:

                   

                  Screen shot 2011-12-14 at 8.34.05 PM.png

                   

                  Screen shot 2011-12-14 at 8.34.48 PM.png

                   

                  Is this waht you did ?

                   

                  Christophe.

                  1 person found this helpful
                  • 6. Re: getAllSubfolders ?
                    manfriday Hot Shot

                    Yes, that is what I did.

                    I see what is going on now.

                     

                    I also had added the "Select Value AS" -> Drop-Down property.

                     

                    Somehow that undoes the "Specify root object" Property. Maybe a bug? Or maybe that is as designed and I just dont understand how it is supposed to be used?

                    • 7. Re: getAllSubfolders ?
                      cdecanini_ Virtuoso
                      VMware Employees

                      A select value as drop down does disable the tree view. Not sure if this is a bug or a non implementation of a features.

                      If you want to use it you could create an action returning all the VMs for a vCenter folder and use it with the predefined list of elements properties.

                       

                      Christophe.

                      • 8. Re: getAllSubfolders ?
                        manfriday Hot Shot

                        I think I might do that.

                        Thanks!