use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericConnPropertiesWizard method performFinish.
@Override
public boolean performFinish() {
boolean done = super.performFinish();
if (done) {
Property property = object.getProperty();
GenericConnectionItem gcItem = (GenericConnectionItem) property.getItem();
boolean itemChanged = GenericConnectionUtil.synNamePropertyWithItem(gcItem);
if (itemChanged) {
try {
ProxyRepositoryFactory.getInstance().save(gcItem);
} catch (PersistenceException e) {
done = false;
ExceptionHandler.process(e);
}
}
}
return done;
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method createNewItem.
@Override
public Item createNewItem(ERepositoryObjectType type) {
GenericConnectionItem item = null;
if (isRepObjType(type)) {
item = GenericMetadataFactory.eINSTANCE.createGenericConnectionItem();
item.setTypeName(type.getType());
}
return item;
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method addNode.
@Override
public void addNode(ERepositoryObjectType type, RepositoryNode recBinNode, IRepositoryViewObject repositoryObject, RepositoryNode node) {
if (isRepObjType(type)) {
Item item = repositoryObject.getProperty().getItem();
if (item instanceof GenericConnectionItem) {
GenericConnectionItem connItem = (GenericConnectionItem) item;
GenericConnection connection = (GenericConnection) connItem.getConnection();
createSubNodes(node, repositoryObject, connection);
}
}
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class RepositoryUpdateTest method launchRepositoryUpdateOnNode.
/**
* DOC nrousseau Comment method "updateNode".
* @param id
* @param process
* @param node
* @throws PersistenceException
*/
private void launchRepositoryUpdateOnNode(String id, Process process, Node node) throws PersistenceException {
GenericConnectionItem connectionItem;
IRepositoryViewObject object;
object = ProxyRepositoryFactory.getInstance().getLastVersion(id);
connectionItem = (GenericConnectionItem) object.getProperty().getItem();
Assert.assertEquals(1, SchemaUtils.getMetadataTables(connectionItem.getConnection(), SubContainer.class).size());
UpdateResult ur = createUpdateResult(node);
ur.setResult(EUpdateItemType.NODE_PROPERTY, EUpdateResult.UPDATE, connectionItem);
ur.setJob(process);
UpdateNodeParameterCommand cmd = new UpdateNodeParameterCommand(ur);
cmd.execute();
}
use of org.talend.repository.generic.model.genericMetadata.GenericConnectionItem in project tdi-studio-se by Talend.
the class RepositoryUpdateTest method createBasicConnection.
/**
* DOC nrousseau Comment method "createBasicConnection".
*
* @param id
* @return
* @throws PersistenceException
*/
private GenericConnectionItem createBasicConnection(String id) throws PersistenceException {
GenericConnection connection = GenericMetadataFactory.eINSTANCE.createGenericConnection();
Property connectionProperty = PropertiesFactory.eINSTANCE.createProperty();
// ses the id to be used for persistence lookup
connectionProperty.setId(id);
connectionProperty.setAuthor(((RepositoryContext) CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
//$NON-NLS-1$
connectionProperty.setStatusCode("");
connectionProperty.setLabel("test");
GenericConnectionItem connectionItem = GenericMetadataFactory.eINSTANCE.createGenericConnectionItem();
connectionItem.setProperty(connectionProperty);
connectionItem.setConnection(connection);
connectionItem.setTypeName("salesforce");
ProxyRepositoryFactory.getInstance().create(connectionItem, new Path(""));
return connectionItem;
}
Aggregations