use of org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository in project tdi-studio-se by Talend.
the class ProjectSettingManager method reloadStatsAndLogFromProjectSettings.
public static void reloadStatsAndLogFromProjectSettings(Element process, Project pro, StatsAndLogsComposite statsComposite) {
Element elem = createStatsAndLogsElement(pro);
ParametersType stats = pro.getEmfProject().getStatAndLogsSettings().getParameters();
ElementParameterType eleType = ElementParameter2ParameterType.findElementParameterType(stats, //$NON-NLS-1$
EParameterName.PROPERTY_TYPE.getName() + ":" + EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
if (eleType != null) {
String value = eleType.getValue();
if (value != null && !"".equals(value) && !RepositoryNode.NO_ID.equals(value)) {
//$NON-NLS-1$
ElementParameterType propertyType = ElementParameter2ParameterType.findElementParameterType(stats, //$NON-NLS-1$
EParameterName.PROPERTY_TYPE.getName() + ":" + EParameterName.PROPERTY_TYPE.getName());
if (propertyType != null) {
String propertyTypeValue = propertyType.getValue();
if (//$NON-NLS-1$
propertyTypeValue != null && !"".equals(propertyTypeValue) && !EmfComponent.BUILTIN.equals(propertyTypeValue)) {
IRepositoryViewObject lastVersion = UpdateRepositoryUtils.getRepositoryObjectById(value);
if (lastVersion == null || lastVersion.getProperty() == null || lastVersion.getProperty().getItem() == null) {
ChangeValuesFromRepository changeValuesFromRepository = new ChangeValuesFromRepository(elem, null, //$NON-NLS-1$
EParameterName.PROPERTY_TYPE.getName() + ":" + EParameterName.PROPERTY_TYPE.getName(), EmfComponent.BUILTIN);
changeValuesFromRepository.execute();
saveStatsAndLogToProjectSettings(elem, pro);
}
}
}
}
// load the project settings to process
ElementParameter2ParameterType.loadElementParameters(process, stats, //$NON-NLS-1$
EParameterName.PROPERTY_TYPE.getName() + ":" + EParameterName.PROPERTY_TYPE.getName());
// change repository item
// TODO
// StatsAndLogsHelper.changeRepositoryConnection(process, statsComposite);
}
}
use of org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository in project tesb-studio-se by Talend.
the class ESBService method repositoryChange.
private void repositoryChange(RepositoryNode repNode, INode node, IProcess2 process) {
IElementParameter param = node.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
ConnectionItem connectionItem = (ConnectionItem) repNode.getObject().getProperty().getItem();
if (param != null) {
param.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName()).setValue(EmfComponent.REPOSITORY);
param.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName()).setValue("");
connectionItem.getProperty().getId();
((PortRepositoryObject) repNode.getParent().getObject()).getId();
((OperationRepositoryObject) repNode.getObject()).getId();
ChangeValuesFromRepository command2 = new ChangeValuesFromRepository(node, null, param.getName() + ":" + EParameterName.PROPERTY_TYPE.getName(), //$NON-NLS-1$
"BUILT_IN");
IEditorPart editor = process.getEditor();
if (editor == null) {
command2.execute();
} else {
((AbstractMultiPageTalendEditor) editor).getTalendEditor().getCommandStack().execute(command2);
}
}
}
use of org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository in project tesb-studio-se by Talend.
the class AssignJobAction method repositoryChange.
private void repositoryChange(RepositoryNode repNode, INode node) {
IElementParameter param = node.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
ConnectionItem connectionItem = (ConnectionItem) repNode.getObject().getProperty().getItem();
if (param != null) {
param.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName()).setValue(EmfComponent.REPOSITORY);
String serviceId = connectionItem.getProperty().getId();
String portId = ((PortRepositoryObject) repNode.getParent().getObject()).getId();
String operationId = ((OperationRepositoryObject) repNode.getObject()).getId();
ChangeValuesFromRepository command2 = new ChangeValuesFromRepository(node, connectionItem.getConnection(), param.getName() + ":" + EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), //$NON-NLS-1$
serviceId + " - " + portId + " - " + operationId);
command2.execute();
}
}
use of org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository in project tdi-studio-se by Talend.
the class RepositoryUpdateTest method updateNodeConnectionOnly.
private void updateNodeConnectionOnly(String id, Node node, GenericConnection connection) {
IElementParameter propertyParam = node.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
propertyParam.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName()).setValue(EmfComponent.REPOSITORY);
propertyParam.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName()).setValue(id);
ChangeValuesFromRepository command = new ChangeValuesFromRepository(node, connection, null, propertyParam.getName() + ":" + EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), id, //$NON-NLS-1$
true);
command.execute(true);
}
Aggregations