use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class ServerDefService method getLegendServerDefs.
/*
* (non-Javadoc)
*
* @see com.amalto.workbench.service.ILegendServerDefService#getLegendServerDefs()
*/
public List<com.amalto.workbench.utils.MDMServerDef> getLegendServerDefs() {
List<MDMServerDef> servers = ServerDefService.getAllServerDefs();
List<com.amalto.workbench.utils.MDMServerDef> legendDefs = new LinkedList<com.amalto.workbench.utils.MDMServerDef>();
if (servers != null) {
for (MDMServerDef serverDef : servers) {
String url = // $NON-NLS-1$
serverDef.getProtocol() + serverDef.getHost() + ":" + serverDef.getPort() + serverDef.getPath();
com.amalto.workbench.utils.MDMServerDef legendDef = com.amalto.workbench.utils.MDMServerDef.parse(serverDef.getProtocol(), url, serverDef.getUser(), serverDef.getPasswd(), serverDef.getName());
legendDefs.add(legendDef);
}
}
return legendDefs;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class ShowServerConsoleAction method run.
@Override
public void run() {
IRepositoryViewObject viewObject = getSelectedViewObject();
if (viewObject != null) {
MDMServerDefItem serverDefItem = getMDMItem(viewObject);
MDMServerDef selectedServerDef = serverDefItem.getServerDef();
if (selectedServerDef != null) {
showMDMServerConsole(selectedServerDef);
}
}
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class ServerDefDialog method buttonPressed.
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
if (!validateInput()) {
return;
}
updateUI2Model(serverDef);
}
if (buttonId == CHECK_CONNECTION_ID) {
if (!validateInput()) {
return;
}
MDMServerDef tmpServerDef = MdmmetadataFactory.eINSTANCE.createMDMServerDef();
tmpServerDef.setAlgorithm(PasswordUtil.ALGORITHM_COMMON_V2);
updateUI2Model(tmpServerDef);
try {
ServerDefService.checkMDMConnection(tmpServerDef.getDecryptedServerDef());
setMessage(Messages.ServerExplorer_ConnectSuccessful);
} catch (MissingJarsException e) {
return;
} catch (XtentisException e) {
setErrorMessage(Messages.ServerExplorer_ConnectFailed);
} catch (MalformedURLException e) {
setErrorMessage(Messages.ServerExplorer_ConnectFailed);
}
}
super.buttonPressed(buttonId);
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class JobResourceListener method run.
@Override
protected void run(String propertyName, final Item item) throws Exception {
boolean jobSaved = false;
boolean jobCreated = false;
if (propertyName.equals(ERepositoryActionName.SAVE.getName())) {
jobSaved = true;
}
if (propertyName.equals(ERepositoryActionName.CREATE.getName()) || propertyName.equals(ERepositoryActionName.IMPORT.getName()) || propertyName.equals(ERepositoryActionName.COPY.getName())) {
jobCreated = true;
}
if (!jobSaved && !jobCreated) {
// if the operation is not job saved or created, just don't do anything.
return;
}
if (jobCreated) {
CommandManager.getInstance().pushCommand(ICommand.CMD_ADD, item.getProperty().getId(), item.getProperty().getDisplayName());
removeLastServerInfo(item);
}
if (jobSaved) {
// create a new object but without GUI info since it won't be used here certainly
final IRepositoryViewObject viewObject = new RepositoryViewObject(item.getProperty(), true);
final MDMServerDef serverDef = RepositoryResourceUtil.getLastServerDef(viewObject);
DisplayUtils.getDisplay().syncExec(new Runnable() {
public void run() {
if (viewObject != null && serverDef != null && isOpenInEditor(viewObject)) {
CommandManager.getInstance().pushCommand(ICommand.CMD_MODIFY, viewObject);
final IRepositoryViewObject cacheViewObject = ContainerCacheService.get(item.getProperty());
if (cacheViewObject != null) {
MDMRepositoryView.show().getCommonViewer().refresh(cacheViewObject);
} else {
MDMRepositoryView.show().getCommonViewer().refresh(viewObject);
}
}
}
});
}
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class RepositoryViewObjectCheckedWidget method updateServerDef.
private void updateServerDef(IRepositoryViewObject viewObj) {
if (hasSameServerDef) {
Item item = viewObj.getProperty().getItem();
if (item == null || item instanceof ContainerItem) {
return;
}
MDMServerDef serverDef = RepositoryResourceUtil.getLastServerDef(item);
if (lastServerDef == null) {
lastServerDef = serverDef;
} else {
if (!lastServerDef.equals(serverDef)) {
lastServerDef = null;
hasSameServerDef = false;
}
}
}
}
Aggregations