Search in sources :

Example 61 with IElementParameter

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IElementParameter(org.talend.core.model.process.IElementParameter) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map)

Example 62 with IElementParameter

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;
}
Also used : ArrayList(java.util.ArrayList) IElementParameter(org.talend.core.model.process.IElementParameter) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map)

Example 63 with IElementParameter

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;
}
Also used : INode(org.talend.core.model.process.INode) IOConnection(org.talend.designer.mapper.external.connection.IOConnection) IElementParameter(org.talend.core.model.process.IElementParameter)

Example 64 with IElementParameter

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);
}
Also used : HashMap(java.util.HashMap) TextElementParameter(org.talend.core.model.runprocess.shadow.TextElementParameter) ArrayList(java.util.ArrayList) IElementParameter(org.talend.core.model.process.IElementParameter) ObjectElementParameter(org.talend.core.model.runprocess.shadow.ObjectElementParameter) Map(java.util.Map) HashMap(java.util.HashMap)

Example 65 with IElementParameter

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);
    }
}
Also used : TextElementParameter(org.talend.core.model.runprocess.shadow.TextElementParameter) IElementParameter(org.talend.core.model.process.IElementParameter)

Aggregations

IElementParameter (org.talend.core.model.process.IElementParameter)439 ArrayList (java.util.ArrayList)165 List (java.util.List)112 Node (org.talend.designer.core.ui.editor.nodes.Node)108 Map (java.util.Map)99 INode (org.talend.core.model.process.INode)94 HashMap (java.util.HashMap)87 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)73 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)69 Point (org.eclipse.swt.graphics.Point)57 ElementParameter (org.talend.designer.core.model.components.ElementParameter)48 ConnectionItem (org.talend.core.model.properties.ConnectionItem)45 IConnection (org.talend.core.model.process.IConnection)40 PersistenceException (org.talend.commons.exception.PersistenceException)39 Item (org.talend.core.model.properties.Item)38 PropertyChangeCommand (org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand)37 IComponent (org.talend.core.model.components.IComponent)36 CCombo (org.eclipse.swt.custom.CCombo)33 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)29 Connection (org.talend.core.model.metadata.builder.connection.Connection)28