use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericDragAndDropHandler method getCorrespondingComponentName.
@Override
public IComponentName getCorrespondingComponentName(Item item, ERepositoryObjectType type) {
RepositoryComponentSetting setting = null;
List<Class<Item>> list = new ArrayList<Class<Item>>();
if (item instanceof GenericConnectionItem) {
GenericConnection connection = (GenericConnection) ((GenericConnectionItem) item).getConnection();
setting = new RepositoryComponentSetting();
setting.setWithSchema(true);
String componentMainName = getComponentMainName(connection);
setting.setInputComponent(getInputComponentName(componentMainName));
setting.setOutputComponent(getOutputComponentName(componentMainName));
Class clazz = null;
try {
clazz = Class.forName(GenericConnectionItem.class.getName());
} catch (ClassNotFoundException e) {
ExceptionHandler.process(e);
}
list.add(clazz);
setting.setClasses(list.toArray(new Class[0]));
}
return setting;
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericDragAndDropHandler method filterNeededComponents.
@Override
public List<IComponent> filterNeededComponents(Item item, RepositoryNode seletetedNode, ERepositoryObjectType type) {
// TUP-4151
List<IComponent> neededComponents = new ArrayList<>();
if (!(item instanceof GenericConnectionItem)) {
return neededComponents;
}
IComponentsService service = (IComponentsService) GlobalServiceRegister.getDefault().getService(IComponentsService.class);
Set<IComponent> components = service.getComponentsFactory().getComponents();
for (IComponent component : components) {
if (EComponentType.GENERIC.equals(component.getComponentType())) {
if (!neededComponents.contains(component) && isValid(seletetedNode, component)) {
neededComponents.add(component);
}
}
}
return neededComponents;
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class NewGenericWizardMigrationTask method initGenericConnectionItem.
protected GenericConnectionItem initGenericConnectionItem(ConnectionItem oldConnectionItem) {
if (oldConnectionItem == null) {
return null;
}
GenericConnectionItem genericConnectionItem = GenericMetadataFactory.eINSTANCE.createGenericConnectionItem();
////$NON-NLS-1$
genericConnectionItem.setTypeName("");
genericConnectionItem.setState(oldConnectionItem.getState());
genericConnectionItem.setFileExtension(oldConnectionItem.getFileExtension());
genericConnectionItem.setNeedVersion(oldConnectionItem.isNeedVersion());
return genericConnectionItem;
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method save.
@Override
public Resource save(Item item) throws PersistenceException {
Resource itemResource = null;
if (isProcess(item)) {
GenericConnectionUtil.synNamePropertyWithItem((GenericConnectionItem) item);
itemResource = save((GenericConnectionItem) item);
}
return itemResource;
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method getRepositoryObjectType.
@Override
public ERepositoryObjectType getRepositoryObjectType(Item item) {
ERepositoryObjectType type = null;
if (isProcess(item)) {
GenericConnectionItem connectionItem = (GenericConnectionItem) item;
type = ERepositoryObjectType.valueOf(connectionItem.getTypeName());
}
return type;
}
Aggregations