use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef 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);
}
}
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class DeployOnMDMAction method getMdmServer.
private MDMServerDef getMdmServer(SpagoBiServer spagoBiServer) {
MDMServerDef mdmServerDef = MdmmetadataFactory.eINSTANCE.createMDMServerDef();
mdmServerDef.setName(spagoBiServer.getShortDescription());
mdmServerDef.setHost(spagoBiServer.getHost());
mdmServerDef.setPort(spagoBiServer.getPort());
mdmServerDef.setUser(spagoBiServer.getLogin());
mdmServerDef.setPasswd(spagoBiServer.getPassword());
return mdmServerDef;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class MDMServerDefItemImpl method getServerDef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public MDMServerDef getServerDef() {
if (serverDef != null && serverDef.eIsProxy()) {
InternalEObject oldServerDef = (InternalEObject) serverDef;
serverDef = (MDMServerDef) eResolveProxy(oldServerDef);
if (serverDef.eResource() == null && eResource() != null) {
URI uri = EcoreUtil.getURI(serverDef);
if (uri.hasFragment()) {
uri = uri.trimFragment();
}
Resource resource = eResource().getResourceSet().getResource(uri, true);
for (EObject object : resource.getContents()) {
if (object instanceof MDMServerDef) {
serverDef = (MDMServerDef) object;
break;
}
}
}
if (serverDef != oldServerDef) {
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MdmpropertiesPackage.MDM_SERVER_DEF_ITEM__SERVER_DEF, oldServerDef, serverDef));
}
}
}
return serverDef;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class MDMServerDefImpl method getDecryptedServerDef.
/*
* (non-Javadoc)
*
* @see org.talend.mdm.repository.model.mdmmetadata.MDMServerDef#getDecryptedServerDef()
*/
@Override
public MDMServerDef getDecryptedServerDef() {
MDMServerDef clone = EcoreUtil.copy(this);
if (clone.getPasswd() == null || clone.getPasswd().trim().length() == 0) {
clone.setPasswd(getTempPasswd());
} else {
String decryptedPassword = PasswordUtil.decryptPassword(getPasswd(), algorithm);
clone.setPasswd(decryptedPassword);
}
return clone;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class MDMServerDefImpl method getEncryptedServerDef.
@Override
public MDMServerDef getEncryptedServerDef() {
MDMServerDef clone = EcoreUtil.copy(this);
String encryptedPassword = PasswordUtil.encryptPassword(getPasswd(), algorithm);
clone.setPasswd(encryptedPassword);
return clone;
}
Aggregations