use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.
the class RepositoryProcessesNamesHolder method getExternalInfo.
@Override
public String[] getExternalInfo() {
List<IRepositoryViewObject> viewObjs = RepositoryResourceUtil.findAllViewObjects(IServerObjectRepositoryType.TYPE_TRANSFORMERV2);
String[] names = new String[viewObjs.size()];
int i = 0;
for (IRepositoryViewObject viewObj : viewObjs) {
Property prop = viewObj.getProperty();
if (prop.getItem() instanceof MDMServerObjectItem) {
MDMServerObject serverObject = ((MDMServerObjectItem) prop.getItem()).getMDMServerObject();
if (serverObject != null) {
names[i] = serverObject.getName();
}
} else {
names[i] = prop.getLabel();
}
i++;
}
return names;
}
use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.
the class MdmPropertiesWizard method performFinish.
@Override
public boolean performFinish() {
if (alreadyEditedByUser) {
return false;
}
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
Item item = object.getProperty().getItem();
String newName = object.getLabel();
MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
if (serverObject != null) {
String oldName = serverObject.getName();
try {
if (newName != null && factory.isEditableAndLockIfPossible(item)) {
serverObject.setName(newName);
item = RepositoryResourceUtil.assertItem(item);
factory.save(item, false);
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(item);
if (!oldName.equals(newName) && lastServerDef != null) {
CommandManager.getInstance().pushCommand(ICommand.CMD_RENAME, object.getId(), new String[] { oldName, newName });
}
}
} catch (PersistenceException e) {
MessageBoxExceptionHandler.process(e);
return false;
} finally {
try {
factory.unlock(item);
} catch (PersistenceException e) {
MessageBoxExceptionHandler.process(e);
return false;
} catch (LoginException e) {
MessageBoxExceptionHandler.process(e);
return false;
}
}
}
return true;
}
use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.
the class ViewBrowserInput method init.
protected void init(Item item) {
MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
Object treeObject = Bean2EObjUtil.getInstance().wrapEObjWithTreeObject(serverObject);
setModel(treeObject);
setName(serverObject.getName());
}
use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.
the class XObjectBrowserInput2 method init.
protected void init(Item item) {
MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
Object treeObject = Bean2EObjUtil.getInstance().wrapEObjWithTreeObject(serverObject);
setModel(treeObject);
setName(serverObject.getName());
}
use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.
the class XObjectEditorInput2 method init.
protected void init(Item item) {
MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
Object treeObject = Bean2EObjUtil.getInstance().wrapEObjWithTreeObject(serverObject);
setModel(treeObject);
setName(serverObject.getName());
}
Aggregations