How to get loaded component in RWS programmatically
In RWS, after I loaded some components into sandbox, these component turned to filled cyan color. And I want to get this loaded component list programmatically. Do anyone know which API can do this task?
Beside that, I want to get sanbox folder corresponding with each loaded component, how can I do that?
|
Accepted answer
The list of components shown in the Pending Changes view can be retrieved by: IComponentSyncModel.getComponentSyncContexts()
IComponentSyncModel model = FileSystemResourcesPlugin.getComponentSyncModel();
if (model.getLocalSynchronizationManager().isShared(workspace.getResolvedWorkspace(), component)) {
// component is loaded
} To hook a listener to know when components are loaded/unloaded (in case you need to respond to these events) ILocalSynchronizationManager mgr = FileSystemResourcesPlugin.getComponentSyncModel().getLocalSynchronizationManager(); mgr.addGenericListener(ILocalSynchronizationManager.LOADED_COMPONENTS, fSharedComponentsListener); For your second question, it's important to note that a given component could be loaded in multiple sandboxes. To get the list of sandboxes you would first get the IWorkspaceConnection for the workspace in question, then call: Collection<ISandbox> sandboxes = FileSystemCore.getSharingManager().getSandboxes(new ConfigurationFacade(workspaceConnection, component), monitor); Anbe Pham selected this answer as the correct answer
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.