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.
Thanks laurent .
That is what i needed .
Its working fine solved my issue.:):smileylaugh:
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());
}
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:
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")]
Thanks laurent .
That is what i needed .
Its working fine solved my issue.:):smileylaugh: