use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class TransformerMainPage2 method getLastServerDef.
private MDMServerDef getLastServerDef() {
XObjectEditorInput2 input = (XObjectEditorInput2) editor2.getEditorInput();
Item item = input.getInputItem();
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(item);
return lastServerDef;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class RepositoryWebServiceAdapter method getMDMService.
public static TMDMService getMDMService(Shell shell, MDMServerDef lastserverDef) {
if (lastserverDef == null) {
MessageDialog.openWarning(null, Messages.Warning_text, Messages.RepositoryWebServiceAdapter_DeployFirst);
return null;
}
SelectServerDefDialog dialog = new SelectServerDefDialog(shell);
dialog.create();
dialog.setSelectServer(lastserverDef);
try {
if (dialog.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = dialog.getSelectedServerDef();
TMDMService port = RepositoryWebServiceAdapter.getMDMService(serverDef);
return port;
}
} catch (XtentisException e) {
log.error(e.getMessage(), e);
}
return null;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class OpenObjectAction method doSelectServer.
public boolean doSelectServer(Item item, IRepositoryViewEditorInput editorInput) {
MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
if (serverObject.getType() == TreeObject.DATA_CLUSTER) {
// Data Cluster
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(item);
MDMServerDef serverDef = openServerDialog(lastServerDef);
if (serverDef != null) {
XObjectBrowserInput input = (XObjectBrowserInput) editorInput;
TreeObject xobject = (TreeObject) input.getModel();
if (xobject != null && xobject.getWsKey() != null) {
TreeParent serverRoot = getServerRoot(serverDef);
xobject.setWsKey(new WSDataClusterPK(xobject.getWsKey().toString()));
xobject.setServerRoot(serverRoot);
return true;
}
}
return false;
}
return true;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class OpenObjectAction method openServerDialog.
/**
* return a decrypted server def
*
* @param serverObject
* @return a decrypted server def
*/
public MDMServerDef openServerDialog(MDMServerDef serverObject) {
SelectServerDefDialog dlg = new SelectServerDefDialog(getShell());
dlg.create();
dlg.setSelectServer(serverObject);
if (dlg.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = dlg.getSelectedServerDef();
return serverDef;
}
return null;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class DeployService method autoDeploy.
public void autoDeploy(Shell shell, IRepositoryViewObject viewObj) {
if (shell == null || viewObj == null) {
throw new IllegalArgumentException();
}
MDMServerDef serverDef = RepositoryResourceUtil.getLastServerDef(viewObj);
if (serverDef != null) {
if (!serverDef.isEnabled()) {
MessageDialog.openWarning(shell, null, Messages.DeployService_CanNotDeployToDisabledServer);
return;
}
List<IRepositoryViewObject> viewObjs = getAssociatedObjects(viewObj);
viewObjs.add(0, viewObj);
IStatus status = deploy(serverDef, viewObjs, ICommand.CMD_MODIFY, false);
if (!status.isOK()) {
return;
}
updateAutoStatus(status);
if (status.isMultiStatus()) {
showDeployStatus(shell, status);
}
} else {
boolean warnUser = PlatformUI.getPreferenceStore().getBoolean(PreferenceConstants.P_WARN_USER_AUTO_DEPLOY);
if (warnUser) {
MessageDialog.openWarning(shell, Messages.Warning_text, Messages.NeverDeploy_text);
}
}
}
Aggregations