use of org.talend.core.model.process.IElementParameter in project tdi-studio-se by Talend.
the class FileOutputXMLComponent method setTableElementParameter.
//$NON-NLS-1$
@SuppressWarnings("unchecked")
public boolean setTableElementParameter(List<Map<String, String>> epsl, String paraName) {
List<IElementParameter> eps = (List<IElementParameter>) this.getElementParameters();
boolean result = true;
for (int i = 0; i < eps.size(); i++) {
IElementParameter parameter = eps.get(i);
if (parameter.getFieldType() == EParameterFieldType.TABLE && parameter.getName().equals(paraName)) {
List<Map<String, String>> newValues = new ArrayList<Map<String, String>>();
for (Map<String, String> map : epsl) {
Map<String, String> newMap = new HashMap<String, String>();
newMap.putAll(map);
newValues.add(newMap);
}
if (result) {
parameter.setValue(newValues);
}
break;
}
}
return result;
}
use of org.talend.core.model.process.IElementParameter in project tdi-studio-se by Talend.
the class FileOutputXMLComponent method getTableList.
//$NON-NLS-1$
@SuppressWarnings("unchecked")
public List<Map<String, String>> getTableList(String paraName) {
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
List<IElementParameter> eps = (List<IElementParameter>) this.getElementParameters();
if (eps == null) {
return list;
}
for (int i = 0; i < eps.size(); i++) {
IElementParameter parameter = eps.get(i);
if (parameter.getFieldType() == EParameterFieldType.TABLE && parameter.getName().equals(paraName)) {
list = (List<Map<String, String>>) parameter.getValue();
break;
}
}
return list;
}
use of org.talend.core.model.process.IElementParameter in project tdi-studio-se by Talend.
the class InputTable method hasReadOnlyMetadataColumns.
/*
* (non-Javadoc)
*
* @see org.talend.designer.mapper.model.table.AbstractInOutTable#hasReadOnlyMetadataColumns()
*/
@Override
public boolean hasReadOnlyMetadataColumns() {
boolean hasReadOnlyMetadataColumns = false;
IOConnection connection = getConnection();
if (connection != null) {
INode source = connection.getSource();
if (source != null) {
hasReadOnlyMetadataColumns = connection.isReadOnly() || !connection.isActivate() || source.isReadOnly();
if (!hasReadOnlyMetadataColumns) {
for (IElementParameter param : source.getElementParameters()) {
if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
if (param.isReadOnly()) {
hasReadOnlyMetadataColumns = true;
break;
}
}
}
}
}
}
return hasReadOnlyMetadataColumns;
}
use of org.talend.core.model.process.IElementParameter in project tdi-studio-se by Talend.
the class WSDLSchemaInputNode method addParameters.
/**
* DOC qwei Comment method "addParameters".
*
* @param schemaBean
* @param parameters
*/
private void addParameters(WSDLSchemaBean schemaBean, ArrayList parameters) {
//$NON-NLS-1$
IElementParameter param = new TextElementParameter("ENDPOINT", schemaBean.getWslUrl());
addParameter(param);
if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
addJavaParameters(schemaBean);
} else if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.PERL)) {
addPerlParameters(schemaBean);
}
//$NON-NLS-1$
param = new TextElementParameter("METHOD", schemaBean.getMethod());
addParameter(param);
// fix preview
//$NON-NLS-1$
param = new TextElementParameter("ADVANCED_USE", Boolean.toString(false));
addParameter(param);
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
if (parameters != null) {
for (Object string : parameters) {
Map<String, Object> map = new HashMap<String, Object>();
//$NON-NLS-1$
map.put("VALUE", TalendTextUtils.addQuotes(string.toString()));
list.add(map);
}
}
//$NON-NLS-1$
param = new ObjectElementParameter("PARAMS", list);
//$NON-NLS-1$
param.setListItemsDisplayCodeName(new String[] { "VALUE" });
addParameter(param);
}
use of org.talend.core.model.process.IElementParameter in project tdi-studio-se by Talend.
the class WSDLSchemaInputNode method addJavaParameters.
private void addJavaParameters(WSDLSchemaBean schemaBean) {
//$NON-NLS-1$ //$NON-NLS-2$
IElementParameter param = new TextElementParameter("NEED_AUTH", "" + schemaBean.isNeedAuth());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("AUTH_USERNAME", schemaBean.getUserName());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("AUTH_PASSWORD", schemaBean.getPassword());
addParameter(param);
//$NON-NLS-1$ //$NON-NLS-2$
param = new TextElementParameter("UES_PROXY", "" + schemaBean.isUseProxy());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("PROXY_HOST", schemaBean.getProxyHost());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("PROXY_PORT", schemaBean.getProxyPort());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("PROXY_USERNAME", schemaBean.getProxyUser());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("PROXY_PASSWORD", schemaBean.getProxyPassword());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("TIMEOUT", "" + schemaBean.getTimeOut());
addParameter(param);
if (!schemaBean.getIsInputModel()) {
//$NON-NLS-1$
param = new TextElementParameter("PORT_NAME", schemaBean.getPortName());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("PORT_NS", schemaBean.getPortNS());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("SERVICE_NAME", schemaBean.getServerName());
addParameter(param);
//$NON-NLS-1$
param = new TextElementParameter("SERVICE_NS", "" + schemaBean.getServerNS());
addParameter(param);
}
}
Aggregations