use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class MetadataColumnComparator method createNewRepositoryNode.
/**
* dev Comment method "createNewRepositoryNode".
*
* @param node
* @param parameters
* @param connection
* @param iMetadataConnection
* @return
*/
@SuppressWarnings("unchecked")
private RepositoryNode createNewRepositoryNode(RepositoryNode node, ConnectionParameters parameters, DatabaseConnection connection, IMetadataConnection iMetadataConnection) {
ManagerConnection managerConnection = new ManagerConnection();
boolean status = managerConnection.check(iMetadataConnection);
connection.setDivergency(!status);
ConnectionHelper.getTables(connection).clear();
if (status) {
// try {
// List<MetadataTable> tablesFromDB = ExtractMetaDataFromDataBase.returnMetaTablesFormConnection(
// iMetadataConnection, 500);
// ExtractMetaDataUtils.getInstance().setReconnect(false);
// for (MetadataTable table : tablesFromDB) {
// List<MetadataColumn> columnsFromDB = new ArrayList<MetadataColumn>();
// columnsFromDB.addAll(ExtractMetaDataFromDataBase.returnMetadataColumnsFormTable(iMetadataConnection,
// table.getSourceName()));
// table.getColumns().clear();
// for (MetadataColumn column : columnsFromDB) {
// column.setLabel(""); //$NON-NLS-1$
// table.getColumns().add(column);
// }
// table.setLabel(""); //$NON-NLS-1$
// ConnectionHelper.getTables(connection).add(table);
// }
// ExtractMetaDataUtils.getInstance().setReconnect(true);
// } catch (Exception e) {
// if (parameters != null) {
// parameters.setConnectionComment(e.getMessage());
// }
// return null;
// }
} else {
if (parameters != null) {
parameters.setConnectionComment(managerConnection.getMessageException() == null ? "" : //$NON-NLS-1$
managerConnection.getMessageException());
}
}
DatabaseConnectionItem item = PropertiesFactory.eINSTANCE.createDatabaseConnectionItem();
Property connectionProperty = PropertiesFactory.eINSTANCE.createProperty();
connectionProperty.setAuthor(((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
//$NON-NLS-1$
connectionProperty.setStatusCode("");
item.setProperty(connectionProperty);
// TDI-18665
updatePackage(iMetadataConnection);
DatabaseConnection dbConn = (DatabaseConnection) iMetadataConnection.getCurrentConnection();
item.setConnection(dbConn);
RepositoryObject object = new RepositoryObject(connectionProperty);
//$NON-NLS-1$
object.setLabel("");
ItemState state = PropertiesFactory.eINSTANCE.createItemState();
state.setDeleted(false);
item.setState(state);
if (node == null) {
node = new RepositoryNode(null, null, ENodeType.SYSTEM_FOLDER);
}
RepositoryNode newNode = new RepositoryNode(object, node, ENodeType.SYSTEM_FOLDER);
return newNode;
}
use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class StatusManagerSettingPage method researchMaxVersion.
private void researchMaxVersion() {
String version = statusCombo.getText();
if ("".equals(version.trim())) {
//$NON-NLS-1$
version = VersionUtils.DEFAULT_VERSION;
}
for (RepositoryObject object : checkedObjects) {
// if (VersionUtils.compareTo(version, object.getOldVersion()) < 0) {
// version = object.getOldVersion();
// }
}
statusCombo.setText(version);
}
Aggregations