use of org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem in project tmdm-studio-se by Talend.
the class DataModelInteractiveHandler method deploy.
@Override
public boolean deploy(AbstractDeployCommand cmd) throws XtentisException {
IRepositoryViewObject viewObj = cmd.getViewObject();
Item item = viewObj.getProperty().getItem();
MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
Object wsObj = convert(item, serverObject);
//
ICommandParameter parameter = cmd.getParameter();
if (parameter != null) {
callModelService(cmd);
return true;
} else {
TMDMService service = getService(cmd.getServerDef());
return doDeployWSObject(service, wsObj);
}
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem 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.mdmproperties.MDMServerObjectItem in project tmdm-studio-se by Talend.
the class RemoveFromRepositoryAction method removeServerObject.
private void removeServerObject(IRepositoryViewObject viewObj) {
if (removed.contains(viewObj.getId())) {
return;
}
removed.add(viewObj.getId());
try {
Item item = viewObj.getProperty().getItem();
IEditorReference ref = RepositoryResourceUtil.isOpenedInEditor(viewObj);
if (ref != null) {
RepositoryResourceUtil.closeEditor(ref, true);
}
factory.deleteObjectLogical(viewObj);
if (item instanceof MDMServerObjectItem) {
MDMServerObject serverObj = ((MDMServerObjectItem) item).getMDMServerObject();
CommandManager.getInstance().pushCommand(ICommand.CMD_DELETE, viewObj.getId(), serverObj.getName());
}
} catch (BusinessException e) {
MessageDialog.openError(getShell(), Messages.Common_Error, e.getMessage());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem in project tmdm-studio-se by Talend.
the class RepositoryNodeActionProviderAdapter method getActions.
@Override
public List<AbstractRepositoryAction> getActions(IRepositoryViewObject viewObj) {
List<AbstractRepositoryAction> actions = new LinkedList<AbstractRepositoryAction>();
//
Item item = viewObj.getProperty().getItem();
if (item instanceof MDMItem) {
if (item instanceof ContainerItem) {
FolderType type = ((FolderItem) item).getType();
switch(type.getValue()) {
case FolderType.SYSTEM_FOLDER:
addAction(actions, createFolderAction, viewObj);
addAction(actions, pasteAction, viewObj);
actions.add(importServerObjectAction);
actions.add(importObjectAction);
break;
case FolderType.STABLE_SYSTEM_FOLDER:
break;
case FolderType.FOLDER:
addAction(actions, createFolderAction, viewObj);
if (!((ContainerItem) item).getRepObjType().equals(ERepositoryObjectType.PROCESS)) {
actions.add(removeFromRepositoryAction);
}
addAction(actions, pasteAction, viewObj);
break;
}
} else if (item instanceof MDMServerObjectItem) {
addAction(actions, removeFromRepositoryAction, viewObj);
addAction(actions, mdmEditPropertyAction, viewObj);
addAction(actions, openVersionAction, viewObj);
addAction(actions, copyAction, viewObj);
addAction(actions, pasteAction, viewObj);
addAction(actions, duplicateAction, viewObj);
if (exAdapter != null) {
exAdapter.addActions(actions, viewObj);
}
} else if (item instanceof WorkspaceRootItem) {
// fix bug TMDM-3168
actions.add(importObjectAction);
}
}
if (enableDebug) {
// for debug digestValue
addAction(actions, debugDigestValueAction, viewObj);
}
//
actions.add(refreshAction);
actions.add(exportObjectAction);
// action provider
for (IRepositoryNodeActionProvider provider : getExtendActionProviders()) {
List<AbstractRepositoryAction> providerActions = provider.getActions(viewObj);
if (providerActions != null) {
actions.addAll(providerActions);
}
}
if (viewObj.getRepositoryObjectType() != null && IServerObjectRepositoryType.TYPE_EVENTMANAGER.equals(viewObj.getRepositoryObjectType())) {
actions.add(emAction);
}
//
return actions;
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem in project tmdm-studio-se by Talend.
the class ConsistencyService method calculateDigestValueByObjectResource.
private String calculateDigestValueByObjectResource(Item item) {
EObject copy = null;
if (item instanceof ProcessItem) {
copy = EcoreUtil.copy(((ProcessItem) item).getProcess());
} else if (item instanceof MDMServerObjectItem) {
MDMServerObject mdmServerObject = ((MDMServerObjectItem) item).getMDMServerObject();
copy = EcoreUtil.copy(mdmServerObject);
// remove server def property
MDMServerObject copiedMdmObj = (MDMServerObject) copy;
copiedMdmObj.setLastServerDef(null);
copiedMdmObj.setLastServerName(null);
copiedMdmObj.setCurrentDigestValue(null);
copiedMdmObj.setDigestValue(null);
// restore the timestamp to default
copiedMdmObj.setTimestamp(0L);
} else {
// unsupport to caculate object md5 which not belong to MDM
throw new UnsupportedOperationException();
}
if (copy != null) {
//
Resource resource = new SortResourceImpl();
resource.getContents().add(copy);
return calculateDigestValueByEMFResource(resource);
}
return null;
}
Aggregations