use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class SelectImportedModulesDialog2 method getPort.
@Override
protected TMDMService getPort() throws XtentisException {
SelectServerDefDialog dialog = new SelectServerDefDialog(getShell());
if (dialog.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = dialog.getSelectedServerDef();
this.serverDef = serverDef;
return RepositoryWebServiceAdapter.getMDMService(serverDef);
}
return null;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class RenameViewAction method renameViewObject.
private void renameViewObject(IRepositoryViewObject viewObj) {
MDMServerObjectItem item = (MDMServerObjectItem) viewObj.getProperty().getItem();
MDMServerObject serverObject = item.getMDMServerObject();
IProxyRepositoryFactory factory = getFactory();
try {
if (serverObject != null) {
String oldName = serverObject.getName();
RenameViewDialog dialog = getRenameDialog(oldName);
int returnCode = dialog.open();
if (returnCode == IDialogConstants.OK_ID) {
String newName = dialog.getValue();
if (RepositoryTransformUtil.getInstance().getViewType(oldName) == TYPE_WEBFILTER) {
newName = PREFIX_VIEW_UPPER + newName;
} else {
if (newName.startsWith(PREFIX_VIEW_UPPER)) {
viewTypeChanged = true;
item.getState().setPath(IPath.SEPARATOR + PATH_WEBFILTER);
}
}
if (newName != null && factory.isEditableAndLockIfPossible(item)) {
serverObject.setName(newName);
viewObj.getProperty().setLabel(newName);
viewObj.getProperty().setDisplayName(newName);
factory.save(viewObj.getProperty().getItem(), false);
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(viewObj);
if (lastServerDef != null) {
CommandManager.getInstance().pushCommand(ICommand.CMD_RENAME, viewObj.getId(), new String[] { oldName, newName });
}
}
commonViewer.refresh(viewObj);
}
}
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
} finally {
try {
factory.unlock(item);
} catch (PersistenceException e) {
log.error(e.getMessage(), e);
} catch (LoginException e) {
log.error(e.getMessage(), e);
}
}
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class MDMServerDecorator method decorateRepositoryObject.
private void decorateRepositoryObject(Item item, IDecoration decoration) {
if (item != null) {
String version = item.getProperty().getVersion();
if (item instanceof WSResourceItem) {
// resource image show catalog
WSResourceItem ritem = (WSResourceItem) item;
String imageCatalog = ritem.getResource().getImageCatalog();
if (imageCatalog != null) {
// $NON-NLS-1$
decoration.addSuffix(" " + imageCatalog);
}
} else if (version != null) {
// $NON-NLS-1$
decoration.addSuffix(" " + version);
}
MDMServerDef serverDef = RepositoryResourceUtil.getLastServerDef(item);
if (serverDef != null) {
decoration.addOverlay(IMG_SERVER, IDecoration.TOP_RIGHT);
// $NON-NLS-1$
decoration.addSuffix(" " + serverDef.getName());
}
}
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class ConnectToWebUIAction method getUrl.
private String getUrl() {
// $NON-NLS-1$
String path = "/talendmdm";
// $NON-NLS-1$
String defaultHostPort = "http://localhost:8080";
List<IRepositoryViewObject> viewObjects = ServerDefService.getAllServerDefViewObjects();
if (viewObjects == null || viewObjects.size() == 0) {
return defaultHostPort + path;
}
SelectServerDefDialog selServerDlg = getSelectServerDefDialog();
if (selServerDlg.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = selServerDlg.getSelectedServerDef();
return serverDef.getProtocol() + serverDef.getHost() + ":" + serverDef.getPort() + // $NON-NLS-1$
Util.getContextPath(serverDef.getPath());
}
return null;
}
use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class UserSecurityComboBoxDialogCellEditor method getSchemaFromServer.
private String getSchemaFromServer() {
String schema = null;
MDMServerDef serverDef = getServerDef();
if (isAccessible(serverDef)) {
TMDMService service = getService(serverDef);
WSDataModel wsDataModel = service.getDataModel(new WSGetDataModel(new WSDataModelPK(dataModelName)));
schema = wsDataModel.getXsdSchema();
}
return schema;
}
Aggregations