abhishekdubey
Enthusiast
Enthusiast

Update vcenter TaskPane on webclient UI

Jump to solution

hi laurent,

we are creating a vCenter Task which is displaying in "Recent Task Pane "only after clicking global refresh button on UI.

Is it possible to update vCenter Recent Task Pane View by our flex mediator code.or call global refresh click by means of mediator class?

so the task will populate in the task pane immediate after creating task.

Thanks.

1 Solution

Accepted Solutions
abhishekdubey
Enthusiast
Enthusiast

Thanks laurent .

That is what i needed .

Its working fine solved my issue.:):smileylaugh:

View solution in original post

0 Kudos
4 Replies
laurentsd
VMware Employee
VMware Employee

In order for a custom task to be visible in he Recent Task Pane it must be created using the vCenter session user name, not the login name used for the Web Client.

Here is a code snippet to get the VC session name in your java plugin:

   private com.vmware.vim25.UserSession getCurrentVcUserSession(

         ServiceContent serviceContent, ManagedObjectReference sessionManager)

         throws RemoteException, InvalidPropertyFaultMsg, RuntimeFaultFaultMsg {

      PropertySpec pSpec = new PropertySpec();

      pSpec.setAll(new Boolean(false));

      pSpec.setType("SessionManager");

      pSpec.getPathSet().add("currentSession");

      ObjectSpec oSpec = new ObjectSpec();

      oSpec.setObj(sessionManager);

      PropertyFilterSpec pfSpec = new PropertyFilterSpec();

      pfSpec.getObjectSet().add(oSpec);

      pfSpec.getPropSet().add(pSpec);

      List<PropertyFilterSpec> pfSpecs = new ArrayList<PropertyFilterSpec>();

      pfSpecs.add(pfSpec);

      List<ObjectContent> objs = vimPort.retrieveProperties(

            serviceContent.getPropertyCollector(), pfSpecs);

      if (objs == null || objs.get(0) == null) {

         return null;

      }

      List<DynamicProperty> dProps = objs.get(0).getPropSet();

      if (dProps == null || dProps.get(0) == null) {

         return null;

      }

      return ((com.vmware.vim25.UserSession) dProps.get(0).getVal());

   }

0 Kudos
abhishekdubey
Enthusiast
Enthusiast

hi laurent,

Thanks for response but what i needed is different from what you suggested.

My Environment workflow Steps:

1) UI(Flex mediator) invoke the operation and communicate to java service layer.

2) java service layer communicate to C++ server.

3) There i can successfully  create vCenter Task with c++ code using vCenter API.

4) In webclient plugin UI the task is not visible in the recent task pane till i click Global refresh button.

my requirement:

I want to see my task immediate after creation of Task from my C++ code i;e refresh UI or click Global refresh from Code so task appears without manually click Global refresh.

Is that possible or feasible from either from service (java ) or UI (Flex) to trigger Global refresh Click Event.?:smileyconfused:

0 Kudos
laurentsd
VMware Employee
VMware Employee

If you are already creating your task with the right VC session user name try this:

- when receiving the response that your task has been started, add this to your UI mediator code

     dispatchEvent(new Event("taskPanelRefreshRequest"));

- the mediator class also needs to declare that it publishes this event above the class declaration

     [Event(name="taskPanelRefreshRequest", type="flash.events.Event")]

abhishekdubey
Enthusiast
Enthusiast

Thanks laurent .

That is what i needed .

Its working fine solved my issue.:):smileylaugh:

View solution in original post

0 Kudos