use of org.talend.core.model.repository.IRepositoryViewObject in project tdi-studio-se by Talend.
the class MultiTypesProcessor method selectRepositoryNode.
protected boolean selectRepositoryNode(Viewer viewer, RepositoryNode parentNode, RepositoryNode node) {
if (node == null) {
return false;
}
IRepositoryViewObject object = node.getObject();
if (object != null) {
// column
if (object instanceof MetadataColumnRepositoryObject) {
return false;
}
}
// hide the column folder
if (object == null && node.getParent() != null && node.getParent().getObject() != null && node.getParent().getObjectType() == ERepositoryObjectType.METADATA_CON_TABLE) {
return false;
}
// cdc
ICDCProviderService cdcService = null;
if (node.getObjectType() == ERepositoryObjectType.METADATA_CON_CDC) {
return false;
}
if (isCDCConnection(node)) {
return false;
}
if (PluginChecker.isCDCPluginLoaded()) {
cdcService = (ICDCProviderService) GlobalServiceRegister.getDefault().getService(ICDCProviderService.class);
if (cdcService != null && cdcService.isSubscriberTableNode(node)) {
return false;
}
}
return true;
}
use of org.talend.core.model.repository.IRepositoryViewObject in project tdi-studio-se by Talend.
the class MetadataColumnComparator method getItem.
/**
* method "getItem" get DatabaseConnectionItem by current RepositoryNode .
*
* @param newNode current RepositoryNode
* @return DatabaseConnectionItem : item current node.
*/
public static DatabaseConnectionItem getItem(RepositoryNode newNode) {
IRepositoryViewObject repositoryObject = newNode.getObject();
DatabaseConnectionItem item = (DatabaseConnectionItem) repositoryObject.getProperty().getItem();
return item;
}
use of org.talend.core.model.repository.IRepositoryViewObject 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.core.model.repository.IRepositoryViewObject in project tdi-studio-se by Talend.
the class RepositoryUpdateTest method testRepositoryChange.
@Test
public void testRepositoryChange() throws PersistenceException {
//$NON-NLS-1$
String id = "testId";
try {
//$NON-NLS-1$ //$NON-NLS-2$
IComponent component = ComponentsFactoryProvider.getInstance().get("tSalesforceInput", "DI");
Node node = new Node(component, new Process(new FakePropertyImpl()));
GenericConnection connection = (GenericConnection) createBasicConnection(id).getConnection();
setupPropertiesWithoutProxy(id);
updateNode(id, node, connection);
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.userPassword.userId", "\"myUser\"");
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.userPassword.password", "\"myPassword\"");
//$NON-NLS-1$
testRepositoryValue(node, "connection.proxy.useProxy", Boolean.FALSE);
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.proxy.host", "\"\"");
//$NON-NLS-1$
testRepositoryValue(node, "connection.proxy.port", null);
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.proxy.userPassword.userId", "\"\"");
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.proxy.userPassword.password", "\"\"");
setupPropertiesWithProxy(id);
updateNode(id, node, connection);
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.userPassword.userId", "\"myUser\"");
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.userPassword.password", "\"myPassword\"");
//$NON-NLS-1$
testRepositoryValue(node, "connection.proxy.useProxy", Boolean.TRUE);
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.proxy.host", "\"host\"");
//$NON-NLS-1$
testRepositoryValue(node, "connection.proxy.port", 1234);
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.proxy.userPassword.userId", "\"proxyUser\"");
//$NON-NLS-1$ //$NON-NLS-2$
testRepositoryValue(node, "connection.proxy.userPassword.password", "\"proxyPassword\"");
} finally {
IRepositoryViewObject object = ProxyRepositoryFactory.getInstance().getLastVersion(id);
if (object != null) {
ProxyRepositoryFactory.getInstance().deleteObjectPhysical(object);
}
}
}
use of org.talend.core.model.repository.IRepositoryViewObject in project tesb-studio-se by Talend.
the class ESBService method updateOperation.
@Override
public void updateOperation(INode node, String linkedRepository, RepositoryNode selectNode) {
String[] ids = linkedRepository.split(" - ");
if (ids.length == 3) {
try {
IRepositoryViewObject reViewObject = ProxyRepositoryFactory.getInstance().getLastVersion(ids[0]);
ServiceItem servicesItem = (ServiceItem) reViewObject.getProperty().getItem();
ServiceConnection serConn = (ServiceConnection) servicesItem.getConnection();
String portName = "";
EList<ServicePort> portList = serConn.getServicePort();
ServiceOperation operation = null;
for (ServicePort port : portList) {
if (port.getId().equals(ids[1])) {
portName = port.getName();
EList<ServiceOperation> opeList = port.getServiceOperation();
for (ServiceOperation ope : opeList) {
if (ope.getId().equals(ids[2])) {
operation = ope;
break;
}
}
break;
}
}
if (operation == null) {
return;
}
RepositoryNode topParent = getServicesTopNode(selectNode);
changeOldOperationLabel(topParent, node, operation);
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
IProcess2 process = (IProcess2) RepositoryPlugin.getDefault().getDesignerCoreService().getCurrentProcess();
Item jobItem = process.getProperty().getItem();
String jobID = jobItem.getProperty().getId();
String jobName = jobItem.getProperty().getLabel();
if (operation.getReferenceJobId() != null && !operation.getReferenceJobId().equals(jobID)) {
changeOtherJobSchemaValue(factory, operation, /* serConn, */
selectNode);
MessageDialog.openWarning(new Shell(), Messages.ESBService_DisconnectWarningTitle, Messages.ESBService_DisconnectWarningMsg);
}
operation.setReferenceJobId(jobID);
operation.setLabel(operation.getName() + '-' + jobName);
IFile wsdlPath = WSDLUtils.getWsdlFile(selectNode);
Map<String, String> serviceParameters = WSDLUtils.getServiceOperationParameters(wsdlPath, operation.getName(), portName);
CreateNewJobAction.setProviderRequestComponentConfiguration(node, serviceParameters);
factory.save(servicesItem);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
Aggregations