use of com.amalto.workbench.service.bridge.IRemoveCommandService in project tmdm-studio-se by Talend.
the class DeployOnMDMAction method doRun.
@Override
protected void doRun() {
List<IRepositoryViewObject> viewObjs = getSelectedViewObject();
DeployOnMDMExportWizard publishWizard = new DeployOnMDMExportWizard();
publishWizard.setWindowTitle(EXPORTJOBSCRIPTS);
publishWizard.init(getWorkbench(), (IStructuredSelection) this.getSelection());
Shell activeShell = Display.getCurrent().getActiveShell();
WizardDialog dialog = new WizardDialog(activeShell, publishWizard);
dialog.open();
boolean deploySucceed = publishWizard.isDeploySucceed();
if (deploySucceed) {
IRemoveCommandService service = (IRemoveCommandService) GlobalServiceRegister.getDefault().getService(IRemoveCommandService.class);
SpagoBiServer spagoBiServer = publishWizard.getMdmServer();
MDMServerDef mdmServer = getMdmServer(spagoBiServer);
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
try {
for (IRepositoryViewObject viewObj : viewObjs) {
Item item = viewObj.getProperty().getItem();
Property property = item.getProperty();
if (property != null) {
boolean eDeliver = property.eDeliver();
property.eSetDeliver(false);
property.getAdditionalProperties().put(PROP_LAST_SERVER_DEF, mdmServer.getName());
factory.save(item);
property.eSetDeliver(eDeliver);
}
refreshMdmRepositoryViewTree();
service.removeDeployPhaseCommandOf(ERepositoryObjectType.PROCESS, item);
}
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
}
}
}
Aggregations