use of org.talend.core.model.metadata.MetadataTable in project tbd-studio-se by Talend.
the class HadoopClusterRepositoryTypeProcessor method selectRepositoryNode.
/*
* (non-Javadoc)
*
* @see
* org.talend.repository.ui.processor.SingleTypeProcessor#selectRepositoryNode(org.eclipse.jface.viewers.Viewer,
* org.talend.repository.model.RepositoryNode, org.talend.repository.model.RepositoryNode)
*/
@Override
protected boolean selectRepositoryNode(Viewer viewer, RepositoryNode parentNode, RepositoryNode node) {
final String repositoryType = getRepositoryType();
if (node == null || repositoryType == null) {
return false;
}
ERepositoryObjectType repObjType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
if (repObjType == ERepositoryObjectType.REFERENCED_PROJECTS) {
return true;
}
if (node.getType() == ENodeType.SYSTEM_FOLDER) {
return true;
}
if (node.getType() == ENodeType.SIMPLE_FOLDER || HCRepositoryUtil.isHadoopContainerNode(node)) {
return isValidFolder(node);
}
IRepositoryViewObject object = node.getObject();
if (object == null || object.getProperty().getItem() == null) {
return false;
}
if (object instanceof MetadataTable) {
return false;
}
Item item = object.getProperty().getItem();
if (item instanceof FolderItem) {
return true;
}
return true;
}
use of org.talend.core.model.metadata.MetadataTable in project tbd-studio-se by Talend.
the class HadoopSubRepositoryTypeProcessor method selectRepositoryNode.
/*
* (non-Javadoc)
*
* @see
* org.talend.repository.ui.processor.SingleTypeProcessor#selectRepositoryNode(org.eclipse.jface.viewers.Viewer,
* org.talend.repository.model.RepositoryNode, org.talend.repository.model.RepositoryNode)
*/
@Override
protected boolean selectRepositoryNode(Viewer viewer, RepositoryNode parentNode, RepositoryNode node) {
final String repositoryType = getRepositoryType();
if (node == null || repositoryType == null) {
return false;
}
ERepositoryObjectType repObjType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
if (repObjType == ERepositoryObjectType.REFERENCED_PROJECTS) {
return true;
}
if (node.getType() == ENodeType.SYSTEM_FOLDER) {
return true;
}
if (node.getType() == ENodeType.SIMPLE_FOLDER || HCRepositoryUtil.isHadoopContainerNode(node)) {
return isValidFolder(node);
}
IRepositoryViewObject object = node.getObject();
if (object == null || object.getProperty().getItem() == null) {
return false;
}
if (object instanceof MetadataTable) {
return false;
}
Item item = object.getProperty().getItem();
if (item instanceof FolderItem) {
return true;
}
return true;
}
use of org.talend.core.model.metadata.MetadataTable in project tbd-studio-se by Talend.
the class UIManager method getNewRelationShipsList.
private List<Map<String, Object>> getNewRelationShipsList() {
List<Map<String, Object>> map = new ArrayList<Map<String, Object>>();
MetadataTable table = (MetadataTable) neo4jManager.getNeo4jComponent().getMetadataList().get(0);
neo4jManager.convert(neo4jManager.getNeo4jComponent(), table);
for (IMetadataColumn col : table.getListColumns()) {
MetadataColumnExt ext = (MetadataColumnExt) col;
for (Relationship relationship : ext.getData().getRelationships()) {
Map<String, Object> value = new HashMap<String, Object>();
value.put(Neo4jComponent.SCHEMA_COLUMN, ext.getLabel());
value.put(Neo4jComponent.TYPE, relationship.getType());
value.put(Neo4jComponent.DIRECTION, relationship.getDirection().getName());
value.put(Neo4jComponent.INDEX_NAME, relationship.getIndex().getName());
value.put(Neo4jComponent.KEY, relationship.getIndex().getKey());
value.put(Neo4jComponent.VALUE, relationship.getIndex().getValue());
map.add(value);
}
}
return map;
}
use of org.talend.core.model.metadata.MetadataTable in project tbd-studio-se by Talend.
the class RetrieveConfigurationProcess method getMetadataTable.
private MetadataTable getMetadataTable() {
MetadataTable targetTable = new MetadataTable();
targetTable.setAttachedConnector(EConnectionType.FLOW_MAIN.getName());
List columnList = new ArrayList<MetadataColumn>();
IMetadataColumn clusterNameColumn = new MetadataColumn();
// $NON-NLS-1$
clusterNameColumn.setLabel("clusterName");
clusterNameColumn.setTalendType(JavaTypesManager.STRING.getId());
columnList.add(clusterNameColumn);
IMetadataColumn serviceNameColumn = new MetadataColumn();
// $NON-NLS-1$
serviceNameColumn.setLabel("serviceName");
serviceNameColumn.setTalendType(JavaTypesManager.STRING.getId());
columnList.add(serviceNameColumn);
IMetadataColumn confFileNameColumn = new MetadataColumn();
// $NON-NLS-1$
confFileNameColumn.setLabel("confFileName");
confFileNameColumn.setTalendType(JavaTypesManager.STRING.getId());
columnList.add(confFileNameColumn);
IMetadataColumn confFileContentColumn = new MetadataColumn();
// $NON-NLS-1$
confFileContentColumn.setLabel("confFileContent");
confFileContentColumn.setTalendType(JavaTypesManager.STRING.getId());
columnList.add(confFileContentColumn);
targetTable.setListColumns(columnList);
return targetTable;
}
use of org.talend.core.model.metadata.MetadataTable in project tbd-studio-se by Talend.
the class NoSQLRepositoryTypeProcessor method selectRepositoryNode.
/*
* (non-Javadoc)
*
* @see
* org.talend.repository.ui.processor.SingleTypeProcessor#selectRepositoryNode(org.eclipse.jface.viewers.Viewer,
* org.talend.repository.model.RepositoryNode, org.talend.repository.model.RepositoryNode)
*/
@Override
protected boolean selectRepositoryNode(Viewer viewer, RepositoryNode parentNode, RepositoryNode node) {
final String repositoryType = getRepositoryType();
if (node == null || repositoryType == null) {
return false;
}
ERepositoryObjectType repObjType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
if (repObjType == ERepositoryObjectType.REFERENCED_PROJECTS) {
return true;
}
if (node.getType() == ENodeType.SYSTEM_FOLDER) {
return true;
}
IRepositoryViewObject object = node.getObject();
if (object == null || object.getProperty().getItem() == null) {
return false;
}
if (object instanceof MetadataTable) {
return false;
}
Item item = object.getProperty().getItem();
if (item instanceof FolderItem) {
return true;
}
if (item instanceof NoSQLConnectionItem) {
NoSQLConnectionItem connectionItem = (NoSQLConnectionItem) item;
NoSQLConnection connection = (NoSQLConnection) connectionItem.getConnection();
if (repositoryType.startsWith(INoSQLConstants.NOSQL_TYPE_PREFIX)) {
// $NON-NLS-1$
String realDbType = repositoryType.substring(repositoryType.indexOf(":") + 1);
if (!StringUtils.equalsIgnoreCase(realDbType, connection.getDbType())) {
return false;
}
}
}
return true;
}
Aggregations