use of org.talend.repository.model.IRepositoryNode in project tesb-studio-se by Talend.
the class AssignJobAction method getAllReferenceJobId.
private List<String> getAllReferenceJobId(RepositoryNode repositoryNode) {
repositoryNode = getTopParent(repositoryNode);
List<IRepositoryNode> nodeList = repositoryNode.getChildren();
List<ServiceOperation> operaList = new ArrayList<ServiceOperation>();
List<String> jobIDList = new ArrayList<String>();
for (IRepositoryNode node : nodeList) {
if (node.getObject().getProperty().getItem() instanceof ServiceItem) {
ServiceItem item = (ServiceItem) node.getObject().getProperty().getItem();
ServiceConnection conn = (ServiceConnection) item.getConnection();
EList<ServicePort> portList = conn.getServicePort();
for (ServicePort port : portList) {
operaList.addAll(port.getServiceOperation());
}
}
}
for (ServiceOperation operation : operaList) {
String jobID = operation.getReferenceJobId();
if (jobID != null) {
jobIDList.add(jobID);
}
}
return jobIDList;
}
use of org.talend.repository.model.IRepositoryNode in project tdi-studio-se by Talend.
the class RepositoryChangeMetadataCommand method setTableRelevantParameterValues.
protected void setTableRelevantParameterValues() {
Connection conn = connection;
if (conn == null) {
if (newPropValue != null && newPropValue instanceof String) {
String schemaId = (String) newPropValue;
//$NON-NLS-1$
String[] values = schemaId.split(" - ");
String repositoryID = values[0];
IRepositoryNode repositoryNode = RepositorySeekerManager.getInstance().searchRepoViewNode(repositoryID);
if (repositoryNode != null && repositoryNode.getObject() != null) {
Item item = repositoryNode.getObject().getProperty().getItem();
if (item instanceof ConnectionItem) {
ConnectionItem conItem = (ConnectionItem) item;
conn = conItem.getConnection();
}
}
}
}
for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
if (handler.canHandle(conn)) {
handler.handleTableRelevantParameters(conn, node, newOutputMetadata);
}
}
}
use of org.talend.repository.model.IRepositoryNode in project tdi-studio-se by Talend.
the class AbstractSchemaController method findRepositoryNode.
public RepositoryNode findRepositoryNode(String label, String id, RepositoryNode root) {
String name = (String) root.getProperties(EProperties.LABEL);
String rootID = root.getId();
RepositoryNode toReturn = null;
if (label.equals(name) && !id.equals(rootID)) {
toReturn = root;
} else {
for (IRepositoryNode node : root.getChildren()) {
toReturn = findRepositoryNode(label, id, (RepositoryNode) node);
if (toReturn != null) {
break;
}
}
}
return toReturn;
}
use of org.talend.repository.model.IRepositoryNode in project tdi-studio-se by Talend.
the class JSONRepositoryContentHandler method hideAction.
@Override
public boolean hideAction(IRepositoryNode node, Class actionType) {
boolean canHandle = false;
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
if (JSONRepositoryNodeType.JSON.equals(nodeType)) {
canHandle = true;
}
if (!canHandle) {
if (ERepositoryObjectType.METADATA_CON_TABLE.equals(nodeType) || ERepositoryObjectType.METADATA_CON_COLUMN.equals(nodeType)) {
RepositoryNode parentNode = node.getParent();
if (parentNode != null && JSONRepositoryNodeType.JSON.equals(parentNode.getProperties(EProperties.CONTENT_TYPE))) {
canHandle = true;
}
}
}
if (canHandle) {
if (actionType == CreateTableAction.class) {
return true;
}
}
return false;
}
use of org.talend.repository.model.IRepositoryNode in project tdi-studio-se by Talend.
the class UseDynamicJobSelectionDialog method setCheckingNodes.
private void setCheckingNodes() {
final IContentProvider contentProvider = getItemsTreeViewer().getContentProvider();
final Object input = getItemsTreeViewer().getInput();
if (contentProvider instanceof ITreeContentProvider && input instanceof ProjectRepositoryNode && getNeedCheckedjobs() != null && getNeedCheckedjobs().length > 0) {
ITreeContentProvider cnfContentProvider = (ITreeContentProvider) contentProvider;
List<IRepositoryNode> checkingNodes = new ArrayList<IRepositoryNode>();
List<String> needCheckedJobIds = new ArrayList(Arrays.asList(getNeedCheckedjobs()));
final ProjectRepositoryNode root = (ProjectRepositoryNode) input;
final RepositoryNode rootRepositoryNode = root.getRootRepositoryNode(getSupportType());
if (rootRepositoryNode == null) {
return;
}
withReferenceProjects(cnfContentProvider, rootRepositoryNode, needCheckedJobIds, checkingNodes);
// set check for node
getItemsTreeViewer().setCheckedElements(checkingNodes.toArray());
// select and will expand the selected node auto
getItemsTreeViewer().setSelection(new StructuredSelection(checkingNodes), true);
// let scroll bar on top
getItemsTreeViewer().setSelection(new StructuredSelection(rootRepositoryNode));
getItemsTreeViewer().setSelection(StructuredSelection.EMPTY);
}
}
Aggregations