use of org.talend.core.model.properties.ConnectionItem 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.core.model.properties.ConnectionItem 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.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.
the class RenameOracleRACToOracleCustomMigrationTask method execute.
/*
* (non-Javadoc)
*
* @see org.talend.core.model.migration.AbstractItemMigrationTask#execute(org.talend.core.model.properties.Item)
*/
@Override
public ExecutionResult execute(Item item) {
ConnectionItem connectionItem = (ConnectionItem) item;
DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection();
if (connection != null) {
if (connection.getDatabaseType().equals("Oracle RAC")) {
connection.setDatabaseType(EDatabaseTypeName.ORACLE_CUSTOM.getDisplayName());
try {
ProxyRepositoryFactory.getInstance().save(item);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.SUCCESS_NO_ALERT;
} else {
return ExecutionResult.NOTHING_TO_DO;
}
}
return ExecutionResult.NOTHING_TO_DO;
}
use of org.talend.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.
the class RemoveErrorTagMigrationTask method execute.
/*
* (non-Javadoc)
*
* @see org.talend.core.model.migration.AbstractItemMigrationTask#execute(org.talend.core.model.properties.Item)
*/
@Override
public ExecutionResult execute(Item item) {
ConnectionItem connectionItem = (ConnectionItem) item;
DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection();
if (connection != null) {
boolean flag = false;
Iterator it = connectionItem.getProperty().getInformations().iterator();
while (it.hasNext()) {
org.talend.core.model.properties.Information Information = (org.talend.core.model.properties.Information) it.next();
if (Information.getLevel().getName().equals(InformationLevel.ERROR_LITERAL.getName()) || Information.getLevel().getName().equals(InformationLevel.WARN_LITERAL.getName())) {
it.remove();
flag = true;
}
}
if (flag) {
try {
ProxyRepositoryFactory.getInstance().save(item);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.SUCCESS_NO_ALERT;
}
}
return ExecutionResult.NOTHING_TO_DO;
}
Aggregations