use of org.talend.core.repository.model.ProxyRepositoryFactory in project tdi-studio-se by Talend.
the class RenameCustomerColumnOftGenKey method changeCustomerColumn.
private void changeCustomerColumn(Item item) throws PersistenceException {
ProcessType processType = getProcessType(item);
if (processType == null) {
return;
}
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
for (Object o : processType.getNode()) {
NodeType node = (NodeType) o;
for (Object o2 : node.getMetadata()) {
MetadataType metadata = (MetadataType) o2;
for (Object o3 : metadata.getColumn()) {
ColumnType column = (ColumnType) o3;
if ("T_WINDOW_KEY".equals(column.getName())) {
column.setName("T_GEN_KEY");
modified = true;
}
}
}
}
if (modified) {
factory.save(item, true);
}
}
use of org.talend.core.repository.model.ProxyRepositoryFactory in project tdi-studio-se by Talend.
the class RenamePasswordParaForLdapMigrationTask method renamePasswordName.
private void renamePasswordName(Item item) {
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
ProcessType processType = getProcessType(item);
for (Object object : processType.getNode()) {
if (object instanceof NodeType) {
NodeType currentNode = (NodeType) object;
if (currentNode.getComponentName().startsWith("tLDAP")) {
//$NON-NLS-1$
for (Object o : currentNode.getElementParameter()) {
ElementParameterType para = (ElementParameterType) o;
if ("PASSWD".equals(para.getName())) {
//$NON-NLS-1$
//$NON-NLS-1$
para.setName("PASS");
modified = true;
break;
}
}
}
}
}
if (modified) {
try {
factory.save(item, true);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
use of org.talend.core.repository.model.ProxyRepositoryFactory in project tdi-studio-se by Talend.
the class RenameSchemaParameterForMSSqlConnectionMigrationTask method renamePasswordName.
private void renamePasswordName(Item item) {
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
ProcessType processType = getProcessType(item);
for (Object object : processType.getNode()) {
if (object instanceof NodeType) {
NodeType currentNode = (NodeType) object;
if (currentNode.getComponentName().startsWith("tMSSqlConnection")) {
//$NON-NLS-1$
for (Object o : currentNode.getElementParameter()) {
ElementParameterType para = (ElementParameterType) o;
if ("DB_SCHEMA".equals(para.getName())) {
//$NON-NLS-1$
//$NON-NLS-1$
para.setName("SCHEMA_DB");
modified = true;
break;
}
}
}
}
}
if (modified) {
try {
factory.save(item, true);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
use of org.talend.core.repository.model.ProxyRepositoryFactory in project tdi-studio-se by Talend.
the class RenameConnectionRunErrorToComponentErrorTask method renameConnections.
/**
* yzhang Comment method "renameConnections".
*
* @param item
* @param processType
*/
private void renameConnections(Item item, ProcessType processType) throws PersistenceException {
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
for (Object o : processType.getConnection()) {
ConnectionType currentConnection = (ConnectionType) o;
if (currentConnection.getConnectorName().equals("RUN_ERROR")) {
//$NON-NLS-1$
currentConnection.setConnectorName(EConnectionType.ON_COMPONENT_ERROR.getName());
currentConnection.setLabel(EConnectionType.ON_COMPONENT_ERROR.getDefaultLinkName());
currentConnection.setLineStyle(EConnectionType.ON_COMPONENT_ERROR.getId());
modified = true;
}
}
if (modified) {
factory.save(item, true);
}
}
use of org.talend.core.repository.model.ProxyRepositoryFactory in project tdi-studio-se by Talend.
the class RenameConnectionRunIfOkToOnComponentOkTask method renameConnections.
/**
* yzhang Comment method "renameConnections".
*
* @param item
* @param processType
* @throws PersistenceException
*/
private void renameConnections(Item item, ProcessType processType) throws PersistenceException {
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
for (Object o : processType.getConnection()) {
ConnectionType currentConnection = (ConnectionType) o;
if (currentConnection.getConnectorName().equals("RUN_OK")) {
//$NON-NLS-1$
currentConnection.setConnectorName(EConnectionType.ON_COMPONENT_OK.getName());
currentConnection.setLabel(EConnectionType.ON_COMPONENT_OK.getDefaultLinkName());
currentConnection.setLineStyle(EConnectionType.ON_COMPONENT_OK.getId());
modified = true;
}
}
if (modified) {
factory.save(item, true);
}
}
Aggregations