use of org.talend.mdm.repository.core.command.ICommand in project tmdm-studio-se by Talend.
the class DeployService method updateLastServer.
public void updateLastServer(IStatus status, IProgressMonitor monitor) {
CommandManager manager = CommandManager.getInstance();
Map<String, List<ICommand>> commandMap = manager.getAllCommandsByPhase(ICommand.PHASE_AFTER_DEPLOY);
Set<String> ids = getValidUpdateIds(status);
for (String id : commandMap.keySet()) {
boolean canRun = false;
if (ids == null) {
canRun = true;
} else {
canRun = ids.contains(id);
}
if (canRun) {
List<ICommand> cmds = commandMap.get(id);
for (ICommand cmd : cmds) {
cmd.execute(null, monitor);
}
manager.removeCommandStack(id, ICommand.PHASE_AFTER_DEPLOY);
}
}
}
use of org.talend.mdm.repository.core.command.ICommand in project tmdm-studio-se by Talend.
the class BatchDeployJobCommand method runDeleteCmds.
private void runDeleteCmds(Object params, IProgressMonitor monitor, MultiStatus ms) {
for (ICommand cmd : subDeleteCmds) {
if (cmd instanceof AbstractDeployCommand) {
AbstractDeployCommand removeCmd = (AbstractDeployCommand) cmd;
IStatus status = removeCmd.execute(params, monitor);
ms.add(status);
}
}
}
use of org.talend.mdm.repository.core.command.ICommand in project tmdm-studio-se by Talend.
the class MDMServerDecorator method decorateModifiedObject.
private void decorateModifiedObject(IRepositoryViewObject viewObj, IDecoration decoration) {
CommandStack stack = CommandManager.getInstance().findCommandStack(viewObj.getId());
if (stack != null) {
ICommand command = stack.getValidDeployCommand();
switch(command.getCommandType()) {
case ICommand.CMD_ADD:
decoration.addOverlay(IMG_NEW, IDecoration.BOTTOM_RIGHT);
return;
case ICommand.CMD_DELETE:
decoration.addOverlay(IMG_DELETE, IDecoration.BOTTOM_RIGHT);
return;
case ICommand.CMD_MODIFY:
case ICommand.CMD_RENAME:
// $NON-NLS-1$
decoration.addPrefix("> ");
decoration.addOverlay(IMG_MODIFY, IDecoration.BOTTOM_RIGHT);
return;
}
}
}
use of org.talend.mdm.repository.core.command.ICommand in project tmdm-studio-se by Talend.
the class DeployStatusDialog method getType.
private ERepositoryObjectType getType(IStatus status) {
IStatus queryStatus = status;
if (status.isMultiStatus()) {
IStatus[] childrenStatus = status.getChildren();
if (childrenStatus != null && childrenStatus.length > 0) {
queryStatus = childrenStatus[0];
}
}
if (queryStatus != null && queryStatus instanceof DeployStatus) {
ICommand command = ((DeployStatus) queryStatus).getCommand();
IRepositoryViewObject viewObject = null;
if (command != null) {
if (command instanceof BatchDeployJobCommand) {
return ERepositoryObjectType.PROCESS;
} else {
viewObject = command.getViewObject();
}
}
if (viewObject == null) {
return null;
}
return viewObject.getRepositoryObjectType();
}
return null;
}
use of org.talend.mdm.repository.core.command.ICommand in project tmdm-studio-se by Talend.
the class ViewMainPage2 method isReferedViewObjModified.
private boolean isReferedViewObjModified() {
XObjectEditorInput2 editorInput2 = (XObjectEditorInput2) getEditor().getEditorInput();
IRepositoryViewObject viewObj = editorInput2.getViewObject();
CommandStack stack = CommandManager.getInstance().findCommandStack(viewObj.getId());
if (stack != null) {
ICommand command = stack.getValidDeployCommand();
if (command.getCommandType() == ICommand.CMD_MODIFY) {
return true;
}
}
return false;
}
Aggregations