use of org.talend.mdm.repository.core.command.param.ICommandParameter in project tmdm-studio-se by Talend.
the class DataModelInteractiveHandler method callModelService.
private void callModelService(AbstractDeployCommand cmd) throws XtentisException {
ICommandParameter parameter = cmd.getParameter();
if (parameter != null) {
ImpactOperation operation = (ImpactOperation) parameter.getParameter();
Boolean force = null;
if (operation == ImpactOperation.APPLY_LOW_CHANGE) {
force = false;
} else if (operation == ImpactOperation.RECREATE_TABLE) {
force = true;
}
ModelImpactAnalyseService.updateModel(cmd.getServerDef(), cmd.getViewObject(), force);
}
}
use of org.talend.mdm.repository.core.command.param.ICommandParameter 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.core.command.param.ICommandParameter in project tmdm-studio-se by Talend.
the class DeployService method deployAnotherVersion.
public IStatus deployAnotherVersion(MDMServerDef serverDef, List<IRepositoryViewObject> viewObjs) {
CommandManager manager = CommandManager.getInstance();
List<AbstractDeployCommand> commands = manager.getDeployCommandsWithoutHistory(viewObjs);
try {
// insert impact dialog
Map<IRepositoryViewObject, ImpactOperation> analyzeModelImpact = ModelImpactAnalyseService.analyzeCommandImpact(serverDef, commands);
Map<IRepositoryViewObject, ICommandParameter> paramMap = null;
if (analyzeModelImpact != null) {
ModelImpactAnalyseService.shrinkDeployCommands(analyzeModelImpact, commands);
paramMap = ModelImpactAnalyseService.convertToParameters(analyzeModelImpact);
manager.attachParameterToCommand(commands, paramMap);
}
} catch (InterruptedException ex) {
return Status.CANCEL_STATUS;
}
return runCommands(commands, serverDef);
}
use of org.talend.mdm.repository.core.command.param.ICommandParameter in project tmdm-studio-se by Talend.
the class CommandManager method getDeployCommands.
/**
* DOC hbhong Comment method "getDeployCommands".
*
* @param viewObjs
* @param defaultCmdType if none then assign -1
* @return
*/
public List<AbstractDeployCommand> getDeployCommands(List<IRepositoryViewObject> viewObjs, int defaultCmdType, Map<IRepositoryViewObject, ICommandParameter> paramMap) {
List<AbstractDeployCommand> cmds = new LinkedList<AbstractDeployCommand>();
for (IRepositoryViewObject viewObj : viewObjs) {
CommandStack stack = findCommandStack(viewObj.getId());
if (stack == null) {
stack = new CommandStack();
ICommand cmd = getNewCommand(viewObj, defaultCmdType);
cmd.init(viewObj);
stack.pushCommand(cmd);
}
ICommand validCommand = stack.getValidDeployCommand();
if (validCommand != null) {
if (validCommand instanceof AbstractDeployCommand) {
fillViewObjectToCommand(validCommand);
AbstractDeployCommand deployCommand = (AbstractDeployCommand) validCommand;
if (paramMap != null) {
ICommandParameter param = paramMap.get(viewObj);
deployCommand.setParameter(param);
}
cmds.add(deployCommand);
} else if (validCommand instanceof NOPCommand && defaultCmdType > 0) {
ICommand cmd = getNewCommand(defaultCmdType);
if (cmd instanceof AbstractDeployCommand) {
cmd.init(viewObj);
cmds.add((AbstractDeployCommand) cmd);
}
}
}
}
return cmds;
}
use of org.talend.mdm.repository.core.command.param.ICommandParameter in project tmdm-studio-se by Talend.
the class ModelImpactAnalyseService method convertToParameters.
public static Map<IRepositoryViewObject, ICommandParameter> convertToParameters(Map<IRepositoryViewObject, ImpactOperation> impactResult) {
Map<IRepositoryViewObject, ICommandParameter> paramMap = new HashMap<IRepositoryViewObject, ICommandParameter>();
for (IRepositoryViewObject viewObj : impactResult.keySet()) {
ImpactOperation impactOperation = impactResult.get(viewObj);
ICommandParameter param = new DataModelCmdParam(impactOperation);
paramMap.put(viewObj, param);
}
return paramMap;
}
Aggregations