2 Replies Latest reply on Nov 8, 2012 5:51 AM by coldwater1

    Issue accessing vsphere object from Web Client UI Layer

    coldwater1 Novice

      Hello,

       

      I'm currently working to create a custom plugin for Equallogic, using vsphere 5.1 Web Client development enviroment. I'm trying to access a vsphere object or object id's as reference to process specific request pertaining to it.

       

      Currrently for each of the Flex mxml view logic we have the data request logic implemented in the Action script mediator class. The mediator class implements IContextObjectHolder and set context Object is set by the framework with the current inventory object or null.

       

      So

       

      1. Is there a mechanism to reference custom inventory objects or to set the _contextObject to a specific type for  requestingData pertaining to that object type as opposed to the context.? This would be really helpful for developers to implement custom business logic.

       

       

        /** Called by the framework with the current inventory object or null */
         public function set contextObject(value:Object):void {
            _contextObject = IResourceReference(value);
            if (_contextObject == null) {
               // A null contextObject means that the view is being cleared
               clearData();
               return;
            }
            // Once contextObject is set the view can be initialized with the object data.
            requestData();
         }

       

      2. Secondly While using the data access manager we create a DataModel , using the Model Tag

          [Model(type="VirtualMachine")] . Is there a reference to the list of properties & objects that a developer can query for these certain objects.

       

      Inputs for these would really helpful and much appreciated either from Vmware or developer community !

       

      Thanks!!

       

       

       

        • 1. Re: Issue accessing vsphere object from Web Client UI Layer
          laurentsd Master
          VMware Employees

          > Is there a mechanism to reference custom inventory objects or to set the _contextObject to a specific type for  requestingData pertaining to that object type as opposed to the context.?

           

          Custom inventory objects are supported, see the chassis-app samples of the SDK.  (You need to use the extention templates vsphere.core.inventory.objectViewTemplate and vsphere.core.inventorylist.objectCollectionTemplate.)  The context will be set of the selected custom object the same way it is set for other vSphere object views.

           

          The object used in a DAM request can be any object reference of type IResourceReference.

           

          >  Is there a reference to the list of properties & objects that a developer can query for these certain objects.

           

          For vSphere objects you can use the types and properties from the vSphere Web Service SDK (see this vsphere-50 API reference for instance) or you can define custom properties handled by your own PropertyProviderAdapter (see thevsphere-wssdk-provider sample). For custom objects, you define your own types and properties. It is important to add a namespace like mycompany:mytype to avoid collision with other types.

           

          See more details in the SDK FAQs that are part of the updated-sdk-docs.zip.

          1 person found this helpful
          • 2. Re: Issue accessing vsphere object from Web Client UI Layer
            coldwater1 Novice

            Thanks for providingg these tips ! Very useful, My intention for this question is to query inventory objects from UI independent of the context , I think I have to use DAM API to draw relationsships such to Query the list of the hosts managed by the vcenter and passdown these references down to the service layer for further processing.

             

            Thanks,