use of org.talend.core.model.metadata.builder.connection.Connection in project tdi-studio-se by Talend.
the class DbTypeListController method getCurrentDbms.
private static String getCurrentDbms(INode node) {
boolean hasMappingType = false;
String currentDbms = null;
for (IElementParameter currentParam : node.getElementParameters()) {
if (currentParam.getFieldType().equals(EParameterFieldType.MAPPING_TYPE) && currentParam.isShow(node.getElementParameters())) {
currentDbms = (String) currentParam.getValue();
hasMappingType = true;
}
}
if (!hasMappingType) {
// if there is no mapping type, then check if a db repository schema is used
//$NON-NLS-1$
IElementParameter schemaTypeParameter = node.getElementParameter("SCHEMA_TYPE");
if (schemaTypeParameter == null) {
return null;
}
String schemaType = (String) schemaTypeParameter.getValue();
if (schemaType.equals("REPOSITORY")) {
//$NON-NLS-1$
// repository mode
//$NON-NLS-1$
String metaRepositoryName = (String) node.getElementParameter("REPOSITORY_SCHEMA_TYPE").getValue();
Connection connection = MetadataToolHelper.getConnectionFromRepository(metaRepositoryName);
if (connection instanceof DatabaseConnection) {
// bug 13200
if (((DatabaseConnection) connection).getDatabaseType().equals(EDatabaseTypeName.GENERAL_JDBC.getDisplayName())) {
// bug 7618 modify
currentDbms = (DBConnectionContextUtils.cloneOriginalValueConnection((DatabaseConnection) connection, true, null)).getDbmsId();
} else {
currentDbms = ((DatabaseConnection) connection).getDbmsId();
}
}
} else {
//$NON-NLS-1$
String componentDbType = "";
for (IElementParameter param : (List<IElementParameter>) node.getElementParameters()) {
if (param.getRepositoryValue() != null) {
if (param.getRepositoryValue().equals("TYPE")) {
//$NON-NLS-1$
componentDbType = (String) param.getValue();
}
}
}
String componentProduct = EDatabaseTypeName.getTypeFromDbType(componentDbType).getProduct();
if (EDatabaseTypeName.supportDbType(componentDbType)) {
currentDbms = MetadataTalendType.getDefaultDbmsFromProduct(componentProduct).getId();
}
}
}
return currentDbms;
}
use of org.talend.core.model.metadata.builder.connection.Connection in project tdi-studio-se by Talend.
the class AddQuoteMarkMigrationTask method addQuote.
/**
* Add quote marks to the separators.
*
* yzhang Comment method "addQuote".
*
* @throws PersistenceException
*/
private void addQuote(ConnectionItem connItem) throws PersistenceException {
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
boolean modified = false;
Connection conn = connItem.getConnection();
if (conn instanceof FileConnection) {
FileConnection fileConnection = (FileConnection) conn;
String old = null;
old = fileConnection.getFieldSeparatorValue();
if (!isWithinQuote(old)) {
fileConnection.setFieldSeparatorValue(surroundDQuote(old));
modified = true;
}
old = fileConnection.getRowSeparatorValue();
if (!isWithinQuote(old)) {
fileConnection.setRowSeparatorValue(surroundDQuote(old));
modified = true;
}
old = fileConnection.getEscapeChar();
if (!isWithinQuote(old)) {
fileConnection.setEscapeChar(TalendTextUtils.addQuotes(old));
modified = true;
}
old = fileConnection.getTextEnclosure();
if (!isWithinQuote(old)) {
fileConnection.setTextEnclosure(TalendTextUtils.addQuotes(old));
modified = true;
}
}
if (modified) {
factory.save(connItem);
}
}
use of org.talend.core.model.metadata.builder.connection.Connection in project tdi-studio-se by Talend.
the class PropertyTypeController method createButtonCommand.
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.core.ui.editor.properties.controllers.AbstractRepositoryController#createControl(org.eclipse
* .swt.widgets.Composite, org.talend.core.model.process.IElementParameter, int, int, int,
* org.eclipse.swt.widgets.Control)
*/
@Override
protected Command createButtonCommand(Button button) {
// hwang add for feature 6484
FileItem repositoryFileItem = null;
LinkRulesItem linkItem = null;
Map<String, FileItem> repositoryFileItemMap = null;
Map<String, LinkRulesItem> repositoryLinkRulesItemMap = null;
String paramName = (String) button.getData(PARAMETER_NAME);
IElementParameter param = elem.getElementParameter(paramName);
Object data = button.getData(NAME);
if (data != null && data.equals(REPOSITORY_CHOICE)) {
IElementParameter dbTypeParam = null;
if (elem instanceof org.talend.designer.core.ui.editor.process.Process || elem instanceof StatsAndLogsElement || elem instanceof ImplicitContextLoadElement) {
if (EParameterName.PROPERTY_TYPE.getName().equals(paramName)) {
dbTypeParam = elem.getElementParameter(EParameterName.DB_TYPE.getName());
} else if (JobSettingsConstants.getExtraParameterName(EParameterName.PROPERTY_TYPE.getName()).equals(paramName)) {
dbTypeParam = elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_TYPE.getName()));
}
}
Item item = null;
String id = null;
RepositoryNode selectNode = null;
if (id == null) {
RepositoryReviewDialog dialog = null;
if (dbTypeParam != null) {
String[] listRepositoryItems = dbTypeParam.getListRepositoryItems();
dialog = new RepositoryReviewDialog(Display.getCurrent().getActiveShell(), ERepositoryObjectType.METADATA, param.getRepositoryValue(), listRepositoryItems);
} else {
// Added TDQ-11688
ITDQPatternService service = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQPatternService.class)) {
service = (ITDQPatternService) GlobalServiceRegister.getDefault().getService(ITDQPatternService.class);
}
if (service != null && service.isSinglePatternNode(elem)) {
return processPattern(elem);
}
// ~
dialog = new RepositoryReviewDialog(Display.getCurrent().getActiveShell(), ERepositoryObjectType.METADATA, elem, param);
}
if (dialog.open() == RepositoryReviewDialog.OK) {
selectNode = dialog.getResult();
id = selectNode.getObject().getId();
}
}
if (id != null && !"".equals(id)) {
//$NON-NLS-1$
IElementParameter repositoryParam = param.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
//$NON-NLS-1$
String fullParamName = paramName + ":" + getRepositoryChoiceParamName();
Connection repositoryConnection = null;
// Map<String, ConnectionItem> repositoryConnectionItemMap =
// dynamicProperty.getRepositoryConnectionItemMap();
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
IRepositoryViewObject repobj = factory.getLastVersion(id);
if (repobj != null) {
Property property = repobj.getProperty();
if (property != null) {
item = property.getItem();
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
if (item != null) {
if (item instanceof ConnectionItem) {
repositoryConnection = ((ConnectionItem) item).getConnection();
}
} else {
repositoryConnection = null;
if (repositoryParam != null) {
item = selectNode.getObject().getProperty().getItem();
if (item instanceof ConnectionItem) {
repositoryConnection = ((ConnectionItem) item).getConnection();
}
}
}
if (repositoryConnection != null) {
CompoundCommand compoundCommand = new CompoundCommand();
ChangeValuesFromRepository changeValuesFromRepository = null;
if (selectNode.getObjectType() == ERepositoryObjectType.SERVICESOPERATION && GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
IProcess2 process = (IProcess2) RepositoryPlugin.getDefault().getDesignerCoreService().getCurrentProcess();
String currentJobId = process.getProperty().getId();
String serviceId = item.getProperty().getId();
String portId = selectNode.getParent().getObject().getId();
String operationId = selectNode.getObject().getId();
changeValuesFromRepository = new ChangeValuesFromRepository(elem, repositoryConnection, param.getName() + ":" + //$NON-NLS-1$
EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), //$NON-NLS-1$ //$NON-NLS-2$
serviceId + " - " + portId + " - " + operationId);
service.deleteOldRelation(currentJobId);
//$NON-NLS-1$ //$NON-NLS-2$
service.updateOperation((INode) elem, serviceId + " - " + portId + " - " + operationId, selectNode);
} else {
changeValuesFromRepository = new ChangeValuesFromRepository(elem, repositoryConnection, fullParamName, id);
}
if (changeValuesFromRepository != null) {
compoundCommand.add(changeValuesFromRepository);
}
updateDBType(compoundCommand, repositoryConnection);
return compoundCommand;
}
// for ruleItem,hywang add
if (dynamicProperty instanceof MultipleThreadDynamicComposite) {
repositoryFileItemMap = ((MultipleThreadDynamicComposite) dynamicProperty).getRepositoryFileItemMap();
repositoryLinkRulesItemMap = ((MultipleThreadDynamicComposite) dynamicProperty).getRepositoryLinkRulesItemMap();
}
if (repositoryFileItemMap.containsKey(id)) {
repositoryFileItem = repositoryFileItemMap.get(id);
} else if (repositoryLinkRulesItemMap.containsKey(id)) {
linkItem = repositoryLinkRulesItemMap.get(id);
} else {
if (!repositoryFileItemMap.isEmpty()) {
repositoryFileItem = repositoryFileItemMap.values().iterator().next();
} else {
repositoryFileItem = null;
}
}
if (repositoryFileItem == null && item instanceof FileItem) {
repositoryFileItem = (FileItem) item;
}
if (repositoryFileItem != null) {
CompoundCommand compoundCommand = new CompoundCommand();
final String showId = repositoryFileItem.getProperty().getId();
Command command = new PropertyChangeCommand(elem, EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), showId);
compoundCommand.add(command);
return compoundCommand;
}
if (linkItem != null) {
CompoundCommand compoundCommand = new CompoundCommand();
final String showId = linkItem.getProperty().getId();
Command command = new PropertyChangeCommand(elem, EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), showId);
compoundCommand.add(command);
return compoundCommand;
}
}
} else {
// 1. open wizard
if (elem instanceof INode) {
INode node = (INode) elem;
final IRepositoryService repositoryService = CorePlugin.getDefault().getRepositoryService();
if (param != null) {
RepositoryNode realNode = null;
String repositoryValue = param.getRepositoryValue();
if (repositoryValue != null && repositoryValue.startsWith(ERepositoryCategoryType.DATABASE.getName())) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_CONNECTIONS);
} else // file delimited
if (ERepositoryCategoryType.DELIMITED.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_DELIMITED);
}
// file positional
if (ERepositoryCategoryType.POSITIONAL.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_POSITIONAL);
}
// file regexp
if (ERepositoryCategoryType.REGEX.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_REGEXP);
}
// file xml
if (ERepositoryCategoryType.XML.getName().equals(repositoryValue) || // bug 18012
repositoryValue.startsWith(ERepositoryCategoryType.XML.getName())) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_XML);
}
// file ldif
if (ERepositoryCategoryType.LDIF.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_LDIF);
}
// excel
if (ERepositoryCategoryType.EXCEL.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_EXCEL);
}
// generic schema
if (ERepositoryCategoryType.GENERIC.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_GENERIC_SCHEMA);
}
// ldap
if (ERepositoryCategoryType.LDAP.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_LDAP_SCHEMA);
}
// wsdl
if (ERepositoryCategoryType.WSDL.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_WSDL_SCHEMA);
}
if (ERepositoryCategoryType.WEBSERVICE.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_WSDL_SCHEMA);
}
// salesforce
if (ERepositoryCategoryType.SALESFORCE.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA);
}
// ebcdic
if (ERepositoryCategoryType.EBCDIC.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_EBCDIC);
}
// mdm
if (ERepositoryCategoryType.MDM.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_MDMCONNECTION);
}
// sap
if (ERepositoryCategoryType.SAP.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_SAPCONNECTIONS);
}
// sapIDoc
if (ERepositoryCategoryType.SAPIDOC.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_SAP_IDOC);
}
if (ERepositoryCategoryType.HEADERFOOTER.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_HEADER_FOOTER);
}
// brms
if (ERepositoryCategoryType.BRMS.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_BRMS);
}
// hl7
if (ERepositoryCategoryType.HL7.getName().equals(repositoryValue)) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.METADATA_FILE_HL7);
}
// last resort we assume that the repository value was named after the root component type key
if (realNode == null) {
realNode = (RepositoryNode) repositoryService.getRootRepositoryNode(ERepositoryObjectType.getTypeFromKey(repositoryValue));
}
if (realNode != null) {
final IMetadataService metadataService = CorePlugin.getDefault().getMetadataService();
if (metadataService != null) {
ConnectionItem connItem = metadataService.openMetadataConnection(true, realNode, node);
if (connItem != null) {
IElementParameter propertyParam = elem.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
propertyParam.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName()).setValue(EmfComponent.REPOSITORY);
// 2. commnd
Command cmd = new ChangeValuesFromRepository(node, connItem.getConnection(), //$NON-NLS-1$
propertyParam.getName() + ":" + EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), connItem.getProperty().getId());
executeCommand(cmd);
// see bug in feature 5998.refresh repositoryList.
if (dynamicProperty instanceof MultipleThreadDynamicComposite) {
((MultipleThreadDynamicComposite) dynamicProperty).updateRepositoryList();
}
}
}
}
}
}
}
return null;
}
use of org.talend.core.model.metadata.builder.connection.Connection in project tdi-studio-se by Talend.
the class AbstractJobSettingsPage method save.
protected void save() {
List<String> checkedObjects = new ArrayList<String>();
List<IRepositoryViewObject> allProcess = null;
try {
allProcess = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS);
} catch (PersistenceException e1) {
ExceptionHandler.process(e1);
}
for (IRepositoryViewObject object : allProcess) {
if (isStatUseProjectSetting(object)) {
if (!checkedObjects.contains(object.getProperty().getId())) {
checkedObjects.add(object.getProperty().getId());
if (!checkedNodeObject.contains(object)) {
checkedNodeObject.add(object);
}
}
}
}
List<IProcess2> allOpenedProcessList = CorePlugin.getDefault().getDesignerCoreService().getOpenedProcess(getEditors());
if (allOpenedProcessList != null) {
for (int i = 0; i < allOpenedProcessList.size(); i++) {
if (checkedObjects.contains(allOpenedProcessList.get(i).getProperty().getId())) {
openedProcessList.add(allOpenedProcessList.get(i));
}
}
}
//
final IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(getTaskMessages(), (checkedNodeObject.size()) * 100);
final Map<String, Set<String>> contextVars = DetectContextVarsUtils.detectByPropertyType(elem, true);
// must init this
addContextModel = false;
if (!contextVars.isEmpty()) {
// boolean showDialog = false;
Set<String> contextSet = new HashSet<String>();
for (String key : contextVars.keySet()) {
contextSet = contextVars.get(key);
break;
}
Connection connection = null;
IElementParameter ptParam = elem.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
if (ptParam != null) {
IElementParameter propertyElem = ptParam.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName());
Object proValue = propertyElem.getValue();
if (proValue instanceof String && ((String) proValue).equalsIgnoreCase(EmfComponent.REPOSITORY)) {
IElementParameter repositoryElem = ptParam.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
String value = (String) repositoryElem.getValue();
ConnectionItem connectionItem = UpdateRepositoryUtils.getConnectionItemByItemId(value);
connection = connectionItem.getConnection();
if (connection != null && connection.isContextMode()) {
addContextModel = true;
// ContextItem contextItem =
// ContextUtils.getContextItemById(connection.getContextId());
// for (IProcess process : openedProcessList) {
// Set<String> addedContext =
// ConnectionContextHelper.checkAndAddContextVariables(contextItem,
// contextSet, process.getContextManager(), false);
// if (addedContext != null && !addedContext.isEmpty()) {
// showDialog = true;
// break;
// }
// }
}
}
}
if (addContextModel) {
// if the context is not existed in job, will add or not.
Display disp = Display.getCurrent();
if (disp == null) {
disp = Display.getDefault();
}
if (disp != null) {
disp.syncExec(new Runnable() {
@Override
public void run() {
showContextAndCheck(contextVars);
}
});
} else {
showContextAndCheck(contextVars);
}
}
}
monitor.worked(10);
IWorkspaceRunnable workspaceRunnable = new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
for (IRepositoryViewObject object : checkedNodeObject) {
saveProcess(object, addContextModel, contextVars, monitor);
}
}
};
IWorkspace workspace = ResourcesPlugin.getWorkspace();
try {
ISchedulingRule schedulingRule = workspace.getRoot();
workspace.run(workspaceRunnable, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
monitor.done();
}
};
final ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
try {
dialog.run(true, true, runnable);
} catch (InvocationTargetException e) {
ExceptionHandler.process(e);
} catch (InterruptedException e) {
ExceptionHandler.process(e);
}
}
use of org.talend.core.model.metadata.builder.connection.Connection in project tdi-studio-se by Talend.
the class DynamicComposite method updateRepositoryListExtra.
/**
* for job settings extra (feature 2710).
*
*/
private void updateRepositoryListExtra(IElementParameter param, List<String> repositoryConnectionNameList, List<String> repositoryConnectionValueList, boolean extra) {
String repositoryValue = param.getParentParameter().getRepositoryValue();
if (repositoryValue != null) {
List<String> connectionNamesList = new ArrayList<String>();
List<String> connectionValuesList = new ArrayList<String>();
for (String key : repositoryConnectionItemMap.keySet()) {
ConnectionItem connectionItem = repositoryConnectionItemMap.get(key);
Connection connection = connectionItem.getConnection();
String name = //$NON-NLS-1$
getRepositoryAliasName(connectionItem) + ":" + connectionItem.getProperty().getLabel();
if ((connection instanceof DelimitedFileConnection) && (repositoryValue.equals(ERepositoryCategoryType.DELIMITED.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof PositionalFileConnection) && (repositoryValue.equals(ERepositoryCategoryType.POSITIONAL.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof RegexpFileConnection) && (repositoryValue.equals(ERepositoryCategoryType.REGEX.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof XmlFileConnection) && (repositoryValue.equals(ERepositoryCategoryType.XML.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof FileExcelConnection) && (repositoryValue.equals(ERepositoryCategoryType.EXCEL.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof GenericSchemaConnection) && (repositoryValue.equals(ERepositoryCategoryType.GENERIC.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof LDAPSchemaConnection) && (repositoryValue.equals(ERepositoryCategoryType.LDAP.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof SalesforceSchemaConnection) && (repositoryValue.equals(ERepositoryCategoryType.SALESFORCE.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof WSDLSchemaConnection) && (repositoryValue.equals(ERepositoryCategoryType.WSDL.getName()))) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
if ((connection instanceof DatabaseConnection) && (repositoryValue.startsWith(ERepositoryCategoryType.DATABASE.getName()))) {
//$NON-NLS-1$
String currentDbType = (String) RepositoryToComponentProperty.getValue(connection, "TYPE", null);
if (repositoryValue.contains(":")) {
// database //$NON-NLS-1$
// is
// specified
// //$NON-NLS-1$
//$NON-NLS-1$
String neededDbType = repositoryValue.substring(repositoryValue.indexOf(":") + 1);
if (neededDbType.equals(currentDbType)) {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
} else {
addOrderDisplayNames(connectionValuesList, connectionNamesList, key, name);
}
}
}
repositoryConnectionNameList.addAll(connectionNamesList);
repositoryConnectionValueList.addAll(connectionValuesList);
} else {
List<String> connectionValuesList = new ArrayList<String>();
List<String> connectionStringList = new ArrayList<String>();
for (String key : repositoryConnectionItemMap.keySet()) {
ConnectionItem connectionItem = repositoryConnectionItemMap.get(key);
String name = connectionItem.getProperty().getLabel();
addOrderDisplayNames(connectionValuesList, connectionStringList, key, name);
}
repositoryConnectionNameList.addAll(connectionStringList);
repositoryConnectionValueList.addAll(connectionValuesList);
}
param.setListItemsDisplayName(repositoryConnectionNameList.toArray(new String[0]));
param.setListItemsValue(repositoryConnectionValueList.toArray(new String[0]));
if (!repositoryConnectionItemMap.keySet().contains(param.getValue())) {
if (repositoryConnectionNameList.size() > 0) {
param.setValue(repositoryConnectionValueList.get(0));
}
}
}
Aggregations