diff --git a/README.md b/README.md index a95bd38..eca1661 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ talend-codegen ============== +Updated : Nikita Rousseau 02/08/2017 for Talend Open Studio - Big Data 6.4.1 -Command line code generation (job build/export) plugin for Talend, updated for >= v6.0. +Command line code generation (job build/export) plugin for Talend, updated for >= v6.4.1 Compiling & Configuring ----------------------- @@ -9,86 +10,15 @@ Compiling & Configuring Build: ```bash -#to build the latest version available -> make - #ls in the out directory ->ls jar/talend-codegen_5.6.0.jar - -#build an older version ->make build_jar_5.4.1 +>ls jar/talend-codegen_X.X.X.jar #build directly with ant: -> cat Makefile -build_jar_5.6.0: - ant build -Dtalend_version=5.6.0 -Dtalend_revision=20141024_1545 -clean_5.6.0: - ant clean -Dtalend_version=5.6.0 -Dtalend_revision=20141024_1545 - -#select your version -> ant build -Dtalend_version=5.5.1 -Dtalend_revision=r118616 +>ant build -Dtalend_version=6.4.1 -Dtalend_revision=20170623_1246 ``` And copy `jar/talend-codegen.jar` to the plugins directory of Talend. -Usage with talend-codegen helper --------------------------------- - -This project is shipped with an helper script available in **./bin/talend-codegen**. - -This script must be modify to reflect your Talend installation (TALEND_DIR and TALEND_BIN at the beginning of the script) - -Generation: -```bash -# create out directory -$ mkdir -p './out' - -# With all '-need' options enabled -$ talend-codegen -p './MyProjectDir/' -o './out/' -j './MyJobName' -a - -# With custom options -$ talend-codegen -p './MyProjectDir/' -o './out/' -j 'MyJobName' -O '-needLauncher=true -needContext=true' -``` - -help: -``` -# help -$ talend-codegen -h -usage: talend-codegen -p -o -j \ - [-a] [-O ] [-T ] [-c ] - -Build Talend project from command line - -examples: - * talend-codegen -p ./MyProjectDir/ -o out/ -j MyJobName -a - * talend-codegen -p ./MyProjectDir/ -o out/ -j MyJobName -O '-needLauncher=true -needDependencies=true' - -arguments: - -p : directory containing the talend project - -j : job to export - -o : output directory - -optional arguments: - -a: enable all -need* options - -O : custom options (cannot be used with -a) - -T : talend install directory (default: /home/pcarpent/TOS_DI-r95165-V5.2.1) - -c : location of any custom components used in the job - -codegen options (for -O): - * -version - version of job to be exported - * -needLauncher - include launcher script (true/false) - * -needSystemRoutine - include system outines (true/false) - * -needUserRoutine - and so on.. - * -needTalendLibraries - * -needJobItem - * -needSourceCode - * -needDependencies - * -needJobScript - * -needContext - * -applyToChildren - * -buildType - (osgi/job) -``` - Usage invoking TOS directly --------------------------- @@ -135,5 +65,6 @@ cp $PROJECTDIR/libs/* /home/TOS_DI-r118616-V5.5.1/lib/java/ -targetDir $TARGETDIR -componentDir $COMPONENTDIR ``` - - +```bash +TOS_BD-win-x86_64 -nosplash --launcher.suppressErrors -data "C:\Users\ncel51046\Documents\workspace" -application au.org.emii.talend.codegen.Generator -jobName "neo_update_user" -projectDir "C:\Users\ncel51046\Documents\workspace\NEODEUS" -targetDir "C:\Users\ncel51046\Documents\builds" +``` \ No newline at end of file diff --git a/build.xml b/build.xml index 4fbf2f0..ee53159 100644 --- a/build.xml +++ b/build.xml @@ -4,8 +4,8 @@ - - + + diff --git a/lib/6.2.0/org.apache.log4j_1.2.13.v200903072027.jar b/lib/6.2.0/org.apache.log4j_1.2.13.v200903072027.jar deleted file mode 100755 index 53e60a7..0000000 Binary files a/lib/6.2.0/org.apache.log4j_1.2.13.v200903072027.jar and /dev/null differ diff --git a/lib/6.2.0/org.talend.commons.runtime_6.2.0.20160510_1709.jar b/lib/6.2.0/org.talend.commons.runtime_6.2.0.20160510_1709.jar deleted file mode 100755 index 2472660..0000000 Binary files a/lib/6.2.0/org.talend.commons.runtime_6.2.0.20160510_1709.jar and /dev/null differ diff --git a/lib/6.2.0/org.talend.core.repository_6.2.0.20160510_1709.jar b/lib/6.2.0/org.talend.core.repository_6.2.0.20160510_1709.jar deleted file mode 100755 index e74d836..0000000 Binary files a/lib/6.2.0/org.talend.core.repository_6.2.0.20160510_1709.jar and /dev/null differ diff --git a/lib/6.2.0/org.talend.core.runtime_6.2.0.20160510_1709.jar b/lib/6.2.0/org.talend.core.runtime_6.2.0.20160510_1709.jar deleted file mode 100755 index 7301ba9..0000000 Binary files a/lib/6.2.0/org.talend.core.runtime_6.2.0.20160510_1709.jar and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_begin.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_begin.javajet deleted file mode 100755 index 0375bf7..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_begin.javajet +++ /dev/null @@ -1,464 +0,0 @@ -<%@ jet -imports=" - java.util.List - java.util.ArrayList - java.util.Map - java.util.Set - java.util.HashSet - java.util.HashMap - java.util.Stack - org.talend.components.api.component.ComponentDefinition - org.talend.components.api.component.EndpointComponentDefinition - org.talend.components.api.component.InputComponentDefinition - org.talend.components.api.component.OutputComponentDefinition - org.talend.components.api.properties.ComponentProperties - org.talend.components.api.container.RuntimeContainer - org.talend.daikon.properties.Property - org.talend.daikon.NamedThing - org.talend.designer.core.generic.model.Component - org.talend.core.model.metadata.IMetadataColumn - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.types.JavaType - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.IElementParameter - org.talend.core.model.process.IConnection - org.talend.core.model.process.IConnectionCategory - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.INode - org.talend.core.model.utils.TalendTextUtils - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.process.EParameterFieldType - " -%> -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -INode node = (INode)codeGenArgument.getArgument(); -String cid = node.getUniqueName(); -Component component = (Component)node.getComponent(); -ComponentProperties componentProps = node.getComponentProperties(); -ComponentDefinition def = component.getComponentDefinition(); - -List metadatas = node.getMetadataList(); -IMetadataTable metadata = null; -List columnList = null; -boolean hasDynamic = false; -String dynamicColName = null; -int dynamicPos = -1; -if ((metadatas != null) && (metadatas.size() > 0)) { // metadata - - metadata = metadatas.get(0); - if(metadata != null){ - columnList = metadata.getListColumns(); - int nbSchemaColumns = columnList.size(); - - hasDynamic = false; - - int pos = 0; - for (IMetadataColumn column : columnList) { - if (column.getTalendType().equals("id_Dynamic")) { - hasDynamic = true; - dynamicPos = pos; - dynamicColName = column.getLabel(); - break; - } - pos++; - } - } -} -%> - -org.talend.components.api.component.ComponentDefinition def_<%=cid %> = - new <%= def.getClass().getName()%>(); -<% -List propsToProcess = component.getCodegenPropInfos(componentProps); -%> - -<%= componentProps.getClass().getName()%> props_<%=cid %> = (<%= componentProps.getClass().getName()%>) def_<%=cid %>.createRuntimeProperties(); -<% - -for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo - List properties = propInfo.props.getProperties(); - for (NamedThing prop : properties) { // property - if (prop instanceof Property) { // if, only deal with valued Properties - Property property = (Property)prop; - if (property.getFlags() != null && (property.getFlags().contains(Property.Flags.DESIGN_TIME_ONLY) || property.getFlags().contains(Property.Flags.HIDDEN))) - continue; - Object value = property.getValue(); - if (value != null && (value instanceof List)) { // if - // added for the support of tables - String tmpVarName = cid+propInfo.fieldName.replace('.','_')+"_"+property.getName(); - %> - java.util.List <%=tmpVarName %> = new java.util.ArrayList(); - <% - for (String subPropertyValue : (java.util.List)property.getValue()) { - if ((property.getType() == Property.Type.BOOLEAN) || (property.getType() == Property.Type.ENUM)) { - %> - <%=tmpVarName %>.add("<%=subPropertyValue %>"); - <% - } else { - if(!"".equals(subPropertyValue)) { - %> - <%=tmpVarName %>.add(<%=subPropertyValue %>); - <% - } else { - %> - <%=tmpVarName %>.add(""); - <% - } - } - } - %> - ((org.talend.daikon.properties.Properties)props_<%=cid %><%=propInfo.fieldName%>).setValue("<%=property.getName()%>",<%=tmpVarName %>); - <% - } else if (property.isFlag(Property.Flags.ENCRYPT) && ElementParameterParser.canEncryptValue(property.getStringValue())) { - %> - props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", - routines.system.PasswordEncryptUtil.decryptPassword(<%=component.getCodegenValue(property, property.getStringValue())%>)); - <% - } else if (value != null && Property.Type.DATE.equals(property.getType())){ - %> - props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", - TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",<%=component.getCodegenValue(property, property.getStringValue())%>)); - <% - } else if (value != null && (!(value instanceof String) || !((String)value).equals(""))) { // if - %> - props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", - <%=component.getCodegenValue(property, property.getStringValue())%>); - <% - } // if - }//else may be a ComponentProperties so ignore - } // property -} // propInfo -%> -org.talend.components.api.container.RuntimeContainer container_<%=cid%> = new org.talend.components.api.container.RuntimeContainer() { - public Object getComponentData(String componentId, String key) { - return globalMap.get(componentId + "_" + key); - } - - public void setComponentData(String componentId, String key, Object data) { - globalMap.put(componentId + "_" + key, data); - } - - public String getCurrentComponentId() { - return "<%=cid%>"; - } -}; - -<% -if (def instanceof EndpointComponentDefinition) { -%> - org.talend.components.api.component.runtime.SourceOrSink sourceOrSink_<%=cid%> = ((org.talend.components.api.component.EndpointComponentDefinition)def_<%=cid%>).getRuntime(); - sourceOrSink_<%=cid%>.initialize(container_<%=cid%>, props_<%=cid%>); - org.talend.daikon.properties.ValidationResult vr_<%=cid%> = sourceOrSink_<%=cid%>.validate(container_<%=cid%>); - if (vr_<%=cid%>.getStatus() == org.talend.daikon.properties.ValidationResult.Result.ERROR ) { - throw new RuntimeException(vr_<%=cid%>.getMessage()); - } -<% -} - -if (metadata != null) { - if (def instanceof InputComponentDefinition) { -%> - org.talend.components.api.component.runtime.Source source_<%=cid%> = (org.talend.components.api.component.runtime.Source)sourceOrSink_<%=cid%>; - org.talend.components.api.component.runtime.Reader reader_<%=cid%> = source_<%=cid%>.createReader(container_<%=cid%>); - - <% - IConnection main = null; - List mains = node.getOutgoingConnections(EConnectionType.FLOW_MAIN); - if(mains!=null && !mains.isEmpty()) { - main = mains.get(0); - } - - IConnection reject = null; - for(IConnection outConn : node.getOutgoingConnections()) { - if(!outConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { - continue; - } - - if(main!=null && main.getName().equals(outConn.getName())) { - continue; - } - - reject = outConn; - - break; - } - - boolean hasDataOutput = main!=null || reject!=null; - - // FIXME - multiple outgoing connections? - - if(hasDataOutput) { - if(hasDynamic){ - %> - boolean initDyn_<%=cid%> = false; - routines.system.Dynamic dynamic_<%=cid%> = new routines.system.Dynamic(); - <% - } - - IConnection schemaSourceConnector = (main!=null ? main : reject); - String schemaSourceConnectorName = schemaSourceConnector.getMetadataTable().getAttachedConnector(); - %> - boolean multi_output_is_allowed_<%=cid%> = false; - <% //take care SourceOrSink.validate will change the schema if it contains include-all-fields, so need to get design Avro schema before validate %> - org.talend.components.api.component.Connector c_<%=cid%> = null; - for (org.talend.components.api.component.Connector currentConnector : props_<%=cid %>.getAvailableConnectors(null, true)) { - if (currentConnector.getName().equals("<%=schemaSourceConnectorName%>")) { - c_<%=cid%> = currentConnector; - } - - if (currentConnector.getName().equals("REJECT")) {//it's better to move the code to javajet - multi_output_is_allowed_<%=cid%> = true; - } - } - org.apache.avro.Schema schema_<%=cid%> = props_<%=cid %>.getSchema(c_<%=cid%>, true); - - org.talend.daikon.talend6.Talend6OutgoingSchemaEnforcer current_<%=cid%> = new org.talend.daikon.talend6.Talend6OutgoingSchemaEnforcer(schema_<%=cid%>, false); - - // Create a reusable factory that converts the output of the reader to an IndexedRecord. - org.talend.daikon.avro.IndexedRecordAdapterFactory factory_<%=cid%> = null; - - <% - } - %> - // Iterate through the incoming data. - for(boolean available = reader_<%=cid%>.start(); available; available = reader_<%=cid%>.advance()) {//} - <% - if(hasDataOutput) { - %> - if(multi_output_is_allowed_<%=cid%>) { - <%if(main!=null){%> - <%=main.getName()%> = null; - <%}%> - - <%if(reject!=null){%> - <%=reject.getName()%> = null; - <%}%> - } - - try { - Object data_<%=cid%> = reader_<%=cid%>.getCurrent(); - - <%if(main!=null){%> - - if(multi_output_is_allowed_<%=cid%>) { - <%=main.getName()%> = new <%=main.getName() %>Struct(); - } - - // Construct the factory once when the first data arrives. - if (factory_<%=cid%> == null) - factory_<%=cid%> = (org.talend.daikon.avro.IndexedRecordAdapterFactory) new org.talend.daikon.avro.AvroRegistry() - .createAdapterFactory(data_<%=cid%>.getClass()); - - // Enforce the outgoing schema on the input. - org.apache.avro.generic.IndexedRecord unenforced_<%=cid%> = factory_<%=cid%>.convertToAvro(data_<%=cid%>); - current_<%=cid%>.setWrapped(unenforced_<%=cid%>); - - <% - if(hasDynamic){ - %> - if(!initDyn_<%=cid%>){ - org.apache.avro.Schema dynSchema_<%=cid%> = current_<%=cid%>.getOutgoingDynamicRuntimeSchema(); - - for(org.apache.avro.Schema.Field childDynamic_<%=cid%> : dynSchema_<%=cid%>.getFields()){ - routines.system.DynamicMetadata dynamicMetadata_<%=cid%> = new routines.system.DynamicMetadata(); - dynamicMetadata_<%=cid%>.setName(childDynamic_<%=cid%>.name()); - dynamicMetadata_<%=cid%>.setDbName(childDynamic_<%=cid%>.name()); - String talendType_<%=cid%> = null; - if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ARRAY){ - talendType_<%=cid%> = "<%=JavaTypesManager.LIST.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BOOLEAN){ - talendType_<%=cid%> = "<%=JavaTypesManager.BOOLEAN.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BYTES){ - talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FIXED){ - talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.DOUBLE){ - talendType_<%=cid%> = "<%=JavaTypesManager.DOUBLE.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FLOAT){ - talendType_<%=cid%> = "<%=JavaTypesManager.FLOAT.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.INT){ - talendType_<%=cid%> = "<%=JavaTypesManager.INTEGER.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.LONG){ - talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ENUM){ - talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.STRING){ - talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; - } - dynamicMetadata_<%=cid%>.setType(talendType_<%=cid%>); - dynamic_<%=cid%>.metadatas.add(dynamicMetadata_<%=cid%>); - } - initDyn_<%=cid%> = true; - } - dynamic_<%=cid%>.clearColumnValues(); - <% - } - - List main_output_columnList = main.getMetadataTable().getListColumns(); - - for (int i = 0; i < main_output_columnList.size(); i++) { - IMetadataColumn column = main_output_columnList.get(i); - String columnName = column.getLabel(); - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if(columnName.equals(dynamicColName)){ - %> - java.util.Map dynamicValue_<%=cid%> = (java.util.Map)current_<%=cid%>.get(<%=i%>); - for(String dynamicValue_Key_<%=cid%> : dynamicValue_<%=cid%>.keySet()){ - dynamic_<%=cid%>.setColumnValue(dynamic_<%=cid%>.getIndex(dynamicValue_Key_<%=cid%>), dynamicValue_<%=cid%>.get(dynamicValue_Key_<%=cid%>)); - } - <%=main.getName()%>.<%=dynamicColName%> = dynamic_<%=cid%>; - <% - }else{ - %> - if(current_<%=cid%>.get(<%=i%>) == null){ - <%=main.getName()%>.<%=columnName%> = <%=JavaTypesManager.getDefaultValueFromJavaType(typeToGenerate)%>; - }else{ - <%if(javaType == JavaTypesManager.STRING){%> - <%=main.getName()%>.<%=columnName%> = String.valueOf(current_<%=cid%>.get(<%=i%>)); - <%}else{%> - <%=main.getName()%>.<%=columnName%> = (<%=typeToGenerate%>)(current_<%=cid%>.get(<%=i%>)); - <%}%> - } - <% - } - } - %> - - <%}%> - } catch (org.talend.components.api.exception.DataRejectException e_<%=cid%>) { - <%if(reject!=null){%> - java.util.Map info_<%=cid%> = e_<%=cid%>.getRejectInfo(); - Object data_<%=cid%> = info_<%=cid%>.get("talend_record"); - - if(multi_output_is_allowed_<%=cid%>) { - <%=reject.getName()%> = new <%=reject.getName() %>Struct(); - } - - // Construct the factory once when the first data arrives. - if (factory_<%=cid%> == null) - factory_<%=cid%> = (org.talend.daikon.avro.IndexedRecordAdapterFactory) new org.talend.daikon.avro.AvroRegistry() - .createAdapterFactory(data_<%=cid%>.getClass()); - - // Enforce the outgoing schema on the input. - org.apache.avro.generic.IndexedRecord unenforced_<%=cid%> = factory_<%=cid%>.convertToAvro(data_<%=cid%>); - current_<%=cid%>.setWrapped(unenforced_<%=cid%>); - - <% - if(hasDynamic){ - %> - if(!initDyn_<%=cid%>){ - org.apache.avro.Schema dynSchema_<%=cid%> = current_<%=cid%>.getOutgoingDynamicRuntimeSchema(); - - for(org.apache.avro.Schema.Field childDynamic_<%=cid%> : dynSchema_<%=cid%>.getFields()){ - routines.system.DynamicMetadata dynamicMetadata_<%=cid%> = new routines.system.DynamicMetadata(); - dynamicMetadata_<%=cid%>.setName(childDynamic_<%=cid%>.name()); - dynamicMetadata_<%=cid%>.setDbName(childDynamic_<%=cid%>.name()); - String talendType_<%=cid%> = null; - if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ARRAY){ - talendType_<%=cid%> = "<%=JavaTypesManager.LIST.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BOOLEAN){ - talendType_<%=cid%> = "<%=JavaTypesManager.BOOLEAN.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BYTES){ - talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FIXED){ - talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.DOUBLE){ - talendType_<%=cid%> = "<%=JavaTypesManager.DOUBLE.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FLOAT){ - talendType_<%=cid%> = "<%=JavaTypesManager.FLOAT.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.INT){ - talendType_<%=cid%> = "<%=JavaTypesManager.INTEGER.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.LONG){ - talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ENUM){ - talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; - }else if(childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.STRING){ - talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; - } - dynamicMetadata_<%=cid%>.setType(talendType_<%=cid%>); - dynamic_<%=cid%>.metadatas.add(dynamicMetadata_<%=cid%>); - } - initDyn_<%=cid%> = true; - } - dynamic_<%=cid%>.clearColumnValues(); - <% - } - - Set commonColumns = new HashSet(); - - for (int i = 0; i < columnList.size(); i++) { - IMetadataColumn column = columnList.get(i); - String columnName = column.getLabel(); - - commonColumns.add(columnName); - - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if(columnName.equals(dynamicColName)){ - %> - java.util.Map dynamicValue_<%=cid%> = (java.util.Map)current_<%=cid%>.get(<%=i%>); - for(String dynamicValue_Key_<%=cid%> : dynamicValue_<%=cid%>.keySet()){ - dynamic_<%=cid%>.setColumnValue(dynamic_<%=cid%>.getIndex(dynamicValue_Key_<%=cid%>), dynamicValue_<%=cid%>.get(dynamicValue_Key_<%=cid%>)); - } - <%=main.getName()%>.<%=dynamicColName%> = dynamic_<%=cid%>; - <% - }else{ - %> - if(current_<%=cid%>.get(<%=i%>) == null){ - <%=main.getName()%>.<%=columnName%> = <%=JavaTypesManager.getDefaultValueFromJavaType(typeToGenerate)%>; - }else{ - <%if(javaType == JavaTypesManager.STRING){%> - <%=main.getName()%>.<%=columnName%> = String.valueOf(current_<%=cid%>.get(<%=i%>)); - <%}else{%> - <%=main.getName()%>.<%=columnName%> = (<%=typeToGenerate%>)(current_<%=cid%>.get(<%=i%>)); - <%}%> - } - <% - } - } - - //pass error columns - List rejectColumns = reject.getMetadataTable().getListColumns(); - for(IMetadataColumn column : rejectColumns) { - String columnName = column.getLabel(); - - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - - //error columns - if(!commonColumns.contains(columnName)) { - %> - <%=reject.getName()%>.<%=columnName%> = (<%=typeToGenerate%>)info_<%=cid%>.get("<%=columnName%>"); - <% - } - } - %> - - <%}%> - } - <% - } - } else if (def instanceof OutputComponentDefinition) { - %> - org.talend.components.api.component.runtime.Sink sink_<%=cid%> = (org.talend.components.api.component.runtime.Sink)sourceOrSink_<%=cid%>; - org.talend.components.api.component.runtime.WriteOperation writeOperation_<%=cid%> = sink_<%=cid%>.createWriteOperation(); - writeOperation_<%=cid%>.initialize(container_<%=cid%>);<%//create folder for file; create database/table for db%> - org.talend.components.api.component.runtime.Writer writer_<%=cid%> = writeOperation_<%=cid%>.createWriter(container_<%=cid%>); - writer_<%=cid%>.open("<%=cid%>"); - org.talend.components.api.component.Connector c_<%=cid%> = null; - for (org.talend.components.api.component.Connector currentConnector : props_<%=cid %>.getAvailableConnectors(null, true)) { - if (currentConnector.getName().equals("MAIN")) { - c_<%=cid%> = currentConnector; - break; - } - } - org.apache.avro.Schema designSchema_<%=cid%> = props_<%=cid %>.getSchema(c_<%=cid%>, true); - org.talend.daikon.talend6.Talend6IncomingSchemaEnforcer current_<%=cid%> - = new org.talend.daikon.talend6.Talend6IncomingSchemaEnforcer(designSchema_<%=cid%>); - <% - } -} -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_end.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_end.javajet deleted file mode 100755 index e8db6cc..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_end.javajet +++ /dev/null @@ -1,48 +0,0 @@ -<%@ jet -imports=" - org.talend.components.api.component.ComponentDefinition - org.talend.designer.core.generic.model.Component - org.talend.core.model.process.INode - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.IMetadataColumn - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.process.IConnection - org.talend.core.model.process.IConnectionCategory - java.util.List - " -%> -// end of generic - -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -INode node = (INode)codeGenArgument.getArgument(); -String cid = node.getUniqueName(); -Component component = (Component)node.getComponent(); -ComponentDefinition def = component.getComponentDefinition(); - -IMetadataTable metadata = null; -List metadatas = node.getMetadataList(); -if ((metadatas != null) && (metadatas.size() > 0)) { - metadata = metadatas.get(0); -} - -if (metadata == null) { - return stringBuffer.toString(); -} - -if(def instanceof org.talend.components.api.component.InputComponentDefinition){ -%> - } // while -<% -%> - - reader_<%=cid%>.close(); -<% -}else if(def instanceof org.talend.components.api.component.OutputComponentDefinition){ -// Output -%> - writer_<%=cid%>.close(); -<% -} -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_main.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_main.javajet deleted file mode 100755 index 8d11bb6..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/generic/component_main.javajet +++ /dev/null @@ -1,187 +0,0 @@ -<%@ jet -imports=" - java.util.List - java.util.Set - java.util.HashSet - org.talend.components.api.component.ComponentDefinition - org.talend.designer.core.generic.model.Component - org.talend.core.model.metadata.IMetadataColumn - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.types.JavaType - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.IConnection - org.talend.core.model.process.IConnectionCategory - org.talend.core.model.process.INode - org.talend.core.model.process.EConnectionType - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.utils.TalendTextUtils - " -%> -// main of generic (used only for output components) - -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -INode node = (INode)codeGenArgument.getArgument(); -String cid = node.getUniqueName(); -Component component = (Component)node.getComponent(); -ComponentDefinition def = component.getComponentDefinition(); - -if(def instanceof org.talend.components.api.component.OutputComponentDefinition){ - %> - - // OUTPUT - - <% - List outgoingConns = node.getOutgoingSortedConnections(); - if (outgoingConns!=null){ - for (int i = 0; i < outgoingConns.size(); i++) { - IConnection outgoingConn = outgoingConns.get(i); - if (outgoingConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { - %> - <%=outgoingConn.getName()%> = null; - <% - } - } - } - - List metadatas = node.getMetadataList(); - IMetadataTable metadata; - if ((metadatas != null) && (metadatas.size() > 0) && (metadata = metadatas.get(0)) != null) { // metadata - List columnList = metadata.getListColumns(); - int dynamicPos = -1; - for (int i = 0; i < columnList.size(); i++) { - if (columnList.get(i).getTalendType().equals("id_Dynamic")) { - dynamicPos = i; - break; - } - } - %> - // METADATA - <% - - List< ? extends IConnection> conns = node.getIncomingConnections(); - for (IConnection conn : conns) { // conn - // If there are dynamic columns in the schema, they need to be - // initialized into the runtime schema of the actual IndexedRecord - // provided to the component. - if (dynamicPos != -1) { - %> - if (current_<%=cid%>.needsInitDynamicColumns()) { - // Initialize the dynamic columns when they are first encountered. - for (routines.system.DynamicMetadata dm_<%=cid%> : <%=conn.getName()%>.<%=columnList.get(dynamicPos).getLabel()%>.metadatas) { - current_<%=cid%>.initDynamicColumn( - dm_<%=cid%>.getName(), dm_<%=cid%>.getDbName(), - dm_<%=cid%>.getType(), dm_<%=cid%>.getDbType(), - dm_<%=cid%>.getDbTypeId(), dm_<%=cid%>.getLength(), - dm_<%=cid%>.getPrecision(), dm_<%=cid%>.getFormat(), - dm_<%=cid%>.getDescription(), dm_<%=cid%>.isKey(), - dm_<%=cid%>.isNullable(), - dm_<%=cid%>.getRefFieldName(), dm_<%=cid%>.getRefModuleName()); - } - current_<%=cid%>.initDynamicColumnsFinished(); - } - <% - } - - if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { // conn line style - for (int i = 0; i < columnList.size(); i++) { // column - IMetadataColumn column = columnList.get(i); - if (dynamicPos != i) { - %> - current_<%=cid%>.put("<%=column.getLabel()%>", <%=conn.getName()%>.<%=column.getLabel()%>); - <% - } else { - %> - for (int i = 0; i < <%=conn.getName()%>.<%=column.getLabel()%>.getColumnCount(); i++) { - current_<%=cid%>.put(<%=conn.getName()%>.<%=column.getLabel()%>.getColumnMetadata(i).getName(), - <%=conn.getName()%>.<%=column.getLabel()%>.getColumnValue(i)); - } - <% - } - } // column - %> - - Object data_<%=cid%> = current_<%=cid%>.createIndexedRecord(); - - try { - writer_<%=cid%>.write(data_<%=cid%>); - <% - //pass the main flow - IConnection main = null; - List mains = node.getOutgoingConnections(EConnectionType.FLOW_MAIN); - if(mains!=null && !mains.isEmpty()) { - main = mains.get(0); - %> - <%=main.getName()%> = new <%=main.getName() %>Struct(); - <% - for (IMetadataColumn column : columnList) { - %> - <%=main.getName()%>.<%=column.getLabel()%> = <%=conn.getName()%>.<%=column.getLabel()%>; - <% - } - - //TODO how to pass the additional columns in output connection? like salesforce_id - } - %> - } catch (org.talend.components.api.exception.DataRejectException e_<%=cid%>) { - <% - //pass the reject flow - //the method below can't wrok now, TODO fix it - //List rejects = node.getOutgoingConnections(EConnectionType.REJECT); - - IConnection reject = null; - for(IConnection outConn : node.getOutgoingConnections()) { - if(!outConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { - continue; - } - - if(main!=null && main.getName().equals(outConn.getName())) { - continue; - } - - reject = outConn; - - break; - } - - if(reject!=null) { - Set commonColumns = new HashSet(); - %> - <%=reject.getName()%> = new <%=reject.getName() %>Struct(); - <% - for (IMetadataColumn column : columnList) { - commonColumns.add(column.getLabel()); - %> - <%=reject.getName()%>.<%=column.getLabel()%> = <%=conn.getName()%>.<%=column.getLabel()%>; - <% - } - %> - - java.util.Map info_<%=cid%> = e_<%=cid%>.getRejectInfo(); - - <% - //pass error columns - List rejectColumns = reject.getMetadataTable().getListColumns(); - for(IMetadataColumn column : rejectColumns) { - String columnName = column.getLabel(); - - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - - //error columns - if(!commonColumns.contains(columnName)) { - %> - <%=reject.getName()%>.<%=columnName%> = (<%=typeToGenerate%>)info_<%=cid%>.get("<%=columnName%>"); - <% - } - } - } - %> - } - <% - } // conn line style - } // conn - } // metadata -} // canStart -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_footer.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_footer.javajet deleted file mode 100755 index b1082b8..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_footer.javajet +++ /dev/null @@ -1,343 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.designer.codegen.config.NodesSubTree - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.process.INode - org.talend.core.model.process.IConnection - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.ElementParameterParser - java.util.List - java.util.Iterator - java.util.Vector - org.talend.core.model.process.IProcess - org.talend.core.model.utils.NodeUtil - " - class="SubProcessFooter" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Vector v = (Vector) codeGenArgument.getArgument(); - NodesSubTree subTree = (NodesSubTree) v.get(0); - String finallyPart = v.get(1).toString(); - boolean stat = codeGenArgument.isStatistics(); - IProcess process = subTree.getRootNode().getProcess(); - boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__")); - for(INode node : subTree.getNodes()){ - List metadatas = node.getMetadataList(); - List< ? extends IConnection> conns = node.getOutgoingConnections(); - } - - boolean isParallelize = false; - for(INode node : subTree.getNodes()){ - if(node!=null){ - String parallelize = ElementParameterParser.getValue(node, "__PARALLELIZE__"); - if(parallelize!=null &¶llelize.equals("true")){ - // temporary modification : if tAsyncIn is available, this is always a parallelized process - isParallelize = true; - } - } - } - - List departitionersInCurrentSubTree = new java.util.ArrayList(); - INode startNode = subTree.getRootNode(); - String startNodeId = startNode.getUniqueName(); - - if(startNodeId!=null && startNodeId.startsWith("tCollector")) { - List departitioners = startNode.getProcess().getNodesOfType("tDepartitioner"); - if(departitioners!=null) { - for(INode departitioner : departitioners) { - INode collectorNode = NodeUtil.getSubProcessStartNode(departitioner); - if(collectorNode == startNode) {//in current sub tree - departitionersInCurrentSubTree.add(departitioner); - } - } - } - } - - if(isParallelize){ - %> - - } catch (java.lang.Exception e) { - this.status = "failure"; - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode")); - if (localErrorCode != null) { - if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) { - this.errorCode = localErrorCode; - } - } - pool.setErrorThread(this, new TalendException(e, currentComponent, globalMap)); - //pool.setErrorThread(this,e); - pool.stopAllThreads(); - }finally{ - try{ - <%=finallyPart%> - }catch(java.lang.Exception e){ - //ignore - }catch(java.lang.Error error){ - //ignore - } - resourceMap = null; - } - this.isRunning = false; - - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode")); - String localStatus = (String) (((java.util.Map) threadLocal.get()).get("status")); - if (localErrorCode != null) { - if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) { - this.errorCode = localErrorCode; - } - } - if (!this.status.equals("failure")) { - this.status = localStatus; - } - - pool.getTalendThreadResult().setErrorCode(this.errorCode); - pool.getTalendThreadResult().setStatus(this.status); - }//Run method - }//ParallelThread class - - List buffer = (List) globalMap - .get("PARALLEL_FLOW_BUFFER_<%=(subTree.getName()).replaceAll("tAsyncIn", "tAsyncOut")%>"); - - if (pool.isFull()) { - ParallelThread pt = pool.getFreeThread();// wait for Free Thread - if (pt!= null) { - pt.putBuffer(buffer);// notify the ParallelThread - } - } else { - // Start a new thread - <%=subTree.getName()%>_ParallelThread pt = new <%=subTree.getName()%>_ParallelThread( - globalMap, (Object[]) globalMap - .get("PARALLEL_FLOW_LOCK_<%=(subTree.getName()).replaceAll("tAsyncIn", "tAsyncOut")%>")); - pt.putBuffer(buffer); - pool.execThread(pt); - } - } catch (InterruptedException e) { - e.printStackTrace(); - } catch (java.lang.Exception te) { - throw new TalendException(te, currentComponent, globalMap); - } - <% - }else{ - for(INode departitioner : departitionersInCurrentSubTree) { - String cid = departitioner.getUniqueName(); - String connName = null; - if (departitioner.getIncomingConnections().size() == 1) { - IConnection conn = departitioner.getIncomingConnections().get(0); - connName = conn.getName(); - } - %> - globalMap.put("COMPLETED_<%=cid%>",Boolean.TRUE); - class DepartitionerPoison_<%=cid%> extends <%=connName%>Struct { - } - resourceMap.put("finish_<%=cid%>", true); - - outputQueue_<%=cid%>.put(new DepartitionerPoison_<%=cid%>()); - <%if(isLog4jEnabled){%> - log.info("<%=cid%>[" + Thread.currentThread().getName() + "] - Done."); - <%}%> - <% - } - %> - }//end the resume - - <% - if(subTree.getRootNode().getProcess().getNodesOfType("tFlowMeterCatcher").size() > 0 - && subTree.getRootNode().getProcess().getNodesOfType("tFlowMeter").size() > 0){ - List metterCatchers = (List)subTree.getRootNode().getProcess().getNodesOfType("tFlowMeterCatcher"); - List metters = (List)subTree.getRootNode().getProcess().getNodesOfType("tFlowMeter"); - List nodes = (List)subTree.getNodes(); - - boolean hasMetterProcess = false; - for(INode tmp : nodes){ - for(INode metter : metters){ - if(tmp.getUniqueName().equals(metter.getUniqueName())){ - hasMetterProcess = true; - break; - } - } - if(hasMetterProcess){ - break; - } - } - if(hasMetterProcess){ - for(INode metterCatcher : metterCatchers){ - %> - <%=metterCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - <% - } - } - } - - //this part for "Resume Management" - { - INode firstNode = subTree.getNode(subTree.getName()); - - List beforeSubProcesses = subTree.getBeforeSubProcesses(); - - //System.out.println(firstNode.getUniqueName()); - List outConns = firstNode.getOutgoingConnections(); - - //System.out.println(inConns.size()); - for(IConnection conn : outConns){ - - //boolean activeResume = "true".equals(ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__")); - boolean activeResume = true; - - //System.out.println("Test:" + ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__")); - - String uniqueNameTargetNode = conn.getTarget().getUniqueName(); - - EConnectionType lineStyle = conn.getLineStyle(); - - if(beforeSubProcesses.indexOf(uniqueNameTargetNode) != -1){ - if(activeResume){ - %> - if(resumeEntryMethodName == null || globalResumeTicket){ - resumeUtil.addLog("CHECKPOINT", "CONNECTION:<%=lineStyle.getName() %>:<%=subTree.getName() %>:<%=conn.getName() %><%=conn.getOutputId() > 0 ? conn.getOutputId() : "" %>", "", Thread.currentThread().getId() + "", "", "", "", "", ""); - } - <% - } - if(stat){ - %> - if(execStat){ - runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "ok"); - } - <% - } - %> - <%= uniqueNameTargetNode %>Process(globalMap); - <% - } - } - } - %> - - - - - }catch(java.lang.Exception e){ - <% - if(isLog4jEnabled){ - %> - if(!(e instanceof TalendException)){ - log.fatal(currentComponent + " " + e.getMessage()); - } - <% - } - %> - TalendException te = new TalendException(e, currentComponent, globalMap); - <% - if(NodeUtil.hasVirtualComponent(subTree.getNodes())){ - %> - te.setVirtualComponentName(currentVirtualComponent); - <% - } - - for(INode departitioner : departitionersInCurrentSubTree) { - String cid = departitioner.getUniqueName(); - %> - if(resourceMap.get("finish_<%=cid%>") == null){ - if(resourceMap.get("start_<%=cid%>") != null){ - <%if(isLog4jEnabled){%> - log.error("<%=cid%>[" + Thread.currentThread().getName() + "] - " + e.getMessage()); - <%}%> - globalMap.put("THREADS_HAVE_ERROR", e); - return; - } - } - <% - } - %> - throw te; - }catch(java.lang.Error error){ - <% - if(stat){ - %> - runStat.stopThreadStat(); - <% - } - - for(INode departitioner : departitionersInCurrentSubTree) { - String cid = departitioner.getUniqueName(); - %> - if(resourceMap.get("finish_<%=cid%>") == null){ - if(resourceMap.get("start_<%=cid%>") != null){ - <%if(isLog4jEnabled){%> - log.error("<%=cid%>[" + Thread.currentThread().getName() + "] - " + error.getMessage()); - <%}%> - globalMap.put("THREADS_HAVE_ERROR",error); - return; - } - } - <% - } - %> - throw error; - }finally{ - <% - //generate the code to free memory for lookup link and virtual component buffered datas - List nodes = subTree.getNodes(); - for(INode node:nodes){ - - boolean isVirtualGenerateNode = node.isVirtualGenerateNode(); - - //check the virtual component generate node - if(isVirtualGenerateNode){ - String origin = ElementParameterParser.getValue(node, "__ORIGIN__"); - if(origin != null && !"".equals(origin)){ - %> - //free memory for "<%=node.getUniqueName()%>" - globalMap.remove("<%=origin%>"); - <% - } - }else{ - //check the Lookup link - List lookupInput = node.getIncomingConnections(EConnectionType.FLOW_REF); - if(lookupInput!=null && lookupInput.size()>0){ - //check the tMap like this, instanceof can't work - if(node.getClass().getName().equals("org.talend.designer.mapper.MapperComponent")){ - for(IConnection connection:lookupInput){ - %> - //free memory for "<%=node.getUniqueName()%>" - globalMap.remove("tHash_Lookup_<%=connection.getName()%>"); - <% - } - }else{ - for(IConnection connection:lookupInput){ - %> - //free memory for "<%=node.getUniqueName()%>" - globalMap.remove("tHash_<%=connection.getName()%>"); - <% - } - } - } - } - } - %> - try{ - <%=finallyPart%> - }catch(java.lang.Exception e){ - //ignore - }catch(java.lang.Error error){ - //ignore - } - resourceMap = null; - } - <% - }//isParallelize - %> - - globalMap.put("<%=subTree.getName() %>_SUBPROCESS_STATE", 1); - } - <% - if(subTree.isMethodSizeNeeded()){ - %> - /** - * End of Function: <%=subTree.getName() %>Process - */ - <% - } - %> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_header_java.skeleton b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_header_java.skeleton deleted file mode 100755 index 213968b..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_header_java.skeleton +++ /dev/null @@ -1,100 +0,0 @@ -public class CLASS -{ - // add the list of the connection names to avoid to declare two times the same name. - public String createPrivateClassInstance(INode node, String parentLastRoot, boolean force) { - return createPrivateClassInstance(node, parentLastRoot, force, new HashSet()); - } - - public String createPrivateClassInstance(INode n, String parentLastRoot, boolean force, Set names) { - String toReturn = ""; - // declare root structs (all main outgoing connections) - for (IConnection conn : n.getOutgoingConnections()) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if ((force)||(n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { - // new Instance - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + "Struct " + conn.getName() + " = new " + conn.getName() - + "Struct();\n"; - names.add(conn.getName()); - parentLastRoot = conn.getName(); - } - } else { - // copy - if (!names.contains(conn.getName())) { - toReturn += parentLastRoot + "Struct " + conn.getName() + " = " + parentLastRoot + ";\n"; - names.add(conn.getName()); - } - } - if(!conn.getTarget().getComponent().useMerge()) { - toReturn += createPrivateClassInstance(conn.getTarget(), parentLastRoot, false, names); - } - } else if (conn.getLineStyle().equals(EConnectionType.ITERATE)||conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { - toReturn += createPrivateClassInstance(conn.getTarget(), parentLastRoot, true, names); - } - } - return toReturn; - } - - public String createPriveClassMethodDeclaration(INode n, String parentLastRoot, boolean force, Set names) { - String toReturn = ""; - // declare root structs (all main outgoing connections) - for (IConnection conn : n.getOutgoingConnections()) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if ((force)||(n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { - // new Instance - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + "Struct " + conn.getName() + ","; - names.add(conn.getName()); - parentLastRoot = conn.getName(); - } - } else { - // copy - if (!names.contains(conn.getName())) { - toReturn += parentLastRoot + "Struct " + conn.getName() + ","; - names.add(conn.getName()); - } - } - if(!conn.getTarget().getComponent().useMerge()) { - toReturn += createPriveClassMethodDeclaration(conn.getTarget(), parentLastRoot, false, names); - } - } else if (conn.getLineStyle().equals(EConnectionType.ITERATE)||conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { - toReturn += createPriveClassMethodDeclaration(conn.getTarget(), parentLastRoot, true, names); - } - } - return toReturn; - } - - public String createPrivateClassMethodInstance(INode n, String parentLastRoot, boolean force, Set names) { - String toReturn = ""; - // declare root structs (all main outgoing connections) - for (IConnection conn : n.getOutgoingConnections()) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if ((force) || (n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { - // new Instance - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + ","; - names.add(conn.getName()); - parentLastRoot = conn.getName(); - } - } else { - // copy - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + ","; - names.add(conn.getName()); - } - } - if (!conn.getTarget().getComponent().useMerge()) { - toReturn += createPrivateClassMethodInstance(conn.getTarget(), parentLastRoot, false, names); - } - } else if (conn.getLineStyle().equals(EConnectionType.ITERATE) - || conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { - toReturn += createPrivateClassMethodInstance(conn.getTarget(), parentLastRoot, true, names); - } - } - return toReturn; - } - - public String generate(Object argument) { - return ""; - } -} \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenerator.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenerator.class deleted file mode 100755 index 25494e8..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenerator.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider$1.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider$1.class deleted file mode 100755 index 7788cc6..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider$1.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider.class deleted file mode 100755 index 17c4708..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/ComponentsFactoryProviderManager.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/ComponentsFactoryProviderManager.class deleted file mode 100755 index 9e34693..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/ComponentsFactoryProviderManager.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory.class deleted file mode 100755 index 5a8308a..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/IComponentFactoryFilter.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/IComponentFactoryFilter.class deleted file mode 100755 index 6909cbc..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/IComponentFactoryFilter.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsProvider$1.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsProvider$1.class deleted file mode 100755 index df6c245..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsProvider$1.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsProvider.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsProvider.class deleted file mode 100755 index c2b1452..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsProvider.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2$1.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2$1.class deleted file mode 100755 index 2a58184..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2$1.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage.class deleted file mode 100755 index 7936963..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/IComponentPreferenceConstant.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/IComponentPreferenceConstant.class deleted file mode 100755 index 3a30e70..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/IComponentPreferenceConstant.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/EInternalTemplate.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/EInternalTemplate.class deleted file mode 100755 index 9961d55..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/EInternalTemplate.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TemplateUtil.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TemplateUtil.class deleted file mode 100755 index d142b39..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TemplateUtil.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable.class deleted file mode 100755 index 44e8f80..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory.class deleted file mode 100755 index ee6bb28..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory$1.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory$1.class deleted file mode 100755 index 6c5889a..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory$1.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory$2.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory$2.class deleted file mode 100755 index 4b905ad..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory$2.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory.class b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory.class deleted file mode 100755 index 517650c..0000000 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory.class and /dev/null differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/close_blocks_code.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/close_blocks_code.javajet deleted file mode 100644 index bbc3670..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/close_blocks_code.javajet +++ /dev/null @@ -1,26 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IConnection - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.codegen.config.CloseBlocksCodeArgument - java.util.List - org.talend.core.model.process.BlockCode - " - class="CloseBlocksCode" -%> -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -CloseBlocksCodeArgument closeBlocksCodeArgument = (CloseBlocksCodeArgument)codeGenArgument.getArgument(); - -List blocksCodeList = closeBlocksCodeArgument.getBlocksCodeToClose(); -if(blocksCodeList != null) { - int count = blocksCodeList.size(); - for(int i = 0; i < count; i++) { - %> - - } // <%= blocksCodeList.get(i).getLabel()%> - <% - } -} -%> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_endmain.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_endmain.javajet deleted file mode 100644 index f626319..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_endmain.javajet +++ /dev/null @@ -1,48 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.designer.codegen.config.CodeGeneratorArgument - " - class="ComponentPartEndMain" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - INode node = (INode)codeGenArgument.getArgument(); - String startNodeCid=node.getDesignSubjobStartNode().getUniqueName(); - boolean trace = codeGenArgument.isTrace(); - int pauseTime = codeGenArgument.getPauseTime(); -%> - -<% -if ((trace)&&(node!=null)&&(!node.isThereLinkWithHash())) { -%> - -if(!isChildJob && (Boolean)globalMap.get("ENABLE_TRACES_CONNECTION_<%=startNodeCid%>")){ - if (globalMap.get("USE_CONDITION") != null && (Boolean) globalMap.get("USE_CONDITION")) { - if (globalMap.get("TRACE_CONDITION") != null && (Boolean) globalMap.get("TRACE_CONDITION")) { - // if next breakpoint has been clicked on UI or if start job, should wait action of user. - if (runTrace.isNextBreakpoint()) { - runTrace.waitForUserAction(); - } else if (runTrace.isNextRow()) { - runTrace.waitForUserAction(); - } - } else { - // if next row has been clicked on UI or if start job, should wait action of user. - if (runTrace.isNextRow()) { - runTrace.waitForUserAction(); - } - } - } else { // no condition set - if (runTrace.isNextRow()) { - runTrace.waitForUserAction(); - } else { - Thread.sleep(<%=pauseTime%>); - } - } - -} -globalMap.put("USE_CONDITION",Boolean.FALSE); -<% -} -%> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_footer.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_footer.javajet deleted file mode 100644 index 0f4dbd0..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_footer.javajet +++ /dev/null @@ -1,415 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.core.model.temp.ECodePart - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.IConnection - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.IMetadataColumn - org.talend.core.model.process.EConnectionType - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.codegen.config.NodesSubTree - org.talend.core.model.process.IProcess - org.talend.core.model.utils.NodeUtil - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.metadata.types.JavaType - java.util.Map - java.util.List - java.util.ArrayList - java.util.Set - java.util.HashSet - " - class="ComponentPartFooter" - skeleton="subprocess_header_java.skeleton" -%> -<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/LogUtil.javajet"%> -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -INode node = (INode)codeGenArgument.getArgument(); -log = new LogUtil(node); -IProcess process = node.getProcess(); -String startNodeCid=node.getDesignSubjobStartNode().getUniqueName(); - -NodesSubTree subTree = (NodesSubTree) codeGenArgument.getSubTree(); -ECodePart codePart = codeGenArgument.getCodePart(); -boolean trace = codeGenArgument.isTrace(); -boolean stat = codeGenArgument.isStatistics(); - -boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); - -Set connSet = new HashSet(); -connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MAIN)); -connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MERGE)); - -Set iterateConnSet = new HashSet(); -iterateConnSet.addAll(node.getOutgoingConnections(EConnectionType.ITERATE)); - -List allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections(); - -if((codePart.equals(ECodePart.END))&&(stat)){ - boolean iterateInVFComp = (node.getVirtualLinkTo() != null && node.getVirtualLinkTo() == EConnectionType.ITERATE); - if(iterateInVFComp){ - List needToEndConnNames = new ArrayList(); - INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget(); - NodeUtil.fillConnectionsForStat(needToEndConnNames, nextNode); - %> - if(execStat){ - <% - for(String connName : needToEndConnNames){ - %> - runStat.updateStatOnConnection("<%=connName%>"+iterateId,2, 0); - <% - } - %> - } - <% - } - if(connSet.size()>0){ - for(IConnection con:connSet){ - %> - if(execStat){ - if(resourceMap.get("inIterateVComp") == null || !((Boolean)resourceMap.get("inIterateVComp"))){ - runStat.updateStatOnConnection("<%=con.getUniqueName()%>"+iterateId,2, 0); - } - } - <% - } - } -} -%> - -<% - - if (codePart.equals(ECodePart.MAIN)) { - //================================TDI-17183 start======================================== -/** - if the node is autopropagate the schema, then the output row should evaluate the input row - before the track code part(TDI-17183) -*/ - String inputColName = null; - if (node.getIncomingConnections()!=null) { - for (IConnection incomingConn : node.getIncomingConnections()) { - if (incomingConn.getLineStyle().equals(EConnectionType.FLOW_MAIN)) { - inputColName = incomingConn.getName(); - break; - } - } - } - List metadatas = node.getMetadataList(); - if ((!node.isSubProcessStart())&&(NodeUtil.isDataAutoPropagated(node))) { - if (inputColName!=null) { - if ((metadatas != null) && (metadatas.size() > 0)) { - IMetadataTable outputMetadata = metadatas.get(0); - if (outputMetadata != null) { - for (IConnection outputConnection : node.getOutgoingConnections()) { - if (outputConnection.getLineStyle().equals(EConnectionType.FLOW_MAIN) || outputConnection.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - - //void the case: row1.username=row1.username - if(!outputConnection.getName().equals(inputColName)){//111 - //void the case: row1Struct row1 = new row1Struct(); row1Struct row3 = row1; - //for (IMetadataColumn column : outputMetadata.getListColumns()) { - %> - <%=outputConnection.getName() %> = <%=inputColName %>; - <% - //} - }//111 - - } - } - } - } - } - } -//======================================TDI-17183 end===================================== - boolean traceCodeGenerated = false; - for (IConnection conn : node.getOutgoingConnections()) { - boolean use_reaceenble = ("true").equals(ElementParameterParser.getValue(conn, "__TRACES_CONNECTION_ENABLE__")); - if(node.isSubProcessStart() && node.isSubProcessContainTraceBreakpoint() && !traceCodeGenerated) { - traceCodeGenerated = true; - %> - globalMap.put("USE_CONDITION",Boolean.TRUE); - globalMap.put("TRACE_CONDITION", Boolean.FALSE); - <% - } - IMetadataTable metadata = conn.getMetadataTable(); - if (metadata!=null) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || - conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if (trace && use_reaceenble) { - %> - - if (<%=conn.getName() %> !=null) { - globalMap.put("ENABLE_TRACES_CONNECTION_<%=startNodeCid%>",Boolean.TRUE); - if (runTrace.isPause()) { - while (runTrace.isPause()) { - Thread.sleep(100); - } - } else { - - // here we dump the line content for trace purpose - java.util.LinkedHashMap runTraceData = new java.util.LinkedHashMap(); - <% - for(IMetadataColumn column : metadata.getListColumns()){ - %> - runTraceData.put("<%=column.getLabel()%>", String.valueOf(<%=conn.getName()%>.<%=column.getLabel()%>)); - <% - } - %> - runTrace.sendTrace("<%=conn.getName()%>","<%=startNodeCid%>", runTraceData); - } - <% - - boolean use_breakout = ("true").equals(ElementParameterParser.getValue(conn, "__ACTIVEBREAKPOINT__")); - boolean use_advanced = ("true").equals(ElementParameterParser.getValue(conn, "__USE_ADVANCED__")); - List> keyColumns = (List>)ElementParameterParser.getObjectValue( conn, "__CONDITIONS__"); - String advancedCondition = ElementParameterParser.getValue(conn, "__ADVANCED_COND__"); - String logical = ElementParameterParser.getValue(conn,"__LOGICAL_OP__"); - if (metadata != null) { - if(use_breakout && use_reaceenble){%> - if ( - <% - if ((keyColumns!=null &&keyColumns.size() > 0)|| use_advanced) { //111 - int ii = 0; - - for (Map keyColumn : keyColumns){ // 222 -> - ii++; - %> - <%= ii == 1 ? "" : logical %>( - <% - if (!("").equals(keyColumn.get("FUNCTION"))) { - %> - <%=keyColumn.get("FUNCTION").replace("$source", conn.getName() + "." + keyColumn.get("INPUT_COLUMN")).replace("$target", keyColumn.get("RVALUE")).replace("$operator", keyColumn.get("OPERATOR")) %> - <% - }else { - IMetadataColumn rightColumn = metadata.getColumn(keyColumn.get("INPUT_COLUMN")); - JavaType javaType = JavaTypesManager.getJavaTypeFromId(rightColumn.getTalendType()); - - if (!javaType.isPrimitive()) { - //this is only for bug:8133, when "Oject" type, and "Empty" function, and compare with "null" - if (keyColumn.get("RVALUE") != null && keyColumn.get("RVALUE").equals("null")){ - %> - <%="$source $operator $target".replace("$source", conn.getName() + "." + keyColumn.get("INPUT_COLUMN")).replace("$target", keyColumn.get("RVALUE")).replace("$operator", keyColumn.get("OPERATOR")) %> - <%}else{%> - <%="$source == null? false : $source.compareTo($target) $operator 0".replace("$source", conn.getName() + "." + keyColumn.get("INPUT_COLUMN")).replace("$target", keyColumn.get("RVALUE")).replace("$operator", keyColumn.get("OPERATOR")) %> - <% - } - } else { - %> - <%="$source $operator $target".replace("$source", conn.getName() + "." + keyColumn.get("INPUT_COLUMN")).replace("$target", keyColumn.get("RVALUE")).replace("$operator", keyColumn.get("OPERATOR")) %> - <% - } - } - - %> - ) - <% - } // <- 222 - %> - <%=use_advanced? (keyColumns.size() < 1 ? "" : logical) + advancedCondition.replace("input_row", conn.getName()) : ""%> - <% - } else { //111 - %> - true - <% - } //111 - %> - ){ - globalMap.put("TRACE_CONDITION", Boolean.TRUE); - } -<% - } -%> - } -<% - } - } - } - } - } - - } - if (codePart.equals(ECodePart.END)) { - log.endWork(); -%> - -ok_Hash.put("<%=node.getUniqueName() %>", true); -end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis()); - -<% - String statCatcher = ElementParameterParser.getValue(node,"__TSTATCATCHER_STATS__"); - if ((node.getProcess().getNodesOfType("tStatCatcher").size() > 0) & (statCatcher.equals("true"))) { - for (INode statCatcherNode : node.getProcess().getNodesOfType("tStatCatcher")) { -%> -<%=statCatcherNode.getUniqueName() %>.addMessage("end","<%=node.getUniqueName() %>", end_Hash.get("<%=node.getUniqueName() %>")-start_Hash.get("<%=node.getUniqueName() %>")); -<%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); -<% - } - } - - for (IConnection outgoingConn : node.getOutgoingConnections()) { - if (outgoingConn.getTarget().isActivate()) { - - - if (outgoingConn.getLineStyle().equals(EConnectionType.ON_COMPONENT_OK)) { - //send the ok status to socket - if(stat){ -%> - if(execStat){ - runStat.updateStatOnConnection("<%=outgoingConn.getUniqueName() %>", 0, "ok"); - } -<% - } - - - /* - This boolean is created for the ON_COMPONENT_OK virtual components. - This technic is used on the tWriteXMLField for example. Since the sub method is called in the Thread, we do not have to generate again in the component footer. - */ - boolean generateMethodCall = false; - if((!node.isVirtualGenerateNode())) { - generateMethodCall = true; - } else { - if(node.getVirtualLinkTo()==null || node.getVirtualLinkTo()!=EConnectionType.ON_COMPONENT_OK) { - generateMethodCall = true; - } - // Else, that means the component is a ON_COMPONENT_OK virtual component typed. - } - - if(generateMethodCall) { -%> - <%=outgoingConn.getTarget().getUniqueName() %>Process(globalMap); -<% - } - } - - - if (outgoingConn.getLineStyle().equals(EConnectionType.RUN_IF)) { - %> - if (<%=outgoingConn.getCondition() %>) { - <%//send the true status to socket - if(stat){ - %> - if(execStat){ - runStat.updateStatOnConnection("<%=outgoingConn.getUniqueName() %>", 0, "true"); - } - <%}%> - <%=outgoingConn.getTarget().getUniqueName() %>Process(globalMap); - } - - <% - //send the false status to socket - if(stat){ - %> - else{ - if(execStat){ - runStat.updateStatOnConnection("<%=outgoingConn.getUniqueName() %>", 0, "false"); - } - } -<% - } - } - } - } - } -%> - -<% - //This part in order to feedback with the iterate_subprocess_header.javajet and iterate_subprocess_footer.javajet - - boolean parallelIterate = false; - for (IConnection iterateConn : iterateConnSet) { - parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__")); - if (parallelIterate) { - if (codePart.equals(ECodePart.END)) { - String iterateTargetNodeName = iterateConn.getTarget().getUniqueName(); -%> - mtp_<%=iterateTargetNodeName %>.waitForEndOfQueue(); - - TalendThread errorThread_<%=iterateTargetNodeName %> = mtp_<%=iterateTargetNodeName %>.getErrorThread(); - -<%if(!isRunInMultiThread){%> - if(errorThread_<%=iterateTargetNodeName %> != null) { - if (errorThread_<%=iterateTargetNodeName %>.errorCode != null) { - if (errorCode == null - || errorThread_<%=iterateTargetNodeName %>.errorCode.compareTo(errorCode) > 0) { - errorCode = errorThread_<%=iterateTargetNodeName %>.errorCode; - } - } - if (!status.equals("failure")) { - status = errorThread_<%=iterateTargetNodeName %>.status; - } - if(errorThread_<%=iterateTargetNodeName %>.exception!=null){ - throw errorThread_<%=iterateTargetNodeName %>.exception; - } - if(errorThread_<%=iterateTargetNodeName %>.error!=null){ - throw errorThread_<%=iterateTargetNodeName %>.error; - } - }else{ - Integer threadErrorCode = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getErrorCode(); - String threadStatus = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getStatus(); - - if (threadErrorCode != null) { - if (errorCode == null - || threadErrorCode.compareTo(errorCode) > 0) { - errorCode = threadErrorCode; - } - } - if (!status.equals("failure")) { - status = threadStatus; - } - } -<%}else{%> - if(errorThread_<%=iterateTargetNodeName %> != null) { - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode")); - String localStatus = (String) (((java.util.Map) threadLocal.get()).get("status")); - - if (errorThread_<%=iterateTargetNodeName %>.errorCode != null) { - if (localErrorCode == null || errorThread_<%=iterateTargetNodeName %>.errorCode.compareTo(localErrorCode) > 0) { - ((java.util.Map) threadLocal.get()).put("errorCode", errorThread_<%=iterateTargetNodeName %>.errorCode); - } - } - if (!localStatus.equals("failure")) { - ((java.util.Map) threadLocal.get()).put("status", errorThread_<%=iterateTargetNodeName %>.status); - } - if(errorThread_<%=iterateTargetNodeName %>.exception!=null){ - throw errorThread_<%=iterateTargetNodeName %>.exception; - } - }else{ - Integer threadErrorCode = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getErrorCode(); - String threadStatus = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getStatus(); - - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal - .get()).get("errorCode")); - String localStatus = (String) (((java.util.Map) threadLocal - .get()).get("status")); - - if (threadErrorCode != null) { - if (localErrorCode == null - || threadErrorCode.compareTo(localErrorCode) > 0) { - ((java.util.Map) threadLocal.get()).put("errorCode", - threadErrorCode); - } - } - if (!localStatus.equals("failure")) { - ((java.util.Map) threadLocal.get()).put("status", - threadStatus); - } - } -<%}%> - - -<% - } - continue; - } - } -%> - -<%if(codePart.equals(ECodePart.MAIN)){ %> - tos_count_<%=node.getUniqueName() %>++; -<%}%> - -/** - * [<%=node.getUniqueName() %> <%=codePart %> ] stop - */ \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_header.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_header.javajet deleted file mode 100644 index 22c32d3..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/component_part_header.javajet +++ /dev/null @@ -1,258 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.core.model.temp.ECodePart - org.talend.core.model.process.IConnection - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.ElementParameterParser - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.utils.NodeUtil - org.talend.core.model.process.IConnectionCategory - java.util.List - java.util.ArrayList - java.util.Set - java.util.HashSet - java.util.Iterator - " - class="ComponentPartHeader" -%> -<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/LogUtil.javajet"%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - INode node = (INode)codeGenArgument.getArgument(); - log = new LogUtil(node); - boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); - boolean containsTPartitioner = node.getProcess().getNodesOfType("tPartitioner").size() > 0 ? true : false; - String startNodeCid=node.getDesignSubjobStartNode().getUniqueName(); - ECodePart codePart = codeGenArgument.getCodePart(); - boolean trace = codeGenArgument.isTrace(); - boolean stat = codeGenArgument.isStatistics(); - Set connSet = new HashSet(); - connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MAIN)); - connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MERGE)); - String incomingName = codeGenArgument.getIncomingName(); - - Set iterateConnSet = new HashSet(); - iterateConnSet.addAll(node.getOutgoingConnections(EConnectionType.ITERATE)); - - List allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections(); -%> - - /** - * [<%=node.getUniqueName() %> <%=codePart %> ] start - */ - - <% - //This part in order to feedback with the iterate_subprocess_header.javajet and iterate_subprocess_footer.javajet - - if (codePart.equals(ECodePart.BEGIN)) { - boolean parallelIterate = false; - boolean hasParallelIterate = false; - for (IConnection iterateConn : iterateConnSet) { - parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__")); - String iterateNodeName = iterateConn.getTarget().getUniqueName(); - if (parallelIterate) { - %> - TalendThreadPool mtp_<%=iterateConn.getTarget().getUniqueName() %> = new TalendThreadPool(<%=ElementParameterParser.getValue(iterateConn,"__NUMBER_PARALLEL__") %>); - - globalMap.put("lockWrite_<%=iterateNodeName%>", new Object[0]); - int threadIdCounter_<%=iterateNodeName%> =0; - <% - } - %> - int NB_ITERATE_<%=iterateNodeName %> = 0; //for statistics - <% - continue; - } - } - %> - - <% - if (codePart.equals(ECodePart.BEGIN)) { - %> - <% - if(trace){ - %> - globalMap.put("ENABLE_TRACES_CONNECTION_<%=startNodeCid%>",Boolean.FALSE); - <% - } - %> - ok_Hash.put("<%=node.getUniqueName() %>", false); - start_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis()); - <% - String statCatcher = ElementParameterParser.getValue(node,"__TSTATCATCHER_STATS__"); - if ((node.getProcess().getNodesOfType("tStatCatcher").size() > 0) && (statCatcher.equals("true"))) { - for (INode statCatcherNode : node.getProcess().getNodesOfType("tStatCatcher")) { - %> - <%=statCatcherNode.getUniqueName() %>.addMessage("begin","<%=node.getUniqueName() %>"); - <%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - <% - } - } - } - if(codePart.equals(ECodePart.MAIN)) { - List meterCatchers = (List)node.getProcess().getNodesOfType("tFlowMeterCatcher"); - if ((node.getProcess().getNodesOfType("tFlowMeter").size() > 0)){ - for(IConnection temp_conn : node.getIncomingConnections(EConnectionType.FLOW_MAIN)){ - String name_conn = temp_conn.getUniqueName(); - if(temp_conn.isUseByMetter()){ - %> - <% - if (meterCatchers != null) { - for (INode meterCatcher : meterCatchers) { - %> - <%=meterCatcher.getUniqueName() %>.addLineToRow("<%=name_conn%>_count"); - <% - } - } - } - } - - for(IConnection temp_conn : node.getIncomingConnections(EConnectionType.FLOW_MERGE)){ - String name_conn = temp_conn.getUniqueName(); - if(name_conn == incomingName && temp_conn.isUseByMetter()){ - if (meterCatchers != null) { - for (INode meterCatcher : meterCatchers) { - %> - <%=meterCatcher.getUniqueName() %>.addLineToRow("<%=name_conn%>_count"); - <% - } - } - } - } - } - } - %> - <% - if(node.isVirtualGenerateNode()){ - %> - currentVirtualComponent = "<%=NodeUtil.getVirtualUniqueName(node)%>"; - <% - } - %> - currentComponent="<%=node.getUniqueName() %>"; - - <% - connSet = new HashSet(); - connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MAIN)); - connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MERGE)); - - if ((codePart.equals(ECodePart.BEGIN))&&(stat)&&connSet.size()>0) { - for(IConnection con:connSet){ - %> - if (execStat) { - if(resourceMap.get("inIterateVComp") == null){ - <%if(containsTPartitioner){%> - java.util.concurrent.ConcurrentHashMap concurrentHashMap_<%=con.getUniqueName() %> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap"); - concurrentHashMap_<%=con.getUniqueName() %>.putIfAbsent("<%=con.getUniqueName() %>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0)); - java.util.concurrent.atomic.AtomicInteger stats_<%=con.getUniqueName() %> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=con.getUniqueName() %>.get("<%=con.getUniqueName() %>" + iterateLoop); - runStat.updateStatOnConnection("<%=con.getUniqueName() %>" + iterateId, stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1, 0); - <%}else{%> - runStat.updateStatOnConnection("<%=con.getUniqueName() %>" + iterateId, 0, 0); - <%}%> - } - } - - <% - } - } - - if((codePart.equals(ECodePart.MAIN))&&(stat)&&connSet.size()>0){ - for(IConnection con:connSet){ - %> - - //<%=con.getUniqueName()%> - //<%=(String)codeGenArgument.getIncomingName()%> - - - <%if (!node.getComponent().useMerge()) {%> - if(execStat){ - runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1); - } - <% - } else if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){ - %> - if(execStat){ - runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1); - } - <%}%> - - <% - } - } - Set connSetForLog = new HashSet(); - connSetForLog.addAll(node.getIncomingConnections(EConnectionType.FLOW_MAIN)); - connSetForLog.addAll(node.getIncomingConnections(EConnectionType.FLOW_MERGE)); - if((codePart.equals(ECodePart.MAIN)) && isLog4jEnabled && connSetForLog.size()>0){ - if(!(node.isVirtualGenerateNode() && node.getVirtualLinkTo()==null)){//ignore the connector in virtual component - for(IConnection con:connSetForLog){ - %> - if(log.isTraceEnabled()){ - log.trace("<%=con.getUniqueName()%> - " + (<%=con.getName()%>==null? "": <%=con.getName()%>.toLogString())); - } - <% - } - } - } - if(codePart.equals(ECodePart.BEGIN)){ - %> - int tos_count_<%=node.getUniqueName() %> = 0; - <% - log.startWork(); - log.logCompSetting(); - } - if(stat){ - boolean iterateInVFComp = (node.getVirtualLinkTo() != null && node.getVirtualLinkTo() == EConnectionType.ITERATE); - if(iterateInVFComp){ - if(codePart.equals(ECodePart.BEGIN)){ - List needToStartConnNames = new ArrayList(); - INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget(); - NodeUtil.fillConnectionsForStat(needToStartConnNames, nextNode); - %> - if(execStat){ - <% - for(String connName : needToStartConnNames){ - %> - <%if(containsTPartitioner){%> - java.util.concurrent.ConcurrentHashMap concurrentHashMap_<%=connName%> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap"); - concurrentHashMap_<%=connName%>.putIfAbsent("<%=connName%>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0)); - java.util.concurrent.atomic.AtomicInteger stats_<%=connName%> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=connName%>.get("<%=connName%>" + iterateLoop); - runStat.updateStatOnConnection("<%=connName%>" + iterateId, stats_<%=connName%>.incrementAndGet()<=1?0:1, 0); - <%}else{%> - runStat.updateStatOnConnection("<%=connName%>" + iterateId, 0, 0); - <%}%> - <% - } - %> - } - <% - }else if(codePart.equals(ECodePart.MAIN)){ - %> - resourceMap.put("inIterateVComp", true); - <% - }else if(codePart.equals(ECodePart.END)){ - %> - resourceMap.remove("inIterateVComp"); - <% - } - }else{ - IConnection preIterate = (node.getIncomingConnections(EConnectionType.ITERATE) != null && node.getIncomingConnections(EConnectionType.ITERATE).size() == 1) ? node.getIncomingConnections(EConnectionType.ITERATE).get(0) : null; - if(preIterate != null){ - boolean iterateInVSComp = (preIterate.getSource().getVirtualLinkTo() != null && preIterate.getSource().getVirtualLinkTo() == EConnectionType.ITERATE); - if(iterateInVSComp){ - if(codePart.equals(ECodePart.BEGIN)){ - %> - resourceMap.remove("inIterateVComp"); - <% - }else if(codePart.equals(ECodePart.END)){ - %> - resourceMap.put("inIterateVComp", true); - <% - } - } - } - } - } - %> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/context.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/context.javajet deleted file mode 100644 index 1e0fe69..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/context.javajet +++ /dev/null @@ -1,26 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IContextParameter - org.talend.designer.codegen.config.CodeGeneratorArgument - java.util.List - java.util.Properties - java.io.ByteArrayOutputStream - org.talend.core.model.utils.TalendTextUtils - org.talend.core.model.utils.ContextOrderProperties - " - class="Context" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - List parameterList = (List) codeGenArgument.getArgument(); - ContextOrderProperties contextProperty = new ContextOrderProperties(parameterList); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try { - contextProperty.store(baos, "this is context properties"); - } catch (java.lang.Exception e) { - e.printStackTrace(); - } -%> -<%=baos %> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/default_template.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/default_template.javajet deleted file mode 100644 index dc6f07a..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/default_template.javajet +++ /dev/null @@ -1,28 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.temp.ECodePart - " - class="Default_template" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Object object = codeGenArgument.getArgument(); - - //This is only for the component, when it compile error, there will call this template file to generate. - //If the files in /resources compile error, ignore them. - if(object instanceof INode) { - - INode node = (INode)codeGenArgument.getArgument(); - String cid = node.getUniqueName(); - ECodePart codePart = codeGenArgument.getCodePart(); - String part = codePart.getName(); -%> - -The <%=part %> part of <%=cid %> compile with error, it can't generate any code, please check and correct it. - -<% - } -%> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer.javajet deleted file mode 100644 index 4a0a9b3..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer.javajet +++ /dev/null @@ -1,1348 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IProcess - org.talend.core.model.process.INode - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.CorePlugin - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.IConnection - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.IMetadataColumn - java.util.Vector - java.util.List - java.util.ArrayList - org.talend.core.model.process.IContextParameter - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.metadata.types.JavaType - org.talend.core.model.utils.JavaResourcesHelper - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.IContext - org.talend.core.model.process.ProcessUtils - " - class="Footer" - skeleton="footer_java.skeleton" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Vector v = (Vector) codeGenArgument.getArgument(); - IProcess process = (IProcess)v.get(0); - String className = process.getName(); - boolean isTestContainer=ProcessUtils.isTestContainer(process); - if (isTestContainer) { - className = className + "Test"; - } - - List rootNodes = (List)v.get(1); - boolean containsTPartitioner = process.getNodesOfType("tPartitioner").size() > 0 ? true : false; - boolean stats = codeGenArgument.isStatistics(); - boolean trace = codeGenArgument.isTrace(); - boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); - List params = new ArrayList(); - params=process.getContextManager().getDefaultContext().getContextParameterList(); - - String jobFolderName = ""; - IProcess baseProcess = ProcessUtils.getTestContainerBaseProcess(process); - if (baseProcess != null) { - jobFolderName = JavaResourcesHelper.getJobFolderName(baseProcess.getName(), baseProcess.getVersion()) + '/'; - } - jobFolderName = jobFolderName + JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion()); - String jobClassPackageFolder = codeGenArgument.getCurrentProjectName().toLowerCase() + '/' + jobFolderName; - - boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__")); - - boolean exist_tParallelize = false; - List tParallelizeList = process.getNodesOfType("tParallelize"); - if(tParallelizeList != null && tParallelizeList.size() > 0){ - exist_tParallelize = true; - } - - boolean exist_tMOM = false; - List momComponentsList = (List)process.getNodesOfType("tMomConnection"); - momComponentsList.addAll((List)process.getNodesOfType("tMomInput")); - momComponentsList.addAll((List)process.getNodesOfType("tMomOutput")); - if (momComponentsList.size() > 0) { - exist_tMOM = true; - } - - String[] sqlDbComponents = new String[] { - "tAccessConnection", - "tAmazonMysqlConnection", - "tAmazonOracleConnection", - "tAS400Connection", - "tDB2Connection", - "tFirebirdConnection", - "tGreenplumConnection", - "tHiveConnection", - "tInformixConnection", - "tIngresConnection", - "tInterbaseConnection", - "tJDBCConnection", - "tMSSqlConnection", - "tMysqlConnection", - "tNetezzaConnection", - "tOracleConnection", - "tParAccelConnection", - "tPostgresPlusConnection", - "tPostgresqlConnection", - "tRedshiftConnection", - "tSQLiteConnection", - "tSybaseConnection", - "tTeradataConnection", - "tVectorWiseConnection", - "tVerticaConnection" - }; - boolean exist_tSQLDB = false; - List sqlDbComponentsList = new ArrayList(); - for (String sqlDbComponent : sqlDbComponents) { - sqlDbComponentsList.addAll((List)process.getNodesOfType(sqlDbComponent)); - } - if (sqlDbComponentsList.size() > 0) { - exist_tSQLDB = true; - } - - boolean exist_tSCP = false; - List scpComponentsList = (List)process.getNodesOfType("tSCPConnection"); - if (scpComponentsList.size() > 0) { - exist_tSCP = true; - } - - boolean exist_tCassandra = false; - List cassandraComponentsList = (List)process.getNodesOfType("tCassandraConnection"); - if (cassandraComponentsList.size() > 0) { - exist_tCassandra = true; - } - boolean exist_tHBase = false; - List hbaseComponentsList = (List)process.getNodesOfType("tHBaseConnection"); - if (hbaseComponentsList.size() > 0) { - exist_tHBase = true; - } - - boolean exist_tFtp = false; - List ftpComponentsList = (List)process.getNodesOfType("tFTPConnection"); - if (ftpComponentsList.size() > 0) { - exist_tFtp = true; - } - - boolean exist_tS3 = false; - List s3ComponentsList = (List)process.getNodesOfType("tS3Connection"); - if (s3ComponentsList.size() > 0) { - exist_tS3 = true; - } - - boolean exist_tLDAP = false; - List ldapComponentsList = (List)process.getNodesOfType("tLDAPConnection"); - if (ldapComponentsList.size() > 0) { - exist_tLDAP = true; - } - - boolean exist_tMDM = false; - List mdmComponentsList = (List)process.getNodesOfType("tMDMConnection"); - if (mdmComponentsList.size() > 0) { - exist_tMDM = true; - } - - boolean exist_tPalo = false; - List paloComponentsList = (List)process.getNodesOfType("tPaloConnection"); - if (paloComponentsList.size() > 0) { - exist_tPalo = true; - } - - boolean exist_tEXist= false; - List existComponentsList = (List)process.getNodesOfType("tEXistConnection"); - if (existComponentsList.size() > 0) { - exist_tEXist = true; - } - - boolean exist_tSalesforce= false; - List salesforceComponentsList = (List)process.getNodesOfType("tSalesforceConnection"); - if (salesforceComponentsList.size() > 0) { - exist_tSalesforce = true; - } - - boolean exist_tSAP= false; - List sapComponentsList = (List)process.getNodesOfType("tSAPConnection"); - if (sapComponentsList.size() > 0) { - exist_tSAP = true; - } - - boolean exist_tGS= false; - List gsComponentsList = (List)process.getNodesOfType("tGSConnection"); - if (gsComponentsList.size() > 0) { - exist_tGS = true; - } - - boolean hasSAM4RS = false; - for (INode node : process.getNodesOfType("tRESTClient")) { - if (Boolean.valueOf(ElementParameterParser.getValue(node, "__SERVICE_ACTIVITY_MONITOR__"))) { - hasSAM4RS = true; - break; - } - } - boolean hasSAM4WS = false; - for (INode node : process.getNodesOfType("tESBConsumer")) { - if (Boolean.valueOf(ElementParameterParser.getValue(node, "__SERVICE_ACTIVITY_MONITOR__"))) { - hasSAM4WS = true; - break; - } - } - class API_selector{ - public boolean useDatastax(INode node){ - String dbVersion = ElementParameterParser.getValue(node, "__DB_VERSION__"); - String apiType = ElementParameterParser.getValue(node, "__API_TYPE__"); - return "CASSANDRA_2_2".equals(dbVersion) || "CASSANDRA_3_0".equals(dbVersion) || ("CASSANDRA_2_0_0".equals(dbVersion) && "DATASTAX".equals(apiType)); - } - } -%> - public String resuming_logs_dir_path = null; - public String resuming_checkpoint_path = null; - public String parent_part_launcher = null; - private String resumeEntryMethodName = null; - private boolean globalResumeTicket = false; - - public boolean watch = false; - // portStats is null, it means don't execute the statistics - public Integer portStats = null; - public int portTraces = 4334; - public String clientHost; - public String defaultClientHost = "localhost"; - public String contextStr = "<%=codeGenArgument.getContextName() %>"; - public boolean isDefaultContext = true; - public String pid = "0"; - public String rootPid = null; - public String fatherPid = null; - public String fatherNode = null; - public long startTime = 0; - public boolean isChildJob = false; - public String log4jLevel = ""; - - private boolean execStat = true; - - private ThreadLocal> threadLocal = new ThreadLocal>() { - protected java.util.Map initialValue() { - java.util.Map threadRunResultMap = new java.util.HashMap(); - threadRunResultMap.put("errorCode", null); - threadRunResultMap.put("status", ""); - return threadRunResultMap; - }; - }; - -<% if (hasSAM4RS) { %> - // ESB Service Activity Monitor Feature - private org.apache.cxf.feature.Feature eventFeature; - - public void setEventFeature(org.apache.cxf.feature.Feature eventFeature) { - this.eventFeature = eventFeature; - } -<% } %> - -<% - if(isRunInMultiThread || exist_tParallelize){ -%> - private SyncInt runningThreadCount =new SyncInt(); - - private class SyncInt - { - private int count = 0; - public synchronized void add(int i) - { - count +=i; - } - - public synchronized int getCount() - { - return count; - } - } -<% - } -%> - - private java.util.Properties context_param = new java.util.Properties(); - public java.util.Map parentContextMap = new java.util.HashMap(); - - public String status= ""; - - public static void main(String[] args){ - final <%=className %> <%=className %>Class = new <%=className %>(); - - int exitCode = <%=className %>Class.runJobInTOS(args); - <%if(isLog4jEnabled){%> - if(exitCode==0){ - log.info("TalendJob: '<%=codeGenArgument.getJobName()%>' - Done."); - } - <%}%> - - System.exit(exitCode); - } - - <% - if (isTestContainer) { - List instanceList = ProcessUtils.getTestInstances(process); - String encoding = System.getProperty("file.encoding"); - for(String instance : instanceList) - { - String context = ProcessUtils.getInstanceContext(process,instance); - %> - @Test - public void test<%=instance%>() throws java.lang.Exception{ - <% - int assertNum = ProcessUtils.getAssertAmount(process); - %> - if(<%=assertNum%><=0){ - throw new java.lang.Exception("There is no tAssert in your test case!"); - } - junitGlobalMap.put("tests.log",new String()); - junitGlobalMap.put("tests.nbFailure",new Integer(0)); - final <%=className %> <%=className %>Class = new <%=className %>(); - java.util.List paraList_<%=instance%> = new java.util.ArrayList(); - paraList_<%=instance%>.add("--context=<%=context%>"); - <% - for(String testData : ProcessUtils.getTestData(process,instance)){ - String path = ProcessUtils.getTestDataValue(process, instance, testData); - if(path!=null&&path.length()>0){ - %> - - String instance_<%=testData%>=null; - <% - if(ProcessUtils.isSpark(process)){ - String lineSeparator = (String) java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction("line.separator")); - String fileContentEnCodeStr = ""; - try { - fileContentEnCodeStr = (new sun.misc.BASE64Encoder()).encode(path.getBytes("UTF-8")); - } catch (java.io.UnsupportedEncodingException e) { - e.printStackTrace(); - } - StringBuilder result = new StringBuilder(); - String[] arrayStr = fileContentEnCodeStr.split(lineSeparator); - for(String item : arrayStr){ - result.append(item); - } - String testDataValue = result.toString(); - %> - try { - instance_<%=testData%> = new String((new sun.misc.BASE64Decoder()).decodeBuffer("<%=testDataValue%>"), utf8Charset); - } catch (java.lang.Exception e) { - e.printStackTrace(); - } - - <% - }else{ - %> - java.net.URL url_<%=testData%> = getClass().getResource("<%=path%>"); - instance_<%=testData%>="<%=testData%>=" + java.net.URLDecoder.decode(url_<%=testData%>.getPath(), "<%=encoding%>"); - <% - } - %> - paraList_<%=instance%>.add("--context_param"); - paraList_<%=instance%>.add(instance_<%=testData%>); - <% - } - - } - %> - String[] arrays = new String[paraList_<%=instance%>.size()]; - for(int i=0;i.size();i++){ - arrays[i] = (String)paraList_<%=instance%>.get(i); - } - <%=className %>Class.runJobInTOS(arrays); - - String errors = (String)junitGlobalMap.get("tests.log"); - Integer nbFailure = (Integer)junitGlobalMap.get("tests.nbFailure"); - assertTrue("Failure="+nbFailure+java.lang.System.getProperty("line.separator")+errors, errors.isEmpty()); - - if(<%=className %>Class.exception!=null){ - throw <%=className %>Class.exception; - } - } - <% - } - } - %> - - public String[][] runJob(String[] args) { - - int exitCode = runJobInTOS(args); - <% - List tBufferNodes = (List)process.getNodesOfType("tBufferOutput"); - if(tBufferNodes != null && tBufferNodes.size() > 0) { - %> - String[][] bufferValue = (String[][])globalBuffer.toArray(new String[globalBuffer.size()][]); - <% - } else { - %> - String[][] bufferValue = new String[][] { { Integer.toString(exitCode) } }; - <% - } - %> - - return bufferValue; - } - - public boolean hastBufferOutputComponent() { - boolean hastBufferOutput = false; - <%//For TDI-28558 - List tBufferNodesList = (List)process.getNodesOfType("tBufferOutput"); - if(tBufferNodesList != null && tBufferNodesList.size() > 0) { - %> - hastBufferOutput = true; - <% - } - %> - return hastBufferOutput; - } - - public int runJobInTOS(String[] args) { - // reset status - status = ""; - - String lastStr = ""; - for (String arg : args) { - if (arg.equalsIgnoreCase("--context_param")) { - lastStr = arg; - } else if (lastStr.equals("")) { - evalParam(arg); - } else { - evalParam(lastStr + " " + arg); - lastStr = ""; - } - } - - <%if(isLog4jEnabled){%> - if(!"".equals(log4jLevel)){ - if("trace".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.TRACE); - }else if("debug".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.DEBUG); - }else if("info".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.INFO); - }else if("warn".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.WARN); - }else if("error".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.ERROR); - }else if("fatal".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.FATAL); - }else if ("off".equalsIgnoreCase(log4jLevel)){ - log.setLevel(org.apache.log4j.Level.OFF); - } - org.apache.log4j.Logger.getRootLogger().setLevel(log.getLevel()); - } - log.info("TalendJob: '<%=codeGenArgument.getJobName()%>' - Start."); - <%}%> - - if(clientHost == null) { - clientHost = defaultClientHost; - } - - if(pid == null || "0".equals(pid)) { - pid = TalendString.getAsciiRandomString(6); - } - - if (rootPid==null) { - rootPid = pid; - } - if (fatherPid==null) { - fatherPid = pid; - }else{ - isChildJob = true; - } - -<% - if (stats) { -%> - if (portStats != null) { - // portStats = -1; //for testing - if (portStats < 0 || portStats > 65535) { - // issue:10869, the portStats is invalid, so this client socket can't open - System.err.println("The statistics socket port " + portStats + " is invalid."); - execStat = false; - } - } else { - execStat = false; - } -<% - } -%> - - try { - //call job/subjob with an existing context, like: --context=production. if without this parameter, there will use the default context instead. - java.io.InputStream inContext = <%=className%>.class.getClassLoader().getResourceAsStream("<%=jobClassPackageFolder%>/contexts/"+contextStr+".properties"); - if(isDefaultContext && inContext ==null) { - - } else { - if (inContext!=null) { - //defaultProps is in order to keep the original context value - defaultProps.load(inContext); - inContext.close(); - context = new ContextProperties(defaultProps); - }else{ - //print info and job continue to run, for case: context_param is not empty. - System.err.println("Could not find the context " + contextStr); - } - } - - if(!context_param.isEmpty()) { - context.putAll(context_param); - } - <% for (IContextParameter ctxParam :params) - { - if (ctxParam.getType().equals("id_Password")) { - %> - String pwd_<%=ctxParam.getName()%>_value = context.getProperty("<%=ctxParam.getName()%>"); - context.<%=ctxParam.getName()%> = null; - if(pwd_<%=ctxParam.getName()%>_value!=null) { - if(context_param.containsKey("<%=ctxParam.getName()%>")) {//no need to decrypt if it come from program argument or parent job runtime - context.<%=ctxParam.getName()%> = pwd_<%=ctxParam.getName()%>_value; - } else if (!pwd_<%=ctxParam.getName()%>_value.isEmpty()) { - try { - context.<%=ctxParam.getName()%> = routines.system.PasswordEncryptUtil.decryptPassword(pwd_<%=ctxParam.getName()%>_value); - context.put("<%=ctxParam.getName()%>",context.<%=ctxParam.getName()%>); - } catch (java.lang.RuntimeException e) { - //do nothing - } - } - } - <% - continue; - } - String typeToGenerate ="String"; - if( !(ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory") ||ctxParam.getType().equals("id_List Of Value"))) - { - typeToGenerate=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true); - } - if(typeToGenerate.equals("java.util.Date")) - { - - %> - try{ - String context_<%=ctxParam.getName()%>_value = context.getProperty("<%=ctxParam.getName()%>"); - if (context_<%=ctxParam.getName()%>_value == null){ - context_<%=ctxParam.getName()%>_value = ""; - } - int context_<%=ctxParam.getName()%>_pos = context_<%=ctxParam.getName()%>_value.indexOf(";"); - String context_<%=ctxParam.getName()%>_pattern = "yyyy-MM-dd HH:mm:ss"; - if(context_<%=ctxParam.getName()%>_pos > -1){ - context_<%=ctxParam.getName()%>_pattern = context_<%=ctxParam.getName()%>_value.substring(0, context_<%=ctxParam.getName()%>_pos); - context_<%=ctxParam.getName()%>_value = context_<%=ctxParam.getName()%>_value.substring(context_<%=ctxParam.getName()%>_pos + 1); - } - - context.<%=ctxParam.getName()%>=(java.util.Date)(new java.text.SimpleDateFormat(context_<%=ctxParam.getName()%>_pattern).parse(context_<%=ctxParam.getName()%>_value)); - - }catch(ParseException e) - { - context.<%=ctxParam.getName()%>=null; - } - <% - }else if(typeToGenerate.equals("Object")||typeToGenerate.equals("String")||typeToGenerate.equals("java.lang.String") ) - { - %> - context.<%=ctxParam.getName()%>=(<%=typeToGenerate%>) context.getProperty("<%=ctxParam.getName()%>"); - <% - }else if(typeToGenerate.equals("Character")&&ctxParam.getName()!=null) - { - %> - context.<%=ctxParam.getName()%>= new java.text.StringCharacterIterator(context.getProperty("<%=ctxParam.getName()%>")).first(); - <% - } else { - %> - try{ - context.<%=ctxParam.getName()%>=routines.system.ParserUtils.parseTo_<%=typeToGenerate%> (context.getProperty("<%=ctxParam.getName()%>")); - }catch(NumberFormatException e){ - context.<%=ctxParam.getName()%>=null; - } - <% - } - } - %> - } catch (java.io.IOException ie) { - System.err.println("Could not load context "+contextStr); - ie.printStackTrace(); - } - - - // get context value from parent directly - if (parentContextMap != null && !parentContextMap.isEmpty()) { - <% for (IContextParameter ctxParam :params){ - //about the type, they are same as header.javajet - String typeToGenerate = "String"; - if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")){ - typeToGenerate = "String"; - }else{ - typeToGenerate = JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true); - } - %>if (parentContextMap.containsKey("<%=ctxParam.getName()%>")) { - context.<%=ctxParam.getName()%> = (<%=typeToGenerate %>) parentContextMap.get("<%=ctxParam.getName()%>"); - }<%}%> - } - - //Resume: init the resumeUtil - resumeEntryMethodName = ResumeUtil.getResumeEntryMethodName(resuming_checkpoint_path); - resumeUtil = new ResumeUtil(resuming_logs_dir_path, isChildJob, rootPid); - resumeUtil.initCommonInfo(pid, rootPid, fatherPid, projectName, jobName, contextStr, jobVersion); - - List parametersToEncrypt = new java.util.ArrayList(); -<% for(IContextParameter ctxParam :params) { - if ("id_Password".equals(ctxParam.getType())) { -%> - parametersToEncrypt.add("<%=ctxParam.getName()%>"); -<% - } - } -%> - //Resume: jobStart - resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "","","","",resumeUtil.convertToJsonText(context,parametersToEncrypt)); - -<% - if (stats) { -%> -if(execStat) { - try { - runStat.openSocket(!isChildJob); - runStat.setAllPID(rootPid, fatherPid, pid, jobName); - runStat.startThreadStat(clientHost, portStats); - runStat.updateStatOnJob(RunStat.JOBSTART, fatherNode); - } catch (java.io.IOException ioException) { - ioException.printStackTrace(); - } -} -<% - } -%> - -<% - if (trace) { -%> - try { - runTrace.openSocket(!isChildJob); - runTrace.startThreadTrace(clientHost, portTraces); - } catch (java.io.IOException ioException) { - ioException.printStackTrace(); - } -<% - } -%> - -<%= ElementParameterParser.getValue(process, "__HEADER_CODE__")%> - <%//if(containsTPartitioner){//as tMatchGroupIn and tFuzzyUniqRow use this concurrentHashMap, so generate always%> - java.util.concurrent.ConcurrentHashMap concurrentHashMap = new java.util.concurrent.ConcurrentHashMap(); - globalMap.put("concurrentHashMap", concurrentHashMap); - <%//}%> - - long startUsedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); - long endUsedMemory = 0; - long end = 0; - - startTime = System.currentTimeMillis(); -<% - //1. send the begin msg - - for (INode statCatcherNode : process.getNodesOfType("tStatCatcher")) { -%> - <%=statCatcherNode.getUniqueName() %>.addMessage("begin"); -<% - } - - List prejobNodes = new ArrayList(); - - List postjobNodes = new ArrayList(); - - INode implicit_Context = null; - - for (INode rootNode : rootNodes) { - String componentName = rootNode.getComponent().getName(); - String uniqueName = rootNode.getUniqueName(); - - if (componentName.equals("tPrejob")) { - prejobNodes.add(rootNode); - continue; - } - - if (componentName.equals("tPostjob")) { - postjobNodes.add(rootNode); - continue; - } - - if (uniqueName.startsWith("Implicit_Context_")) { - implicit_Context = rootNode; - continue; - } - } -%> - -<% -//2. load implicit contextload - if(implicit_Context != null) { -%> -<%=createCallProcess(implicit_Context, className, false) %> -<% - } -%> - -this.globalResumeTicket = true;//to run tPreJob - -<% -//3. run pre-job - if(!prejobNodes.isEmpty()) { - for(INode preNode:prejobNodes) { -%> -<%=createCallProcess(preNode, className, false) %> -<% - } - } -%> - - -<% - //4. flush the begin msg - for (INode statCatcherNode : process.getNodesOfType("tStatCatcher")) { -%> - try { - <%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - } catch (java.lang.Exception e) { - e.printStackTrace(); - } -<% - } -%> - -this.globalResumeTicket = false;//to run others jobs - -<% - - //5. all others sub-job (MultiThread mode) - if(isRunInMultiThread){ - for (INode rootNode : rootNodes) { - String componentName = rootNode.getComponent().getName(); - String uniqueName = rootNode.getUniqueName(); - - //filter the special subjob - if("tPrejob".equals(componentName)) continue; - if("tPostjob".equals(componentName)) continue; - - //bug16808 when use parallel option at Output components, that will multi thread - if(componentName.startsWith("tAsyncIn")) continue; - //end bug16808 - - if(implicit_Context!=null && implicit_Context.getUniqueName().equals(uniqueName)) continue; - - if (!componentName.equals("tLogCatcher") && !componentName.equals("tFlowMeterCatcher") && !componentName.equals("tAssertCatcher") && !componentName.equals("tStatCatcher")) { -%> - runningThreadCount.add(1); - new Thread(){ - public void run() { - java.util.Map threadRunResultMap = new java.util.HashMap(); - threadRunResultMap.put("errorCode", null); - threadRunResultMap.put("status", ""); - threadLocal.set(threadRunResultMap); - - <%=createCallProcess(rootNode, className, true) %> - finally { - Integer localErrorCode = (Integer)(((java.util.Map)threadLocal.get()).get("errorCode")); - String localStatus = (String)(((java.util.Map)threadLocal.get()).get("status")); - if (localErrorCode != null) { - if (errorCode == null || localErrorCode.compareTo(errorCode) > 0) { - errorCode = localErrorCode; - } - } - if (!status.equals("failure")){ - status = localStatus; - } - - runningThreadCount.add(-1); - } - } - }.start(); - -<% - } - } -%> - while (runningThreadCount.getCount() > 0) { - try { - Thread.sleep(10); - } catch (java.lang.Exception e) { - e.printStackTrace(); - } - } -<% - } else { // isRunInMultiThread //5. all others sub-job (SingleThread mode) - for (INode rootNode : rootNodes) { - String componentName = rootNode.getComponent().getName(); - String uniqueName = rootNode.getUniqueName(); - - //filter the special subjob - if("tPrejob".equals(componentName)) continue; - if("tPostjob".equals(componentName)) continue; - if(implicit_Context!=null && implicit_Context.getUniqueName().equals(uniqueName)) continue; - - if (!componentName.equals("tLogCatcher") && !componentName.equals("tFlowMeterCatcher") && !componentName.equals("tAssertCatcher") && !componentName.equals("tStatCatcher") && !componentName.equals("tAsyncIn")) { -%> -<%=createCallProcess(rootNode, className, false) %> -<% } - } -}// end if(isRunInMultiThread) -%> - -this.globalResumeTicket = true;//to run tPostJob - -<% -//6. run the post-job - if(!postjobNodes.isEmpty()){ - for(INode postNode:postjobNodes){ -%> -<%=createCallProcess(postNode, className, false) %> -<% - } - } -%> - -<%= ElementParameterParser.getValue(process, "__FOOTER_CODE__")%> - - end = System.currentTimeMillis(); - - if (watch) { - System.out.println((end-startTime)+" milliseconds"); - } - - endUsedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); - if (false) { - System.out.println((endUsedMemory - startUsedMemory) + " bytes memory increase when running : <%=className %>"); - } -<% - //7. send & flush the end msg to statcatcher - for (INode statCatcherNode : process.getNodesOfType("tStatCatcher")) { -%> - <%=statCatcherNode.getUniqueName() %>.addMessage(status==""?"end":status, (end-startTime)); - try { - <%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - } catch (java.lang.Exception e) { - e.printStackTrace(); - } -<% - } -%> - -<% if (exist_tMOM) { %> - closeJmsConnections(); -<% } %> - -<% if (exist_tSCP) { %> - closeScpConnections(); -<% } %> - -<% - if (hasSAM4RS || hasSAM4WS) { -%> - if (false<% if (hasSAM4RS) { %> || null == eventFeature<% } %><% if (hasSAM4WS) { %> || null == registry<% } %>) { // TESB-8574: Fix SAM timeout issue in Studio - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - } - } -<% - } -%> - - -<% - if (stats) { -%> -if (execStat) { - runStat.updateStatOnJob(RunStat.JOBEND, fatherNode); - runStat.stopThreadStat(); -} -<% - } - - if (trace) { -%> - runTrace.stopThreadTrace(); -<% - } -%> - int returnCode = 0; - if(errorCode == null) { - returnCode = status != null && status.equals("failure") ? 1 : 0; - } else { - returnCode = errorCode.intValue(); - } - resumeUtil.addLog("JOB_ENDED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "","" + returnCode,"","",""); - - return returnCode; - - } - - // only for OSGi env - public void destroy() { -<% if(exist_tMOM) { %> - closeJmsConnections(); -<% } %> -<% if(exist_tSCP) { %> - closeScpConnections(); -<% } %> -<% if (exist_tSQLDB) { %> - closeSqlDbConnections(); -<% } %> -<% if (exist_tCassandra) { %> - closeCassandraConnections(); -<% } %> -<% if (exist_tHBase) { %> - closeHBaseConnections(); -<% } %> -<% if (exist_tFtp) { %> - closeFtpConnections(); -<% } %> -<% if (exist_tS3) { %> - closeS3Connections(); -<% } %> -<% if (exist_tLDAP) { %> - closeLDAPConnections(); -<% } %> -<% if (exist_tMDM) { %> - closeMDMConnections(); -<% } %> -<% if (exist_tPalo) { %> - closePaloConnections(); -<% } %> -<% if (exist_tEXist) { %> - closeEXistConnections(); -<% } %> -<% if (exist_tGS) { %> - closeGSConnections(); -<% } %> - - - } - -<% - if(exist_tMOM) { -%> - private void closeJmsConnections() { - try { - Object obj_conn; -<% - for (INode momNode : momComponentsList) { - // fix for TESB-16026 - if (!(Boolean.valueOf(ElementParameterParser.getValue(momNode, "__USE_CONNECTION__")) || Boolean.valueOf(ElementParameterParser.getValue(momNode, "__USE_SHARED_CONNECTION__")))) { - // end fix for TESB-16026 -%> - obj_conn = globalMap.remove("connection_<%=momNode.getUniqueName() %>"); - if (null != obj_conn) { - ((javax.jms.Connection) obj_conn).close(); - } -<% - } - // fix for TESB-16026 - } - // end fix for TESB-16026 -%> - } catch (java.lang.Exception e) { - } - } -<% - } -%> - -<% - if(exist_tSCP) { -%> - private void closeScpConnections() { - try { - Object obj_conn; -<% - for (INode scpNode : scpComponentsList) { -%> - obj_conn = globalMap.remove("conn_<%=scpNode.getUniqueName() %>"); - if (null != obj_conn) { - ((ch.ethz.ssh2.Connection) obj_conn).close(); - } -<% - } -%> - } catch (java.lang.Exception e) { - } - } -<% - } -%> - -<% if(exist_tSQLDB) { %> - private void closeSqlDbConnections() { - try { - Object obj_conn; -<% for (INode sqlDbComponent : sqlDbComponentsList) { %> - obj_conn = globalMap.remove("conn_<%=sqlDbComponent.getUniqueName() %>"); - if (null != obj_conn) { - ((java.sql.Connection) obj_conn).close(); - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<% } %> - -<% if (exist_tCassandra) { %> - private void closeCassandraConnections() { - try { - Object obj_cluster; - Object obj_conn; -<% for (INode cassandraDbNode : cassandraComponentsList) { - if((new API_selector()).useDatastax(cassandraDbNode)) { %> - obj_cluster = globalMap.remove("cluster_<%=cassandraDbNode.getUniqueName()%>"); - obj_conn = globalMap.remove("connection_<%=cassandraDbNode.getUniqueName()%>"); - if(obj_conn != null) { - ((com.datastax.driver.core.Session) obj_conn).close(); - } - if(obj_cluster != null) { - ((com.datastax.driver.core.Cluster) obj_cluster).close(); - } -<% } else { %> - obj_conn = globalMap.remove("cluster_<%=cassandraDbNode.getUniqueName()%>"); - if(obj_conn!=null) { - ((me.prettyprint.hector.api.Cluster) obj_conn).getConnectionManager().shutdown(); - } -<% } - }%> - } catch (java.lang.Exception e) { - } - } -<% }//End if -%> - -<% if(exist_tHBase) { %> - private void closeHBaseConnections() { - try { -<% - for (INode hbaseComponent : hbaseComponentsList) { - - String hbaseDistribution = ElementParameterParser.getValue(hbaseComponent, "__DISTRIBUTION__"); - String hbaseVersion = ElementParameterParser.getValue(hbaseComponent, "__HBASE_VERSION__"); - - org.talend.hadoop.distribution.component.HBaseComponent hbaseDistrib = null; - try { - hbaseDistrib = (org.talend.hadoop.distribution.component.HBaseComponent) org.talend.hadoop.distribution.DistributionFactory.buildDistribution(hbaseDistribution, hbaseVersion); - } catch (java.lang.Exception e) { - e.printStackTrace(); - return ""; - } - - boolean isCustom = hbaseDistrib instanceof org.talend.hadoop.distribution.custom.CustomDistribution; - - boolean isHadoop2 = "HADOOP_2".equals(ElementParameterParser.getValue(hbaseComponent, "__HADOOP_CUSTOM_VERSION__"));%> - org.apache.hadoop.conf.Configuration conn_<%=hbaseComponent.getUniqueName()%> =(org.apache.hadoop.conf.Configuration)globalMap.get("conn_<%=hbaseComponent.getUniqueName()%>"); - if(conn_<%=hbaseComponent.getUniqueName()%> != null ) - { - <% - if((isCustom && isHadoop2) || (!isCustom && hbaseDistrib.doSupportNewHBaseAPI())) {%> - org.apache.hadoop.hbase.client.HConnection hConnection_<%=hbaseComponent.getUniqueName() %> = org.apache.hadoop.hbase.client.HConnectionManager.getConnection(conn_<%=hbaseComponent.getUniqueName() %>); - if ((hConnection_<%=hbaseComponent.getUniqueName() %> != null) && (!hConnection_<%=hbaseComponent.getUniqueName() %>.isClosed())) { - hConnection_<%=hbaseComponent.getUniqueName() %>.close(); - } - <%} else {%> - org.apache.hadoop.hbase.client.HConnectionManager.deleteConnection(conn_<%=hbaseComponent.getUniqueName() %>,true); - <%}%> - } - globalMap.remove("conn_<%=hbaseComponent.getUniqueName() %>"); - <%}%> - } catch (java.lang.Exception e) { - } - } -<% } %> - -<% if (exist_tFtp) { %> - private void closeFtpConnections() { - try { - Object obj_conn; -<% for (INode ftpNode : ftpComponentsList) { %> - obj_conn = globalMap.remove("conn_<%=ftpNode.getUniqueName() %>"); - if (obj_conn != null) { -<% String type; - if (("true").equals(ElementParameterParser.getValue(ftpNode, "__SFTP__"))) { - type = "sftp"; - } else if (("true").equals(ElementParameterParser.getValue(ftpNode, "__FTPS__"))) { - type = "ftps"; - } else { - type = "ftp"; - } - if ("ftp".equals(type)) { %> - ((com.enterprisedt.net.ftp.FTPClient) obj_conn).quit(); - <%} else if ("sftp".equals(type)) { %> - ((com.jcraft.jsch.ChannelSftp) obj_conn).quit(); - <%} else { %> - ((it.sauronsoftware.ftp4j.FTPClient) obj_conn).disconnect(true); - <%}%> - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<%}%> - -<% if(exist_tS3) { %> - private void closeS3Connections() { - try { -<% for (INode s3Component : s3ComponentsList) { %> - com.amazonaws.services.s3.AmazonS3Client conn_<%=s3Component.getUniqueName() %> = (com.amazonaws.services.s3.AmazonS3Client)globalMap.get("conn_<%=s3Component.getUniqueName() %>"); - if(conn_<%=s3Component.getUniqueName() %> !=null){ - conn_<%=s3Component.getUniqueName() %>.shutdown(); - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<% } %> - -<% if (exist_tLDAP) { %> - private void closeLDAPConnections() { - try { - Object obj_conn; -<% for (INode ldapNode : ldapComponentsList) { %> - obj_conn = globalMap.remove("conn_<%=ldapNode.getUniqueName() %>"); - if (obj_conn != null) { - ((javax.naming.ldap.InitialLdapContext) obj_conn).close(); - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<%}%> - -<% if(exist_tMDM) { %> - private void closeMDMConnections() { - try { -<% for (INode mdmComponent : mdmComponentsList) { %> - org.talend.mdm.webservice.TMDMService service_<%=mdmComponent.getUniqueName() %> = (org.talend.mdm.webservice.TMDMService)globalMap.get("TMDMService_<%=mdmComponent.getUniqueName() %>"); - if(service_<%=mdmComponent.getUniqueName() %> != null) - { - service_<%=mdmComponent.getUniqueName() %>.logout(new org.talend.mdm.webservice.WSLogout()); - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<% } %> - - -<% if(exist_tPalo) { %> - private void closePaloConnections() { - try { -<% for (INode paloComponent : paloComponentsList) { %> - org.talend.jpalo.paloconnection pConn_<%=paloComponent.getUniqueName()%> = (org.talend.jpalo.paloconnection)globalMap.get("pConn_<%=paloComponent.getUniqueName()%>"); - if(pConn_<%=paloComponent.getUniqueName()%> !=null){ - pConn_<%=paloComponent.getUniqueName() %>.logout(); - - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<% } %> - -<% if(exist_tEXist) { %> - private void closeEXistConnections() { - try { -<% for (INode existComponent : existComponentsList) { %> - org.xmldb.api.base.Collection col_<%=existComponent.getUniqueName()%> = (org.xmldb.api.base.Collection)globalMap.get("col_<%=existComponent.getUniqueName()%>"); - if(col_<%=existComponent.getUniqueName()%> !=null){ - col_<%=existComponent.getUniqueName()%>.close(); - - } -<% } %> - } catch (java.lang.Exception e) { - } - } -<% } %> - -<% if(exist_tGS) { %> - private void closeGSConnections() { - try { -<% for (INode gsComponent : gsComponentsList) { %> - org.jets3t.service.impl.rest.httpclient.GoogleStorageService service_<%=gsComponent.getUniqueName()%> = - (org.jets3t.service.impl.rest.httpclient.GoogleStorageService)globalMap.get("service_<%=gsComponent.getUniqueName()%>"); - if(service_<%=gsComponent.getUniqueName()%> !=null){ - service_<%=gsComponent.getUniqueName()%>.shutdown(); - } - -<% } %> - } catch (java.lang.Exception e) { - } - } -<% } %> - - private java.util.Map getSharedConnections4REST() { - java.util.Map connections = new java.util.HashMap(); -<% - for (INode momNode : momComponentsList) { -%> - connections.put("connection_<%=momNode.getUniqueName() %>", globalMap.get("connection_<%=momNode.getUniqueName() %>")); - connections.put("session_<%=momNode.getUniqueName() %>", globalMap.get("session_<%=momNode.getUniqueName() %>")); -<% - } -%> -<% - for (INode scpNode : scpComponentsList) { -%> - connections.put("conn_<%=scpNode.getUniqueName() %>", globalMap.get("conn_<%=scpNode.getUniqueName() %>")); -<% - } -%> -<% - for (INode sqlDbNode : sqlDbComponentsList) { -%> - connections.put("conn_<%=sqlDbNode.getUniqueName() %>", globalMap.get("conn_<%=sqlDbNode.getUniqueName() %>")); -<% - } -%> -<% - - for (INode cassandraDbNode : cassandraComponentsList) { - if((new API_selector()).useDatastax(cassandraDbNode)) { %> - connections.put("connection_<%=cassandraDbNode.getUniqueName() %>", globalMap.get("connection_<%=cassandraDbNode.getUniqueName() %>")); - connections.put("cluster_<%=cassandraDbNode.getUniqueName() %>", globalMap.get("cluster_<%=cassandraDbNode.getUniqueName() %>")); -<% } else { %> - connections.put("cluster_<%=cassandraDbNode.getUniqueName() %>", globalMap.get("cluster_<%=cassandraDbNode.getUniqueName()%>")); -<% } - } -%> - -<% - for (INode hbaseNode : hbaseComponentsList) { -%> - connections.put("conn_<%=hbaseNode.getUniqueName() %>", globalMap.get("conn_<%=hbaseNode.getUniqueName() %>")); -<% - } -%> - -<% for (INode ftpNode : ftpComponentsList) { %> - connections.put("conn_<%=ftpNode.getUniqueName() %>", globalMap.get("conn_<%=ftpNode.getUniqueName() %>")); -<% } %> -<% - for (INode s3Node : s3ComponentsList) { -%> - connections.put("conn_<%=s3Node.getUniqueName() %>", globalMap.get("conn_<%=s3Node.getUniqueName() %>")); -<% - } -%> -<% for (INode ldapNode : ldapComponentsList) { %> - connections.put("conn_<%=ldapNode.getUniqueName() %>", globalMap.get("conn_<%=ldapNode.getUniqueName() %>")); - connections.put("connBaseDN_<%=ldapNode.getUniqueName() %>", globalMap.get("connBaseDN_<%=ldapNode.getUniqueName() %>")); -<% } %> - -<% for (INode mdmNode : mdmComponentsList) {%> - connections.put("TMDMService_<%=mdmNode.getUniqueName() %>", globalMap.get("TMDMService_<%=mdmNode.getUniqueName() %>")); -<% if( "false".equals(ElementParameterParser.getValue(mdmNode, "__AUTO_COMMIT__"))) {%> - connections.put("mdmTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmTransaction_<%=mdmNode.getUniqueName() %>")); -<% } - } %> -<% for (INode paloNode : paloComponentsList) { %> - connections.put("p_<%=paloNode.getUniqueName() %>", globalMap.get("p_<%=paloNode.getUniqueName() %>")); - connections.put("pConn_<%=paloNode.getUniqueName() %>", globalMap.get("pConn_<%=paloNode.getUniqueName() %>")); -<% } %> -<% for (INode existNode : existComponentsList) { %> - connections.put("col_<%=existNode.getUniqueName()%>", globalMap.get("col_<%=existNode.getUniqueName()%>")); -<% } %> - -<% for (INode salesforceNode : salesforceComponentsList) { %> - connections.put("conn_<%=salesforceNode.getUniqueName()%>", globalMap.get("conn_<%=salesforceNode.getUniqueName()%>")); -<% } %> -<% for (INode sapNode : sapComponentsList) { %> - connections.put("conn_<%=sapNode.getUniqueName()%>", globalMap.get("conn_<%=sapNode.getUniqueName()%>")); -<% } %> -<% for (INode gsNode : gsComponentsList) { %> - connections.put("service_<%=gsNode.getUniqueName()%>", globalMap.get("service_<%=gsNode.getUniqueName()%>")); -<% } %> - - - return connections; - } - - private void evalParam(String arg) { - if (arg.startsWith("--resuming_logs_dir_path")) { - resuming_logs_dir_path = arg.substring(25); - } else if (arg.startsWith("--resuming_checkpoint_path")) { - resuming_checkpoint_path = arg.substring(27); - } else if (arg.startsWith("--parent_part_launcher")) { - parent_part_launcher = arg.substring(23); - } else if (arg.startsWith("--watch")) { - watch = true; - } else if (arg.startsWith("--stat_port=")) { - String portStatsStr = arg.substring(12); - if (portStatsStr != null && !portStatsStr.equals("null")) { - portStats = Integer.parseInt(portStatsStr); - } - } else if (arg.startsWith("--trace_port=")) { - portTraces = Integer.parseInt(arg.substring(13)); - } else if (arg.startsWith("--client_host=")) { - clientHost = arg.substring(14); - } else if (arg.startsWith("--context=")) { - contextStr = arg.substring(10); - isDefaultContext = false; - } else if (arg.startsWith("--father_pid=")) { - fatherPid = arg.substring(13); - } else if (arg.startsWith("--root_pid=")) { - rootPid = arg.substring(11); - } else if (arg.startsWith("--father_node=")) { - fatherNode = arg.substring(14); - } else if (arg.startsWith("--pid=")) { - pid = arg.substring(6); - } else if (arg.startsWith("--context_param")) { - String keyValue = arg.substring(16); - int index = -1; - if (keyValue != null && (index = keyValue.indexOf('=')) > -1) { - if (fatherPid==null) { - context_param.put(keyValue.substring(0, index), replaceEscapeChars(keyValue.substring(index + 1))); - } else { // the subjob won't escape the especial chars - context_param.put(keyValue.substring(0, index), keyValue.substring(index + 1) ); - } - } - }else if (arg.startsWith("--log4jLevel=")) { - log4jLevel = arg.substring(13); - } - - } - - private final String[][] escapeChars = { - {"\\\\","\\"},{"\\n","\n"},{"\\'","\'"},{"\\r","\r"}, - {"\\f","\f"},{"\\b","\b"},{"\\t","\t"} - }; - private String replaceEscapeChars (String keyValue) { - - if (keyValue == null || ("").equals(keyValue.trim())) { - return keyValue; - } - - StringBuilder result = new StringBuilder(); - int currIndex = 0; - while (currIndex < keyValue.length()) { - int index = -1; - // judege if the left string includes escape chars - for (String[] strArray : escapeChars) { - index = keyValue.indexOf(strArray[0],currIndex); - if (index>=0) { - - result.append(keyValue.substring(currIndex, index + strArray[0].length()).replace(strArray[0], strArray[1])); - currIndex = index + strArray[0].length(); - break; - } - } - // if the left string doesn't include escape chars, append the left into the result - if (index < 0) { - result.append(keyValue.substring(currIndex)); - currIndex = currIndex + keyValue.length(); - } - } - - return result.toString(); - } - - public Integer getErrorCode() { - return errorCode; - } - - - public String getStatus() { - return status; - } - - ResumeUtil resumeUtil = null; -} diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer_java.skeleton b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer_java.skeleton deleted file mode 100644 index 2129a2e..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer_java.skeleton +++ /dev/null @@ -1,61 +0,0 @@ -import org.talend.core.model.process.INode; - -public class CLASS -{ - private static String end_multiThread = "if ( !\"failure\".equals(((java.util.Map)threadLocal.get()).get(\"status\")) ) {\n((java.util.Map) threadLocal.get()).put(\"status\", \"end\");\n}"; - private static String end_singleThread = "if(!\"failure\".equals(status)) { status = \"end\"; }"; - private static String failure_multiThread = "((java.util.Map) threadLocal.get()).put(\"status\", \"failure\");"; - private static String failure_singleThread = "status = \"failure\";"; - private static String errorCode_multiThread = "((java.util.Map) threadLocal.get()).put(\"errorCode\", null);"; - private static String errorCode_singleThread = "errorCode = null;"; - - // add the list of the connection names to avoid to declare two times the same name. - public String createCallProcess(INode rootNode, String className, boolean isMultiThread) { - String toReturn = ""; - toReturn = "try {\n"; - if(isMultiThread) { - toReturn += errorCode_multiThread; - }else{ - toReturn += errorCode_singleThread; - } - - toReturn += rootNode.getUniqueName() + "Process(globalMap);\n"; - - if(isMultiThread) { - toReturn += end_multiThread; - }else{ - toReturn += end_singleThread; - } - - toReturn += "\n}catch (TalendException e_" + rootNode.getUniqueName() + ") {\n"; - -// if(isMultiThread) { -// toReturn += failure_multiThread; -// }else{ -// toReturn += failure_singleThread; -// } - - toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n"; - - toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n"; - - - //List< ? extends IConnection> onSubJobErrorConns = rootNode.getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR); - //if(onSubJobErrorConns!=null){ - // for(IConnection conn : onSubJobErrorConns) { - // toReturn += createCallProcess(conn.getTarget(), className, isMultiThread); - // } - //} - if(isMultiThread){ - toReturn += "\n}catch (java.lang.Error e_" + rootNode.getUniqueName() + ") {\n"; - toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n"; - toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n"; - } - toReturn += "\n}"; - return toReturn; - } - - public String generate(Object argument) { - return ""; - } -} \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer_process_info.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer_process_info.javajet deleted file mode 100644 index 98b50c4..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/footer_process_info.javajet +++ /dev/null @@ -1,20 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.designer.codegen.config.CodeGeneratorArgument - java.text.DateFormat - java.util.Calendar - org.talend.core.ui.branding.IBrandingService - org.talend.core.GlobalServiceRegister - " - class="ProcessInfo" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Integer chars = (Integer) codeGenArgument.getArgument(); -%> -/************************************************************************************************ - * <%=chars %> characters generated by <%=((IBrandingService) GlobalServiceRegister.getDefault().getService( - IBrandingService.class)).getFullProductName() %> - * on the <%=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG).format(Calendar.getInstance().getTime()) %> - ************************************************************************************************/ \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header.javajet deleted file mode 100644 index 97dafbc..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header.javajet +++ /dev/null @@ -1,800 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IProcess - org.talend.core.model.process.INode - org.talend.core.model.process.IConnection - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.ElementParameterParser - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.runprocess.CodeGeneratorRoutine - org.talend.designer.codegen.i18n.Messages - org.talend.core.ui.branding.IBrandingService - org.talend.core.ui.branding.AbstractBrandingService - org.talend.core.GlobalServiceRegister - org.talend.designer.codegen.ITalendSynchronizer - org.talend.designer.codegen.PigTemplate - java.util.List - java.util.ArrayList - java.util.Vector - org.talend.core.model.process.IContextParameter - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.utils.NodeUtil - org.talend.core.model.utils.JavaResourcesHelper - org.talend.core.model.process.ProcessUtils - " - class="Header" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Vector v = (Vector) codeGenArgument.getArgument(); - IProcess process = (IProcess)v.get(0); - String version = (String)v.get(1); - - List< ? extends INode> processNodes = (List< ? extends INode>)process.getGeneratingNodes(); - boolean stats = codeGenArgument.isStatistics(); - boolean trace = codeGenArgument.isTrace(); - boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); - List params = new ArrayList(); - params=process.getContextManager().getDefaultContext().getContextParameterList(); - String className = process.getName(); -%> -<% -IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class); -if(service instanceof AbstractBrandingService){ -%> -<%=((AbstractBrandingService) service).getJobLicenseHeader(version)%> -<% -} - String jobFolderName = ""; - IProcess baseProcess = ProcessUtils.getTestContainerBaseProcess(process); - if (baseProcess != null) { - jobFolderName = JavaResourcesHelper.getJobFolderName(baseProcess.getName(), baseProcess.getVersion()) + "."; - } - jobFolderName = jobFolderName + JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion()); - String packageName = codeGenArgument.getCurrentProjectName().toLowerCase() + "." + jobFolderName; -%> -package <%= packageName %>; - -<%for (String routine : CodeGeneratorRoutine.getRequiredPigudfName(process)) { - boolean isTemplate =false; - for(PigTemplate template:PigTemplate.values()){ - if(routine.equals(template.getFileName())){ - isTemplate = true; - } - } - if(!isTemplate){%> -import pigudf.<%=routine%>; -<% } -}%> -<%for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) { - if(!routine.equals(ITalendSynchronizer.TEMPLATE)){%> -import routines.<%=routine%>; -<% } -}%> -import routines.system.*; -import routines.system.api.*; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.math.BigDecimal; -import java.io.ByteArrayOutputStream; -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; -import java.io.IOException; -import java.util.Comparator; -<% -if(ProcessUtils.isTestContainer(process)) { - className = className + "Test"; -%> -import org.junit.Test; -import static org.junit.Assert.assertTrue; -<% -} -%> - -<%=ElementParameterParser.getValue(process, "__HEADER_IMPORT__") %> -<%=ElementParameterParser.getValue(process, "__FOOTER_IMPORT__") %> - - -<% - List nodesWithImport = process.getNodesWithImport(); - if(nodesWithImport != null) { - for(INode node:nodesWithImport){ -%> - //the import part of <%=node.getUniqueName() %> - <%=ElementParameterParser.getValue(node, "__IMPORT__") %> - -<% } - } -%> - -@SuppressWarnings("unused") - -/** - * Job: <%=className%> Purpose: <%=ElementParameterParser.getValue(process, "__PURPOSE__") %>
- * Description: <%=ElementParameterParser.getValue(process, "__DESCRIPTION__") %>
- * @author <%=ElementParameterParser.getValue(process, "__AUTHOR__") %> - * @version <%=version %> - * @status <%=ElementParameterParser.getValue(process, "__STATUS__") %> - */ -<% -String talendJobInterfaces = "TalendJob"; - -boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty(); - -boolean actAsProvider = !process.getNodesOfType("tESBProviderRequest").isEmpty(); -boolean actAsConsumer = !process.getNodesOfType("tESBConsumer").isEmpty(); -boolean hasSAM4RS = false; -for (INode node : process.getNodesOfType("tRESTClient")) { - if (Boolean.valueOf(ElementParameterParser.getValue(node, "__SERVICE_ACTIVITY_MONITOR__"))) { - hasSAM4RS = true; - break; - } -} - -boolean talendEsbJob = actAsProvider || actAsConsumer || !process.getNodesOfType("tRouteInput").isEmpty(); -boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty(); - -boolean talendStepTemplate = !process.getNodesOfType("tActionInput").isEmpty() || !process.getNodesOfType("tActionOutput").isEmpty() || !process.getNodesOfType("tActionReject").isEmpty(); - -boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__")); - -if (talendMdmJob) { - talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job -} -if (talendEsbJob) { - talendJobInterfaces += ", TalendESBJob"; // Talend ESB job -} -if (talendEsbJobFactory) { - talendJobInterfaces += ", TalendESBJobFactory"; // Talend ESB provider job -} -if (talendStepTemplate) { - talendJobInterfaces += ", TalendStepTemplateFactory"; // Talend Step Template -} -%> -public class <%=className%> implements <%=talendJobInterfaces%> { -<%if(isLog4jEnabled){%> - static {System.setProperty("TalendJob.log", "<%=className%>.log");} - private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(<%=className%>.class); -<%}%> - -<% if (talendEsbJob) { %> - private ESBEndpointRegistry registry = null; - - public void setEndpointRegistry(ESBEndpointRegistry registry) { - this.registry = registry; - } - - private ESBProviderCallback callback = null; - - public void setProviderCallback(ESBProviderCallback callback) { - <% if (actAsProvider) { %> - this.callback = callback; - <% } %> - } - - <% if (!actAsProvider) { %> - public ESBEndpointInfo getEndpoint() { return null; } - <% } %> -<% } %> - -<% if (talendEsbJobFactory) { %> - public TalendESBJob newTalendESBJob() { - <%=process.getName()%> talendESBJob = new <%=process.getName()%>(); - java.util.Map talendDataSources = - (java.util.Map) globalMap.get(KEY_DB_DATASOURCES); - if (null != talendDataSources) { - java.util.Map dataSources = new java.util.HashMap(); - for (java.util.Map.Entry talendDataSourceEntry : talendDataSources.entrySet()) { - dataSources.put(talendDataSourceEntry.getKey(), talendDataSourceEntry.getValue().getRawDataSource()); - } - talendESBJob.setDataSources(dataSources); - } - // fix for TESB-7714 - talendESBJob.setEndpointRegistry(registry); - - // TESB-15920 tRESTClient and SAM not working - <% if (hasSAM4RS) { %> - talendESBJob.setEventFeature(eventFeature); - <% } %> - - return talendESBJob; - } -<% } %> - - public final Object obj = new Object(); - - // for transmiting parameters purpose - private Object valueObject = null; - - public Object getValueObject() { - return this.valueObject; - } - - public void setValueObject(Object valueObject) { - this.valueObject = valueObject; - } -<% -if(isRunInMultiThread){ -%> - private Object[] multiThreadLockWrite = new Object[0]; -<% -} -%> - <%//it will be use in job setting.%> - private final static String defaultCharset = java.nio.charset.Charset.defaultCharset().name(); - - <%//uft-8 is for temp file, for example: tSortRow, tMap. Because they need keep reversibility.%> - private final static String utf8Charset = "UTF-8"; - - // create and load default properties - private java.util.Properties defaultProps = new java.util.Properties(); - // create application properties with default - public class ContextProperties extends java.util.Properties { - - private static final long serialVersionUID = 1L; - - public ContextProperties(java.util.Properties properties){ - super(properties); - } - public ContextProperties(){ - super(); - } - - public void synchronizeContext(){ - <% for (IContextParameter ctxParam :params){ - String cParaName = ctxParam.getName(); - %> - if(<%=cParaName %> != null){ - <%if(ctxParam.getType().equals("id_Date")){%> - String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss"; - String value_<%=cParaName %> = "<%=ctxParam.getValue() %>"; - String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";"); - if(parts_<%=cParaName %>.length > 1){ - pattern_<%=cParaName %> = parts_<%=cParaName %>[0]; - this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>)); - }else{ - this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>)); - } - <%}else{%> - this.setProperty("<%=cParaName %>", <%=cParaName %>.toString()); - <%}%> - } - <% } %> - } - -<% - for (IContextParameter ctxParam :params) - { - if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) - { - %> - public String <%=ctxParam.getName()%>; - public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>(){ - return this.<%=ctxParam.getName()%>; - } - <% - }else - { -%> -public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>; -public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>(){ - return this.<%=ctxParam.getName()%>; -} -<% } - } -%> - } - private ContextProperties context = new ContextProperties(); - public ContextProperties getContext() { - return this.context; - } - private final String jobVersion = "<%=process.getVersion() %>"; - private final String jobName = "<%=codeGenArgument.getJobName() %>"; - private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>"; - public Integer errorCode = null; - private String currentComponent = ""; - <% - //tParallelize will wrap globalMap with synchronizedMap - if(isRunInMultiThread || NodeUtil.containsMultiThreadComponent(process)){ - %> - private final java.util.Map globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap()); - <% - } else { - %> - private final java.util.Map globalMap = new java.util.HashMap(); - private final static java.util.Map junitGlobalMap = new java.util.HashMap(); - <% - } - boolean exist_tParallelize = false; - List tParallelizeList = process.getNodesOfType("tParallelize"); - if(tParallelizeList != null && tParallelizeList.size() > 0){ - exist_tParallelize = true; - } - if(!isRunInMultiThread && !exist_tParallelize){ - %> - private final java.util.Map start_Hash = new java.util.HashMap(); - private final java.util.Map end_Hash = new java.util.HashMap(); - private final java.util.Map ok_Hash = new java.util.HashMap(); - public final java.util.List globalBuffer = new java.util.ArrayList(); - <% - }else{ - %> - private final java.util.Map start_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); - private final java.util.Map end_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); - private final java.util.Map ok_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); - public final java.util.List globalBuffer = java.util.Collections.synchronizedList(new java.util.ArrayList()); - <% - } - %> - -<% - if (stats) { -%> -private RunStat runStat = new RunStat(); -<% - } -%> -<% - if (trace) { -%> -private RunTrace runTrace = new RunTrace(); -<% - } -%> - - // OSGi DataSource - private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES"; - - public void setDataSources(java.util.Map dataSources) { - java.util.Map talendDataSources = new java.util.HashMap(); - for (java.util.Map.Entry dataSourceEntry : dataSources.entrySet()) { - talendDataSources.put(dataSourceEntry.getKey(), new routines.system.TalendDataSource(dataSourceEntry.getValue())); - } - globalMap.put(KEY_DB_DATASOURCES, talendDataSources); - } - -<% - for (INode logCatcher : process.getNodesOfType("tLogCatcher")) { -%> - LogCatcherUtils <%=logCatcher.getUniqueName() %> = new LogCatcherUtils(); -<% - } - - for (INode statCatcher : process.getNodesOfType("tStatCatcher")) { -%> - StatCatcherUtils <%=statCatcher.getUniqueName() %> = new StatCatcherUtils("<%=process.getId() %>", "<%=process.getVersion() %>"); -<% - } - - for (INode metterCatcher : process.getNodesOfType("tFlowMeterCatcher")) { -%> - MetterCatcherUtils <%=metterCatcher.getUniqueName() %> = new MetterCatcherUtils("<%=process.getId() %>", "<%=process.getVersion() %>"); -<% - } - - for (INode assertCatcher : process.getNodesOfType("tAssertCatcher")) { -%> - AssertCatcherUtils <%=assertCatcher.getUniqueName() %> = new AssertCatcherUtils(); -<% - } -%> - -private final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); -private final java.io.PrintStream errorMessagePS = new java.io.PrintStream(new java.io.BufferedOutputStream(baos)); - -public String getExceptionStackTrace() { - if ("failure".equals(this.getStatus())) { - errorMessagePS.flush(); - return baos.toString(); - } - return null; -} - -private Exception exception; - -public Exception getException() { - if ("failure".equals(this.getStatus())) { - return this.exception; - } - return null; -} - -private class TalendException extends Exception { - - private static final long serialVersionUID = 1L; - - private java.util.Map globalMap = null; - private Exception e = null; - private String currentComponent = null; - private String virtualComponentName = null; - - public void setVirtualComponentName (String virtualComponentName){ - this.virtualComponentName = virtualComponentName; - } - - private TalendException(Exception e, String errorComponent, final java.util.Map globalMap) { - this.currentComponent= errorComponent; - this.globalMap = globalMap; - this.e = e; - } - - public Exception getException() { - return this.e; - } - - public String getCurrentComponent() { - return this.currentComponent; - } - - <%//For TDI-27789%> - public String getExceptionCauseMessage(Exception e){ - Throwable cause = e; - String message = null; - int i = 10; - while (null != cause && 0 < i--) { - message = cause.getMessage(); - if (null == message) { - cause = cause.getCause(); - } else { - break; - } - } - if (null == message) { - message = e.getClass().getName(); - } - return message; - } - - @Override - public void printStackTrace() { - if (!(e instanceof TalendException || e instanceof TDieException)) { - if(virtualComponentName!=null && currentComponent.indexOf(virtualComponentName+"_")==0){ - globalMap.put(virtualComponentName+"_ERROR_MESSAGE",getExceptionCauseMessage(e)); - } - globalMap.put(currentComponent+"_ERROR_MESSAGE",getExceptionCauseMessage(e)); - System.err.println("Exception in component " + currentComponent); - } - if (!(e instanceof TDieException)) { - if(e instanceof TalendException){ - e.printStackTrace(); - } else { - e.printStackTrace(); - e.printStackTrace(errorMessagePS); - <%=className%>.this.exception = e; - } - } - if (!(e instanceof TalendException)) { - try { - for (java.lang.reflect.Method m : this.getClass().getEnclosingClass().getMethods()) { - if (m.getName().compareTo(currentComponent + "_error") == 0) { - m.invoke(<%=className%>.this, new Object[] { e , currentComponent, globalMap}); - break; - } - } - - if(!(e instanceof TDieException)){ -<% - if (process.getNodesOfType("tLogCatcher").size() > 0) { - List logCatchers = (List)process.getNodesOfType("tLogCatcher"); - for (INode logCatcher : logCatchers) { - if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - // 1) add the message to the stack -%> - <%=logCatcher.getUniqueName() %>.addMessage("Java Exception", currentComponent, 6, e.getClass().getName() + ":" + e.getMessage(), 1); -<% - } - } - - INode virtualNCatchNode = null; - boolean hasRealCatchNode = false; - for (INode logCatcher : logCatchers) { - if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - if(logCatcher.isVirtualGenerateNode()){ - virtualNCatchNode = logCatcher; - }else{ - hasRealCatchNode = true; - } - } - } - if(hasRealCatchNode && virtualNCatchNode!=null){ -%> - try{ -<% - } - for (INode logCatcher : logCatchers) { - if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - if(logCatcher!=virtualNCatchNode){ - // 2) launch logCatcher subProcess -%> - <%=logCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); -<% - } - } - } - if(hasRealCatchNode && virtualNCatchNode!=null){ -%> - }finally{ -<% - } - if(virtualNCatchNode!=null){ -%> - <%=virtualNCatchNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); -<% - } - if(hasRealCatchNode && virtualNCatchNode!=null){ -%> - } -<% - } - } -%> - } -<% - boolean needCatchTalendException = false; - if (process.getNodesOfType("tLogCatcher").size() > 0) { - for(INode node:process.getNodesOfType("tLogCatcher")){ - if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){ - needCatchTalendException = true; - break; - } - } - } - - if ((!needCatchTalendException) && (process.getNodesOfType("tAssertCatcher").size() > 0)) { - for(INode node:process.getNodesOfType("tAssertCatcher")){ - if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){ - needCatchTalendException = true; - break; - } - } - } - if(needCatchTalendException) { - if (process.getNodesOfType("tLogCatcher").size() > 0) { - %> - } catch (TalendException e) { - // do nothing - <% - } - } -%> - } catch (Exception e) { - this.e.printStackTrace(); - } - } - } -} - -<% // Methods for RUN IF Error links %> -<% - for (INode node : processNodes) { - if (node.isActivate()) { - %> - public void <%=node.getUniqueName() %>_error(Exception exception, String errorComponent, final java.util.Map globalMap) throws TalendException { - <% - //If node is virtual component input part,invoke virtual component output part when virtual link is ROWS_END,FLOW,COMPONENT_OK,ITERATE(virtual link could not be ON_SUBJOB_OK) - if(node.isVirtualGenerateNode() && node.getVirtualLinkTo()!=null){ - List< ? extends IConnection> conns = node.getOutgoingConnections(node.getVirtualLinkTo()); - boolean invokeVirtualLinkError=false; - //If virtual component virtual link is EConnectionType.ON_SUBJOB_OK,node.getOutgoingConnections().size() is 0 - for(IConnection conn:conns){ - INode virtualLinkNode = conn.getTarget(); - if(virtualLinkNode.isVirtualGenerateNode()){ - %> - <%=virtualLinkNode.getUniqueName()%>_error(exception, errorComponent, globalMap); - <% - invokeVirtualLinkError=true; - break; - } - } - if(invokeVirtualLinkError){ - %> - } - <% - continue; - } - } - if(!node.isVirtualGenerateNode() && node.getUniqueName().startsWith("tAsyncIn_")){ - %> - <%=node.getUniqueName().replace("tAsyncIn_","tAsyncOut_")%>_error(exception, errorComponent, globalMap); - } - <% - continue; - } - %> - end_Hash.put(errorComponent, System.currentTimeMillis()); - <% - boolean ifBeforRunError = NodeUtil.checkComponentErrorConnectionAfterNode(node); - if(!ifBeforRunError) { - if (process.getNodesOfType("tAssertCatcher").size() > 0) { - List assertCatchers = (List)process.getNodesOfType("tAssertCatcher"); - for (INode assertCatcher : assertCatchers) { - if (ElementParameterParser.getValue(assertCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - // 1) add the message to the stack - %> - if(!(exception instanceof TDieException)){ - <%if("true".equals(ElementParameterParser.getValue(assertCatcher, "__GET_ORIGINAL_EXCEPTION__"))){%> - <%=assertCatcher.getUniqueName()%>.addMessage(pid, projectName, jobName, "java", null, "Failed", "Job execution error", exception); - <%}else{%> - <%=assertCatcher.getUniqueName()%>.addMessage(pid, projectName, jobName, "java", null, "Failed", "Job execution error", exception.getMessage()); - <%}%> - <%=assertCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - } - <% - } - } - } - } - if (!node.getComponent().getName().equals("tDie")) { - String statCatcher = ElementParameterParser.getValue(node,"__TSTATCATCHER_STATS__"); - if (statCatcher.compareTo("true")==0) { - for (INode statCatcherNode : node.getProcess().getNodesOfType("tStatCatcher")) { - %> - <%=statCatcherNode.getUniqueName() %>.addMessage("failure",errorComponent, end_Hash.get(errorComponent)-start_Hash.get(errorComponent)); - <%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - <% - } - } - } - boolean isExistOnCompErrorLink = false; - List< ? extends IConnection> conns = NodeUtil.getVirtualNode(node).getOutgoingConnections(); - for (IConnection conn : conns) { - if (conn.getLineStyle().equals(EConnectionType.ON_COMPONENT_ERROR)) { - isExistOnCompErrorLink = true; - %> - try { - <%if (stats) {%> - if(this.execStat){ - runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "error"); - } - <%}%> - <% - if (isRunInMultiThread ) { - %> - ((java.util.Map)threadLocal.get()).put("errorCode", null); - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if ( !"failure".equals(((java.util.Map)threadLocal.get()).get("status")) ) { - ((java.util.Map)threadLocal.get()).put("status", "end"); - } - <% - } else { - %> - errorCode = null; - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if (!"failure".equals(status)) { - status = "end"; - } - <% - } - %> - - } catch (Exception e) { - e.printStackTrace(); - } - <% - } - } - /* - This part of code in order to call the correct onComponentError and onSubjobError for virtual component which EConnectionType is ROWS_END,FLOW,COMPONENT_OK,ITERATE. - */ - INode subjob_start_node = node; - boolean hasBeenChanged = true; - while(subjob_start_node.getDesignSubjobStartNode().isVirtualGenerateNode() && hasBeenChanged) { - hasBeenChanged = false; - if(subjob_start_node.getDesignSubjobStartNode().getVirtualLinkTo()==null){ - //if EConnectionType of virtual component(INPUT-->SUBJOB_OK-->OUTPUT) is SUBJOB_OK,the size of OUTPUT node IncomingConnections is zero. - if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections().size()>0){ - subjob_start_node = subjob_start_node.getDesignSubjobStartNode().getIncomingConnections().get(0).getSource(); - hasBeenChanged = true; - } - } - } - // when use parallelize will add virtual components(tAsyncIn and tAsyncOut) but in graphical these is visable=false - if ("true".equals(ElementParameterParser.getValue(node, "__PARALLELIZE__"))) { - if(subjob_start_node.getDesignSubjobStartNode().getUniqueName().startsWith("tAsyncIn_")){ - subjob_start_node = NodeUtil.getNodeByUniqueName(subjob_start_node.getProcess(),subjob_start_node.getDesignSubjobStartNode().getUniqueName().replace("tAsyncIn_","tAsyncOut_")); - } - } - //end - boolean isSubjobHasOnSubJobError = false; - if (!isExistOnCompErrorLink) { - INode subJobStartNode = subjob_start_node.getDesignSubjobStartNode(); - if (subJobStartNode != null) { - List< ? extends IConnection> tempConns = subJobStartNode.getOutgoingConnections(); - for (IConnection conn : tempConns) { - if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { - isSubjobHasOnSubJobError = true; - break; - } - } - } - } - - if (!isSubjobHasOnSubJobError && !isExistOnCompErrorLink) { // when there is no subjoberror and no onComponentError - if (isRunInMultiThread ) { - %> - ((java.util.Map)threadLocal.get()).put("status", "failure"); - <% - } else { - %> - status = "failure"; - <% - } - } - - %> - <%=subjob_start_node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap); - } - <% - } - } - for (INode node : processNodes) { - if (node.isDesignSubjobStartNode()) { -%> - public void <%=node.getUniqueName() %>_onSubJobError(Exception exception, String errorComponent, final java.util.Map globalMap) throws TalendException { -<% - List< ? extends IConnection> conns = node.getOutgoingConnections(); - int count = 0; - for (IConnection conn : conns) { - if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { - count++; - } - } - - String label = "ERROR"; - - if(count == 0){//FATAL - label = "FATAL"; - }else{//ERROR------>RunSubJobError - label = "ERROR"; - } -%> - -resumeUtil.addLog("SYSTEM_LOG", "NODE:"+ errorComponent, "", Thread.currentThread().getId()+ "", "<%=label %>", "", exception.getMessage(), ResumeUtil.getExceptionStackTrace(exception),""); - -<% - for (IConnection conn : conns) { - if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { -%> - try { - <%if (stats) {%> - if(this.execStat){ - runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "error"); - } - <%}%> -<% - if(isRunInMultiThread ){ -%> - ((java.util.Map)threadLocal.get()).put("errorCode", null); - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if ( !"failure".equals(((java.util.Map)threadLocal.get()).get("status")) ) { - ((java.util.Map)threadLocal.get()).put("status", "end"); - } -<% - } else { -%> - errorCode = null; - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if (!"failure".equals(status)) { - status = "end"; - } -<% - } -%> - } catch (Exception e) { - e.printStackTrace(); - } -<% - } - } -%> - } -<% - } - } -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional.javajet deleted file mode 100644 index 89db980..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional.javajet +++ /dev/null @@ -1,4 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - class="Header_additional" -%> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_box.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_box.javajet deleted file mode 100644 index aa5c1bb..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_box.javajet +++ /dev/null @@ -1,260 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators.common" - imports=" - java.util.List - java.util.Vector - - org.talend.core.model.process.INode - org.talend.core.model.process.IProcess - org.talend.designer.codegen.config.CodeGeneratorArgument - " - class="Header_additional" -%> - -<% -boolean hasBox = false; -boolean hasBoxPut = false; -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -Vector v = (Vector) codeGenArgument.getArgument(); -IProcess process = (IProcess)v.get(0); - -List tBoxCreateList = process.getNodesOfType("tBoxCreate"); -List tBoxGetList = process.getNodesOfType("tBoxGet"); -List tBoxListList = process.getNodesOfType("tBoxList"); -List tBoxCopyList = process.getNodesOfType("tBoxCopy"); -List tBoxUploadList = process.getNodesOfType("tBoxPut"); -List tBoxDeleteList = process.getNodesOfType("tBoxDelete"); - -if (tBoxUploadList != null && tBoxUploadList.size() > 0) -{ - hasBoxPut = true; -} - -if((tBoxCreateList != null && tBoxCreateList.size() > 0) || (tBoxGetList != null && tBoxGetList.size() > 0) - || (tBoxListList != null && tBoxListList.size() > 0) || (tBoxCopyList != null && tBoxCopyList.size() > 0) - || hasBoxPut || (tBoxDeleteList != null && tBoxDeleteList.size() > 0)){ - hasBox = true; -} - - -if(hasBox){ -%> - - public com.box.boxjavalibv2.dao.BoxFolder searchFolder(com.box.boxjavalibv2.BoxClient client, String path, String name) throws Exception - { - com.box.boxjavalibv2.dao.BoxFolder boxFolder = null; - if (name.equals("All Files") || path.equals("All Files")) - { - return client.getFoldersManager().getFolder("0", null); - } - com.box.boxjavalibv2.dao.BoxCollection searchResults = client.getSearchManager().search(name, null); - for (com.box.boxjavalibv2.dao.BoxTypedObject entry : searchResults.getEntries()) - { - if (entry instanceof com.box.boxjavalibv2.dao.BoxFolder && ((com.box.boxjavalibv2.dao.BoxFolder) entry).getName().equals(name)) - { - if (path == null || path.isEmpty()) - { - return ((com.box.boxjavalibv2.dao.BoxFolder) entry); - } - java.lang.StringBuilder sBuilder = new java.lang.StringBuilder(); - for (com.box.boxjavalibv2.dao.BoxTypedObject obj : ((com.box.boxjavalibv2.dao.BoxFolder) entry).getPathCollection().getEntries()) - { - sBuilder.append(obj.getValue("name") + "/"); - } - sBuilder.append(((com.box.boxjavalibv2.dao.BoxFolder) entry).getName()); - if (sBuilder.toString().equals(path)) - { - boxFolder = (com.box.boxjavalibv2.dao.BoxFolder) entry; - return boxFolder; - } - } - } - return null; - } - - public com.box.boxjavalibv2.dao.BoxFile searchFile(com.box.boxjavalibv2.BoxClient client, String path, String name) throws Exception - { - com.box.boxjavalibv2.dao.BoxFile boxFile = null; - com.box.boxjavalibv2.dao.BoxCollection searchResults = client.getSearchManager().search(name, null); - for (com.box.boxjavalibv2.dao.BoxTypedObject entry : searchResults.getEntries()) - { - if (entry instanceof com.box.boxjavalibv2.dao.BoxFile && ((com.box.boxjavalibv2.dao.BoxFile) entry).getName().equals(name)) - { - if (path == null || path.isEmpty()) - { - return ((com.box.boxjavalibv2.dao.BoxFile) entry); - } - java.lang.StringBuilder sBuilder = new java.lang.StringBuilder(); - for (com.box.boxjavalibv2.dao.BoxTypedObject obj : ((com.box.boxjavalibv2.dao.BoxFile) entry).getPathCollection().getEntries()) - { - sBuilder.append(obj.getValue("name") + "/"); - } - sBuilder.append(((com.box.boxjavalibv2.dao.BoxFile) entry).getName()); - if (sBuilder.toString().equals(path)) - { - boxFile = (com.box.boxjavalibv2.dao.BoxFile) entry; - return boxFile; - } - } - } - return null; - } - - private String getBoxItemPath(com.box.boxjavalibv2.dao.BoxItem item) - { - if (item == null) - return ""; - java.lang.StringBuilder itemPath = new java.lang.StringBuilder(); - for (com.box.boxjavalibv2.dao.BoxTypedObject obj : item.getPathCollection().getEntries()) - itemPath.append(obj.getValue("name") + "/"); - return itemPath.toString(); - } - - private static String normalizePath(String path) - { - if (path == null) - { - return null; - } - path = path.replace('\\', '/'); - if (path.startsWith("/")) - { - path = path.substring(1); - } - if (path.endsWith("/")) - path = path.substring(0, path.length() - 1); - return path; - } - - private static String getFolderFromPath(String path) - { - if (path != null && !path.isEmpty()) - { - String[] parts = path.split("/"); - String folder = null; - if (parts.length > 1) - folder = parts[parts.length - 1]; - else - folder = parts[0]; - return folder; - } - return null; - } - - private static com.box.boxjavalibv2.dao.BoxFolder getBoxFolderRecursively(List paths, - com.box.boxjavalibv2.dao.BoxFolder folder, com.box.boxjavalibv2.BoxClient client) throws Exception { - - if (paths.size() > 1) { - paths.remove(0); - } else { - return folder; - } - - for (com.box.boxjavalibv2.dao.BoxTypedObject obj : folder.getItemCollection().getEntries()) { - if (obj.getValue("name").equals(paths.get(0))) { - return getBoxFolderRecursively(paths, client.getFoldersManager().getFolder(obj.getId(), null), client); - } - } - - return folder; - } - - private java.util.List getChildrenRecursively(com.box.boxjavalibv2.BoxClient client, com.box.boxjavalibv2.dao.BoxFolder folder, - java.util.List list, boolean withFolders, boolean withFiles) throws Exception - { - if (folder != null) - { - for (com.box.boxjavalibv2.dao.BoxTypedObject obj : folder.getItemCollection().getEntries()) - { - if (withFolders && withFiles) - { - if(obj.getType().equals("folder")) - { - com.box.boxjavalibv2.dao.BoxFolder boxFolder = client.getFoldersManager().getFolder(obj.getId(), null); - list.add(boxFolder); - getChildrenRecursively(client, boxFolder, list, withFolders, withFiles); - } - if (obj.getType().equals("file")) - { - com.box.boxjavalibv2.dao.BoxFile file = client.getFilesManager().getFile(obj.getId(), null); - list.add(file); - } - } - else if (withFolders) - { - if(obj.getType().equals("folder")) - { - com.box.boxjavalibv2.dao.BoxFolder boxFolder = client.getFoldersManager().getFolder(obj.getId(), null); - list.add(boxFolder); - getChildrenRecursively(client, boxFolder, list, withFolders, withFiles); - } - } - else if (withFiles) - { - if(obj.getType().equals("folder")) - { - com.box.boxjavalibv2.dao.BoxFolder boxFolder = client.getFoldersManager().getFolder(obj.getId(), null); - getChildrenRecursively(client, boxFolder, list, withFolders, withFiles); - } - if (obj.getType().equals("file")) - { - com.box.boxjavalibv2.dao.BoxFile file = client.getFilesManager().getFile(obj.getId(), null); - list.add(file); - } - } - } - } - return list; - } - - public static com.box.boxjavalibv2.dao.BoxItem searchItem(com.box.boxjavalibv2.BoxClient client, String name) throws Exception - { - com.box.boxjavalibv2.dao.BoxItem boxItem = null; - com.box.boxjavalibv2.dao.BoxCollection searchResults = client.getSearchManager().search(name, null); - for (com.box.boxjavalibv2.dao.BoxTypedObject entry : searchResults.getEntries()) - { - if (((com.box.boxjavalibv2.dao.BoxItem) entry).getName().equals(name)) - { - boxItem = (com.box.boxjavalibv2.dao.BoxItem) entry; - return boxItem; - } - } - return null; - } - -<% -} -%> -<%if(hasBoxPut) -{%> - private com.box.boxjavalibv2.dao.BoxFolder createSubDirectories(com.box.boxjavalibv2.BoxClient client, com.box.boxjavalibv2.dao.BoxFolder folder, String path) throws Exception - { - com.box.boxjavalibv2.dao.BoxFolder destinationFolder = folder; - if (path != null && !path.isEmpty()) - { - String[] parts = path.split("/"); - if (parts.length > 0) - { - boolean exists = false; - for (com.box.boxjavalibv2.dao.BoxTypedObject obj : folder.getItemCollection().getEntries()) - { - if (obj.getValue("name").equals(parts[0])) - { - exists = true; - destinationFolder = client.getFoldersManager().getFolder(obj.getId(), null); - if (parts.length > 1) - destinationFolder = createSubDirectories(client, destinationFolder, path.substring(parts[0].length() + 1, path.length())); - } - } - if(!exists) - { - com.box.boxjavalibv2.requests.requestobjects.BoxFolderRequestObject folderRequestObj = com.box.boxjavalibv2.requests.requestobjects.BoxFolderRequestObject.createFolderRequestObject(parts[0], folder.getId()); - destinationFolder = client.getFoldersManager().createFolder(folderRequestObj); - if (parts.length > 1) - destinationFolder = createSubDirectories(client, destinationFolder, path.substring(parts[0].length() + 1, path.length())); - } - } - } - return destinationFolder; - } -<%}%> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_mdmtrigger.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_mdmtrigger.javajet deleted file mode 100644 index 190c830..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_mdmtrigger.javajet +++ /dev/null @@ -1,61 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators.common" - imports=" - java.util.List - java.util.Vector - - org.talend.core.model.process.INode - org.talend.core.model.process.IProcess - org.talend.designer.codegen.config.CodeGeneratorArgument - " - class="Header_additional" -%> - -<% -boolean withMDMTrigger = false; - -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -Vector v = (Vector) codeGenArgument.getArgument(); -IProcess process = (IProcess)v.get(0); - -List tMDMTriggerInputList = process.getNodesOfType("tMDMTriggerInput"); -List tMDMTriggerOutputList = process.getNodesOfType("tMDMTriggerOutput"); - -if((tMDMTriggerInputList != null && tMDMTriggerInputList.size() > 0) || (tMDMTriggerOutputList != null && tMDMTriggerOutputList.size() > 0)){ - withMDMTrigger = true; -} - -if(withMDMTrigger){ -%> - - - // These fields are defined for "MDM triggers" - private routines.system.Document MDMOutputMessage = null; - - public org.dom4j.Document getMDMOutputMessage() { - if(this.MDMOutputMessage != null) - return this.MDMOutputMessage.getDocument(); - else - return null; - } - - private routines.system.Document MDMInputMessage = null; - - public void setMDMInputMessage(org.dom4j.Document message) { - if(message != null) - this.MDMInputMessage.setDocument(message); - } - - public void setMDMInputMessage(String message) throws org.dom4j.DocumentException { - try { - this.MDMInputMessage = ParserUtils.parseTo_Document(message); - } catch (org.dom4j.DocumentException e) { - throw new org.dom4j.DocumentException(e); - } - } - - // End of MDM trigger fields - -<% -} -%> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_talendesb_wsconsumer.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_talendesb_wsconsumer.javajet deleted file mode 100644 index 7767d93..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/header_additional_talendesb_wsconsumer.javajet +++ /dev/null @@ -1,418 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators.common" - imports=" - java.util.Vector - - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.INode - org.talend.core.model.process.IProcess - " - class="Header_additional" -%> -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -Vector v = (Vector) codeGenArgument.getArgument(); -IProcess process = (IProcess) v.get(0); - -boolean actAsProvider = !process.getNodesOfType("tESBProviderRequest").isEmpty(); -boolean actAsConsumer = !process.getNodesOfType("tESBConsumer").isEmpty(); -if (actAsConsumer) { -%> - @SuppressWarnings("serial") - public static class GenericFaultInfoException extends org.apache.cxf.frontend.FaultInfoException { - - private org.dom4j.Document faultInfo; - - public GenericFaultInfoException(String arg0, javax.xml.transform.Source source) { - super(arg0); - try { - faultInfo = GenericConsumer.sourceToDocument(source); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public org.dom4j.Document getFaultInfo() { - return faultInfo; - } - } - - static interface GenericServiceClass { - Object invoke(Object param) throws GenericFaultInfoException; - } - - static class GenericConsumer { - - private static final javax.xml.transform.TransformerFactory FACTORY = javax.xml.transform.TransformerFactory.newInstance(); - - private javax.xml.namespace.QName serviceQName; - private javax.xml.namespace.QName portQName; - private javax.xml.namespace.QName operationQName; - private boolean isRequestResponse; - private String soapAction; - private String address; - private String wsdlURL; - - private java.util.Collection esbFeatures; - private org.apache.cxf.Bus bus; - - private String authType; - private String username; - private String password; - - private String proxyServer; - private int proxyPort; - private String proxyUsername; - private String proxyPassword; - - private long connectionTimeout; - private long receiveTimeout; - - private boolean autoRedirect; - private boolean redirectSameHostOnly; - - private boolean logMessages; - - private java.util.Collection soapHeaders; - - private Object correlationIDCallbackHandler; - - private String correlationID; - - public void setServiceQName(javax.xml.namespace.QName serviceQName) { - this.serviceQName = serviceQName; - } - - public void setPortQName(javax.xml.namespace.QName portQName) { - this.portQName = portQName; - } - - public void setOperationQName(javax.xml.namespace.QName operationQName) { - this.operationQName = operationQName; - } - - public void setIsRequestResponse(boolean isRequestResponse) { - this.isRequestResponse = isRequestResponse; - } - - public void setSoapAction(String soapAction) { - this.soapAction = soapAction; - } - - public void setAddress(String address) { - this.address = address; - } - - public void setWsdlURL(String wsdlURL) { - this.wsdlURL = wsdlURL; - } - - public void setEsbFeatures( - java.util.Collection esbFeatures) { - this.esbFeatures = esbFeatures; - } - - public void setBus(org.apache.cxf.Bus bus) { - this.bus = bus; - } - - public void setAuthType(String authType) { - this.authType = authType; - } - - public void setUsername(String username) { - this.username = username; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setProxyServer(String proxyServer) { - this.proxyServer = proxyServer; - } - - public void setProxyPort(int proxyPort) { - this.proxyPort = proxyPort; - } - - public void setProxyUsername(String proxyUsername) { - this.proxyUsername = proxyUsername; - } - - public void setProxyPassword(String proxyPassword) { - this.proxyPassword = proxyPassword; - } - - public void setConnectionTimeout(long connectionTimeout) { - this.connectionTimeout = connectionTimeout; - } - - public void setReceiveTimeout(long receiveTimeout) { - this.receiveTimeout = receiveTimeout; - } - - public void setAutoRedirect(boolean autoRedirect) { - this.autoRedirect = autoRedirect; - } - - public void setRedirectSameHostOnly(boolean redirectSameHostOnly) { - this.redirectSameHostOnly = redirectSameHostOnly; - } - - public void setLogMessages(boolean logMessages) { - this.logMessages = logMessages; - } - - public void setSoapHeaders(java.util.Collection soapHeaders) { - this.soapHeaders = soapHeaders; - } - - public void setCorrelationIDCallbackHandler(Object correlationIDCallbackHandler) { - this.correlationIDCallbackHandler = correlationIDCallbackHandler; - } - - public String getCorrelationID() { - return correlationID; - } - - public org.dom4j.Document invoke(org.dom4j.Document doc) throws GenericFaultInfoException, org.apache.cxf.interceptor.Fault { - org.apache.cxf.frontend.ClientFactoryBean clientFactory = new org.apache.cxf.frontend.ClientFactoryBean(); - clientFactory.setDataBinding(new org.apache.cxf.databinding.source.SourceDataBinding()); - clientFactory.getServiceFactory().getServiceConfigurations().add(0, new org.apache.cxf.wsdl.service.factory.AbstractServiceConfiguration() { - @Override - public Boolean isOperation(java.lang.reflect.Method method) { - return "invoke".equals(method.getName()); - } - @Override - public javax.xml.namespace.QName getOperationName(org.apache.cxf.service.model.InterfaceInfo service, java.lang.reflect.Method method) { - return operationQName; - } - @Override - public Boolean hasOutMessage(java.lang.reflect.Method m) { - return isRequestResponse; - } - @Override - public String getAction(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method) { - return soapAction; - } - @Override - public Boolean isWrapped() { - return Boolean.FALSE; - } - @Override - public javax.xml.namespace.QName getFaultName(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo o, - Class exClass, Class beanClass) { - for (org.apache.cxf.service.model.FaultInfo fi : o.getFaults()) { - for (org.apache.cxf.service.model.MessagePartInfo mpi : fi.getMessageParts()) { - return mpi.getConcreteName(); - } - } - return null; - } - }); - if (null != wsdlURL) { - clientFactory.setWsdlURL(wsdlURL); - } - clientFactory.setServiceClass(GenericServiceClass.class); - - clientFactory.setServiceName(serviceQName); - clientFactory.setEndpointName(portQName); - - clientFactory.setAddress(address); - clientFactory.getProperties(true).put("soap.no.validate.parts", Boolean.TRUE); - - if (null != bus) { - clientFactory.setBus(bus); - } - if (null != esbFeatures) { - clientFactory.getFeatures().addAll(esbFeatures); - } - if (logMessages) { - clientFactory.getFeatures().add(new org.apache.cxf.feature.LoggingFeature()); - } - if (null != correlationIDCallbackHandler) { - clientFactory.getProperties(true).put("correlation-id.callback-handler", correlationIDCallbackHandler); - } - - org.apache.cxf.endpoint.Client client = clientFactory.create(); - - org.apache.cxf.transport.http.HTTPConduit conduit = (org.apache.cxf.transport.http.HTTPConduit) client.getConduit(); - if ("BASIC".equals(authType)) { - org.apache.cxf.configuration.security.AuthorizationPolicy authorizationPolicy = new org.apache.cxf.configuration.security.AuthorizationPolicy(); - authorizationPolicy.setUserName(username); - authorizationPolicy.setPassword(password); - authorizationPolicy.setAuthorizationType("Basic"); - conduit.setAuthorization(authorizationPolicy); - } else if ("DIGEST".equals(authType)) { - org.apache.cxf.configuration.security.AuthorizationPolicy authorizationPolicy = new org.apache.cxf.configuration.security.AuthorizationPolicy(); - authorizationPolicy.setUserName(username); - authorizationPolicy.setPassword(password); - authorizationPolicy.setAuthorizationType("Digest"); - conduit.setAuthorization(authorizationPolicy); - } else if ("TOKEN".equals(authType)) { - java.util.Map wssProps = new java.util.HashMap(); - wssProps.put(org.apache.wss4j.common.ConfigurationConstants.ACTION, org.apache.wss4j.common.ConfigurationConstants.USERNAME_TOKEN); - wssProps.put(org.apache.wss4j.common.ConfigurationConstants.USER, username); - wssProps.put(org.apache.wss4j.common.ConfigurationConstants.PASSWORD_TYPE, org.apache.wss4j.common.WSS4JConstants.PW_TEXT); - wssProps.put(org.apache.wss4j.common.ConfigurationConstants.PW_CALLBACK_REF, - new javax.security.auth.callback.CallbackHandler() { - public void handle(javax.security.auth.callback.Callback[] callbacks) - throws java.io.IOException, javax.security.auth.callback.UnsupportedCallbackException { - ((org.apache.wss4j.common.ext.WSPasswordCallback) callbacks[0]).setPassword(password); - } - }); - client.getEndpoint() - .getOutInterceptors().add(new org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor(wssProps)); - } - - org.apache.cxf.transports.http.configuration.HTTPClientPolicy httpClientPolicy = conduit.getClient(); - if (null != proxyServer) { - httpClientPolicy.setProxyServerType(org.apache.cxf.transports.http.configuration.ProxyServerType.HTTP); - httpClientPolicy.setProxyServer(proxyServer); - httpClientPolicy.setProxyServerPort(proxyPort); - } - if (null != proxyUsername && !"".equals(proxyUsername)) { - org.apache.cxf.configuration.security.ProxyAuthorizationPolicy proxyAuthorization = new org.apache.cxf.configuration.security.ProxyAuthorizationPolicy(); - proxyAuthorization.setUserName(proxyUsername); - proxyAuthorization.setPassword(proxyPassword); - conduit.setProxyAuthorization(proxyAuthorization); - } - httpClientPolicy.setConnectionTimeout(connectionTimeout); - httpClientPolicy.setReceiveTimeout(receiveTimeout); - if (autoRedirect) { - httpClientPolicy.setAutoRedirect(autoRedirect); - client.getRequestContext().put("http.redirect.relative.uri", true); - client.getRequestContext().put("http.redirect.same.host.only", redirectSameHostOnly); - } - - if (null != soapHeaders) { - client.getRequestContext().put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders); - } - - try { - Object[] results = client.invoke(operationQName, new javax.xml.transform.dom.DOMSource(new org.dom4j.io.DOMWriter().write(doc))); - correlationID = (String) client.getResponseContext().get("CorrelationID"); - if (results != null && results.length > 0) { - return sourceToDocument((javax.xml.transform.Source) results[0]); - } - } catch (GenericFaultInfoException e) { - throw e; - } catch (org.apache.cxf.interceptor.Fault e) { - throw e; - } catch (Exception e) { - throw new org.apache.cxf.interceptor.Fault(e); - } - return null; - } - - public static org.dom4j.Document sourceToDocument(javax.xml.transform.Source source) throws Exception{ - java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream(); - FACTORY.newTransformer().transform(source, new javax.xml.transform.stream.StreamResult(os)); - return new org.dom4j.io.SAXReader().read(new java.io.ByteArrayInputStream(os.toByteArray())); - } - - } - - private static java.util.Map collectFaultInfo(Exception error) { - String faultString = null; - String faultActor = null; - String faultCode = null; - String faultRole = null; - String faultNode = null; - org.dom4j.Document faultDetail = null; - org.w3c.dom.Element faultDomDetail = null; - - if (error instanceof org.apache.cxf.binding.soap.SoapFault) { - org.apache.cxf.binding.soap.SoapFault cxfSoapFault = (org.apache.cxf.binding.soap.SoapFault) error; - - faultString = cxfSoapFault.getReason(); - faultCode = cxfSoapFault.getFaultCode().toString(); - faultRole = cxfSoapFault.getRole(); - faultNode = cxfSoapFault.getNode(); - faultDomDetail = cxfSoapFault.getDetail(); - } else if (error instanceof GenericFaultInfoException) { - GenericFaultInfoException genericFault = (GenericFaultInfoException) error; - - faultString = genericFault.getMessage(); - faultDetail = genericFault.getFaultInfo(); - } else if (error instanceof javax.xml.ws.soap.SOAPFaultException) { - javax.xml.soap.SOAPFault wsSoapFault = ((javax.xml.ws.soap.SOAPFaultException) error).getFault(); - - faultString = wsSoapFault.getFaultString(); - faultActor = wsSoapFault.getFaultActor(); - faultCode = wsSoapFault.getFaultCodeAsQName().toString(); - - if (javax.xml.soap.SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(wsSoapFault.getNamespaceURI())) { - // SOAP 1.2 - try { - faultRole = wsSoapFault.getFaultRole(); - faultNode = wsSoapFault.getFaultNode(); - } catch (java.lang.UnsupportedOperationException uoe) { } - } - - faultDomDetail = wsSoapFault.getDetail(); - } else { - return null; - } - - java.util.Map faultInfo = new java.util.HashMap(); - faultInfo.put("faultString", faultString); - faultInfo.put("faultActor", faultActor); - faultInfo.put("faultCode", faultCode); - faultInfo.put("faultRole", faultRole); - faultInfo.put("faultNode", faultNode); - if (null != faultDomDetail) { - org.w3c.dom.NodeList nl = faultDomDetail.getElementsByTagName("*"); - if (nl.getLength() > 0) { - try { - javax.xml.transform.Source faultSource = new javax.xml.transform.dom.DOMSource( - nl.item(0)); - faultDetail = GenericConsumer.sourceToDocument(faultSource); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - faultInfo.put("faultDetail", faultDetail); - return faultInfo; - } - - private void printFaultInfo(java.util.Map faultInfo) { - java.lang.StringBuffer sb = new java.lang.StringBuffer("Fault {"); - sb.append("string: ").append(faultInfo.get("faultString")); - if (null != faultInfo.get("faultCode")) { - sb.append("; code:").append(faultInfo.get("faultCode")); - } - if (null != faultInfo.get("faultActor")) { - sb.append("; actor:").append(faultInfo.get("faultActor")); - } - if (null != faultInfo.get("faultRole")) { - sb.append("; role:").append(faultInfo.get("faultRole")); - } - if (null != faultInfo.get("faultNode")) { - sb.append("; node:").append(faultInfo.get("faultNode")); - } - if (null != faultInfo.get("faultDetail")) { - sb.append("; detail:").append(((org.dom4j.Document) faultInfo.get("faultDetail")).asXML()); - } - sb.append("}"); - System.out.println(sb.toString()); - } - -<% } // end if (actAsConsumer) %> - -<% if (actAsProvider || actAsConsumer) {%> - private Object wrapPayload(Object payload, Object customProperties) { - java.util.Map outputWrapped = new java.util.HashMap(); - outputWrapped.put("PAYLOAD", payload); - if (null != customProperties) { - outputWrapped.put("SAM-PROPS", customProperties); - } - return outputWrapped; - } -<% } %> - - - diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/iterate_subprocess_footer.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/iterate_subprocess_footer.javajet deleted file mode 100644 index e77e2ef..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/iterate_subprocess_footer.javajet +++ /dev/null @@ -1,148 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.core.model.temp.ECodePart - org.talend.core.model.process.IConnection - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.ElementParameterParser - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.process.IConnectionCategory - org.talend.designer.codegen.config.NodesSubTree - org.talend.core.model.utils.NodeUtil - java.util.List - java.util.Set - java.util.HashSet - java.util.Iterator - java.util.Vector - " - class="IterateSubProcessFooter" - skeleton="subprocess_header_java.skeleton" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Vector v = (Vector) codeGenArgument.getArgument(); - INode node = (INode) v.get(0); - String finallyPart = v.get(1).toString(); - - ECodePart codePart = codeGenArgument.getCodePart(); - //boolean trace = codeGenArgument.isTrace(); - boolean stat = codeGenArgument.isStatistics(); - - Set connSet = new HashSet(); - connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MAIN)); - connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MERGE)); - //String incomingName = codeGenArgument.getIncomingName(); - NodesSubTree subTree = (NodesSubTree) codeGenArgument.getSubTree(); - - Set iterateConnSet = new HashSet(); - iterateConnSet.addAll(node.getIncomingConnections(EConnectionType.ITERATE)); - - String iterateNodeName = node.getUniqueName(); - - List allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections(); -%> - -<% - if (codePart.equals(ECodePart.END)) {//1 - boolean parallelIterate = false; - for (IConnection iterateConn : iterateConnSet) {//2 - parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__")); - if (parallelIterate) {//3 - String schemaInstanceDeclaration = createPrivateClassMethodInstance(subTree.getRootNode(), subTree.getRootNode().getOutgoingConnections().get(0).getName(), false, new java.util.HashSet()); - if (schemaInstanceDeclaration.length()>0) { - schemaInstanceDeclaration = "," + schemaInstanceDeclaration.substring(0,schemaInstanceDeclaration.length()-1); - } - if(stat){ - %> - if(execStat){ - runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>",2,"exec"+iterateId); - } - <% - } - %> - } catch (java.lang.Exception e) { - this.status = "failure"; - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode")); - if (localErrorCode != null) { - if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) { - this.errorCode = localErrorCode; - } - } - - TalendException te = new TalendException(e, currentComponent, globalMap); - <% - if(NodeUtil.hasVirtualComponent(subTree.getNodes())){ - %> - te.setVirtualComponentName(currentVirtualComponent); - <% - } - %> - this.exception = te; - talendThreadPool.setErrorThread(this); - talendThreadPool.stopAllWorkers(); - - } catch (java.lang.Error error){ - this.status = "failure"; - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode")); - if (localErrorCode != null) { - if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) { - this.errorCode = localErrorCode; - } - } - this.error = error; - talendThreadPool.setErrorThread(this); - talendThreadPool.stopAllWorkers(); - } finally { - try{ - <%=finallyPart%> - }catch(java.lang.Exception e){ - //ignore - }catch(java.lang.Error error){ - //ignore - } - resourceMap = null; - } - this.isRunning = false; - - Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode")); - String localStatus = (String) (((java.util.Map) threadLocal.get()).get("status")); - if (localErrorCode != null) { - if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) { - this.errorCode = localErrorCode; - } - } - if (!this.status.equals("failure")) { - this.status = localStatus; - } - - talendThreadPool.getTalendThreadResult().setErrorCode(this.errorCode); - talendThreadPool.getTalendThreadResult().setStatus(this.status); - } - } - - <%=node.getUniqueName() %>Thread bt_<%=node.getUniqueName() %> = new <%=node.getUniqueName() %>Thread(globalMap<%=schemaInstanceDeclaration %>,threadIdCounter_<%=node.getUniqueName()%>++); - mtp_<%=node.getUniqueName() %>.execute(bt_<%=node.getUniqueName() %>); - - <% - continue; - }else {//3 - if(stat){ - if(node.getDesignSubjobStartNode().getComponent().getName().equals("tCollector")){ - %> - if(execStat){ - runStat.updateStatOnIterate("<%=iterateConn.getUniqueName() %>", RunStat.END); - } - <% - }else{%> - if(execStat){ - runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>", 2, "exec" + NB_ITERATE_<%=iterateNodeName %>); - } - <% - } - } - }//3 - }//2 - }//1 -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/iterate_subprocess_header.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/iterate_subprocess_header.javajet deleted file mode 100644 index 06a32a7..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/iterate_subprocess_header.javajet +++ /dev/null @@ -1,246 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.core.model.temp.ECodePart - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.IConnection - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.IMetadataColumn - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.IExternalNode - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.codegen.config.NodesSubTree - org.talend.core.model.process.IProcess - org.talend.core.model.utils.NodeUtil - org.talend.core.model.process.IContextParameter - java.util.List - java.util.Set - java.util.HashSet - java.util.ArrayList - " - class="IterateSubProcessHeader" - skeleton="subprocess_header_java.skeleton" -%> -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; -INode node = (INode)codeGenArgument.getArgument(); -boolean containsTPartitioner = node.getProcess().getNodesOfType("tPartitioner").size() > 0 ? true : false; -boolean isRunJob = "tRunJob".equals(node.getComponent().getName()); -IProcess process = node.getProcess(); - -NodesSubTree subTree = (NodesSubTree) codeGenArgument.getSubTree(); -ECodePart codePart = codeGenArgument.getCodePart(); -//boolean trace = codeGenArgument.isTrace(); -boolean stat = codeGenArgument.isStatistics(); - -boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); - -Set connSet = new HashSet(); -connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MAIN)); -connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MERGE)); - -Set iterateConnSet = new HashSet(); -iterateConnSet.addAll(node.getIncomingConnections(EConnectionType.ITERATE)); - -String iterateNodeName = node.getUniqueName(); - -List params = new ArrayList(); -params = process.getContextManager().getDefaultContext().getContextParameterList(); - -List allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections(); -boolean parallelIterate = false; -for (IConnection iterateConn : iterateConnSet) { //1 -%> - NB_ITERATE_<%=iterateNodeName %>++; - <%if(containsTPartitioner){%> - iterateLoop++; - <%}%> - <% - parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__")); - if (parallelIterate) {//2 - if (codePart.equals(ECodePart.BEGIN)) {//3 - String rowList=","; - for (IConnection conn : allSubProcessConnection) { - rowList += conn.getUniqueName()+"Struct "+conn.getUniqueName()+","; - } - rowList = rowList.substring(0, rowList.length()-1); - %> - class <%=node.getUniqueName() %>Thread extends TalendThread {//implements routines.system.TalendThreadPool.PropertySettable - class ThreadedMap extends java.util.HashMap { - - private static final long serialVersionUID = 0L; - - public ThreadedMap(java.util.Map globalMap) { - super(globalMap); - } - - @Override - public Object put(String key, Object value) { - <%if(!isRunInMultiThread){%> - synchronized (<%=process.getName()%>.this.obj) { - <%}%> - super.put(key, value); - return <%=process.getName()%>.this.globalMap.put(key, value); - <%if(!isRunInMultiThread){%> - } - <%}%> - } - } - <% if(isRunJob) {%> - private final ContextProperties localContext = new ContextProperties(); - <% } %> - private java.util.Map globalMap = null; - boolean isRunning = false; - String iterateId = ""; - <%if(containsTPartitioner){%> - int iterateLoop = 0; - <%}%> - <% - if(!subTree.isMergeSubTree()) { - List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections(); - if ((rootConns!=null)&&(rootConns.size()>0)) { - %> - <%=createPrivateClassInstance(subTree.getRootNode(), rootConns.get(0).getName(), false)%> - <% - } - } else { - List sortedMergeBranchStarts = subTree.getSortedMergeBranchStarts(); - for (INode startNode : sortedMergeBranchStarts) { - List< ? extends IConnection> rootConns = startNode.getOutgoingConnections(); - if ((rootConns!=null)&&(rootConns.size()>0)) { - %> - <%=createPrivateClassInstance(startNode, rootConns.get(0).getName(), false)%> - <% - } - } - - List mergeNodes =subTree.getMergeNodes(); - for(INode mNode:mergeNodes){ - List< ? extends IConnection> rootConns = mNode.getOutgoingConnections(); - if ((rootConns!=null)&&(rootConns.size()>0)) { - %> - <%=createPrivateClassInstance(mNode, rootConns.get(0).getName(), false)%> - <% - } - } - } - - String schemaInstanceDeclaration = createPriveClassMethodDeclaration(subTree.getRootNode(), subTree.getRootNode().getOutgoingConnections().get(0).getName(), false, new java.util.HashSet()); - if (schemaInstanceDeclaration.length()>0) { - schemaInstanceDeclaration = "," + schemaInstanceDeclaration.substring(0,schemaInstanceDeclaration.length()-1); - } - %> - - public <%=node.getUniqueName() %>Thread(java.util.Map globalMap<%=schemaInstanceDeclaration %>, int threadID) { - super(); - <% - for (IConnection connection : allSubProcessConnection) { - IMetadataTable table = connection.getMetadataTable(); - %> - if(<%= connection.getName() %> != null){ - <% - List listColumns = table.getListColumns(); - for (IMetadataColumn column : listColumns) { - %> - this.<%= connection.getName() %>.<%= column.getLabel() %> = <%= connection.getName() %>.<%= column.getLabel() %>; - <% - } - %> - } - <% - } - %> - <% - // if codeGenArgument.getIsRunInMultiThread() is true, the job.this.globalMap will wrapped with synchronizedMap, use synchronized(job.this.globalMap) when use globalMap.keySet().iterator() - // when codeGenArgument.getIsRunInMultiThread() is false, the job.this.globalMap is HashMap, use synchronized(job.this.object) when do the job.this.globalMap.put() operation(tMap,tIterateToFlow). - if(isRunInMultiThread){%> - synchronized (globalMap) { - this.globalMap = java.util.Collections.synchronizedMap(new ThreadedMap(globalMap)); - <%}else{%> - synchronized (<%=process.getName()%>.this.obj) { - this.globalMap = new ThreadedMap(globalMap); - <%}%> - } - iterateId = "." + threadID; - <%if(containsTPartitioner){%> - iterateLoop++; - <%}%> - <%if(isRunJob) {%> - //bug21906 copy context to local for mutilthread - context.synchronizeContext(); - java.util.Enumeration propertyNames = context.propertyNames(); - while(propertyNames.hasMoreElements()) { - String propertyName = (String)propertyNames.nextElement(); - String propertyValue = context.getProperty(propertyName); - localContext.setProperty(propertyName, propertyValue); - } - <% for (IContextParameter ctxParam : params){%> - localContext.<%=ctxParam.getName()%> = context.<%=ctxParam.getName()%>; - <% - } - } - %> - } - - - public void run() { - - java.util.Map threadRunResultMap = new java.util.HashMap(); - threadRunResultMap.put("errorCode", null); - threadRunResultMap.put("status", ""); - threadLocal.set(threadRunResultMap); - - this.isRunning = true; - String currentComponent = ""; - java.util.Map resourceMap = new java.util.HashMap(); - <% - if(NodeUtil.hasVirtualComponent(subTree.getNodes())){ - %> - String currentVirtualComponent = null; - <% - } - %> - try { - <% - if(stat){ - %> - if(execStat){ - runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>",0,"exec"+iterateId); - } - <% - } - }//3 - continue; - }else {//2 - if(stat){ - //iterateConn.getSource().getVirtualLinkTo() only works on the first component of a virtual component, if it works for the second one, the code should change - boolean iterateInVComp = iterateConn.getSource().getVirtualLinkTo() != null && iterateConn.getSource().getVirtualLinkTo() == EConnectionType.ITERATE; - if(!iterateInVComp){ - Set allInLineJobConns = NodeUtil.getAllInLineJobConnections(iterateConn.getTarget()); - for (IConnection inLineConn : allInLineJobConns) { - %> - if(execStat){ - runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, 0); - } - <% - } - } - if(node.getDesignSubjobStartNode().getComponent().getName().equals("tCollector")){ - %> - if(execStat){ - runStat.updateStatOnIterate("<%=iterateConn.getUniqueName() %>", RunStat.RUNNING); - } - <% - }else{ - %> - if(execStat){ - runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>", 1, "exec" + NB_ITERATE_<%=iterateNodeName %>); - //Thread.sleep(1000); - } - <% - } - } - }//2 -}//1 -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_header.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_header.javajet deleted file mode 100644 index 89e4a6a..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_header.javajet +++ /dev/null @@ -1,1190 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.designer.codegen.config.NodesSubTree - org.talend.core.model.process.INode - java.util.List - java.util.HashSet - java.util.Set - java.util.Map - org.talend.core.model.process.IProcess - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.IConnection - org.talend.core.model.metadata.IMetadataTable - org.talend.core.model.metadata.IMetadataColumn - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.metadata.types.JavaType - org.talend.core.model.process.ElementParameterParser - org.talend.core.model.process.IHashableInputConnections - org.talend.core.model.process.IHashConfiguration - org.talend.core.model.process.IHashableColumn - org.talend.core.model.utils.NodeUtil - " - class="SubProcessHeader" - skeleton="subprocess_header_java.skeleton" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - NodesSubTree subTree = (NodesSubTree) codeGenArgument.getArgument(); - boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); - boolean stat = codeGenArgument.isStatistics(); - boolean containsTPartitioner = subTree.getRootNode().getProcess().getNodesOfType("tPartitioner").size() > 0 ? true : false; - boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(subTree.getRootNode().getProcess(), "__LOG4J_ACTIVATE__")); -%> - -<% - HashSet hSet = new HashSet(); - for (INode node : subTree.getNodes()) { - List metadatas = node.getMetadataList(); - List< ? extends IConnection> conns = node.getOutgoingConnections(); - for (IConnection conn : conns) { - // templateOrigin is used for Virtual COmponents - String templateOrigin = ""; - if (conn.getTarget()!=null) { - templateOrigin = ElementParameterParser.getValue(conn.getTarget(), "__ORIGIN__"); - } - boolean isLookup = false; - if ( - (templateOrigin.compareTo("")!=0) || - (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN))|| - (conn.getLineStyle().equals(EConnectionType.FLOW_REF)) || - (conn.getLineStyle().equals(EConnectionType.FLOW_MERGE))|| - (conn.getLineStyle().equals(EConnectionType.RUN_AFTER)) - ) { - - if(conn.getLineStyle().equals(EConnectionType.RUN_AFTER)){ - templateOrigin = ElementParameterParser.getValue(conn.getSource(), "__ORIGIN__"); - } - if (!hSet.contains(conn.getName() + templateOrigin)) { - hSet.add(conn.getName() + templateOrigin); - IMetadataTable metadata = conn.getMetadataTable(); - - boolean changeHashAndEqualsForBigDecimal = false; - Set hashableColumnsNames = new HashSet(); - - INode targetNode = conn.getTarget(); - if(targetNode instanceof IHashableInputConnections) { - if(targetNode.getUniqueName().startsWith("tMap")) { - changeHashAndEqualsForBigDecimal = "true".equals(ElementParameterParser.getValue(targetNode, "__CHANGE_HASH_AND_EQUALS_FOR_BIGDECIMAL__")); - } - IHashableInputConnections target = (IHashableInputConnections)targetNode; - IHashConfiguration hashConfiguration = target.getHashConfiguration(conn.getName()); - if(hashConfiguration != null) { - for(IHashableColumn hashableColumn : hashConfiguration.getHashableColumns()) { - isLookup = true; - hashableColumnsNames.add(hashableColumn.getName()); - } - } - } else { - - //only for the lookup branch of the tJoin - boolean isLookOftJoin = false; - boolean isLookOftRecordMatching = false; - boolean isLookOfHashOutput = false; - if(conn.getLineStyle().equals(EConnectionType.FLOW_REF)){ - IProcess process = conn.getTarget().getProcess(); - for (INode tjoinNode : process.getNodesOfType("tJoin")) { - if(conn.getTarget().getUniqueName().equals(tjoinNode.getUniqueName())){ - List> joinKeys = (List>)ElementParameterParser.getObjectValue(conn.getTarget(), "__JOIN_KEY__"); - for(Map joinKeyLine : joinKeys){ - String lookupKey = joinKeyLine.get("LOOKUP_COLUMN"); - hashableColumnsNames.add(lookupKey); - } - isLookOftJoin = true; - isLookup = true; - } - } - - // for tRecordMatching - if(conn.getTarget().getUniqueName().startsWith("tRecordMatching")){ - List> joinKeys = (List>)ElementParameterParser.getObjectValue(conn.getTarget(), "__BLOCKING_DEFINITION__"); - for(Map joinKeyLine : joinKeys){ - String lookupKey = joinKeyLine.get("LOOKUP_COLUMN"); - hashableColumnsNames.add(lookupKey); - isLookup = true; - } - isLookOftRecordMatching = true; - } - } else if(conn.getLineStyle() == EConnectionType.FLOW_MAIN) { - IProcess process = conn.getTarget().getProcess(); - for (INode thashNode : process.getNodesOfType("tHashOutput")) { - if(conn.getTarget().getUniqueName().equals(thashNode.getUniqueName())){ - boolean isLinked = "true".equals(ElementParameterParser.getValue(thashNode, "__LINK_WITH__")); - String matchingMode = ElementParameterParser.getValue(thashNode,"__KEYS_MANAGEMENT__"); - boolean hashKeyFromInputConnector = "true".equals(ElementParameterParser.getValue(thashNode, "__HASH_KEY_FROM_INPUT_CONNECTOR__")); - if(isLinked || !"KEEP_FIRST".equals(matchingMode) || hashKeyFromInputConnector) { - continue; - } - IMetadataTable thashNodeMetadata = null; - List thashNodeMetadatas = thashNode.getMetadataList(); - if (thashNodeMetadatas != null && thashNodeMetadatas.size() > 0) { - thashNodeMetadata = thashNodeMetadatas.get(0); - } - if(thashNodeMetadata!=null) { - for (IMetadataColumn column: thashNodeMetadata.getListColumns()) { - if (column.isKey()) { - hashableColumnsNames.add(column.getLabel()); - } - } - } - isLookOfHashOutput = true; - } - } - } - - if (!isLookOftJoin && !isLookOftRecordMatching && !isLookOfHashOutput && metadata!=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (column.isKey()) { - hashableColumnsNames.add(column.getLabel()); - } - } - } - } - boolean hasAtLeastOneKey = hashableColumnsNames.size() > 0; - -%> - -public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements routines.system.<%= isLookup ? "IPersistableComparableLookupRow<"+conn.getName()+"Struct>" : "IPersistableRow<"+conn.getName()+"Struct"+ templateOrigin + ">" %> { - final static byte[] commonByteArrayLock_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %> = new byte[0]; - static byte[] commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %> = new byte[0]; -<% - if(hasAtLeastOneKey) { -%> - protected static final int DEFAULT_HASHCODE = 1; - protected static final int PRIME = 31; - protected int hashCode = DEFAULT_HASHCODE; - public boolean hashCodeDirty = true; - - public String loopKey; - - -<% - } -%> - - <% - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if("id_Document".equals(javaType.getId()) || "id_Dynamic".equals(javaType.getId())) { - typeToGenerate = javaType.getNullableClass().getCanonicalName(); - } - %> - public <%= typeToGenerate %> <%=column.getLabel() %><% - - if(javaType == JavaTypesManager.CHARACTER && !column.isNullable()) { - %> = ' '<% - } - - %>; - - public <%= typeToGenerate %> get<%=column.getLabel().substring(0, 1).toUpperCase()%><%=column.getLabel().substring(1)%> () { - return this.<%=column.getLabel()%>; - } - <% - if((conn.getLineStyle() == EConnectionType.FLOW_REF) && conn.getTarget().getUniqueName().startsWith("tXMLMap") && "id_Document".equals(javaType.getId())) { - %> - public java.util.Map documentLookupResult = new java.util.HashMap(); - <% - } - } - } - %> - - <% - if(hasAtLeastOneKey) { // T_SH_001 - %> - - @Override - public int hashCode() { - if (this.hashCodeDirty) { - final int prime = PRIME; - int result = DEFAULT_HASHCODE; - <% - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (hashableColumnsNames.contains(column.getLabel())) { - - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - - if (JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) { - - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if(javaType == JavaTypesManager.BOOLEAN) { - %> - result = prime * result + (this.<%=column.getLabel() %> ? 1231 : 1237); - <% - } else { - %> - result = prime * result + (int) this.<%=column.getLabel() %>; - <% - } - - } else if(javaType == JavaTypesManager.BYTE_ARRAY) { - - %> - result = prime * result + java.util.Arrays.hashCode(this.<%=column.getLabel() %>); - <% - - } else if((javaType == JavaTypesManager.BIGDECIMAL) && changeHashAndEqualsForBigDecimal) { - %> - result = prime * result + ((this.<%=column.getLabel() %> == null) ? 0 : new Double(this.<%=column.getLabel() %>.doubleValue()).hashCode()); - <% - } else { - %> - result = prime * result + ((this.<%=column.getLabel() %> == null) ? 0 : this.<%=column.getLabel() %>.hashCode()); - <% - } - - } - } - } - %> - this.hashCode = result; - this.hashCodeDirty = false; - } - return this.hashCode; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; - final <%=conn.getName() %>Struct<%=templateOrigin %> other = (<%=conn.getName() %>Struct<%=templateOrigin %>) obj; - <% - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (hashableColumnsNames.contains(column.getLabel())) { - - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - - if (JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) { - %> - if (this.<%=column.getLabel() %> != other.<%=column.getLabel() %>) - return false; - <% - } else if(javaType == JavaTypesManager.BYTE_ARRAY) { - %> - if(!java.util.Arrays.equals(this.<%=column.getLabel() %>, other.<%=column.getLabel() %>)) { - return false; - } - <% - } else { - %> - if (this.<%=column.getLabel() %> == null) { - if (other.<%=column.getLabel() %> != null) - return false; - <%if((javaType == JavaTypesManager.BIGDECIMAL) && changeHashAndEqualsForBigDecimal) {%> - } else if ((other.<%=column.getLabel() %> == null) || (this.<%=column.getLabel() %>.compareTo(other.<%=column.getLabel() %>)!=0)) - <%} else {%> - } else if (!this.<%=column.getLabel() %>.equals(other.<%=column.getLabel() %>)) - <%}%> - return false; - <% - } - - } - } - } - %> - - return true; - } - - public void copyDataTo(<%=conn.getName() %>Struct<%=templateOrigin %> other) { - - <% - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - - %>other.<%= column.getLabel() %> = this.<%= column.getLabel() %>; - <% - } - } - %> - } - - public void copyKeysDataTo(<%=conn.getName() %>Struct<%=templateOrigin %> other) { - - <% - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (hashableColumnsNames.contains(column.getLabel())) { - - %>other.<%= column.getLabel() %> = this.<%= column.getLabel() %>; - <% - } - } - } - %> - } - - - <% - } // T_SH_001 - %> - -<% - if (metadata !=null) { - boolean hasString1 = false; - boolean hasString2 = false; - boolean hasDate1 = false; - boolean hasDate2 = false; - boolean hasByteArray1 = false; - boolean hasByteArray2 = false; - boolean hasInteger1 = false; - boolean hasInteger2 = false; - for (IMetadataColumn column: metadata.getListColumns()) { - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if(JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) continue; - if(typeToGenerate.equals("String")) { - if (!hasString1 && (!isLookup || hashableColumnsNames.contains(column.getLabel()))) { - hasString1 =true; -%> - - private String readString(ObjectInputStream dis) throws IOException{ - String strReturn = null; - int length = 0; - length = dis.readInt(); - if (length == -1) { - strReturn = null; - } else { - if(length > commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %>.length) { - if(length < 1024 && commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %>.length == 0) { - commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %> = new byte[1024]; - } else { - commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %> = new byte[2 * length]; - } - } - dis.readFully(commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %>, 0, length); - strReturn = new String(commonByteArray_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %>, 0, length, utf8Charset); - } - return strReturn; - } - - private void writeString(String str, ObjectOutputStream dos) throws IOException{ - if(str == null) { - dos.writeInt(-1); - } else { - byte[] byteArray = str.getBytes(utf8Charset); - dos.writeInt(byteArray.length); - dos.write(byteArray); - } - } -<% - } else if(!hasString2 && (isLookup && !hashableColumnsNames.contains(column.getLabel()))){ - hasString2 = true; -%> - - private String readString(DataInputStream dis, ObjectInputStream ois) throws IOException{ - String strReturn = null; - int length = 0; - length = dis.readInt(); - if (length == -1) { - strReturn = null; - } else { - byte[] byteArray = new byte[length]; - dis.read(byteArray); - strReturn = new String(byteArray, utf8Charset); - } - return strReturn; - } - - private void writeString(String str, DataOutputStream dos, ObjectOutputStream oos) throws IOException{ - if(str == null) { - dos.writeInt(-1); - } else { - byte[] byteArray = str.getBytes(utf8Charset); - dos.writeInt(byteArray.length); - dos.write(byteArray); - } - } -<% - } - } else if(typeToGenerate.equals("java.util.Date")) { - if(!hasDate1 && (!isLookup || hashableColumnsNames.contains(column.getLabel()))) { - hasDate1 = true; -%> - - private java.util.Date readDate(ObjectInputStream dis) throws IOException{ - java.util.Date dateReturn = null; - int length = 0; - length = dis.readByte(); - if (length == -1) { - dateReturn = null; - } else { - dateReturn = new Date(dis.readLong()); - } - return dateReturn; - } - - private void writeDate(java.util.Date date1, ObjectOutputStream dos) throws IOException{ - if(date1 == null) { - dos.writeByte(-1); - } else { - dos.writeByte(0); - dos.writeLong(date1.getTime()); - } - } -<% - }else if (!hasDate2 && (isLookup && !hashableColumnsNames.contains(column.getLabel()))) { - hasDate2 = true; -%> - - private java.util.Date readDate(DataInputStream dis, ObjectInputStream ois) throws IOException{ - java.util.Date dateReturn = null; - int length = 0; - length = dis.readByte(); - if (length == -1) { - dateReturn = null; - } else { - dateReturn = new Date(dis.readLong()); - } - return dateReturn; - } - - private void writeDate(java.util.Date date1, DataOutputStream dos, ObjectOutputStream oos) throws IOException{ - if(date1 == null) { - dos.writeByte(-1); - } else { - dos.writeByte(0); - dos.writeLong(date1.getTime()); - } - } -<% - } - } else if(typeToGenerate.equals("byte[]")) { - if(!hasByteArray1 && (!isLookup || hashableColumnsNames.contains(column.getLabel()))) { - hasByteArray1 = true; -%> - private byte[] readByteArray(ObjectInputStream dis) throws IOException{ - byte[] byteArrayReturn; - int length = 0; - length = dis.readInt(); - if (length == -1) { - byteArrayReturn = null; - } else { - byte[] byteArray = new byte[length]; - dis.readFully(byteArray); - byteArrayReturn = byteArray; - } - return byteArrayReturn; - } - - private void writeByteArray(byte[] byteArray, ObjectOutputStream dos) throws IOException{ - if(byteArray == null) { - dos.writeInt(-1); - } else { - dos.writeInt(byteArray.length); - dos.write(byteArray); - } - } -<% - }else if (!hasByteArray2 && (isLookup && !hashableColumnsNames.contains(column.getLabel()))) { - hasByteArray2 = true; -%> - private byte[] readByteArray(DataInputStream dis, ObjectInputStream ois) throws IOException{ - byte[] byteArrayReturn; - int length = 0; - length = dis.readInt(); - if (length == -1) { - byteArrayReturn = null; - } else { - byte[] byteArray = new byte[length]; - dis.read(byteArray); - byteArrayReturn = byteArray; - } - return byteArrayReturn; - } - - private void writeByteArray(byte[] byteArray, DataOutputStream dos, ObjectOutputStream oos) throws IOException{ - if(byteArray == null) { - dos.writeInt(-1); - } else { - dos.writeInt(byteArray.length); - dos.write(byteArray); - } - } -<% - } - }else { - typeToGenerate =JavaTypesManager.getTypeToGenerate(column.getTalendType(), false); - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - if(typeToGenerate.equals("Int")){ - if(!hasInteger1 && (!isLookup || hashableColumnsNames.contains(column.getLabel()))) { - hasInteger1 = true; -%> - private Integer readInteger(ObjectInputStream dis) throws IOException{ - Integer intReturn; - int length = 0; - length = dis.readByte(); - if (length == -1) { - intReturn = null; - } else { - intReturn = dis.read<%= typeToGenerate %>(); - } - return intReturn; - } - - private void writeInteger(Integer intNum, ObjectOutputStream dos) throws IOException{ - if(intNum == null) { - dos.writeByte(-1); - } else { - dos.writeByte(0); - dos.write<%= typeToGenerate %>(intNum); - } - } -<% - } else if(!hasInteger2 && (isLookup && !hashableColumnsNames.contains(column.getLabel()))){ - hasInteger2 = true; -%> - private Integer readInteger(DataInputStream dis, ObjectInputStream ois) throws IOException{ - Integer intReturn; - int length = 0; - length = dis.readByte(); - if (length == -1) { - intReturn = null; - } else { - intReturn = dis.read<%= typeToGenerate %>(); - } - return intReturn; - } - - private void writeInteger(Integer intNum, DataOutputStream dos, ObjectOutputStream oos) throws IOException{ - if(intNum == null) { - dos.writeByte(-1); - } else { - dos.writeByte(0); - dos.write<%= typeToGenerate %>(intNum); - } - } -<% - } - } - } - } - } -%> - - public void <%= isLookup ? "readKeys" : "read" %>Data(ObjectInputStream dis) { - - synchronized(commonByteArrayLock_<%=codeGenArgument.getCurrentProjectName() %>_<%=codeGenArgument.getJobName() %>) { - - try { - - int length = 0; - <% - boolean hasAtLeastOneRead = false; - boolean hasAtLeastOneObjectType = false; - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (!isLookup || hashableColumnsNames.contains(column.getLabel())) { - hasAtLeastOneRead = true; - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - - if (JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) { - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - %> - this.<%=column.getLabel() %> = dis.read<%= typeToGenerate %>(); - <% - } else if(typeToGenerate.equals("String")) { - %> - this.<%=column.getLabel() %> = readString(dis); - <% - } else if(typeToGenerate.equals("java.util.Date")) { - %> - this.<%=column.getLabel() %> = readDate(dis); - <% - } else if(typeToGenerate.equals("byte[]")) { - %> - this.<%=column.getLabel() %> = readByteArray(dis); - <% - } else if(javaType.isObjectBased() || typeToGenerate.equals("Geometry") || typeToGenerate.equals("Dynamic")) { - hasAtLeastOneObjectType = true; - if("id_Document".equals(javaType.getId()) || "id_Dynamic".equals(javaType.getId())) { - typeToGenerate = javaType.getNullableClass().getCanonicalName(); - } - %> - this.<%=column.getLabel() %> = (<%= typeToGenerate %>) dis.readObject(); - <% - } else { - typeToGenerate =JavaTypesManager.getTypeToGenerate(column.getTalendType(), false); - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - if(typeToGenerate.equals("Int")){ - %> - this.<%=column.getLabel() %> = readInteger(dis); - <% - } else { - %> - length = dis.readByte(); - if (length == -1) { - this.<%=column.getLabel() %> = null; - } else { - this.<%=column.getLabel() %> = dis.read<%= typeToGenerate %>(); - } - <% - } - } - } - } - } - if(hasAtLeastOneRead) { - %> - } catch (IOException e) { - throw new RuntimeException(e); - <% - } - %> - - <% - if(hasAtLeastOneObjectType) { - %> - } catch(ClassNotFoundException eCNFE) { - throw new RuntimeException(eCNFE); - <% - } - %> - - } - - <% - if(!hasAtLeastOneRead) { - %> - finally {} - <% - } - %> - - } - - - } - - public void <%= isLookup ? "writeKeys" : "write" %>Data(ObjectOutputStream dos) { - try { - - <% - boolean hasAtLeastOneWrite = false; - hasAtLeastOneObjectType = false; - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (!isLookup || hashableColumnsNames.contains(column.getLabel())) { - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - hasAtLeastOneWrite = true; - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - %> - // <%=typeToGenerate %> - <% - if (JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) { - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - %> - dos.write<%= typeToGenerate %>(this.<%=column.getLabel() %>); - <% - } else if(typeToGenerate.equals("String")) { - %> - writeString(this.<%=column.getLabel() %>,dos); - <% - } else if(typeToGenerate.equals("java.util.Date")) { - %> - writeDate(this.<%=column.getLabel() %>,dos); - <% - } else if(typeToGenerate.equals("byte[]")) { - %> - writeByteArray(this.<%=column.getLabel() %>,dos); - <% - } else if(javaType.isObjectBased() || typeToGenerate.equals("Geometry") || typeToGenerate.equals("Dynamic")) { - %> - dos.writeObject(this.<%=column.getLabel() %>); - <% - } else { - typeToGenerate =JavaTypesManager.getTypeToGenerate(column.getTalendType(), false); - typeToGenerate = typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - if(typeToGenerate.equals("Int")){ - %> - writeInteger(this.<%=column.getLabel() %>,dos); - <% - } else { - %> - if(this.<%=column.getLabel() %> == null) { - dos.writeByte(-1); - } else { - dos.writeByte(0); - dos.write<%= typeToGenerate %>(this.<%=column.getLabel() %>); - } - <% - } - } - } - } - } - if(hasAtLeastOneWrite) { - %> - } catch (IOException e) { - throw new RuntimeException(e); - <% - } - %> - } - - <% - if(!hasAtLeastOneWrite) { - %> - finally {} - <% - } - %> - - } - - <% - if(isLookup) { // T SH 002 - %> - - - /** - * Fill Values data by reading ObjectInputStream. - */ - public void readValuesData(DataInputStream dis, ObjectInputStream ois) { - try { - - int length = 0; - <% - hasAtLeastOneRead = false; - hasAtLeastOneObjectType = false; - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (!hashableColumnsNames.contains(column.getLabel())) { - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - hasAtLeastOneRead = true; - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - - if (JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) { - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - %> - this.<%=column.getLabel() %> = dis.read<%= typeToGenerate %>(); - <% - } else if(typeToGenerate.equals("String")) { - %> - this.<%=column.getLabel() %> = readString(dis,ois); - <% - } else if(typeToGenerate.equals("byte[]")) { - %> - this.<%=column.getLabel() %> = readByteArray(dis,ois); - <% - } else if(typeToGenerate.equals("java.util.Date")) { - %> - this.<%=column.getLabel() %> = readDate(dis,ois); - <% - } else if(typeToGenerate.equals("Object") || typeToGenerate.equals("Geometry") || typeToGenerate.equals("BigDecimal") || typeToGenerate.equals("List") || typeToGenerate.equals("Dynamic") || typeToGenerate.equals("Document")) { - hasAtLeastOneObjectType = true; - if("id_Document".equals(javaType.getId()) || "id_Dynamic".equals(javaType.getId())) { - typeToGenerate = javaType.getNullableClass().getCanonicalName(); - } - %> - this.<%=column.getLabel() %> = (<%= typeToGenerate %>) ois.readObject(); - <% - } else { - typeToGenerate =JavaTypesManager.getTypeToGenerate(column.getTalendType(), false); - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - if(typeToGenerate.equals("Int")){ - %> - this.<%=column.getLabel() %> = readInteger(dis,ois); - <% - } else { - %> - length = dis.readByte(); - if (length == -1) { - this.<%=column.getLabel() %> = null; - } else { - this.<%=column.getLabel() %> = dis.read<%= typeToGenerate %>(); - } - <% - } - } - } - } - } - if(hasAtLeastOneRead) { - %> - } catch (IOException e) { - throw new RuntimeException(e); - <% - } - %> - - <% - if(hasAtLeastOneObjectType) { - %> - } catch(ClassNotFoundException eCNFE) { - throw new RuntimeException(eCNFE); - <% - } - %> - - } - - <% - if(!hasAtLeastOneRead) { - %> - finally {} - <% - } - %> - - } - - /** - * Return a byte array which represents Values data. - */ - public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) { - try { - - <% - hasAtLeastOneWrite = false; - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (!hashableColumnsNames.contains(column.getLabel())) { - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - hasAtLeastOneWrite = true; - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if (JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable())) { - typeToGenerate=typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - %> - dos.write<%= typeToGenerate %>(this.<%=column.getLabel() %>); - <% - } else if(typeToGenerate.equals("String")) { - %> - writeString(this.<%=column.getLabel() %>, dos, oos); - <% - } else if(typeToGenerate.equals("byte[]")) { - %> - writeByteArray(this.<%=column.getLabel() %>, dos, oos); - <% - } else if(typeToGenerate.equals("java.util.Date")) { - %> - writeDate(this.<%=column.getLabel() %>, dos, oos); - <% - } else if(typeToGenerate.equals("Object") || typeToGenerate.equals("Geometry") || typeToGenerate.equals("BigDecimal") || typeToGenerate.equals("List") || typeToGenerate.equals("Dynamic") || typeToGenerate.equals("Document")) { - %> - oos.writeObject(this.<%=column.getLabel() %>); - <% - } else { - typeToGenerate =JavaTypesManager.getTypeToGenerate(column.getTalendType(), false); - typeToGenerate = typeToGenerate.substring(0,1).toUpperCase()+typeToGenerate.substring(1); - if(typeToGenerate.equals("Int")){ - %> - writeInteger(this.<%=column.getLabel() %>, dos, oos); - <% - } else { - %> - if(this.<%=column.getLabel() %> == null) { - dos.writeByte(-1); - } else { - dos.writeByte(0); - dos.write<%= typeToGenerate %>(this.<%=column.getLabel() %>); - } - <% - } - } - } - } - } - - if(hasAtLeastOneRead) { - %> - } catch (IOException e) { - throw new RuntimeException(e); - <% - } - %> - } - <% - if(!hasAtLeastOneRead) { - %> - finally {} - <% - } - %> - - } - - <% - } // T SH 002 - %> - - public String toString() { - - StringBuilder sb = new StringBuilder(); - sb.append(super.toString()); - sb.append("["); -<% - if (metadata !=null) { - List clmlist = metadata.getListColumns(); - for(int i=0; i< clmlist.size(); i++) { - IMetadataColumn column = clmlist.get(i); - String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); - if(typeToGenerate.equals("String")) { -%> - sb.append("<%=i==0?"":"," %><%=column.getLabel() %>="+<%=column.getLabel() %>); -<% - }else{ -%> - sb.append("<%=i==0?"":"," %><%=column.getLabel() %>="+String.valueOf(<%=column.getLabel() %>)); -<% - } - } - } -%> - sb.append("]"); - - return sb.toString(); - } - <%if(isLog4jEnabled){%> - public String toLogString(){ - StringBuilder sb = new StringBuilder(); - <% - if (metadata !=null) { - List columnList = metadata.getListColumns(); - for(IMetadataColumn column : columnList){ - JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); - String columnName = column.getLabel(); - boolean isPrimit = JavaTypesManager.isJavaPrimitiveType(column.getTalendType(), column.isNullable()); - if(isPrimit){ - %> - sb.append(<%=columnName%>); - <% - }else{ - %> - if(<%=columnName%> == null){ - sb.append(""); - }else{ - sb.append(<%=columnName%>); - } - <% - } - %> - sb.append("|"); - <% - } - } - %> - return sb.toString(); - } - <%}%> - - /** - * Compare keys - */ - public int compareTo(<%=conn.getName() %>Struct<%=templateOrigin %> other) { - - int returnValue = -1; - <% - if (metadata !=null) { - for (IMetadataColumn column: metadata.getListColumns()) { - if (hashableColumnsNames.contains(column.getLabel())) { - %> - returnValue = checkNullsAndCompare(this.<%=column.getLabel() %>, other.<%=column.getLabel() %>); - if(returnValue != 0) { - return returnValue; - } - - <% - } - } - } - %> - return returnValue; - } - - - private int checkNullsAndCompare(Object object1, Object object2) { - int returnValue = 0; - if (object1 instanceof Comparable && object2 instanceof Comparable) { - returnValue = ((Comparable) object1).compareTo(object2); - } else if (object1 != null && object2 != null) { - returnValue = compareStrings(object1.toString(), object2.toString()); - } else if (object1 == null && object2 != null) { - returnValue = 1; - } else if (object1 != null && object2 == null) { - returnValue = -1; - } else { - returnValue = 0; - } - - return returnValue; - } - - private int compareStrings(String string1, String string2) { - return string1.compareTo(string2); - } - - -} -<% - } - } - } - } -%> -<% if (subTree.isMethodSizeNeeded()){ %> -/** - * Start of Function: <%=subTree.getName() %>Process. - * Byte Length of Source Code: ?SIZE? - */ - <% } %> -public void <%=subTree.getName() %>Process(final java.util.Map globalMap) throws TalendException { - globalMap.put("<%=subTree.getName() %>_SUBPROCESS_STATE", 0); - - final boolean execStat = this.execStat; -<% - boolean isParallelize = false; - for (INode node : subTree.getNodes()) { - if(node!=null){ - String parallelize = ElementParameterParser.getValue(node, "__PARALLELIZE__"); - if(parallelize!=null &¶llelize.equals("true")){ - // temporary modification : if tAsyncIn is available, this is always a parallelized process - isParallelize = true; - } - } - } - if(isParallelize){ -%> - - try { - final ParallelThreadPool pool = (ParallelThreadPool) globalMap - .get("PARALLEL_FLOW_POOL_<%=(subTree.getName()).replaceAll("tAsyncIn", "tAsyncOut")%>"); - class <%=subTree.getName() %>_ParallelThread extends ParallelThread { - - public <%=subTree.getName() %>_ParallelThread( - java.util.Map globalMap, - Object[] lockWrite) { - super(globalMap, lockWrite); - } - boolean isRunning = false; - String iterateId = ""; - <%if(containsTPartitioner){%> - int iterateLoop = 0; - <%}%> - - public void run() { - java.util.Map threadRunResultMap = new java.util.HashMap(); - threadRunResultMap.put("errorCode", null); - threadRunResultMap.put("status", ""); - threadLocal.set(threadRunResultMap); - - this.isRunning = true; - String currentComponent = ""; - <% - if(NodeUtil.hasVirtualComponent(subTree.getNodes())){ - %> - String currentVirtualComponent = null; - <% - } - %> - java.util.Map resourceMap = new java.util.HashMap(); - try{ - -<% - }else{ // else part for "if(isParallelize)" Line: 1054 - if(NodeUtil.hasVirtualComponent(subTree.getNodes())){ -%> - String currentVirtualComponent = null; -<% - } -%> - <% - if(subTree.getRootNode().getComponent().getName().equals("tCollector")){ - %> - String iterateId = "." + globalMap.get("<%=subTree.getRootNode().getDesignSubjobStartNode().getUniqueName()%>_THREAD_ID"); - <% - }else{ - %> - String iterateId = ""; - <% - } - %> - <%if(containsTPartitioner){%> - int iterateLoop = 0; - <%}%> - String currentComponent = ""; - java.util.Map resourceMap = new java.util.HashMap(); - - try { - - String currentMethodName = new java.lang.Exception().getStackTrace()[0].getMethodName(); - boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); - if( resumeEntryMethodName == null || resumeIt || globalResumeTicket){//start the resume - globalResumeTicket = true; - -<% -//this part for "Resume Management" -{ - INode firstNode = subTree.getNode(subTree.getName()); - - //System.out.println(firstNode.getUniqueName()); - List inConns = firstNode.getIncomingConnections(); - - //System.out.println(inConns.size()); - for(IConnection conn : inConns){ - - boolean activeResume = "true".equals(ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__")); - - //System.out.println("Test:" + ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__")); - - if(activeResume){ - EConnectionType lineStyle = conn.getLineStyle(); - INode sourceNode = conn.getSource(); - String sourceNodeName = sourceNode.getUniqueName(); - %> - //resumeUtil.addLog("CHECKPOINT", "CONNECTION:<%=lineStyle.getName() %>:<%=sourceNodeName %>:<%=conn.getName() %><%=conn.getOutputId() > 0 ? conn.getOutputId() : "" %>", "", Thread.currentThread().getId() + "", "", "", "", "", ""); - <% - } - } -} -%> - -<% - // Call for RUN AFTER links - for (String after : subTree.getAfterSubProcesses()) { -%> - <%=after %>Process(globalMap); -<% - } - }//isParallelize -%> - -<% - if(!subTree.isMergeSubTree()) { - List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections(); - if ((rootConns!=null)&&(rootConns.size()>0)) { -%> - <%=createPrivateClassInstance(subTree.getRootNode(), rootConns.get(0).getName(), false)%> -<% - } - } else { - List sortedMergeBranchStarts = subTree.getSortedMergeBranchStarts(); - for (INode startNode : sortedMergeBranchStarts) { - List< ? extends IConnection> rootConns = startNode.getOutgoingConnections(); - if ((rootConns!=null)&&(rootConns.size()>0)) { -%> - <%=createPrivateClassInstance(startNode, rootConns.get(0).getName(), false)%> -<% - } - } - List mergeNodes =subTree.getMergeNodes(); - for(INode mNode:mergeNodes){ - List< ? extends IConnection> rootConns = mNode.getOutgoingConnections(); - if ((rootConns!=null)&&(rootConns.size()>0)) { -%> - <%=createPrivateClassInstance(mNode, rootConns.get(0).getName(), false)%> -<% - } - } - - } -%> - diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subtree_begin.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subtree_begin.javajet deleted file mode 100644 index 13440b7..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subtree_begin.javajet +++ /dev/null @@ -1,53 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IConnection - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.codegen.config.SubTreeArgument - org.talend.core.model.process.IConnectionCategory - org.talend.core.model.utils.NodeUtil - java.util.List - " - class="SubTreeBegin" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - SubTreeArgument subTreeArgument = (SubTreeArgument)codeGenArgument.getArgument(); - IConnection connection = subTreeArgument.getInputSubtreeConnection(); - if(subTreeArgument.isSourceComponentHasConditionnalOutputs() - && connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { -%> - -// Start of branch "<%= connection.getName()%>" -if(<%= connection.getName()%> != null) { -<% - java.util.Set conns = NodeUtil.getAllInLineJobConnections(connection.getTarget()); - //Bug15479, if there is any non-Main_Flow link(OK/ERROR/IF/ITERATOR...) followed, REJECT will not assigned to NULL at here - boolean flag = true; - for(IConnection conn : conns){ - if(conn.getLineStyle().compareTo(org.talend.core.model.process.EConnectionType.FLOW_MAIN) > 0){ - flag = false; - } - } - for (Object obj : conns) { - IConnection conn = (IConnection)obj; - // Bug16902, because conn.isMonitorConnection() always return false in AbstractConnection, use conn.getMetadataTable().getTableName().contains("vFlowMeter_") instead - if("REJECT".equals(conn.getConnectorName()) && flag && !conn.getMetadataTable().getTableName().contains("vFlowMeter_")) { -%> - <%= conn.getName()%> = null; -<% - } - } - if (connection.getSource().isUseLoopOnConditionalOutput(connection.getName())) { -%> - // start of joined table loop - for (<%= connection.getName()%>Struct cur_<%= connection.getName()%> :<%= connection.getName()%>_List) { - <%= connection.getName()%> = cur_<%= connection.getName()%>; -<% - } -%> - - -<% - } -%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subtree_end.javajet b/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subtree_end.javajet deleted file mode 100644 index df0935c..0000000 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subtree_end.javajet +++ /dev/null @@ -1,43 +0,0 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IConnection - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.codegen.config.SubTreeArgument - org.talend.core.model.process.IConnectionCategory - org.talend.core.model.utils.NodeUtil - " - class="SubTreeEnd" -%> -<% -CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - SubTreeArgument subTreeArgument = (SubTreeArgument)codeGenArgument.getArgument(); - IConnection connection = subTreeArgument.getInputSubtreeConnection(); - - if(subTreeArgument.isSourceComponentHasConditionnalOutputs() - && connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { -%> -<% - if (connection.getSource().isUseLoopOnConditionalOutput(connection.getName())) { -%> - } // end of joined table loop - <%=connection.getName()%>_List.clear(); -<% - } -%> - -} // End of branch "<%= connection.getName()%>" - -<% - } - - if (subTreeArgument.isMultiplyingOutputComponents() && - NodeUtil.isLastMultiplyingOutputComponents(connection)) { -%> - // end for - } -<% - } -%> - - diff --git a/lib/6.2.0/org.talend.model_6.2.0.20160510_1709.jar b/lib/6.2.0/org.talend.model_6.2.0.20160510_1709.jar deleted file mode 100755 index 9845255..0000000 Binary files a/lib/6.2.0/org.talend.model_6.2.0.20160510_1709.jar and /dev/null differ diff --git a/lib/6.2.0/log4j-1.2.17.jar b/lib/6.4.1/log4j-1.2.17.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/log4j-1.2.17.jar rename to lib/6.4.1/log4j-1.2.17.jar diff --git a/lib/6.2.0/org.apache.log4j_1.2.15.v201012070815.jar b/lib/6.4.1/org.apache.log4j_1.2.15.v201012070815.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.apache.log4j_1.2.15.v201012070815.jar rename to lib/6.4.1/org.apache.log4j_1.2.15.v201012070815.jar diff --git a/lib/6.2.0/org.eclipse.core.jobs_3.6.0.v20140424-0053.jar b/lib/6.4.1/org.eclipse.core.jobs_3.6.0.v20140424-0053.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.core.jobs_3.6.0.v20140424-0053.jar rename to lib/6.4.1/org.eclipse.core.jobs_3.6.0.v20140424-0053.jar diff --git a/lib/6.2.0/org.eclipse.core.resources_3.9.1.v20140825-1431.jar b/lib/6.4.1/org.eclipse.core.resources_3.9.1.v20140825-1431.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.core.resources_3.9.1.v20140825-1431.jar rename to lib/6.4.1/org.eclipse.core.resources_3.9.1.v20140825-1431.jar diff --git a/lib/6.2.0/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar b/lib/6.4.1/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar rename to lib/6.4.1/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar diff --git a/lib/6.2.0/org.eclipse.emf.common_2.10.1.v20140901-1043.jar b/lib/6.4.1/org.eclipse.emf.common_2.10.1.v20140901-1043.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.emf.common_2.10.1.v20140901-1043.jar rename to lib/6.4.1/org.eclipse.emf.common_2.10.1.v20140901-1043.jar diff --git a/lib/6.2.0/org.eclipse.emf.ecore_2.10.1.v20140901-1043.jar b/lib/6.4.1/org.eclipse.emf.ecore_2.10.1.v20140901-1043.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.emf.ecore_2.10.1.v20140901-1043.jar rename to lib/6.4.1/org.eclipse.emf.ecore_2.10.1.v20140901-1043.jar diff --git a/lib/6.2.0/org.eclipse.equinox.app_1.3.200.v20130910-1609.jar b/lib/6.4.1/org.eclipse.equinox.app_1.3.200.v20130910-1609.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.equinox.app_1.3.200.v20130910-1609.jar rename to lib/6.4.1/org.eclipse.equinox.app_1.3.200.v20130910-1609.jar diff --git a/lib/6.2.0/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar b/lib/6.4.1/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar rename to lib/6.4.1/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar diff --git a/lib/6.2.0/org.eclipse.jface_3.10.1.v20140813-1009.jar b/lib/6.4.1/org.eclipse.jface_3.10.1.v20140813-1009.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.jface_3.10.1.v20140813-1009.jar rename to lib/6.4.1/org.eclipse.jface_3.10.1.v20140813-1009.jar diff --git a/lib/6.2.0/org.eclipse.osgi_3.10.1.v20140909-1633.jar b/lib/6.4.1/org.eclipse.osgi_3.10.100.v20150521-1310.jar old mode 100755 new mode 100644 similarity index 66% rename from lib/6.2.0/org.eclipse.osgi_3.10.1.v20140909-1633.jar rename to lib/6.4.1/org.eclipse.osgi_3.10.100.v20150521-1310.jar index b83fd2e..f83d97f Binary files a/lib/6.2.0/org.eclipse.osgi_3.10.1.v20140909-1633.jar and b/lib/6.4.1/org.eclipse.osgi_3.10.100.v20150521-1310.jar differ diff --git a/lib/6.2.0/org.eclipse.ui.ide_3.10.1.v20140828-0944.jar b/lib/6.4.1/org.eclipse.ui.ide_3.10.1.v20140828-0944.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.ui.ide_3.10.1.v20140828-0944.jar rename to lib/6.4.1/org.eclipse.ui.ide_3.10.1.v20140828-0944.jar diff --git a/lib/6.2.0/org.eclipse.ui.workbench_3.106.1.v20140827-1737.jar b/lib/6.4.1/org.eclipse.ui.workbench_3.106.1.v20140827-1737.jar old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.eclipse.ui.workbench_3.106.1.v20140827-1737.jar rename to lib/6.4.1/org.eclipse.ui.workbench_3.106.1.v20140827-1737.jar diff --git a/lib/6.2.0/org.talend.common.ui.runtime_6.2.0.20160510_1709.jar b/lib/6.4.1/org.talend.common.ui.runtime_6.4.1.20170623_1246.jar old mode 100755 new mode 100644 similarity index 87% rename from lib/6.2.0/org.talend.common.ui.runtime_6.2.0.20160510_1709.jar rename to lib/6.4.1/org.talend.common.ui.runtime_6.4.1.20170623_1246.jar index 68c783a..3e96798 Binary files a/lib/6.2.0/org.talend.common.ui.runtime_6.2.0.20160510_1709.jar and b/lib/6.4.1/org.talend.common.ui.runtime_6.4.1.20170623_1246.jar differ diff --git a/lib/6.4.1/org.talend.commons.runtime_6.4.1.20170623_1246.jar b/lib/6.4.1/org.talend.commons.runtime_6.4.1.20170623_1246.jar new file mode 100644 index 0000000..c5881d0 Binary files /dev/null and b/lib/6.4.1/org.talend.commons.runtime_6.4.1.20170623_1246.jar differ diff --git a/lib/6.4.1/org.talend.core.repository_6.4.1.20170623_1246.jar b/lib/6.4.1/org.talend.core.repository_6.4.1.20170623_1246.jar new file mode 100644 index 0000000..7538009 Binary files /dev/null and b/lib/6.4.1/org.talend.core.repository_6.4.1.20170623_1246.jar differ diff --git a/lib/6.4.1/org.talend.core.runtime_6.4.1.20170623_1246.jar b/lib/6.4.1/org.talend.core.runtime_6.4.1.20170623_1246.jar new file mode 100644 index 0000000..2c4a973 Binary files /dev/null and b/lib/6.4.1/org.talend.core.runtime_6.4.1.20170623_1246.jar differ diff --git a/lib/6.2.0/org.talend.core.ui_6.2.0.20160510_1709.jar b/lib/6.4.1/org.talend.core.ui_6.4.1.20170623_1246.jar old mode 100755 new mode 100644 similarity index 85% rename from lib/6.2.0/org.talend.core.ui_6.2.0.20160510_1709.jar rename to lib/6.4.1/org.talend.core.ui_6.4.1.20170623_1246.jar index 2e9dffd..f859d1b Binary files a/lib/6.2.0/org.talend.core.ui_6.2.0.20160510_1709.jar and b/lib/6.4.1/org.talend.core.ui_6.4.1.20170623_1246.jar differ diff --git a/lib/6.2.0/org.talend.core_6.2.0.20160510_1709.jar b/lib/6.4.1/org.talend.core_6.4.1.20170623_1246.jar old mode 100755 new mode 100644 similarity index 85% rename from lib/6.2.0/org.talend.core_6.2.0.20160510_1709.jar rename to lib/6.4.1/org.talend.core_6.4.1.20170623_1246.jar index 258e2c3..34d42c0 Binary files a/lib/6.2.0/org.talend.core_6.2.0.20160510_1709.jar and b/lib/6.4.1/org.talend.core_6.4.1.20170623_1246.jar differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/META-INF/MANIFEST.MF b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/META-INF/MANIFEST.MF old mode 100755 new mode 100644 similarity index 95% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/META-INF/MANIFEST.MF rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/META-INF/MANIFEST.MF index d3290f1..b3c403e --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/META-INF/MANIFEST.MF +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/META-INF/MANIFEST.MF @@ -1,29 +1,29 @@ -Manifest-Version: 1.0 -Bundle-SymbolicName: org.talend.designer.codegen;singleton:=true -Archiver-Version: Plexus Archiver -Built-By: -Require-Bundle: org.talend.core.repository,org.eclipse.emf.codegen,org - .eclipse.jdt.core,org.talend.repository,org.talend.commons.ui,org.ecl - ipse.emf.ecore.xmi,org.talend.model,org.talend.metadata.managment,org - .talend.designer.core,org.talend.hadoop.distribution,org.talend.hadoo - p.distribution.custom,org.apache.xerces,org.talend.core,org.talend.co - re.ui,org.eclipse.ui.workbench,org.apache.log4j,org.talend.components - .api,org.talend.designer.core.generic,org.talend.daikon -Bundle-ManifestVersion: 2 -Bundle-Vendor: .Talend SA. -Import-Package: org.apache.commons.lang -Eclipse-LazyStart: true -Export-Package: org.talend.designer.codegen,org.talend.designer.codege - n.additionaljet,org.talend.designer.codegen.components.model,org.tale - nd.designer.codegen.components.ui,org.talend.designer.codegen.config, - org.talend.designer.codegen.exception,org.talend.designer.codegen.mod - el,org.talend.designer.codegen.proxy -Bundle-Name: CodeGen Plug-in -Bundle-Version: 6.2.0.20160510_1709 -Bundle-Localization: plugin -Bundle-ClassPath: . -Bundle-Activator: org.talend.designer.codegen.CodeGeneratorActivator -Created-By: Apache Maven 3.2.5 -Build-Jdk: 1.8.0_40 -Eclipse-BundleShape: dir - +Manifest-Version: 1.0 +Bundle-SymbolicName: org.talend.designer.codegen;singleton:=true +Archiver-Version: Plexus Archiver +Built-By: +Require-Bundle: org.talend.core.repository,org.eclipse.emf.codegen,org + .eclipse.jdt.core,org.talend.repository,org.talend.commons.ui,org.ecl + ipse.emf.ecore.xmi,org.talend.model,org.talend.metadata.managment,org + .talend.designer.core,org.talend.hadoop.distribution,org.talend.hadoo + p.distribution.custom,org.apache.xerces,org.talend.core,org.talend.co + re.ui,org.eclipse.ui.workbench,org.apache.log4j,org.talend.components + .api,org.talend.designer.core.generic,org.talend.daikon +Bundle-ManifestVersion: 2 +Bundle-Vendor: .Talend SA. +Import-Package: org.apache.commons.lang +Eclipse-LazyStart: true +Export-Package: org.talend.designer.codegen,org.talend.designer.codege + n.additionaljet,org.talend.designer.codegen.components.model,org.tale + nd.designer.codegen.components.ui,org.talend.designer.codegen.config, + org.talend.designer.codegen.exception,org.talend.designer.codegen.mod + el,org.talend.designer.codegen.proxy +Bundle-Name: CodeGen Plug-in +Bundle-Version: 6.4.1.20170623_1246 +Bundle-Localization: plugin +Bundle-ClassPath: . +Bundle-Activator: org.talend.designer.codegen.CodeGeneratorActivator +Created-By: Apache Maven 3.2.5 +Build-Jdk: 1.8.0_40 +Eclipse-BundleShape: dir + diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/META-INF/eclipse.inf b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/META-INF/eclipse.inf old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/META-INF/eclipse.inf rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/META-INF/eclipse.inf diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/icons/sample.gif b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/icons/sample.gif old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/icons/sample.gif rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/icons/sample.gif diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/close_blocks_code.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/close_blocks_code.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/close_blocks_code.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/close_blocks_code.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/component_part_endmain.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/component_part_endmain.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/component_part_endmain.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/component_part_endmain.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/component_part_footer.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/component_part_footer.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/component_part_footer.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/component_part_footer.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/component_part_header.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/component_part_header.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/component_part_header.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/component_part_header.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/context.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/context.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/context.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/context.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/default_template.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/default_template.javajet old mode 100755 new mode 100644 similarity index 97% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/default_template.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/default_template.javajet index dc6f07a..b4f5d9a --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/default_template.javajet +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/default_template.javajet @@ -1,28 +1,28 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.INode - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.core.model.temp.ECodePart - " - class="Default_template" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Object object = codeGenArgument.getArgument(); - - //This is only for the component, when it compile error, there will call this template file to generate. - //If the files in /resources compile error, ignore them. - if(object instanceof INode) { - - INode node = (INode)codeGenArgument.getArgument(); - String cid = node.getUniqueName(); - ECodePart codePart = codeGenArgument.getCodePart(); - String part = codePart.getName(); -%> - -The <%=part %> part of <%=cid %> compile with error, it can't generate any code, please check and correct it. - -<% - } +<%@ jet + package="org.talend.designer.codegen.translators" + imports=" + org.talend.core.model.process.INode + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.core.model.temp.ECodePart + " + class="Default_template" +%> +<% + CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; + Object object = codeGenArgument.getArgument(); + + //This is only for the component, when it compile error, there will call this template file to generate. + //If the files in /resources compile error, ignore them. + if(object instanceof INode) { + + INode node = (INode)codeGenArgument.getArgument(); + String cid = node.getUniqueName(); + ECodePart codePart = codeGenArgument.getCodePart(); + String part = codePart.getName(); +%> + +The <%=part %> part of <%=cid %> compile with error, it can't generate any code, please check and correct it. + +<% + } %> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer.javajet old mode 100755 new mode 100644 similarity index 90% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer.javajet index 4a0a9b3..a29a27b --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer.javajet +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer.javajet @@ -12,6 +12,8 @@ java.util.Vector java.util.List java.util.ArrayList + java.util.Set + java.util.HashSet org.talend.core.model.process.IContextParameter org.talend.core.model.metadata.types.JavaTypesManager org.talend.core.model.metadata.types.JavaType @@ -32,7 +34,7 @@ if (isTestContainer) { className = className + "Test"; } - + List rootNodes = (List)v.get(1); boolean containsTPartitioner = process.getNodesOfType("tPartitioner").size() > 0 ? true : false; boolean stats = codeGenArgument.isStatistics(); @@ -40,7 +42,7 @@ boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); List params = new ArrayList(); params=process.getContextManager().getDefaultContext().getContextParameterList(); - + String jobFolderName = ""; IProcess baseProcess = ProcessUtils.getTestContainerBaseProcess(process); if (baseProcess != null) { @@ -123,7 +125,7 @@ if (ftpComponentsList.size() > 0) { exist_tFtp = true; } - + boolean exist_tS3 = false; List s3ComponentsList = (List)process.getNodesOfType("tS3Connection"); if (s3ComponentsList.size() > 0) { @@ -190,7 +192,7 @@ public boolean useDatastax(INode node){ String dbVersion = ElementParameterParser.getValue(node, "__DB_VERSION__"); String apiType = ElementParameterParser.getValue(node, "__API_TYPE__"); - return "CASSANDRA_2_2".equals(dbVersion) || "CASSANDRA_3_0".equals(dbVersion) || ("CASSANDRA_2_0_0".equals(dbVersion) && "DATASTAX".equals(apiType)); + return "CASSANDRA_2_2".equals(dbVersion) || "CASSANDRA_3_0".equals(dbVersion) || ("CASSANDRA_2_0_0".equals(dbVersion) && "DATASTAX".equals(apiType)); } } %> @@ -258,7 +260,7 @@ } %> - private java.util.Properties context_param = new java.util.Properties(); + private PropertiesWithType context_param = new PropertiesWithType(); public java.util.Map parentContextMap = new java.util.HashMap(); public String status= ""; @@ -276,13 +278,13 @@ System.exit(exitCode); } - <% + <% if (isTestContainer) { List instanceList = ProcessUtils.getTestInstances(process); String encoding = System.getProperty("file.encoding"); for(String instance : instanceList) { - String context = ProcessUtils.getInstanceContext(process,instance); + String context = ProcessUtils.getInstanceContext(process,instance); %> @Test public void test<%=instance%>() throws java.lang.Exception{ @@ -300,9 +302,10 @@ <% for(String testData : ProcessUtils.getTestData(process,instance)){ String path = ProcessUtils.getTestDataValue(process, instance, testData); + String paramemterName = ProcessUtils.getTestDataParamemter(process, instance, testData); if(path!=null&&path.length()>0){ %> - + String instance_<%=testData%>=null; <% if(ProcessUtils.isSpark(process)){ @@ -312,7 +315,7 @@ fileContentEnCodeStr = (new sun.misc.BASE64Encoder()).encode(path.getBytes("UTF-8")); } catch (java.io.UnsupportedEncodingException e) { e.printStackTrace(); - } + } StringBuilder result = new StringBuilder(); String[] arrayStr = fileContentEnCodeStr.split(lineSeparator); for(String item : arrayStr){ @@ -325,7 +328,13 @@ } catch (java.lang.Exception e) { e.printStackTrace(); } - + + <% + }else if(paramemterName!=null){ + %> + java.net.URL url_<%=testData%> = getClass().getResource("<%=path%>"); + instance_<%=testData%>="<%=paramemterName%>=" + java.net.URLDecoder.decode(url_<%=testData%>.getPath(), "<%=encoding%>"); + <% }else{ %> @@ -338,19 +347,19 @@ paraList_<%=instance%>.add(instance_<%=testData%>); <% } - + } - %> + %> String[] arrays = new String[paraList_<%=instance%>.size()]; for(int i=0;i.size();i++){ arrays[i] = (String)paraList_<%=instance%>.get(i); } <%=className %>Class.runJobInTOS(arrays); - + String errors = (String)junitGlobalMap.get("tests.log"); Integer nbFailure = (Integer)junitGlobalMap.get("tests.nbFailure"); assertTrue("Failure="+nbFailure+java.lang.System.getProperty("line.separator")+errors, errors.isEmpty()); - + if(<%=className %>Class.exception!=null){ throw <%=className %>Class.exception; } @@ -483,9 +492,19 @@ if(!context_param.isEmpty()) { context.putAll(context_param); + //set types for params from parentJobs + for (Object key: context_param.keySet()){ + String context_key = key.toString(); + String context_type = context_param.getContextType(context_key); + context.setContextType(context_key, context_type); + + } } <% for (IContextParameter ctxParam :params) { + %> + context.setContextType("<%=ctxParam.getName()%>", "<%=ctxParam.getType()%>"); + <% if (ctxParam.getType().equals("id_Password")) { %> String pwd_<%=ctxParam.getName()%>_value = context.getProperty("<%=ctxParam.getName()%>"); @@ -646,6 +665,9 @@ if(execStat) { List postjobNodes = new ArrayList(); + List hadoopConfNodes = new ArrayList(); + Set hadoopClusterIds = new HashSet(); + INode implicit_Context = null; for (INode rootNode : rootNodes) { @@ -662,6 +684,18 @@ if(execStat) { continue; } + if (componentName.equals("tHadoopConfManager")) { + hadoopConfNodes.add(rootNode); + org.talend.core.model.process.IElementParameter ciParam = rootNode.getElementParameter("CLUSTER_ID"); + if (ciParam != null) { + Object repIdObj = ciParam.getValue(); + if (repIdObj != null) { + hadoopClusterIds.add(String.valueOf(repIdObj)); + } + } + continue; + } + if (uniqueName.startsWith("Implicit_Context_")) { implicit_Context = rootNode; continue; @@ -669,6 +703,20 @@ if(execStat) { } %> +<%if (hadoopClusterIds.size() > 1) {%> + System.err.println("Only one hadoop configuration is allowed in one job!"); +<%}%> + +<% +// run tHadoopConfManager component if there is it. + if(!hadoopConfNodes.isEmpty()) { + INode hadoopConfNode = hadoopConfNodes.get(0); +%> +<%=createCallProcess(hadoopConfNode, className, false) %> +<% + } +%> + <% //2. load implicit contextload if(implicit_Context != null) { @@ -711,6 +759,7 @@ this.globalResumeTicket = false;//to run others jobs //5. all others sub-job (MultiThread mode) if(isRunInMultiThread){ + %>final Thread launchingThread = Thread.currentThread();<% for (INode rootNode : rootNodes) { String componentName = rootNode.getComponent().getName(); String uniqueName = rootNode.getUniqueName(); @@ -718,6 +767,7 @@ this.globalResumeTicket = false;//to run others jobs //filter the special subjob if("tPrejob".equals(componentName)) continue; if("tPostjob".equals(componentName)) continue; + if("tHadoopConfManager".equals(componentName)) continue; //bug16808 when use parallel option at Output components, that will multi thread if(componentName.startsWith("tAsyncIn")) continue; @@ -748,6 +798,10 @@ this.globalResumeTicket = false;//to run others jobs status = localStatus; } + if ("true".equals(((java.util.Map) threadLocal.get()).get("JobInterrupted"))) { + launchingThread.interrupt(); + } + runningThreadCount.add(-1); } } @@ -757,13 +811,22 @@ this.globalResumeTicket = false;//to run others jobs } } %> + boolean interrupted = false; while (runningThreadCount.getCount() > 0) { try { Thread.sleep(10); + } catch (java.lang.InterruptedException e) { + interrupted = true; } catch (java.lang.Exception e) { e.printStackTrace(); } } + + if (interrupted) { + Thread.currentThread().interrupt(); + } + + <% } else { // isRunInMultiThread //5. all others sub-job (SingleThread mode) for (INode rootNode : rootNodes) { @@ -773,6 +836,7 @@ this.globalResumeTicket = false;//to run others jobs //filter the special subjob if("tPrejob".equals(componentName)) continue; if("tPostjob".equals(componentName)) continue; + if("tHadoopConfManager".equals(componentName)) continue; if(implicit_Context!=null && implicit_Context.getUniqueName().equals(uniqueName)) continue; if (!componentName.equals("tLogCatcher") && !componentName.equals("tFlowMeterCatcher") && !componentName.equals("tAssertCatcher") && !componentName.equals("tStatCatcher") && !componentName.equals("tAsyncIn")) { @@ -924,7 +988,7 @@ if (execStat) { for (INode momNode : momComponentsList) { // fix for TESB-16026 if (!(Boolean.valueOf(ElementParameterParser.getValue(momNode, "__USE_CONNECTION__")) || Boolean.valueOf(ElementParameterParser.getValue(momNode, "__USE_SHARED_CONNECTION__")))) { - // end fix for TESB-16026 + // end fix for TESB-16026 %> obj_conn = globalMap.remove("connection_<%=momNode.getUniqueName() %>"); if (null != obj_conn) { @@ -934,7 +998,7 @@ if (execStat) { } // fix for TESB-16026 } - // end fix for TESB-16026 + // end fix for TESB-16026 %> } catch (java.lang.Exception e) { } @@ -986,7 +1050,7 @@ if (execStat) { try { Object obj_cluster; Object obj_conn; -<% for (INode cassandraDbNode : cassandraComponentsList) { +<% for (INode cassandraDbNode : cassandraComponentsList) { if((new API_selector()).useDatastax(cassandraDbNode)) { %> obj_cluster = globalMap.remove("cluster_<%=cassandraDbNode.getUniqueName()%>"); obj_conn = globalMap.remove("connection_<%=cassandraDbNode.getUniqueName()%>"); @@ -1008,11 +1072,11 @@ if (execStat) { } <% }//End if %> - + <% if(exist_tHBase) { %> private void closeHBaseConnections() { try { -<% +<% for (INode hbaseComponent : hbaseComponentsList) { String hbaseDistribution = ElementParameterParser.getValue(hbaseComponent, "__DISTRIBUTION__"); @@ -1027,7 +1091,7 @@ if (execStat) { } boolean isCustom = hbaseDistrib instanceof org.talend.hadoop.distribution.custom.CustomDistribution; - + boolean isHadoop2 = "HADOOP_2".equals(ElementParameterParser.getValue(hbaseComponent, "__HADOOP_CUSTOM_VERSION__"));%> org.apache.hadoop.conf.Configuration conn_<%=hbaseComponent.getUniqueName()%> =(org.apache.hadoop.conf.Configuration)globalMap.get("conn_<%=hbaseComponent.getUniqueName()%>"); if(conn_<%=hbaseComponent.getUniqueName()%> != null ) @@ -1084,7 +1148,7 @@ if (execStat) { <% for (INode s3Component : s3ComponentsList) { %> com.amazonaws.services.s3.AmazonS3Client conn_<%=s3Component.getUniqueName() %> = (com.amazonaws.services.s3.AmazonS3Client)globalMap.get("conn_<%=s3Component.getUniqueName() %>"); if(conn_<%=s3Component.getUniqueName() %> !=null){ - conn_<%=s3Component.getUniqueName() %>.shutdown(); + conn_<%=s3Component.getUniqueName() %>.shutdown(); } <% } %> } catch (java.lang.Exception e) { @@ -1110,13 +1174,16 @@ if (execStat) { <% if(exist_tMDM) { %> private void closeMDMConnections() { try { -<% for (INode mdmComponent : mdmComponentsList) { %> - org.talend.mdm.webservice.TMDMService service_<%=mdmComponent.getUniqueName() %> = (org.talend.mdm.webservice.TMDMService)globalMap.get("TMDMService_<%=mdmComponent.getUniqueName() %>"); - if(service_<%=mdmComponent.getUniqueName() %> != null) - { - service_<%=mdmComponent.getUniqueName() %>.logout(new org.talend.mdm.webservice.WSLogout()); - } -<% } %> + java.util.Iterator keySets = globalMap.keySet().iterator(); + while (keySets.hasNext()) { + String key = keySets.next().toString(); + if (key.startsWith("TMDMService_tMDMConnection_")) { + org.talend.mdm.webservice.TMDMService service = (org.talend.mdm.webservice.TMDMService)globalMap.get(key); + if (service != null) { + service.logout(new org.talend.mdm.webservice.WSLogout()); + } + } + } } catch (java.lang.Exception e) { } } @@ -1130,7 +1197,7 @@ if (execStat) { org.talend.jpalo.paloconnection pConn_<%=paloComponent.getUniqueName()%> = (org.talend.jpalo.paloconnection)globalMap.get("pConn_<%=paloComponent.getUniqueName()%>"); if(pConn_<%=paloComponent.getUniqueName()%> !=null){ pConn_<%=paloComponent.getUniqueName() %>.logout(); - + } <% } %> } catch (java.lang.Exception e) { @@ -1145,7 +1212,7 @@ if (execStat) { org.xmldb.api.base.Collection col_<%=existComponent.getUniqueName()%> = (org.xmldb.api.base.Collection)globalMap.get("col_<%=existComponent.getUniqueName()%>"); if(col_<%=existComponent.getUniqueName()%> !=null){ col_<%=existComponent.getUniqueName()%>.close(); - + } <% } %> } catch (java.lang.Exception e) { @@ -1157,7 +1224,7 @@ if (execStat) { private void closeGSConnections() { try { <% for (INode gsComponent : gsComponentsList) { %> - org.jets3t.service.impl.rest.httpclient.GoogleStorageService service_<%=gsComponent.getUniqueName()%> = + org.jets3t.service.impl.rest.httpclient.GoogleStorageService service_<%=gsComponent.getUniqueName()%> = (org.jets3t.service.impl.rest.httpclient.GoogleStorageService)globalMap.get("service_<%=gsComponent.getUniqueName()%>"); if(service_<%=gsComponent.getUniqueName()%> !=null){ service_<%=gsComponent.getUniqueName()%>.shutdown(); @@ -1194,7 +1261,7 @@ if (execStat) { } %> <% - + for (INode cassandraDbNode : cassandraComponentsList) { if((new API_selector()).useDatastax(cassandraDbNode)) { %> connections.put("connection_<%=cassandraDbNode.getUniqueName() %>", globalMap.get("connection_<%=cassandraDbNode.getUniqueName() %>")); @@ -1228,12 +1295,14 @@ if (execStat) { connections.put("connBaseDN_<%=ldapNode.getUniqueName() %>", globalMap.get("connBaseDN_<%=ldapNode.getUniqueName() %>")); <% } %> -<% for (INode mdmNode : mdmComponentsList) {%> - connections.put("TMDMService_<%=mdmNode.getUniqueName() %>", globalMap.get("TMDMService_<%=mdmNode.getUniqueName() %>")); -<% if( "false".equals(ElementParameterParser.getValue(mdmNode, "__AUTO_COMMIT__"))) {%> - connections.put("mdmTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmTransaction_<%=mdmNode.getUniqueName() %>")); -<% } - } %> +<% for (INode mdmNode : mdmComponentsList) {%> + connections.put("mdmUrl_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmUrl_<%=mdmNode.getUniqueName() %>")); + connections.put("username_<%=mdmNode.getUniqueName() %>", globalMap.get("username_<%=mdmNode.getUniqueName() %>")); + connections.put("password_<%=mdmNode.getUniqueName() %>", globalMap.get("password_<%=mdmNode.getUniqueName() %>")); + connections.put("useTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("useTransaction_<%=mdmNode.getUniqueName() %>")); + connections.put("useClientTranId_<%=mdmNode.getUniqueName() %>", globalMap.get("useClientTranId_<%=mdmNode.getUniqueName() %>")); +<% } %> + <% for (INode paloNode : paloComponentsList) { %> connections.put("p_<%=paloNode.getUniqueName() %>", globalMap.get("p_<%=paloNode.getUniqueName() %>")); connections.put("pConn_<%=paloNode.getUniqueName() %>", globalMap.get("pConn_<%=paloNode.getUniqueName() %>")); @@ -1285,7 +1354,19 @@ if (execStat) { fatherNode = arg.substring(14); } else if (arg.startsWith("--pid=")) { pid = arg.substring(6); - } else if (arg.startsWith("--context_param")) { + } else if (arg.startsWith("--context_type")) { + String keyValue = arg.substring(15); + int index = -1; + if (keyValue != null && (index = keyValue.indexOf('=')) > -1) { + if (fatherPid==null) { + context_param.setContextType(keyValue.substring(0, index), replaceEscapeChars(keyValue.substring(index + 1))); + } else { // the subjob won't escape the especial chars + context_param.setContextType(keyValue.substring(0, index), keyValue.substring(index + 1) ); + } + + } + + } else if (arg.startsWith("--context_param")) { String keyValue = arg.substring(16); int index = -1; if (keyValue != null && (index = keyValue.indexOf('=')) > -1) { @@ -1300,6 +1381,8 @@ if (execStat) { } } + + private static final String NULL_VALUE_EXPRESSION_IN_COMMAND_STRING_FOR_CHILD_JOB_ONLY = ""; private final String[][] escapeChars = { {"\\\\","\\"},{"\\n","\n"},{"\\'","\'"},{"\\r","\r"}, diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer_java.skeleton b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer_java.skeleton old mode 100755 new mode 100644 similarity index 94% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer_java.skeleton rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer_java.skeleton index 2129a2e..68fb805 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer_java.skeleton +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer_java.skeleton @@ -1,61 +1,62 @@ -import org.talend.core.model.process.INode; - -public class CLASS -{ - private static String end_multiThread = "if ( !\"failure\".equals(((java.util.Map)threadLocal.get()).get(\"status\")) ) {\n((java.util.Map) threadLocal.get()).put(\"status\", \"end\");\n}"; - private static String end_singleThread = "if(!\"failure\".equals(status)) { status = \"end\"; }"; - private static String failure_multiThread = "((java.util.Map) threadLocal.get()).put(\"status\", \"failure\");"; - private static String failure_singleThread = "status = \"failure\";"; - private static String errorCode_multiThread = "((java.util.Map) threadLocal.get()).put(\"errorCode\", null);"; - private static String errorCode_singleThread = "errorCode = null;"; - - // add the list of the connection names to avoid to declare two times the same name. - public String createCallProcess(INode rootNode, String className, boolean isMultiThread) { - String toReturn = ""; - toReturn = "try {\n"; - if(isMultiThread) { - toReturn += errorCode_multiThread; - }else{ - toReturn += errorCode_singleThread; - } - - toReturn += rootNode.getUniqueName() + "Process(globalMap);\n"; - - if(isMultiThread) { - toReturn += end_multiThread; - }else{ - toReturn += end_singleThread; - } - - toReturn += "\n}catch (TalendException e_" + rootNode.getUniqueName() + ") {\n"; - -// if(isMultiThread) { -// toReturn += failure_multiThread; -// }else{ -// toReturn += failure_singleThread; -// } - - toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n"; - - toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n"; - - - //List< ? extends IConnection> onSubJobErrorConns = rootNode.getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR); - //if(onSubJobErrorConns!=null){ - // for(IConnection conn : onSubJobErrorConns) { - // toReturn += createCallProcess(conn.getTarget(), className, isMultiThread); - // } - //} - if(isMultiThread){ - toReturn += "\n}catch (java.lang.Error e_" + rootNode.getUniqueName() + ") {\n"; - toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n"; - toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n"; - } - toReturn += "\n}"; - return toReturn; - } - - public String generate(Object argument) { - return ""; - } +import org.talend.core.model.process.INode; + +public class CLASS +{ + private static String end_multiThread = "if ( !\"failure\".equals(((java.util.Map)threadLocal.get()).get(\"status\")) ) {\n((java.util.Map) threadLocal.get()).put(\"status\", \"end\");\n}"; + private static String end_singleThread = "if(!\"failure\".equals(status)) { status = \"end\"; }"; + private static String failure_multiThread = "((java.util.Map) threadLocal.get()).put(\"status\", \"failure\");"; + private static String failure_singleThread = "status = \"failure\";"; + private static String errorCode_multiThread = "((java.util.Map) threadLocal.get()).put(\"errorCode\", null);"; + private static String errorCode_singleThread = "errorCode = null;"; + + // add the list of the connection names to avoid to declare two times the same name. + public String createCallProcess(INode rootNode, String className, boolean isMultiThread) { + String toReturn = ""; + toReturn = "try {\n"; + if(isMultiThread) { + toReturn += errorCode_multiThread; + }else{ + toReturn += errorCode_singleThread; + } + + toReturn += rootNode.getUniqueName() + "Process(globalMap);\n"; + + if(isMultiThread) { + toReturn += end_multiThread; + }else{ + toReturn += end_singleThread; + } + + toReturn += "\n}catch (TalendException e_" + rootNode.getUniqueName() + ") {\n"; + +// if(isMultiThread) { +// toReturn += failure_multiThread; +// }else{ +// toReturn += failure_singleThread; +// } + + toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n"; + + toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n"; + + + //List< ? extends IConnection> onSubJobErrorConns = rootNode.getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR); + //if(onSubJobErrorConns!=null){ + // for(IConnection conn : onSubJobErrorConns) { + // toReturn += createCallProcess(conn.getTarget(), className, isMultiThread); + // } + //} + if(isMultiThread){ + toReturn += "\n}catch (java.lang.Error e_" + rootNode.getUniqueName() + ") {\n"; + toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n"; + toReturn += failure_multiThread; + toReturn += "throw e_" + rootNode.getUniqueName() + ";\n"; + } + toReturn += "\n}"; + return toReturn; + } + + public String generate(Object argument) { + return ""; + } } \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer_process_info.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer_process_info.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/footer_process_info.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/footer_process_info.javajet diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_begin.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_begin.javajet new file mode 100644 index 0000000..96c22dd --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_begin.javajet @@ -0,0 +1,445 @@ +<%@ jet +imports=" + org.talend.designer.core.generic.model.Component + java.util.ArrayList + java.util.HashMap + java.util.HashSet + java.util.List + java.util.Map + java.util.Set + java.util.Stack + org.talend.components.api.component.ComponentDefinition + org.talend.components.api.component.ConnectorTopology + org.talend.components.api.container.RuntimeContainer + org.talend.components.api.properties.ComponentProperties + org.talend.components.api.properties.ComponentReferenceProperties + org.talend.core.model.metadata.IMetadataColumn + org.talend.core.model.metadata.IMetadataTable + org.talend.core.model.metadata.types.JavaType + org.talend.core.model.metadata.types.JavaTypesManager + org.talend.core.model.process.EConnectionType + org.talend.core.model.process.ElementParameterParser + org.talend.core.model.process.EParameterFieldType + org.talend.core.model.process.IConnection + org.talend.core.model.process.IConnectionCategory + org.talend.core.model.process.IElementParameter + org.talend.core.model.process.INode + org.talend.core.model.utils.TalendTextUtils + org.talend.daikon.NamedThing + org.talend.daikon.properties.property.Property + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.core.model.utils.NodeUtil + org.talend.designer.core.generic.constants.IGenericConstants + " +%> +<%@include file="@{org.talend.designer.codegen}/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet"%> +<% +CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; +INode node = (INode)codeGenArgument.getArgument(); +String cid = node.getUniqueName(); +Component component = (Component)node.getComponent(); +ComponentProperties componentProps = node.getComponentProperties(); +ComponentDefinition def = component.getComponentDefinition(); + +List metadatas = node.getMetadataList(); +IMetadataTable metadata = null; +List columnList = null; +if ((metadatas != null) && (metadatas.size() > 0)) { // metadata + metadata = metadatas.get(0); + if(metadata != null){ + columnList = metadata.getListColumns(); + } +} + +// Set up the component definition, and the properties for all types of +// components. + +%> + +org.talend.components.api.component.ComponentDefinition def_<%=cid %> = + new <%= def.getClass().getName()%>(); +<% +List propsToProcess = component.getCodegenPropInfos(componentProps); +%> + +<%= componentProps.getClass().getName()%> props_<%=cid %> = + (<%= componentProps.getClass().getName()%>) def_<%=cid %>.createRuntimeProperties(); +<% + +final Set referenceProperties = new HashSet(); + +for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo + List properties = propInfo.props.getProperties(); + for (NamedThing prop : properties) { // property + if (prop instanceof Property) { // if, only deal with valued Properties + Property property = (Property)prop; + if (property.getFlags() != null && (property.getFlags().contains(Property.Flags.DESIGN_TIME_ONLY) || property.getFlags().contains(Property.Flags.HIDDEN))) + continue; + Object value = property.getStoredValue(); + if (value != null) { + if (value instanceof List) { + // added for the support of tables + String tmpVarName = cid+propInfo.fieldName.replace('.','_')+"_"+property.getName(); + %> + java.util.List <%=tmpVarName %> = new java.util.ArrayList(); + <% + for (Object subPropertyValue : (java.util.List)property.getValue()) { + if ((property.getPossibleValues() != null && property.getPossibleValues().size() > 0)|| + Boolean.valueOf(String.valueOf(property.getTaggedValue(IGenericConstants.ADD_QUOTES)))) { + %> + <%=tmpVarName %>.add("<%=subPropertyValue %>"); + <% + } else if(!"".equals(subPropertyValue)) { + %> + <%=tmpVarName %>.add(<%=subPropertyValue %>); + <% + } else { + %> + <%=tmpVarName %>.add(""); + <% + } + } + %> + ((org.talend.daikon.properties.Properties)props_<%=cid %><%=propInfo.fieldName%>).setValue("<%=property.getName()%>",<%=tmpVarName %>); + <% + } else if (value instanceof String && property.isFlag(Property.Flags.ENCRYPT) && ElementParameterParser.canEncryptValue((String) value)) { + if (!"".equals(property.getStringValue())) { + %> + props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", + routines.system.PasswordEncryptUtil.decryptPassword(<%=component.getCodegenValue(property, (String) value)%>)); + <% + } + } else if (value != null && "java.util.Date".equals(property.getType())){ + %> + props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", + TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",<%=component.getCodegenValue(property, value.toString())%>)); + <% + } else if (property instanceof org.talend.daikon.properties.property.EnumProperty) { + %> + props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", + <%=property.getType().replaceAll("<.*>", "")%>.<%=property.getValue()%>); + <% + } else if (property instanceof org.talend.daikon.properties.property.SchemaProperty) { + %> + props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", + new org.apache.avro.Schema.Parser().parse(<%=component.getCodegenValue(property, property.getStringValue())%>)); + <% + } else if (!(value instanceof String) || !((String)value).equals("")) { + %> + props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", + <%=component.getCodegenValue(property, value.toString())%>); + <% + } + } + + if("java.lang.Integer".equals(property.getType()) && (value == null || ((value instanceof String) && ((String)value).isEmpty()))) {//need to overwrite the default value when the passed value is null or empty string from the model + %> + props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", null); + <% + } + } else if (prop instanceof ComponentReferenceProperties) { + final String fieldString = propInfo.fieldName + "." + prop.getName(); + referenceProperties.add(fieldString); + } //else may be a ComponentProperties so ignore + } // property +} // propInfo + +for (final String fieldString : referenceProperties) { + %> + if (org.talend.components.api.properties.ComponentReferenceProperties.ReferenceType.COMPONENT_INSTANCE == props_<%=cid %><%=fieldString %>.referenceType.getValue()) { + final String referencedComponentInstanceId_<%=cid %> = props_<%=cid %><%=fieldString %>.componentInstanceId.getStringValue(); + if (referencedComponentInstanceId_<%=cid %> != null) { + org.talend.daikon.properties.Properties referencedComponentProperties_<%=cid %> = (org.talend.daikon.properties.Properties) globalMap.get( + referencedComponentInstanceId_<%=cid %> + "_COMPONENT_RUNTIME_PROPERTIES"); + props_<%=cid %><%=fieldString %>.setReference(referencedComponentProperties_<%=cid %>); + } + } + <% +} +%> +globalMap.put("<%=cid %>_COMPONENT_RUNTIME_PROPERTIES", props_<%=cid %>); + +org.talend.components.api.container.RuntimeContainer container_<%=cid%> = new org.talend.components.api.container.RuntimeContainer() { + public Object getComponentData(String componentId, String key) { + return globalMap.get(componentId + "_" + key); + } + + public void setComponentData(String componentId, String key, Object data) { + globalMap.put(componentId + "_" + key, data); + } + + public String getCurrentComponentId() { + return "<%=cid%>"; + } + + public Object getGlobalData(String key) { + return globalMap.get(key); + } +}; + +int nb_line_<%=cid %> = 0; + +org.talend.components.api.component.ConnectorTopology topology_<%=cid%> = null; +<% +boolean hasInput = !NodeUtil.getIncomingConnections(node, IConnectionCategory.DATA).isEmpty(); +boolean hasOutput = !NodeUtil.getOutgoingConnections(node, IConnectionCategory.DATA).isEmpty(); +boolean hasOutputOnly = hasOutput && !hasInput; + +if (hasInput && hasOutput) { +%> +topology_<%=cid%> = org.talend.components.api.component.ConnectorTopology.INCOMING_AND_OUTGOING; +<% +} else if (hasInput) { +%> +topology_<%=cid%> = org.talend.components.api.component.ConnectorTopology.INCOMING; +<% +} else if (hasOutput) { +%> +topology_<%=cid%> = org.talend.components.api.component.ConnectorTopology.OUTGOING; +<% +} else { +%> +topology_<%=cid%> = org.talend.components.api.component.ConnectorTopology.NONE; +<% +} +%> + +org.talend.daikon.runtime.RuntimeInfo runtime_info_<%=cid%> = def_<%=cid%>.getRuntimeInfo( + org.talend.components.api.component.runtime.ExecutionEngine.DI, props_<%=cid%>, topology_<%=cid%>); +java.util.Set supported_connector_topologies_<%=cid%> = def_<%=cid%>.getSupportedConnectorTopologies(); + +org.talend.components.api.component.runtime.RuntimableRuntime componentRuntime_<%=cid%> = (org.talend.components.api.component.runtime.RuntimableRuntime)(Class.forName(runtime_info_<%=cid%>.getRuntimeClassName()).newInstance()); +org.talend.daikon.properties.ValidationResult initVr_<%=cid%> = componentRuntime_<%=cid%>.initialize(container_<%=cid%>, props_<%=cid%>); + +if (initVr_<%=cid%>.getStatus() == org.talend.daikon.properties.ValidationResult.Result.ERROR ) { + throw new RuntimeException(initVr_<%=cid%>.getMessage()); +} + +if(componentRuntime_<%=cid%> instanceof org.talend.components.api.component.runtime.ComponentDriverInitialization) { + org.talend.components.api.component.runtime.ComponentDriverInitialization compDriverInitialization_<%=cid%> = (org.talend.components.api.component.runtime.ComponentDriverInitialization)componentRuntime_<%=cid%>; + compDriverInitialization_<%=cid%>.runAtDriver(container_<%=cid%>); +} + +org.talend.components.api.component.runtime.SourceOrSink sourceOrSink_<%=cid%> = null; +if(componentRuntime_<%=cid%> instanceof org.talend.components.api.component.runtime.SourceOrSink) { + sourceOrSink_<%=cid%> = (org.talend.components.api.component.runtime.SourceOrSink)componentRuntime_<%=cid%>; + org.talend.daikon.properties.ValidationResult vr_<%=cid%> = sourceOrSink_<%=cid%>.validate(container_<%=cid%>); + if (vr_<%=cid%>.getStatus() == org.talend.daikon.properties.ValidationResult.Result.ERROR ) { + throw new RuntimeException(vr_<%=cid%>.getMessage()); + } +} + +<% +// Return at this point if there is no metadata. +if (metadata == null) { + return stringBuffer.toString(); +} + +Set connectorTopologies = def.getSupportedConnectorTopologies(); +boolean asInputComponent = connectorTopologies!=null && (connectorTopologies.size() < 3) && connectorTopologies.contains(ConnectorTopology.OUTGOING); + +if (hasOutputOnly || asInputComponent) { + %> + org.talend.components.api.component.runtime.Source source_<%=cid%> = + (org.talend.components.api.component.runtime.Source)sourceOrSink_<%=cid%>; + org.talend.components.api.component.runtime.Reader reader_<%=cid%> = + source_<%=cid%>.createReader(container_<%=cid%>); + reader_<%=cid%> = new org.talend.codegen.flowvariables.runtime.FlowVariablesReader(reader_<%=cid%>, container_<%=cid%>); + + <% + IConnection main = null; + List mains = node.getOutgoingConnections("MAIN"); + if (mains!=null && !mains.isEmpty()) { + main = mains.get(0); + } + + IConnection reject = null; + List rejects = node.getOutgoingConnections("REJECT"); + if (rejects != null && !rejects.isEmpty()) { + reject = rejects.get(0); + } + + boolean hasDataOutput = (main != null || reject != null); + IndexedRecordToRowStructGenerator irToRow = null; + + if(hasDataOutput) { + IConnection schemaSourceConnector = (main!=null ? main : reject); + String schemaSourceConnectorName = schemaSourceConnector.getMetadataTable().getAttachedConnector(); + %> + boolean multi_output_is_allowed_<%=cid%> = false; + <% //take care SourceOrSink.validate will change the schema if it contains include-all-fields, so need to get design Avro schema before validate %> + org.talend.components.api.component.Connector c_<%=cid%> = null; + for (org.talend.components.api.component.Connector currentConnector : props_<%=cid %>.getAvailableConnectors(null, true)) { + if (currentConnector.getName().equals("<%=schemaSourceConnectorName%>")) { + c_<%=cid%> = currentConnector; + } + + if (currentConnector.getName().equals("REJECT")) {//it's better to move the code to javajet + multi_output_is_allowed_<%=cid%> = true; + } + } + org.apache.avro.Schema schema_<%=cid%> = props_<%=cid %>.getSchema(c_<%=cid%>, true); + + <% + irToRow = new IndexedRecordToRowStructGenerator(cid, null, columnList); + irToRow.generateInitialVariables("schema_" + cid, false); + } + %> + + // Iterate through the incoming data. + boolean available_<%=cid%> = reader_<%=cid%>.start(); + + resourceMap.put("reader_<%=cid%>", reader_<%=cid%>); + + for (; available_<%=cid%>; available_<%=cid%> = reader_<%=cid%>.advance()) { + nb_line_<%=cid %>++; + + <%if(hasDataOutput) {%> + if (multi_output_is_allowed_<%=cid%>) { + <%if(main!=null){%> + <%=main.getName()%> = null; + <%}%> + + <%if(reject!=null){%> + <%=reject.getName()%> = null; + <%}%> + } + <%}%> + + try { + Object data_<%=cid%> = reader_<%=cid%>.getCurrent(); + <% + if (main != null) { + %> + + if(multi_output_is_allowed_<%=cid%>) { + <%=main.getName()%> = new <%=main.getName() %>Struct(); + } + + <% + irToRow.generateConvertRecord("data_" + cid, main.getName(), main.getMetadataTable().getListColumns()); + } + %> + } catch (org.talend.components.api.exception.DataRejectException e_<%=cid%>) { + java.util.Map info_<%=cid%> = e_<%=cid%>.getRejectInfo(); + <% + if (reject!=null) { + %> + Object data_<%=cid%> = info_<%=cid%>.get("talend_record"); + + if (multi_output_is_allowed_<%=cid%>) { + <%=reject.getName()%> = new <%=reject.getName() %>Struct(); + } + try{ + <% + irToRow.generateConvertRecord("data_" + cid, reject.getName()); + %> + }catch(java.lang.Exception e){ + // do nothing + } + <% + Set commonColumns = new HashSet(); + + for (IMetadataColumn column : columnList) { + commonColumns.add(column.getLabel()); + } + + //pass error columns + List rejectColumns = reject.getMetadataTable().getListColumns(); + for(IMetadataColumn column : rejectColumns) { + String columnName = column.getLabel(); + + // JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); + String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); + + //error columns + if(!commonColumns.contains(columnName)) { + %> + <%=reject.getName()%>.<%=columnName%> = (<%=typeToGenerate%>)info_<%=cid%>.get("<%=columnName%>"); + <% + } + } + } else { + %> + //TODO use a method instead of getting method by the special key "error/errorMessage" + Object errorMessage_<%=cid%> = null; + if(info_<%=cid%>.containsKey("error")){ + errorMessage_<%=cid%> = info_<%=cid%>.get("error"); + }else if(info_<%=cid%>.containsKey("errorMessage")){ + errorMessage_<%=cid%> = info_<%=cid%>.get("errorMessage"); + }else{ + errorMessage_<%=cid%> = "Rejected but error message missing"; + } + errorMessage_<%=cid%> = "Row "+ nb_line_<%=cid %> + ": "+errorMessage_<%=cid%>; + System.err.println(errorMessage_<%=cid%>); + <% + } + if (main != null) { + %> + // If the record is reject, the main line record should put NULL + <%=main.getName()%> = null; + <% + } + %> + } + <% + // The for loop around the incoming records from the reader is left open. + + +} else if (hasInput) { + %> + org.talend.components.api.component.runtime.Sink sink_<%=cid%> = + (org.talend.components.api.component.runtime.Sink)sourceOrSink_<%=cid%>; + org.talend.components.api.component.runtime.WriteOperation writeOperation_<%=cid%> = sink_<%=cid%>.createWriteOperation(); + writeOperation_<%=cid%>.initialize(container_<%=cid%>); + org.talend.components.api.component.runtime.Writer writer_<%=cid%> = writeOperation_<%=cid%>.createWriter(container_<%=cid%>); + writer_<%=cid%>.open("<%=cid%>"); + + resourceMap.put("writer_<%=cid%>", writer_<%=cid%>); + + org.talend.components.api.component.Connector c_<%=cid%> = null; + for (org.talend.components.api.component.Connector currentConnector : props_<%=cid %>.getAvailableConnectors(null, false)) { + if (currentConnector.getName().equals("MAIN")) { + c_<%=cid%> = currentConnector; + break; + } + } + org.apache.avro.Schema designSchema_<%=cid%> = props_<%=cid %>.getSchema(c_<%=cid%>, false); + org.talend.daikon.di.DiIncomingSchemaEnforcer current_<%=cid%> + = new org.talend.daikon.di.DiIncomingSchemaEnforcer(designSchema_<%=cid%>); + <% + List outgoingConns = node.getOutgoingSortedConnections(); + if (outgoingConns!=null){ + for (IConnection outgoingConn : outgoingConns) { + if ("MAIN".equals(outgoingConn.getConnectorName())) { + %> + c_<%=cid%> = null; + for (org.talend.components.api.component.Connector currentConnector : props_<%=cid %>.getAvailableConnectors(null, true)) { + if (currentConnector.getName().equals("MAIN")) { + c_<%=cid%> = currentConnector; + } + } + org.apache.avro.Schema mainSchema_<%=cid%> = props_<%=cid %>.getSchema(c_<%=cid%>, true); + <% + IndexedRecordToRowStructGenerator mainIrToRow = new IndexedRecordToRowStructGenerator( + cid + "OutMain", outgoingConn); + mainIrToRow.generateInitialVariables("mainSchema_" + cid, false); + } + if ("REJECT".equals(outgoingConn.getConnectorName())) { + %> + c_<%=cid%> = null; + for (org.talend.components.api.component.Connector currentConnector : props_<%=cid %>.getAvailableConnectors(null, true)) { + if (currentConnector.getName().equals("REJECT")) { + c_<%=cid%> = currentConnector; + } + } + org.apache.avro.Schema rejectSchema_<%=cid%> = props_<%=cid %>.getSchema(c_<%=cid%>, true); + <% + IndexedRecordToRowStructGenerator rejectIrToRow = new IndexedRecordToRowStructGenerator( + cid + "OutReject", outgoingConn); + rejectIrToRow.generateInitialVariables("rejectSchema_" + cid, false); + } + } + } +} +%> diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_end.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_end.javajet new file mode 100644 index 0000000..8fd334b --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_end.javajet @@ -0,0 +1,92 @@ +<%@ jet +imports=" + java.util.List + java.util.Set + org.talend.components.api.component.ComponentDefinition + org.talend.components.api.component.ConnectorTopology + org.talend.core.model.metadata.IMetadataColumn + org.talend.core.model.metadata.IMetadataTable + org.talend.core.model.process.ElementParameterParser + org.talend.core.model.process.IConnection + org.talend.core.model.process.IConnectionCategory + org.talend.core.model.process.INode + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.core.generic.model.Component + org.talend.core.model.utils.NodeUtil + " +%> +// end of generic + +<% +CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; +INode node = (INode)codeGenArgument.getArgument(); +String cid = node.getUniqueName(); +Component component = (Component)node.getComponent(); +ComponentDefinition def = component.getComponentDefinition(); + +IMetadataTable metadata = null; +List metadatas = node.getMetadataList(); +if ((metadatas != null) && (metadatas.size() > 0)) { + metadata = metadatas.get(0); +} + +// Return at this point if there is no metadata. +if (metadata == null) { + return stringBuffer.toString(); +} + +boolean hasInput = !NodeUtil.getIncomingConnections(node, IConnectionCategory.DATA).isEmpty(); +boolean hasOutput = !NodeUtil.getOutgoingConnections(node, IConnectionCategory.DATA).isEmpty(); +boolean hasOutputOnly = hasOutput && !hasInput; + +Set connectorTopologies = def.getSupportedConnectorTopologies(); +boolean asInputComponent = connectorTopologies!=null && (connectorTopologies.size() < 3) && connectorTopologies.contains(ConnectorTopology.OUTGOING); +%> + +resourceMap.put("finish_<%=cid%>", Boolean.TRUE); + +<% +if(hasOutputOnly || asInputComponent){ +%> + } // while + reader_<%=cid%>.close(); + final java.util.Map resultMap_<%=cid%> = reader_<%=cid%>.getReturnValues(); +<% +}else if(hasInput){ +%> + org.talend.components.api.component.runtime.Result resultObject_<%=cid%> = (org.talend.components.api.component.runtime.Result)writer_<%=cid%>.close(); + final java.util.Map resultMap_<%=cid%> = writer_<%=cid%>.getWriteOperation().finalize(java.util.Arrays.asList(resultObject_<%=cid%>), container_<%=cid%>); +<% +} else { + return stringBuffer.toString(); +} +%> +if(resultMap_<%=cid%>!=null) { + for(java.util.Map.Entry entry_<%=cid%> : resultMap_<%=cid%>.entrySet()) { + switch(entry_<%=cid%>.getKey()) { + case org.talend.components.api.component.ComponentDefinition.RETURN_ERROR_MESSAGE : + container_<%=cid%>.setComponentData("<%=cid%>", "ERROR_MESSAGE", entry_<%=cid%>.getValue()); + break; + case org.talend.components.api.component.ComponentDefinition.RETURN_TOTAL_RECORD_COUNT : + container_<%=cid%>.setComponentData("<%=cid%>", "NB_LINE", entry_<%=cid%>.getValue()); + break; + case org.talend.components.api.component.ComponentDefinition.RETURN_SUCCESS_RECORD_COUNT : + container_<%=cid%>.setComponentData("<%=cid%>", "NB_SUCCESS", entry_<%=cid%>.getValue()); + break; + case org.talend.components.api.component.ComponentDefinition.RETURN_REJECT_RECORD_COUNT : + container_<%=cid%>.setComponentData("<%=cid%>", "NB_REJECT", entry_<%=cid%>.getValue()); + break; + default : + StringBuilder studio_key_<%=cid%> = new StringBuilder(); + for (int i_<%=cid%> = 0; i_<%=cid%> < entry_<%=cid%>.getKey().length(); i_<%=cid%>++) { + char ch_<%=cid%> = entry_<%=cid%>.getKey().charAt(i_<%=cid%>); + if(Character.isUpperCase(ch_<%=cid%>) && i_<%=cid%>> 0) { + studio_key_<%=cid%>.append('_'); + } + studio_key_<%=cid%>.append(ch_<%=cid%>); + } + container_<%=cid%>.setComponentData("<%=cid%>", studio_key_<%=cid%>.toString().toUpperCase(java.util.Locale.ENGLISH), entry_<%=cid%>.getValue()); + break; + } + } +} \ No newline at end of file diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_finally.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_finally.javajet new file mode 100644 index 0000000..d3264ee --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_finally.javajet @@ -0,0 +1,72 @@ +<%@ jet +imports=" + java.util.List + java.util.Set + org.talend.components.api.component.ComponentDefinition + org.talend.components.api.component.ConnectorTopology + org.talend.core.model.metadata.IMetadataColumn + org.talend.core.model.metadata.IMetadataTable + org.talend.core.model.process.ElementParameterParser + org.talend.core.model.process.IConnection + org.talend.core.model.process.IConnectionCategory + org.talend.core.model.process.INode + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.core.generic.model.Component + org.talend.core.model.utils.NodeUtil + " +%> +// finally of generic + +<% +CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; +INode node = (INode)codeGenArgument.getArgument(); +String cid = node.getUniqueName(); +Component component = (Component)node.getComponent(); +ComponentDefinition def = component.getComponentDefinition(); + +IMetadataTable metadata = null; +List metadatas = node.getMetadataList(); +if ((metadatas != null) && (metadatas.size() > 0)) { + metadata = metadatas.get(0); +} + +// Return at this point if there is no metadata. +if (metadata == null) { + return stringBuffer.toString(); +} + +boolean hasInput = !NodeUtil.getIncomingConnections(node, IConnectionCategory.DATA).isEmpty(); +boolean hasOutput = !NodeUtil.getOutgoingConnections(node, IConnectionCategory.DATA).isEmpty(); +boolean hasOutputOnly = hasOutput && !hasInput; + +Set connectorTopologies = def.getSupportedConnectorTopologies(); +boolean asInputComponent = connectorTopologies!=null && (connectorTopologies.size() < 3) && connectorTopologies.contains(ConnectorTopology.OUTGOING); +%> + +if(resourceMap.get("finish_<%=cid%>")==null){ +<% +if(hasOutputOnly || asInputComponent){ +%> + if(resourceMap.get("reader_<%=cid%>")!=null){ + try { + ((org.talend.components.api.component.runtime.Reader)resourceMap.get("reader_<%=cid%>")).close(); + } catch (java.io.IOException e_<%=cid %>) { + String errorMessage_<%=cid%> = "failed to release the resource in <%=cid %> :" + e_<%=cid %>.getMessage(); + System.err.println(errorMessage_<%=cid%>); + } + } +<% +}else if(hasInput){ +%> + if(resourceMap.get("writer_<%=cid%>")!=null){ + try { + ((org.talend.components.api.component.runtime.Writer)resourceMap.get("writer_<%=cid%>")).close(); + } catch (java.io.IOException e_<%=cid %>) { + String errorMessage_<%=cid%> = "failed to release the resource in <%=cid %> :" + e_<%=cid %>.getMessage(); + System.err.println(errorMessage_<%=cid%>); + } + } +<% +} +%> +} \ No newline at end of file diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_main.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_main.javajet new file mode 100644 index 0000000..88a6d8c --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_main.javajet @@ -0,0 +1,203 @@ +<%@ jet +imports=" + java.util.List + java.util.Set + java.util.HashSet + org.talend.components.api.component.ComponentDefinition + org.talend.designer.core.generic.model.Component + org.talend.core.model.metadata.IMetadataColumn + org.talend.core.model.metadata.IMetadataTable + org.talend.core.model.metadata.types.JavaType + org.talend.core.model.metadata.types.JavaTypesManager + org.talend.core.model.process.ElementParameterParser + org.talend.core.model.process.IConnection + org.talend.core.model.process.IConnectionCategory + org.talend.core.model.process.INode + org.talend.core.model.process.EConnectionType + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.core.model.utils.TalendTextUtils + org.talend.core.model.utils.NodeUtil + " +%> +<%@include file="@{org.talend.designer.codegen}/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet"%> +<% +CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; +INode node = (INode)codeGenArgument.getArgument(); +String cid = node.getUniqueName(); +Component component = (Component)node.getComponent(); +ComponentDefinition def = component.getComponentDefinition(); + +boolean hasInput = !NodeUtil.getIncomingConnections(node, IConnectionCategory.DATA).isEmpty(); + +if(hasInput){ + // These will be initialized if there are outgoing connections and will be + // null if there isn't a corresponding outgoing connection. + IndexedRecordToRowStructGenerator mainIrToRow = null; + IndexedRecordToRowStructGenerator rejectIrToRow = null; + + List outgoingConns = node.getOutgoingSortedConnections(); + if (outgoingConns!=null){ + for (int i = 0; i < outgoingConns.size(); i++) { + IConnection outgoingConn = outgoingConns.get(i); + if (outgoingConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { + %> + <%=outgoingConn.getName()%> = null; + <% + } + if ("MAIN".equals(outgoingConn.getConnectorName())) { + mainIrToRow = new IndexedRecordToRowStructGenerator(cid + "OutMain", + outgoingConn); + } + if ("REJECT".equals(outgoingConn.getConnectorName())) { + rejectIrToRow = new IndexedRecordToRowStructGenerator(cid + "OutReject", + outgoingConn); + } + } + } + + // Generate the code to handle the incoming records. + IConnection inputConn = null; + List< ? extends IConnection> inputConns = node.getIncomingConnections(); + if(inputConns!=null) { + for (IConnection conn : inputConns) { + if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { + inputConn = conn; + } + } + } + + boolean hasValidInput = inputConn!=null; + + IMetadataTable metadata; + List metadatas = node.getMetadataList(); + boolean haveValidNodeMetadata = ((metadatas != null) && (metadatas.size() > 0) && (metadata = metadatas.get(0)) != null); + + if (hasValidInput && haveValidNodeMetadata) { + List input_columnList = inputConn.getMetadataTable().getListColumns(); + + if (input_columnList!=null && !input_columnList.isEmpty()) { + // If there are dynamic columns in the schema, they need to be + // initialized into the runtime schema of the actual IndexedRecord + // provided to the component. + + int dynamicPos = -1; + for (int i = 0; i < input_columnList.size(); i++) { + if (input_columnList.get(i).getTalendType().equals("id_Dynamic")) { + dynamicPos = i; + break; + } + } + + if (dynamicPos != -1) { + %> + if (!current_<%=cid%>.areDynamicFieldsInitialized()) { + // Initialize the dynamic columns when they are first encountered. + for (routines.system.DynamicMetadata dm_<%=cid%> : <%=inputConn.getName()%>.<%=input_columnList.get(dynamicPos).getLabel()%>.metadatas) { + current_<%=cid%>.addDynamicField( + dm_<%=cid%>.getName(), + dm_<%=cid%>.getType(), + dm_<%=cid%>.getLogicalType(), + dm_<%=cid%>.getFormat(), + dm_<%=cid%>.getDescription(), + dm_<%=cid%>.isNullable()); + } + current_<%=cid%>.createRuntimeSchema(); + } + <% + } + + %> + current_<%=cid%>.createNewRecord(); + <% + for (int i = 0; i < input_columnList.size(); i++) { // column + IMetadataColumn column = input_columnList.get(i); + if (dynamicPos != i) { + %> + current_<%=cid%>.put("<%=column.getLabel()%>", <%=inputConn.getName()%>.<%=column.getLabel()%>); + <% + } else { + %> + for (int i = 0; i < <%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnCount(); i++) { + current_<%=cid%>.put(<%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnMetadata(i).getName(), + <%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnValue(i)); + } + <% + } + } // column + + // If necesary, generate the code to handle outgoing connections. + // TODO: For now, this can only handle one outgoing record for + // each incoming record. To handle multiple outgoing records, code + // generation needs to occur in component_begin in order to open + // a for() loop. + + // There will be a ClassCastException if the output component does + // not implement WriterWithFeedback, but permits outgoing + // connections. + + %> + org.apache.avro.generic.IndexedRecord data_<%=cid%> = current_<%=cid%>.getCurrentRecord(); + + writer_<%=cid%>.write(data_<%=cid%>); + + nb_line_<%=cid %>++; + <% + if (mainIrToRow != null) { + %> + if (writer_<%=cid%> instanceof org.talend.components.api.component.runtime.WriterWithFeedback) { + org.talend.components.api.component.runtime.WriterWithFeedback writerWithFeedbackMain_<%=cid%> = (org.talend.components.api.component.runtime.WriterWithFeedback) writer_<%=cid%>; + writerWithFeedbackMain_<%=cid%> = new org.talend.codegen.flowvariables.runtime.FlowVariablesWriter(writerWithFeedbackMain_<%=cid%>, container_<%=cid%>); + java.util.Iterator outgoingMainRecords_<%=cid%> = writerWithFeedbackMain_<%=cid%>.getSuccessfulWrites().iterator(); + Object outgoingMain_<%=cid%> = null; + if (outgoingMainRecords_<%=cid%>.hasNext()) { + outgoingMain_<%=cid%> = outgoingMainRecords_<%=cid%>.next(); + if(outgoingMainRecords_<%=cid%>.hasNext()){ + outgoingMain_<%=cid%> = data_<%=cid%>; + } + } + <% + if (rejectIrToRow == null) { + %> + else { + if (!writerWithFeedbackMain_<%=cid%>.getRejectedWrites().iterator().hasNext()) { + outgoingMain_<%=cid%> = data_<%=cid%>; + } + } + <% + } + %> + if (outgoingMain_<%=cid%>!=null) { + <%=mainIrToRow.getConnection().getName()%> = new <%=mainIrToRow.getConnection().getName() %>Struct(); + <% + mainIrToRow.generateConvertRecord("outgoingMain_" + cid, mainIrToRow.getConnection().getName()); + %> + } + } else { + // For no feedback writer,just pass the input record to the output + if (data_<%=cid%>!=null) { + <%=mainIrToRow.getConnection().getName()%> = new <%=mainIrToRow.getConnection().getName() %>Struct(); + <% + mainIrToRow.generateConvertRecord("data_" + cid, mainIrToRow.getConnection().getName()); + %> + } + } + <% + } + if (rejectIrToRow != null) { + %> + org.talend.components.api.component.runtime.WriterWithFeedback writerWithFeedbackReject_<%=cid%> = (org.talend.components.api.component.runtime.WriterWithFeedback) writer_<%=cid%>; + writerWithFeedbackReject_<%=cid%> = new org.talend.codegen.flowvariables.runtime.FlowVariablesWriter(writerWithFeedbackReject_<%=cid%>, container_<%=cid%>); + java.util.Iterator outgoingRejectRecords_<%=cid%> = writerWithFeedbackReject_<%=cid%>.getRejectedWrites().iterator(); + if (outgoingRejectRecords_<%=cid%>.hasNext()) { + <%=rejectIrToRow.getConnection().getName()%> = new <%=rejectIrToRow.getConnection().getName() %>Struct(); + Object outgoingReject_<%=cid%> = outgoingRejectRecords_<%=cid%>.next(); + <% + rejectIrToRow.generateConvertRecord("outgoingReject_" + cid, rejectIrToRow.getConnection().getName()); + %> + } + <% + } + } + } +} // canStart +%> diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet new file mode 100644 index 0000000..70fc2f9 --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet @@ -0,0 +1,229 @@ +<% + +/** + * Utility for generating code that can turn an IndexedRecording coming from a + * generic component into a rowStruct expected by the Studio. + */ +class IndexedRecordToRowStructGenerator { + + /** A unique tag for generating code variables, usually based on the cid + * of the node. */ + private final String cid; + + /** The columns in the rowStruct to generate. */ + private final List columns; + + /** The connection that we're generating code for. */ + private final IConnection connection; + + /** If there is a dynamic column, its name. Null if none. */ + private final String dynamicColName; + + /** Variable names generated in code used by this utility. */ + private final String codeVarSchemaEnforcer; + private final String codeVarIsDynamicInitialized; + private final String codeVarDynamic; + private final String codeVarIndexedRecordAdapter; + + public IndexedRecordToRowStructGenerator(String cid, IConnection connection) { + this(cid, connection, connection.getMetadataTable().getListColumns()); + } + + public IndexedRecordToRowStructGenerator(String cid, IConnection connection, List columns) { + this.cid = cid; + this.connection = connection; + this.columns = columns; + + String tmpDynamicColName = null; + for (IMetadataColumn column : columns) { + if (column.getTalendType().equals("id_Dynamic")) { + tmpDynamicColName = column.getLabel(); + break; + } + } + dynamicColName = tmpDynamicColName; + + this.codeVarSchemaEnforcer = "current_" + cid; + this.codeVarIsDynamicInitialized = "initDyn_" + cid; + this.codeVarDynamic = "dynamic_" + cid; + this.codeVarIndexedRecordAdapter = "factory_" + cid; + } + + public IConnection getConnection() { + return connection; + } + + /** + * Generate code that declares and initializes the variables that are used + * in the code generated by this utility. + */ + public void generateInitialVariables(String codeVarSchemaToEnforce, boolean dynamicByPosition) { + if (dynamicColName != null) { + %> + boolean <%=codeVarIsDynamicInitialized%> = false; + routines.system.Dynamic <%=codeVarDynamic%> = new routines.system.Dynamic(); + <% + } + + %> + org.talend.daikon.di.DiOutgoingSchemaEnforcer <%=codeVarSchemaEnforcer%> = org.talend.daikon.di.EnforcerCreator.createOutgoingEnforcer(<%=codeVarSchemaToEnforce%>, <%=dynamicByPosition%>); + + // Create a reusable factory that converts the output of the reader to an IndexedRecord. + org.talend.daikon.avro.converter.IndexedRecordConverter <%=codeVarIndexedRecordAdapter%> = null; + <% + } + + /** + * Generate code that copies data from the IndexedRecord to the rowStruct. + * + * @param codeVarIndexedRecord the name of the variable that contains the + * IndexedRecord. + * @param codeVarRowStruct the name of the variable that contains the + * rowStruct. + */ + public void generateConvertRecord(String codeVarIndexedRecord, String codeVarRowStruct) { + generateConvertRecord(codeVarIndexedRecord, codeVarRowStruct, columns); + } + + /** + * Generate code that copies data from the IndexedRecord to the rowStruct. + * + * @param codeVarIndexedRecord the name of the variable that contains the + * IndexedRecord. + * @param codeVarRowStruct the name of the variable that contains the + * rowStruct. + * @param columnsToGenerate the list of columns in the rowStruct to generate + * code for. + */ + public void generateConvertRecord(String codeVarIndexedRecord, String codeVarRowStruct, List columnsToGenerate) { + %> + // Construct the factory once when the first data arrives. + if (<%=codeVarIndexedRecordAdapter%> == null) { + <%=codeVarIndexedRecordAdapter%> = (org.talend.daikon.avro.converter.IndexedRecordConverter) + new org.talend.daikon.avro.AvroRegistry() + .createIndexedRecordConverter(<%=codeVarIndexedRecord%>.getClass()); + } + + // Enforce the outgoing schema on the input. + <%=codeVarSchemaEnforcer%>.setWrapped(<%=codeVarIndexedRecordAdapter%>.convertToAvro(<%=codeVarIndexedRecord%>)); + <% + + if (dynamicColName != null) { + %> + if (!<%=codeVarIsDynamicInitialized%>) { + org.apache.avro.Schema dynSchema_<%=cid%> = ((org.talend.daikon.di.DiOutgoingDynamicSchemaEnforcer) <%=codeVarSchemaEnforcer%>).getDynamicFieldsSchema(); + for (org.apache.avro.Schema.Field dynamicField_<%=cid%> : dynSchema_<%=cid%>.getFields()){ + routines.system.DynamicMetadata dynamicMetadata_<%=cid%> = new routines.system.DynamicMetadata(); + // set name and db name + dynamicMetadata_<%=cid%>.setName(dynamicField_<%=cid%>.name()); + dynamicMetadata_<%=cid%>.setDbName(dynamicField_<%=cid%>.name()); + // set type + String talendType_<%=cid%> = null; + org.apache.avro.Schema.Type type_<%=cid%> = dynamicField_<%=cid%>.schema().getType(); + if(type_<%=cid%> == org.apache.avro.Schema.Type.UNION){ + java.util.List fieldTypes_<%=cid%> = dynamicField_<%=cid%>.schema().getTypes(); + for(org.apache.avro.Schema fieldType_<%=cid%>:fieldTypes_<%=cid%>){ + if(fieldType_<%=cid%>.getType() == org.apache.avro.Schema.Type.NULL){ + dynamicMetadata_<%=cid%>.setNullable(true); + }else{ + type_<%=cid%> = fieldType_<%=cid%>.getType(); + } + } + } + if (type_<%=cid%> == org.apache.avro.Schema.Type.ARRAY) { + talendType_<%=cid%> = "<%=JavaTypesManager.LIST.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.BOOLEAN) { + talendType_<%=cid%> = "<%=JavaTypesManager.BOOLEAN.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.BYTES) { + talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.FIXED) { + talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.DOUBLE) { + talendType_<%=cid%> = "<%=JavaTypesManager.DOUBLE.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.FLOAT) { + talendType_<%=cid%> = "<%=JavaTypesManager.FLOAT.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.INT) { + talendType_<%=cid%> = "<%=JavaTypesManager.INTEGER.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.LONG) { + String pattern_<%=cid%> = dynamicField_<%=cid%>.getProp(org.talend.daikon.avro.SchemaConstants.TALEND_COLUMN_PATTERN); + if(pattern_<%=cid%>!=null && !pattern_<%=cid%>.trim().isEmpty()){ + talendType_<%=cid%> = "<%=JavaTypesManager.DATE.getId()%>"; + dynamicMetadata_<%=cid%>.setFormat(pattern_<%=cid%>); + }else{ + talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>"; + } + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.ENUM) { + talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; + } else if (type_<%=cid%> == org.apache.avro.Schema.Type.STRING) { + talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; + } + dynamicMetadata_<%=cid%>.setType(talendType_<%=cid%>); + // set logical type + org.apache.avro.Schema unwrappedSchema_<%=cid%> = org.talend.daikon.avro.AvroUtils.unwrapIfNullable(dynamicField_<%=cid%>.schema()); + String logicalType_<%=cid%> = org.talend.daikon.avro.LogicalTypeUtils.getLogicalTypeName(unwrappedSchema_<%=cid%>); + dynamicMetadata_<%=cid%>.setLogicalType(logicalType_<%=cid%>); + // set length + Object length_<%=cid%> = dynamicField_<%=cid%>.getProp(org.talend.daikon.avro.SchemaConstants.TALEND_COLUMN_DB_LENGTH); + if(length_<%=cid%> != null){ + dynamicMetadata_<%=cid%>.setLength(Integer.parseInt(String.valueOf(length_<%=cid%>))); + } + // set precision + Object precision_<%=cid%> = dynamicField_<%=cid%>.getProp(org.talend.daikon.avro.SchemaConstants.TALEND_COLUMN_PRECISION); + if(precision_<%=cid%> != null){ + dynamicMetadata_<%=cid%>.setPrecision(Integer.parseInt(String.valueOf(precision_<%=cid%>))); + } + // add dynamic field metadata to dynamic variable + <%=codeVarDynamic%>.metadatas.add(dynamicMetadata_<%=cid%>); + } + initDyn_<%=cid%> = true; + } + <%=codeVarDynamic%>.clearColumnValues(); + <% + } + + for (int i = 0; i < columnsToGenerate.size(); i++) { + IMetadataColumn column = columnsToGenerate.get(i); + String columnName = column.getLabel(); + JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType()); + String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()); + if (columnName.equals(dynamicColName)) { + %> + java.util.Map dynamicValue_<%=cid%> = (java.util.Map) <%=codeVarSchemaEnforcer%>.get(<%=i%>); + for (java.util.Map.Entry dynamicValueEntry_<%=cid%> : dynamicValue_<%=cid%>.entrySet()) { + <%=codeVarDynamic%>.setColumnValue(<%=codeVarDynamic%>.getIndex(dynamicValueEntry_<%=cid%>.getKey()), dynamicValueEntry_<%=cid%>.getValue()); + } + <%=codeVarRowStruct%>.<%=dynamicColName%> = <%=codeVarDynamic%>; + <% + } else { + %> + Object columnValue_<%=i%>_<%=cid%> = <%=codeVarSchemaEnforcer%>.get(<%=i%>); + if (columnValue_<%=i%>_<%=cid%> == null) { + <%=codeVarRowStruct%>.<%=columnName%> = <%=JavaTypesManager.getDefaultValueFromJavaType(typeToGenerate)%>; + } else { + <% + if (javaType == JavaTypesManager.STRING) { + %> + <%=codeVarRowStruct%>.<%=columnName%> = String.valueOf(columnValue_<%=i%>_<%=cid%>); + <% + } else if (javaType == JavaTypesManager.CHARACTER) { + %> + <%=codeVarRowStruct%>.<%=columnName%> = String.valueOf(columnValue_<%=i%>_<%=cid%>).charAt(0); + <% + } else if("id_Document".equals(column.getTalendType())){ + %> + <%=codeVarRowStruct%>.<%=columnName%> = ParserUtils.parseTo_Document(String.valueOf(columnValue_<%=i%>_<%=cid%>)); + <% + } else { + %> + <%=codeVarRowStruct%>.<%=columnName%> = (<%=typeToGenerate%>) (columnValue_<%=i%>_<%=cid%>); + <% + } + %> + } + <% + } + } + } + +} +%> diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/handle_rejects_end.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/handle_rejects_end.javajet new file mode 100644 index 0000000..d6711f8 --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/handle_rejects_end.javajet @@ -0,0 +1,44 @@ +<%@ jet +imports=" + java.util.List + java.util.Set + org.talend.components.api.component.ComponentDefinition + org.talend.core.model.metadata.IMetadataColumn + org.talend.core.model.metadata.IMetadataTable + org.talend.core.model.metadata.types.JavaType + org.talend.core.model.metadata.types.JavaTypesManager + org.talend.core.model.process.ElementParameterParser + org.talend.core.model.process.IConnection + org.talend.core.model.process.IConnectionCategory + org.talend.core.model.process.INode + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.core.generic.model.Component + org.talend.core.model.utils.NodeUtil + " +%> + +<% +CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; +INode node = (INode)codeGenArgument.getArgument(); +String cid = node.getUniqueName(); + +boolean hasReject = false; + +List outgoingConns = node.getOutgoingSortedConnections(); +if (outgoingConns!=null){ + for (int i = 0; i < outgoingConns.size(); i++) { + IConnection outgoingConn = outgoingConns.get(i); + if ("REJECT".equals(outgoingConn.getConnectorName())) { + hasReject = true; + } + } +} + +if (hasReject) { +%> + } // Finish while +<% +} +%> + +} // finish if writer diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/handle_rejects_start.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/handle_rejects_start.javajet new file mode 100644 index 0000000..e179153 --- /dev/null +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/handle_rejects_start.javajet @@ -0,0 +1,59 @@ +<%@ jet +imports=" + java.util.List + java.util.Set + org.talend.components.api.component.ComponentDefinition + org.talend.core.model.metadata.IMetadataColumn + org.talend.core.model.metadata.IMetadataTable + org.talend.core.model.metadata.types.JavaType + org.talend.core.model.metadata.types.JavaTypesManager + org.talend.core.model.process.ElementParameterParser + org.talend.core.model.process.IConnection + org.talend.core.model.process.IConnectionCategory + org.talend.core.model.process.INode + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.core.generic.model.Component + org.talend.core.model.utils.NodeUtil + " +%> + +<%@include file="@{org.talend.designer.codegen}/jet_stub/generic/component_util_indexedrecord_to_rowstruct.javajet"%> +<% +CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; +INode node = (INode)codeGenArgument.getArgument(); +String cid = node.getUniqueName(); +Component component = (Component)node.getComponent(); +ComponentDefinition def = component.getComponentDefinition(); + +IndexedRecordToRowStructGenerator rejectIrToRow = null; + +List outgoingConns = node.getOutgoingSortedConnections(); +if (outgoingConns!=null){ + for (int i = 0; i < outgoingConns.size(); i++) { + IConnection outgoingConn = outgoingConns.get(i); + if ("REJECT".equals(outgoingConn.getConnectorName())) { + rejectIrToRow = new IndexedRecordToRowStructGenerator(cid + "OutReject", + outgoingConn); + } + } +} + +%> +if (writer_<%=cid%> instanceof org.talend.components.api.component.runtime.WriterWithFeedback) { +<% +if (rejectIrToRow != null) { +%> + // Handle rejects after close + java.util.Iterator outgoingRejectRecords_<%=cid%> = ((org.talend.components.api.component.runtime.WriterWithFeedback)writer_<%=cid%>).getRejectedWrites().iterator(); + <%=rejectIrToRow.getConnection().getName()%> = null; + while (outgoingRejectRecords_<%=cid%>.hasNext()) { + <%=rejectIrToRow.getConnection().getName()%> = new <%=rejectIrToRow.getConnection().getName() %>Struct(); + Object outgoingReject_<%=cid%> = outgoingRejectRecords_<%=cid%>.next(); + <% + rejectIrToRow.generateConvertRecord("outgoingReject_" + cid, rejectIrToRow.getConnection().getName()); + %> +<% + // while finished in handle_rejects_end +} +// if finished in handle_rejects_end +%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/header.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/header.javajet old mode 100755 new mode 100644 similarity index 96% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/header.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/header.javajet index 97dafbc..bf78127 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/header.javajet +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/header.javajet @@ -1,800 +1,820 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - imports=" - org.talend.core.model.process.IProcess - org.talend.core.model.process.INode - org.talend.core.model.process.IConnection - org.talend.core.model.process.EConnectionType - org.talend.core.model.process.ElementParameterParser - org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.runprocess.CodeGeneratorRoutine - org.talend.designer.codegen.i18n.Messages - org.talend.core.ui.branding.IBrandingService - org.talend.core.ui.branding.AbstractBrandingService - org.talend.core.GlobalServiceRegister - org.talend.designer.codegen.ITalendSynchronizer - org.talend.designer.codegen.PigTemplate - java.util.List - java.util.ArrayList - java.util.Vector - org.talend.core.model.process.IContextParameter - org.talend.core.model.metadata.types.JavaTypesManager - org.talend.core.model.utils.NodeUtil - org.talend.core.model.utils.JavaResourcesHelper - org.talend.core.model.process.ProcessUtils - " - class="Header" -%> -<% - CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; - Vector v = (Vector) codeGenArgument.getArgument(); - IProcess process = (IProcess)v.get(0); - String version = (String)v.get(1); - - List< ? extends INode> processNodes = (List< ? extends INode>)process.getGeneratingNodes(); - boolean stats = codeGenArgument.isStatistics(); - boolean trace = codeGenArgument.isTrace(); - boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); - List params = new ArrayList(); - params=process.getContextManager().getDefaultContext().getContextParameterList(); - String className = process.getName(); -%> -<% -IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class); -if(service instanceof AbstractBrandingService){ -%> -<%=((AbstractBrandingService) service).getJobLicenseHeader(version)%> -<% -} - String jobFolderName = ""; - IProcess baseProcess = ProcessUtils.getTestContainerBaseProcess(process); - if (baseProcess != null) { - jobFolderName = JavaResourcesHelper.getJobFolderName(baseProcess.getName(), baseProcess.getVersion()) + "."; - } - jobFolderName = jobFolderName + JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion()); - String packageName = codeGenArgument.getCurrentProjectName().toLowerCase() + "." + jobFolderName; -%> -package <%= packageName %>; - -<%for (String routine : CodeGeneratorRoutine.getRequiredPigudfName(process)) { - boolean isTemplate =false; - for(PigTemplate template:PigTemplate.values()){ - if(routine.equals(template.getFileName())){ - isTemplate = true; - } - } - if(!isTemplate){%> -import pigudf.<%=routine%>; -<% } -}%> -<%for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) { - if(!routine.equals(ITalendSynchronizer.TEMPLATE)){%> -import routines.<%=routine%>; -<% } -}%> -import routines.system.*; -import routines.system.api.*; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.math.BigDecimal; -import java.io.ByteArrayOutputStream; -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; -import java.io.IOException; -import java.util.Comparator; -<% -if(ProcessUtils.isTestContainer(process)) { - className = className + "Test"; -%> -import org.junit.Test; -import static org.junit.Assert.assertTrue; -<% -} -%> - -<%=ElementParameterParser.getValue(process, "__HEADER_IMPORT__") %> -<%=ElementParameterParser.getValue(process, "__FOOTER_IMPORT__") %> - - -<% - List nodesWithImport = process.getNodesWithImport(); - if(nodesWithImport != null) { - for(INode node:nodesWithImport){ -%> - //the import part of <%=node.getUniqueName() %> - <%=ElementParameterParser.getValue(node, "__IMPORT__") %> - -<% } - } -%> - -@SuppressWarnings("unused") - -/** - * Job: <%=className%> Purpose: <%=ElementParameterParser.getValue(process, "__PURPOSE__") %>
- * Description: <%=ElementParameterParser.getValue(process, "__DESCRIPTION__") %>
- * @author <%=ElementParameterParser.getValue(process, "__AUTHOR__") %> - * @version <%=version %> - * @status <%=ElementParameterParser.getValue(process, "__STATUS__") %> - */ -<% -String talendJobInterfaces = "TalendJob"; - -boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty(); - -boolean actAsProvider = !process.getNodesOfType("tESBProviderRequest").isEmpty(); -boolean actAsConsumer = !process.getNodesOfType("tESBConsumer").isEmpty(); -boolean hasSAM4RS = false; -for (INode node : process.getNodesOfType("tRESTClient")) { - if (Boolean.valueOf(ElementParameterParser.getValue(node, "__SERVICE_ACTIVITY_MONITOR__"))) { - hasSAM4RS = true; - break; - } -} - -boolean talendEsbJob = actAsProvider || actAsConsumer || !process.getNodesOfType("tRouteInput").isEmpty(); -boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty(); - -boolean talendStepTemplate = !process.getNodesOfType("tActionInput").isEmpty() || !process.getNodesOfType("tActionOutput").isEmpty() || !process.getNodesOfType("tActionReject").isEmpty(); - -boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__")); - -if (talendMdmJob) { - talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job -} -if (talendEsbJob) { - talendJobInterfaces += ", TalendESBJob"; // Talend ESB job -} -if (talendEsbJobFactory) { - talendJobInterfaces += ", TalendESBJobFactory"; // Talend ESB provider job -} -if (talendStepTemplate) { - talendJobInterfaces += ", TalendStepTemplateFactory"; // Talend Step Template -} -%> -public class <%=className%> implements <%=talendJobInterfaces%> { -<%if(isLog4jEnabled){%> - static {System.setProperty("TalendJob.log", "<%=className%>.log");} - private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(<%=className%>.class); -<%}%> - -<% if (talendEsbJob) { %> - private ESBEndpointRegistry registry = null; - - public void setEndpointRegistry(ESBEndpointRegistry registry) { - this.registry = registry; - } - - private ESBProviderCallback callback = null; - - public void setProviderCallback(ESBProviderCallback callback) { - <% if (actAsProvider) { %> - this.callback = callback; - <% } %> - } - - <% if (!actAsProvider) { %> - public ESBEndpointInfo getEndpoint() { return null; } - <% } %> -<% } %> - -<% if (talendEsbJobFactory) { %> - public TalendESBJob newTalendESBJob() { - <%=process.getName()%> talendESBJob = new <%=process.getName()%>(); - java.util.Map talendDataSources = - (java.util.Map) globalMap.get(KEY_DB_DATASOURCES); - if (null != talendDataSources) { - java.util.Map dataSources = new java.util.HashMap(); - for (java.util.Map.Entry talendDataSourceEntry : talendDataSources.entrySet()) { - dataSources.put(talendDataSourceEntry.getKey(), talendDataSourceEntry.getValue().getRawDataSource()); - } - talendESBJob.setDataSources(dataSources); - } - // fix for TESB-7714 - talendESBJob.setEndpointRegistry(registry); - - // TESB-15920 tRESTClient and SAM not working - <% if (hasSAM4RS) { %> - talendESBJob.setEventFeature(eventFeature); - <% } %> - - return talendESBJob; - } -<% } %> - - public final Object obj = new Object(); - - // for transmiting parameters purpose - private Object valueObject = null; - - public Object getValueObject() { - return this.valueObject; - } - - public void setValueObject(Object valueObject) { - this.valueObject = valueObject; - } -<% -if(isRunInMultiThread){ -%> - private Object[] multiThreadLockWrite = new Object[0]; -<% -} -%> - <%//it will be use in job setting.%> - private final static String defaultCharset = java.nio.charset.Charset.defaultCharset().name(); - - <%//uft-8 is for temp file, for example: tSortRow, tMap. Because they need keep reversibility.%> - private final static String utf8Charset = "UTF-8"; - - // create and load default properties - private java.util.Properties defaultProps = new java.util.Properties(); - // create application properties with default - public class ContextProperties extends java.util.Properties { - - private static final long serialVersionUID = 1L; - - public ContextProperties(java.util.Properties properties){ - super(properties); - } - public ContextProperties(){ - super(); - } - - public void synchronizeContext(){ - <% for (IContextParameter ctxParam :params){ - String cParaName = ctxParam.getName(); - %> - if(<%=cParaName %> != null){ - <%if(ctxParam.getType().equals("id_Date")){%> - String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss"; - String value_<%=cParaName %> = "<%=ctxParam.getValue() %>"; - String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";"); - if(parts_<%=cParaName %>.length > 1){ - pattern_<%=cParaName %> = parts_<%=cParaName %>[0]; - this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>)); - }else{ - this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>)); - } - <%}else{%> - this.setProperty("<%=cParaName %>", <%=cParaName %>.toString()); - <%}%> - } - <% } %> - } - -<% - for (IContextParameter ctxParam :params) - { - if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) - { - %> - public String <%=ctxParam.getName()%>; - public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>(){ - return this.<%=ctxParam.getName()%>; - } - <% - }else - { -%> -public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>; -public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>(){ - return this.<%=ctxParam.getName()%>; -} -<% } - } -%> - } - private ContextProperties context = new ContextProperties(); - public ContextProperties getContext() { - return this.context; - } - private final String jobVersion = "<%=process.getVersion() %>"; - private final String jobName = "<%=codeGenArgument.getJobName() %>"; - private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>"; - public Integer errorCode = null; - private String currentComponent = ""; - <% - //tParallelize will wrap globalMap with synchronizedMap - if(isRunInMultiThread || NodeUtil.containsMultiThreadComponent(process)){ - %> - private final java.util.Map globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap()); - <% - } else { - %> - private final java.util.Map globalMap = new java.util.HashMap(); - private final static java.util.Map junitGlobalMap = new java.util.HashMap(); - <% - } - boolean exist_tParallelize = false; - List tParallelizeList = process.getNodesOfType("tParallelize"); - if(tParallelizeList != null && tParallelizeList.size() > 0){ - exist_tParallelize = true; - } - if(!isRunInMultiThread && !exist_tParallelize){ - %> - private final java.util.Map start_Hash = new java.util.HashMap(); - private final java.util.Map end_Hash = new java.util.HashMap(); - private final java.util.Map ok_Hash = new java.util.HashMap(); - public final java.util.List globalBuffer = new java.util.ArrayList(); - <% - }else{ - %> - private final java.util.Map start_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); - private final java.util.Map end_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); - private final java.util.Map ok_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); - public final java.util.List globalBuffer = java.util.Collections.synchronizedList(new java.util.ArrayList()); - <% - } - %> - -<% - if (stats) { -%> -private RunStat runStat = new RunStat(); -<% - } -%> -<% - if (trace) { -%> -private RunTrace runTrace = new RunTrace(); -<% - } -%> - - // OSGi DataSource - private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES"; - - public void setDataSources(java.util.Map dataSources) { - java.util.Map talendDataSources = new java.util.HashMap(); - for (java.util.Map.Entry dataSourceEntry : dataSources.entrySet()) { - talendDataSources.put(dataSourceEntry.getKey(), new routines.system.TalendDataSource(dataSourceEntry.getValue())); - } - globalMap.put(KEY_DB_DATASOURCES, talendDataSources); - } - -<% - for (INode logCatcher : process.getNodesOfType("tLogCatcher")) { -%> - LogCatcherUtils <%=logCatcher.getUniqueName() %> = new LogCatcherUtils(); -<% - } - - for (INode statCatcher : process.getNodesOfType("tStatCatcher")) { -%> - StatCatcherUtils <%=statCatcher.getUniqueName() %> = new StatCatcherUtils("<%=process.getId() %>", "<%=process.getVersion() %>"); -<% - } - - for (INode metterCatcher : process.getNodesOfType("tFlowMeterCatcher")) { -%> - MetterCatcherUtils <%=metterCatcher.getUniqueName() %> = new MetterCatcherUtils("<%=process.getId() %>", "<%=process.getVersion() %>"); -<% - } - - for (INode assertCatcher : process.getNodesOfType("tAssertCatcher")) { -%> - AssertCatcherUtils <%=assertCatcher.getUniqueName() %> = new AssertCatcherUtils(); -<% - } -%> - -private final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); -private final java.io.PrintStream errorMessagePS = new java.io.PrintStream(new java.io.BufferedOutputStream(baos)); - -public String getExceptionStackTrace() { - if ("failure".equals(this.getStatus())) { - errorMessagePS.flush(); - return baos.toString(); - } - return null; -} - -private Exception exception; - -public Exception getException() { - if ("failure".equals(this.getStatus())) { - return this.exception; - } - return null; -} - -private class TalendException extends Exception { - - private static final long serialVersionUID = 1L; - - private java.util.Map globalMap = null; - private Exception e = null; - private String currentComponent = null; - private String virtualComponentName = null; - - public void setVirtualComponentName (String virtualComponentName){ - this.virtualComponentName = virtualComponentName; - } - - private TalendException(Exception e, String errorComponent, final java.util.Map globalMap) { - this.currentComponent= errorComponent; - this.globalMap = globalMap; - this.e = e; - } - - public Exception getException() { - return this.e; - } - - public String getCurrentComponent() { - return this.currentComponent; - } - - <%//For TDI-27789%> - public String getExceptionCauseMessage(Exception e){ - Throwable cause = e; - String message = null; - int i = 10; - while (null != cause && 0 < i--) { - message = cause.getMessage(); - if (null == message) { - cause = cause.getCause(); - } else { - break; - } - } - if (null == message) { - message = e.getClass().getName(); - } - return message; - } - - @Override - public void printStackTrace() { - if (!(e instanceof TalendException || e instanceof TDieException)) { - if(virtualComponentName!=null && currentComponent.indexOf(virtualComponentName+"_")==0){ - globalMap.put(virtualComponentName+"_ERROR_MESSAGE",getExceptionCauseMessage(e)); - } - globalMap.put(currentComponent+"_ERROR_MESSAGE",getExceptionCauseMessage(e)); - System.err.println("Exception in component " + currentComponent); - } - if (!(e instanceof TDieException)) { - if(e instanceof TalendException){ - e.printStackTrace(); - } else { - e.printStackTrace(); - e.printStackTrace(errorMessagePS); - <%=className%>.this.exception = e; - } - } - if (!(e instanceof TalendException)) { - try { - for (java.lang.reflect.Method m : this.getClass().getEnclosingClass().getMethods()) { - if (m.getName().compareTo(currentComponent + "_error") == 0) { - m.invoke(<%=className%>.this, new Object[] { e , currentComponent, globalMap}); - break; - } - } - - if(!(e instanceof TDieException)){ -<% - if (process.getNodesOfType("tLogCatcher").size() > 0) { - List logCatchers = (List)process.getNodesOfType("tLogCatcher"); - for (INode logCatcher : logCatchers) { - if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - // 1) add the message to the stack -%> - <%=logCatcher.getUniqueName() %>.addMessage("Java Exception", currentComponent, 6, e.getClass().getName() + ":" + e.getMessage(), 1); -<% - } - } - - INode virtualNCatchNode = null; - boolean hasRealCatchNode = false; - for (INode logCatcher : logCatchers) { - if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - if(logCatcher.isVirtualGenerateNode()){ - virtualNCatchNode = logCatcher; - }else{ - hasRealCatchNode = true; - } - } - } - if(hasRealCatchNode && virtualNCatchNode!=null){ -%> - try{ -<% - } - for (INode logCatcher : logCatchers) { - if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - if(logCatcher!=virtualNCatchNode){ - // 2) launch logCatcher subProcess -%> - <%=logCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); -<% - } - } - } - if(hasRealCatchNode && virtualNCatchNode!=null){ -%> - }finally{ -<% - } - if(virtualNCatchNode!=null){ -%> - <%=virtualNCatchNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); -<% - } - if(hasRealCatchNode && virtualNCatchNode!=null){ -%> - } -<% - } - } -%> - } -<% - boolean needCatchTalendException = false; - if (process.getNodesOfType("tLogCatcher").size() > 0) { - for(INode node:process.getNodesOfType("tLogCatcher")){ - if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){ - needCatchTalendException = true; - break; - } - } - } - - if ((!needCatchTalendException) && (process.getNodesOfType("tAssertCatcher").size() > 0)) { - for(INode node:process.getNodesOfType("tAssertCatcher")){ - if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){ - needCatchTalendException = true; - break; - } - } - } - if(needCatchTalendException) { - if (process.getNodesOfType("tLogCatcher").size() > 0) { - %> - } catch (TalendException e) { - // do nothing - <% - } - } -%> - } catch (Exception e) { - this.e.printStackTrace(); - } - } - } -} - -<% // Methods for RUN IF Error links %> -<% - for (INode node : processNodes) { - if (node.isActivate()) { - %> - public void <%=node.getUniqueName() %>_error(Exception exception, String errorComponent, final java.util.Map globalMap) throws TalendException { - <% - //If node is virtual component input part,invoke virtual component output part when virtual link is ROWS_END,FLOW,COMPONENT_OK,ITERATE(virtual link could not be ON_SUBJOB_OK) - if(node.isVirtualGenerateNode() && node.getVirtualLinkTo()!=null){ - List< ? extends IConnection> conns = node.getOutgoingConnections(node.getVirtualLinkTo()); - boolean invokeVirtualLinkError=false; - //If virtual component virtual link is EConnectionType.ON_SUBJOB_OK,node.getOutgoingConnections().size() is 0 - for(IConnection conn:conns){ - INode virtualLinkNode = conn.getTarget(); - if(virtualLinkNode.isVirtualGenerateNode()){ - %> - <%=virtualLinkNode.getUniqueName()%>_error(exception, errorComponent, globalMap); - <% - invokeVirtualLinkError=true; - break; - } - } - if(invokeVirtualLinkError){ - %> - } - <% - continue; - } - } - if(!node.isVirtualGenerateNode() && node.getUniqueName().startsWith("tAsyncIn_")){ - %> - <%=node.getUniqueName().replace("tAsyncIn_","tAsyncOut_")%>_error(exception, errorComponent, globalMap); - } - <% - continue; - } - %> - end_Hash.put(errorComponent, System.currentTimeMillis()); - <% - boolean ifBeforRunError = NodeUtil.checkComponentErrorConnectionAfterNode(node); - if(!ifBeforRunError) { - if (process.getNodesOfType("tAssertCatcher").size() > 0) { - List assertCatchers = (List)process.getNodesOfType("tAssertCatcher"); - for (INode assertCatcher : assertCatchers) { - if (ElementParameterParser.getValue(assertCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { - // 1) add the message to the stack - %> - if(!(exception instanceof TDieException)){ - <%if("true".equals(ElementParameterParser.getValue(assertCatcher, "__GET_ORIGINAL_EXCEPTION__"))){%> - <%=assertCatcher.getUniqueName()%>.addMessage(pid, projectName, jobName, "java", null, "Failed", "Job execution error", exception); - <%}else{%> - <%=assertCatcher.getUniqueName()%>.addMessage(pid, projectName, jobName, "java", null, "Failed", "Job execution error", exception.getMessage()); - <%}%> - <%=assertCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - } - <% - } - } - } - } - if (!node.getComponent().getName().equals("tDie")) { - String statCatcher = ElementParameterParser.getValue(node,"__TSTATCATCHER_STATS__"); - if (statCatcher.compareTo("true")==0) { - for (INode statCatcherNode : node.getProcess().getNodesOfType("tStatCatcher")) { - %> - <%=statCatcherNode.getUniqueName() %>.addMessage("failure",errorComponent, end_Hash.get(errorComponent)-start_Hash.get(errorComponent)); - <%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); - <% - } - } - } - boolean isExistOnCompErrorLink = false; - List< ? extends IConnection> conns = NodeUtil.getVirtualNode(node).getOutgoingConnections(); - for (IConnection conn : conns) { - if (conn.getLineStyle().equals(EConnectionType.ON_COMPONENT_ERROR)) { - isExistOnCompErrorLink = true; - %> - try { - <%if (stats) {%> - if(this.execStat){ - runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "error"); - } - <%}%> - <% - if (isRunInMultiThread ) { - %> - ((java.util.Map)threadLocal.get()).put("errorCode", null); - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if ( !"failure".equals(((java.util.Map)threadLocal.get()).get("status")) ) { - ((java.util.Map)threadLocal.get()).put("status", "end"); - } - <% - } else { - %> - errorCode = null; - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if (!"failure".equals(status)) { - status = "end"; - } - <% - } - %> - - } catch (Exception e) { - e.printStackTrace(); - } - <% - } - } - /* - This part of code in order to call the correct onComponentError and onSubjobError for virtual component which EConnectionType is ROWS_END,FLOW,COMPONENT_OK,ITERATE. - */ - INode subjob_start_node = node; - boolean hasBeenChanged = true; - while(subjob_start_node.getDesignSubjobStartNode().isVirtualGenerateNode() && hasBeenChanged) { - hasBeenChanged = false; - if(subjob_start_node.getDesignSubjobStartNode().getVirtualLinkTo()==null){ - //if EConnectionType of virtual component(INPUT-->SUBJOB_OK-->OUTPUT) is SUBJOB_OK,the size of OUTPUT node IncomingConnections is zero. - if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections().size()>0){ - subjob_start_node = subjob_start_node.getDesignSubjobStartNode().getIncomingConnections().get(0).getSource(); - hasBeenChanged = true; - } - } - } - // when use parallelize will add virtual components(tAsyncIn and tAsyncOut) but in graphical these is visable=false - if ("true".equals(ElementParameterParser.getValue(node, "__PARALLELIZE__"))) { - if(subjob_start_node.getDesignSubjobStartNode().getUniqueName().startsWith("tAsyncIn_")){ - subjob_start_node = NodeUtil.getNodeByUniqueName(subjob_start_node.getProcess(),subjob_start_node.getDesignSubjobStartNode().getUniqueName().replace("tAsyncIn_","tAsyncOut_")); - } - } - //end - boolean isSubjobHasOnSubJobError = false; - if (!isExistOnCompErrorLink) { - INode subJobStartNode = subjob_start_node.getDesignSubjobStartNode(); - if (subJobStartNode != null) { - List< ? extends IConnection> tempConns = subJobStartNode.getOutgoingConnections(); - for (IConnection conn : tempConns) { - if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { - isSubjobHasOnSubJobError = true; - break; - } - } - } - } - - if (!isSubjobHasOnSubJobError && !isExistOnCompErrorLink) { // when there is no subjoberror and no onComponentError - if (isRunInMultiThread ) { - %> - ((java.util.Map)threadLocal.get()).put("status", "failure"); - <% - } else { - %> - status = "failure"; - <% - } - } - - %> - <%=subjob_start_node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap); - } - <% - } - } - for (INode node : processNodes) { - if (node.isDesignSubjobStartNode()) { -%> - public void <%=node.getUniqueName() %>_onSubJobError(Exception exception, String errorComponent, final java.util.Map globalMap) throws TalendException { -<% - List< ? extends IConnection> conns = node.getOutgoingConnections(); - int count = 0; - for (IConnection conn : conns) { - if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { - count++; - } - } - - String label = "ERROR"; - - if(count == 0){//FATAL - label = "FATAL"; - }else{//ERROR------>RunSubJobError - label = "ERROR"; - } -%> - -resumeUtil.addLog("SYSTEM_LOG", "NODE:"+ errorComponent, "", Thread.currentThread().getId()+ "", "<%=label %>", "", exception.getMessage(), ResumeUtil.getExceptionStackTrace(exception),""); - -<% - for (IConnection conn : conns) { - if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { -%> - try { - <%if (stats) {%> - if(this.execStat){ - runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "error"); - } - <%}%> -<% - if(isRunInMultiThread ){ -%> - ((java.util.Map)threadLocal.get()).put("errorCode", null); - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if ( !"failure".equals(((java.util.Map)threadLocal.get()).get("status")) ) { - ((java.util.Map)threadLocal.get()).put("status", "end"); - } -<% - } else { -%> - errorCode = null; - <%=conn.getTarget().getUniqueName() %>Process(globalMap); - if (!"failure".equals(status)) { - status = "end"; - } -<% - } -%> - } catch (Exception e) { - e.printStackTrace(); - } -<% - } - } -%> - } -<% - } - } -%> +<%@ jet + package="org.talend.designer.codegen.translators" + imports=" + org.talend.core.model.process.IProcess + org.talend.core.model.process.INode + org.talend.core.model.process.IConnection + org.talend.core.model.process.EConnectionType + org.talend.core.model.process.ElementParameterParser + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.runprocess.CodeGeneratorRoutine + org.talend.designer.codegen.i18n.Messages + org.talend.core.ui.branding.IBrandingService + org.talend.core.ui.branding.AbstractBrandingService + org.talend.core.GlobalServiceRegister + org.talend.designer.codegen.ITalendSynchronizer + org.talend.designer.codegen.PigTemplate + java.util.List + java.util.ArrayList + java.util.Vector + org.talend.core.model.process.IContextParameter + org.talend.core.model.metadata.types.JavaTypesManager + org.talend.core.model.utils.NodeUtil + org.talend.core.model.utils.JavaResourcesHelper + org.talend.core.model.process.ProcessUtils + " + class="Header" +%> +<% + CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; + Vector v = (Vector) codeGenArgument.getArgument(); + IProcess process = (IProcess)v.get(0); + String version = (String)v.get(1); + + List< ? extends INode> processNodes = (List< ? extends INode>)process.getGeneratingNodes(); + boolean stats = codeGenArgument.isStatistics(); + boolean trace = codeGenArgument.isTrace(); + boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread(); + List params = new ArrayList(); + params=process.getContextManager().getDefaultContext().getContextParameterList(); + String className = process.getName(); +%> +<% +IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class); +if(service instanceof AbstractBrandingService){ +%> +<%=((AbstractBrandingService) service).getJobLicenseHeader(version)%> +<% +} + String jobFolderName = ""; + IProcess baseProcess = ProcessUtils.getTestContainerBaseProcess(process); + if (baseProcess != null) { + jobFolderName = JavaResourcesHelper.getJobFolderName(baseProcess.getName(), baseProcess.getVersion()) + "."; + } + jobFolderName = jobFolderName + JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion()); + String packageName = codeGenArgument.getCurrentProjectName().toLowerCase() + "." + jobFolderName; +%> +package <%= packageName %>; + +<%for (String routine : CodeGeneratorRoutine.getRequiredPigudfName(process)) { + boolean isTemplate =false; + for(PigTemplate template:PigTemplate.values()){ + if(routine.equals(template.getFileName())){ + isTemplate = true; + } + } + if(!isTemplate){%> +import pigudf.<%=routine%>; +<% } +}%> +<%for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) { + if(!routine.equals(ITalendSynchronizer.TEMPLATE)){%> +import routines.<%=routine%>; +<% } +}%> +import routines.system.*; +import routines.system.api.*; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.math.BigDecimal; +import java.io.ByteArrayOutputStream; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectInputStream; +import java.io.IOException; +import java.util.Comparator; +<% +if(ProcessUtils.isTestContainer(process)) { + className = className + "Test"; +%> +import org.junit.Test; +import static org.junit.Assert.assertTrue; +<% +} +%> + +<%=ElementParameterParser.getValue(process, "__HEADER_IMPORT__") %> +<%=ElementParameterParser.getValue(process, "__FOOTER_IMPORT__") %> + + +<% + List nodesWithImport = process.getNodesWithImport(); + if(nodesWithImport != null) { + for(INode node:nodesWithImport){ +%> + //the import part of <%=node.getUniqueName() %> + <%=ElementParameterParser.getValue(node, "__IMPORT__") %> + +<% } + } +%> + +@SuppressWarnings("unused") + +/** + * Job: <%=className%> Purpose: <%=ElementParameterParser.getValue(process, "__PURPOSE__") %>
+ * Description: <%=ElementParameterParser.getValue(process, "__DESCRIPTION__") %>
+ * @author <%=ElementParameterParser.getValue(process, "__AUTHOR__") %> + * @version <%=version %> + * @status <%=ElementParameterParser.getValue(process, "__STATUS__") %> + */ +<% +String talendJobInterfaces = "TalendJob"; + +boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty(); + +boolean actAsProvider = !process.getNodesOfType("tESBProviderRequest").isEmpty(); +boolean actAsConsumer = !process.getNodesOfType("tESBConsumer").isEmpty(); +boolean hasSAM4RS = false; +for (INode node : process.getNodesOfType("tRESTClient")) { + if (Boolean.valueOf(ElementParameterParser.getValue(node, "__SERVICE_ACTIVITY_MONITOR__"))) { + hasSAM4RS = true; + break; + } +} + +boolean talendEsbJob = actAsProvider || actAsConsumer || !process.getNodesOfType("tRouteInput").isEmpty(); +boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty(); + +boolean talendStepTemplate = !process.getNodesOfType("tActionInput").isEmpty() || !process.getNodesOfType("tActionOutput").isEmpty() || !process.getNodesOfType("tActionReject").isEmpty(); + +boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__")); + +if (talendMdmJob) { + talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job +} +if (talendEsbJob) { + talendJobInterfaces += ", TalendESBJob"; // Talend ESB job +} +if (talendEsbJobFactory) { + talendJobInterfaces += ", TalendESBJobFactory"; // Talend ESB provider job +} +if (talendStepTemplate) { + talendJobInterfaces += ", TalendStepTemplateFactory"; // Talend Step Template +} +%> +public class <%=className%> implements <%=talendJobInterfaces%> { +<%if(isLog4jEnabled){%> + static {System.setProperty("TalendJob.log", "<%=className%>.log");} + private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(<%=className%>.class); +<%}%> + +<% if (talendEsbJob) { %> + private ESBEndpointRegistry registry = null; + + public void setEndpointRegistry(ESBEndpointRegistry registry) { + this.registry = registry; + } + + private ESBProviderCallback callback = null; + + public void setProviderCallback(ESBProviderCallback callback) { + <% if (actAsProvider) { %> + this.callback = callback; + <% } %> + } + + <% if (!actAsProvider) { %> + public ESBEndpointInfo getEndpoint() { return null; } + <% } %> +<% } %> + +<% if (talendEsbJobFactory) { %> + public TalendESBJob newTalendESBJob() { + <%=process.getName()%> talendESBJob = new <%=process.getName()%>(); + java.util.Map talendDataSources = + (java.util.Map) globalMap.get(KEY_DB_DATASOURCES); + if (null != talendDataSources) { + java.util.Map dataSources = new java.util.HashMap(); + for (java.util.Map.Entry talendDataSourceEntry : talendDataSources.entrySet()) { + dataSources.put(talendDataSourceEntry.getKey(), talendDataSourceEntry.getValue().getRawDataSource()); + } + talendESBJob.setDataSources(dataSources); + } + // fix for TESB-7714 + talendESBJob.setEndpointRegistry(registry); + + // TESB-15920 tRESTClient and SAM not working + <% if (hasSAM4RS) { %> + talendESBJob.setEventFeature(eventFeature); + <% } %> + + return talendESBJob; + } +<% } %> + + public final Object obj = new Object(); + + // for transmiting parameters purpose + private Object valueObject = null; + + public Object getValueObject() { + return this.valueObject; + } + + public void setValueObject(Object valueObject) { + this.valueObject = valueObject; + } +<% +if(isRunInMultiThread){ +%> + private Object[] multiThreadLockWrite = new Object[0]; +<% +} +%> + <%//it will be use in job setting.%> + private final static String defaultCharset = java.nio.charset.Charset.defaultCharset().name(); + + <%//uft-8 is for temp file, for example: tSortRow, tMap. Because they need keep reversibility.%> + private final static String utf8Charset = "UTF-8"; + //contains type for every context property + public class PropertiesWithType extends java.util.Properties { + private static final long serialVersionUID = 1L; + private java.util.Map propertyTypes = new java.util.HashMap<>(); + + public PropertiesWithType(java.util.Properties properties){ + super(properties); + } + public PropertiesWithType(){ + super(); + } + + public void setContextType(String key, String type) { + propertyTypes.put(key,type); + } + + public String getContextType(String key) { + return propertyTypes.get(key); + } + } + + // create and load default properties + private java.util.Properties defaultProps = new java.util.Properties(); + // create application properties with default + public class ContextProperties extends PropertiesWithType { + + private static final long serialVersionUID = 1L; + + public ContextProperties(java.util.Properties properties){ + super(properties); + } + public ContextProperties(){ + super(); + } + + public void synchronizeContext(){ + <% for (IContextParameter ctxParam :params){ + String cParaName = ctxParam.getName(); + %> + if(<%=cParaName %> != null){ + <%if(ctxParam.getType().equals("id_Date")){%> + String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss"; + String value_<%=cParaName %> = "<%=ctxParam.getValue() %>"; + String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";"); + if(parts_<%=cParaName %>.length > 1){ + pattern_<%=cParaName %> = parts_<%=cParaName %>[0]; + this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>)); + }else{ + this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>)); + } + <%}else{%> + this.setProperty("<%=cParaName %>", <%=cParaName %>.toString()); + <%}%> + } + <% } %> + } + +<% + for (IContextParameter ctxParam :params) + { + if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) + { + %> + public String <%=ctxParam.getName()%>; + public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>(){ + return this.<%=ctxParam.getName()%>; + } + <% + }else + { +%> +public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>; +public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>(){ + return this.<%=ctxParam.getName()%>; +} +<% } + } +%> + } + private ContextProperties context = new ContextProperties(); + public ContextProperties getContext() { + return this.context; + } + private final String jobVersion = "<%=process.getVersion() %>"; + private final String jobName = "<%=codeGenArgument.getJobName() %>"; + private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>"; + public Integer errorCode = null; + private String currentComponent = ""; + <% + //tParallelize will wrap globalMap with synchronizedMap + if(isRunInMultiThread || NodeUtil.containsMultiThreadComponent(process)){ + %> + private final java.util.Map globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap()); + <% + } else { + %> + private final java.util.Map globalMap = new java.util.HashMap(); + private final static java.util.Map junitGlobalMap = new java.util.HashMap(); + <% + } + boolean exist_tParallelize = false; + List tParallelizeList = process.getNodesOfType("tParallelize"); + if(tParallelizeList != null && tParallelizeList.size() > 0){ + exist_tParallelize = true; + } + if(!isRunInMultiThread && !exist_tParallelize){ + %> + private final java.util.Map start_Hash = new java.util.HashMap(); + private final java.util.Map end_Hash = new java.util.HashMap(); + private final java.util.Map ok_Hash = new java.util.HashMap(); + public final java.util.List globalBuffer = new java.util.ArrayList(); + <% + }else{ + %> + private final java.util.Map start_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); + private final java.util.Map end_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); + private final java.util.Map ok_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap()); + public final java.util.List globalBuffer = java.util.Collections.synchronizedList(new java.util.ArrayList()); + <% + } + %> + +<% + if (stats) { +%> +private RunStat runStat = new RunStat(); +<% + } +%> +<% + if (trace) { +%> +private RunTrace runTrace = new RunTrace(); +<% + } +%> + + // OSGi DataSource + private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES"; + + public void setDataSources(java.util.Map dataSources) { + java.util.Map talendDataSources = new java.util.HashMap(); + for (java.util.Map.Entry dataSourceEntry : dataSources.entrySet()) { + talendDataSources.put(dataSourceEntry.getKey(), new routines.system.TalendDataSource(dataSourceEntry.getValue())); + } + globalMap.put(KEY_DB_DATASOURCES, talendDataSources); + } + +<% + for (INode logCatcher : process.getNodesOfType("tLogCatcher")) { +%> + LogCatcherUtils <%=logCatcher.getUniqueName() %> = new LogCatcherUtils(); +<% + } + + for (INode statCatcher : process.getNodesOfType("tStatCatcher")) { +%> + StatCatcherUtils <%=statCatcher.getUniqueName() %> = new StatCatcherUtils("<%=process.getId() %>", "<%=process.getVersion() %>"); +<% + } + + for (INode metterCatcher : process.getNodesOfType("tFlowMeterCatcher")) { +%> + MetterCatcherUtils <%=metterCatcher.getUniqueName() %> = new MetterCatcherUtils("<%=process.getId() %>", "<%=process.getVersion() %>"); +<% + } + + for (INode assertCatcher : process.getNodesOfType("tAssertCatcher")) { +%> + AssertCatcherUtils <%=assertCatcher.getUniqueName() %> = new AssertCatcherUtils(); +<% + } +%> + +private final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); +private final java.io.PrintStream errorMessagePS = new java.io.PrintStream(new java.io.BufferedOutputStream(baos)); + +public String getExceptionStackTrace() { + if ("failure".equals(this.getStatus())) { + errorMessagePS.flush(); + return baos.toString(); + } + return null; +} + +private Exception exception; + +public Exception getException() { + if ("failure".equals(this.getStatus())) { + return this.exception; + } + return null; +} + +private class TalendException extends Exception { + + private static final long serialVersionUID = 1L; + + private java.util.Map globalMap = null; + private Exception e = null; + private String currentComponent = null; + private String virtualComponentName = null; + + public void setVirtualComponentName (String virtualComponentName){ + this.virtualComponentName = virtualComponentName; + } + + private TalendException(Exception e, String errorComponent, final java.util.Map globalMap) { + this.currentComponent= errorComponent; + this.globalMap = globalMap; + this.e = e; + } + + public Exception getException() { + return this.e; + } + + public String getCurrentComponent() { + return this.currentComponent; + } + + <%//For TDI-27789%> + public String getExceptionCauseMessage(Exception e){ + Throwable cause = e; + String message = null; + int i = 10; + while (null != cause && 0 < i--) { + message = cause.getMessage(); + if (null == message) { + cause = cause.getCause(); + } else { + break; + } + } + if (null == message) { + message = e.getClass().getName(); + } + return message; + } + + @Override + public void printStackTrace() { + if (!(e instanceof TalendException || e instanceof TDieException)) { + if(virtualComponentName!=null && currentComponent.indexOf(virtualComponentName+"_")==0){ + globalMap.put(virtualComponentName+"_ERROR_MESSAGE",getExceptionCauseMessage(e)); + } + globalMap.put(currentComponent+"_ERROR_MESSAGE",getExceptionCauseMessage(e)); + System.err.println("Exception in component " + currentComponent + " (" + jobName + ")"); + } + if (!(e instanceof TDieException)) { + if(e instanceof TalendException){ + e.printStackTrace(); + } else { + e.printStackTrace(); + e.printStackTrace(errorMessagePS); + <%=className%>.this.exception = e; + } + } + if (!(e instanceof TalendException)) { + try { + for (java.lang.reflect.Method m : this.getClass().getEnclosingClass().getMethods()) { + if (m.getName().compareTo(currentComponent + "_error") == 0) { + m.invoke(<%=className%>.this, new Object[] { e , currentComponent, globalMap}); + break; + } + } + + if(!(e instanceof TDieException)){ +<% + if (process.getNodesOfType("tLogCatcher").size() > 0) { + List logCatchers = (List)process.getNodesOfType("tLogCatcher"); + for (INode logCatcher : logCatchers) { + if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { + // 1) add the message to the stack +%> + <%=logCatcher.getUniqueName() %>.addMessage("Java Exception", currentComponent, 6, e.getClass().getName() + ":" + e.getMessage(), 1); +<% + } + } + + INode virtualNCatchNode = null; + boolean hasRealCatchNode = false; + for (INode logCatcher : logCatchers) { + if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { + if(logCatcher.isVirtualGenerateNode()){ + virtualNCatchNode = logCatcher; + }else{ + hasRealCatchNode = true; + } + } + } + if(hasRealCatchNode && virtualNCatchNode!=null){ +%> + try{ +<% + } + for (INode logCatcher : logCatchers) { + if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { + if(logCatcher!=virtualNCatchNode){ + // 2) launch logCatcher subProcess +%> + <%=logCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); +<% + } + } + } + if(hasRealCatchNode && virtualNCatchNode!=null){ +%> + }finally{ +<% + } + if(virtualNCatchNode!=null){ +%> + <%=virtualNCatchNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); +<% + } + if(hasRealCatchNode && virtualNCatchNode!=null){ +%> + } +<% + } + } +%> + } +<% + boolean needCatchTalendException = false; + if (process.getNodesOfType("tLogCatcher").size() > 0) { + for(INode node:process.getNodesOfType("tLogCatcher")){ + if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){ + needCatchTalendException = true; + break; + } + } + } + + if ((!needCatchTalendException) && (process.getNodesOfType("tAssertCatcher").size() > 0)) { + for(INode node:process.getNodesOfType("tAssertCatcher")){ + if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){ + needCatchTalendException = true; + break; + } + } + } + if(needCatchTalendException) { + if (process.getNodesOfType("tLogCatcher").size() > 0) { + %> + } catch (TalendException e) { + // do nothing + <% + } + } +%> + } catch (Exception e) { + this.e.printStackTrace(); + } + } + } +} + +<% // Methods for RUN IF Error links %> +<% + for (INode node : processNodes) { + if (node.isActivate()) { + %> + public void <%=node.getUniqueName() %>_error(Exception exception, String errorComponent, final java.util.Map globalMap) throws TalendException { + <% + //If node is virtual component input part,invoke virtual component output part when virtual link is ROWS_END,FLOW,COMPONENT_OK,ITERATE(virtual link could not be ON_SUBJOB_OK) + if(node.isVirtualGenerateNode() && node.getVirtualLinkTo()!=null){ + List< ? extends IConnection> conns = node.getOutgoingConnections(node.getVirtualLinkTo()); + boolean invokeVirtualLinkError=false; + //If virtual component virtual link is EConnectionType.ON_SUBJOB_OK,node.getOutgoingConnections().size() is 0 + for(IConnection conn:conns){ + INode virtualLinkNode = conn.getTarget(); + if(virtualLinkNode.isVirtualGenerateNode()){ + %> + <%=virtualLinkNode.getUniqueName()%>_error(exception, errorComponent, globalMap); + <% + invokeVirtualLinkError=true; + break; + } + } + if(invokeVirtualLinkError){ + %> + } + <% + continue; + } + } + if(!node.isVirtualGenerateNode() && node.getUniqueName().startsWith("tAsyncIn_")){ + %> + <%=node.getUniqueName().replace("tAsyncIn_","tAsyncOut_")%>_error(exception, errorComponent, globalMap); + } + <% + continue; + } + %> + end_Hash.put(errorComponent, System.currentTimeMillis()); + <% + boolean ifBeforRunError = NodeUtil.checkComponentErrorConnectionAfterNode(node); + if(!ifBeforRunError) { + if (process.getNodesOfType("tAssertCatcher").size() > 0) { + List assertCatchers = (List)process.getNodesOfType("tAssertCatcher"); + for (INode assertCatcher : assertCatchers) { + if (ElementParameterParser.getValue(assertCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { + // 1) add the message to the stack + %> + if(!(exception instanceof TDieException)){ + <%if("true".equals(ElementParameterParser.getValue(assertCatcher, "__GET_ORIGINAL_EXCEPTION__"))){%> + <%=assertCatcher.getUniqueName()%>.addMessage(pid, projectName, jobName, "java", null, "Failed", "Job execution error", exception); + <%}else{%> + <%=assertCatcher.getUniqueName()%>.addMessage(pid, projectName, jobName, "java", null, "Failed", "Job execution error", exception.getMessage()); + <%}%> + <%=assertCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); + } + <% + } + } + } + } + if (!node.getComponent().getName().equals("tDie")) { + String statCatcher = ElementParameterParser.getValue(node,"__TSTATCATCHER_STATS__"); + if (statCatcher.compareTo("true")==0) { + for (INode statCatcherNode : node.getProcess().getNodesOfType("tStatCatcher")) { + %> + <%=statCatcherNode.getUniqueName() %>.addMessage("failure",errorComponent, end_Hash.get(errorComponent)-start_Hash.get(errorComponent)); + <%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); + <% + } + } + } + boolean isExistOnCompErrorLink = false; + List< ? extends IConnection> conns = NodeUtil.getVirtualNode(node).getOutgoingConnections(); + for (IConnection conn : conns) { + if (conn.getLineStyle().equals(EConnectionType.ON_COMPONENT_ERROR)) { + isExistOnCompErrorLink = true; + %> + try { + <%if (stats) {%> + if(this.execStat){ + runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "error"); + } + <%}%> + <% + if (isRunInMultiThread ) { + %> + ((java.util.Map)threadLocal.get()).put("errorCode", null); + <%=conn.getTarget().getUniqueName() %>Process(globalMap); + if ( !"failure".equals(((java.util.Map)threadLocal.get()).get("status")) ) { + ((java.util.Map)threadLocal.get()).put("status", "end"); + } + <% + } else { + %> + errorCode = null; + <%=conn.getTarget().getUniqueName() %>Process(globalMap); + if (!"failure".equals(status)) { + status = "end"; + } + <% + } + %> + + } catch (Exception e) { + e.printStackTrace(); + } + <% + } + } + /* + This part of code in order to call the correct onComponentError and onSubjobError for virtual component which EConnectionType is ROWS_END,FLOW,COMPONENT_OK,ITERATE. + */ + INode subjob_start_node = node; + boolean hasBeenChanged = true; + while(subjob_start_node.getDesignSubjobStartNode().isVirtualGenerateNode() && hasBeenChanged) { + hasBeenChanged = false; + if(subjob_start_node.getDesignSubjobStartNode().getVirtualLinkTo()==null){ + //if EConnectionType of virtual component(INPUT-->SUBJOB_OK-->OUTPUT) is SUBJOB_OK,the size of OUTPUT node IncomingConnections is zero. + if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections().size()>0){ + subjob_start_node = subjob_start_node.getDesignSubjobStartNode().getIncomingConnections().get(0).getSource(); + hasBeenChanged = true; + } + } + } + // when use parallelize will add virtual components(tAsyncIn and tAsyncOut) but in graphical these is visable=false + if ("true".equals(ElementParameterParser.getValue(node, "__PARALLELIZE__"))) { + if(subjob_start_node.getDesignSubjobStartNode().getUniqueName().startsWith("tAsyncIn_")){ + subjob_start_node = NodeUtil.getNodeByUniqueName(subjob_start_node.getProcess(),subjob_start_node.getDesignSubjobStartNode().getUniqueName().replace("tAsyncIn_","tAsyncOut_")); + } + } + //end + boolean isSubjobHasOnSubJobError = false; + if (!isExistOnCompErrorLink) { + INode subJobStartNode = subjob_start_node.getDesignSubjobStartNode(); + if (subJobStartNode != null) { + List< ? extends IConnection> tempConns = subJobStartNode.getOutgoingConnections(); + for (IConnection conn : tempConns) { + if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { + isSubjobHasOnSubJobError = true; + break; + } + } + } + } + + if (!isSubjobHasOnSubJobError && !isExistOnCompErrorLink) { // when there is no subjoberror and no onComponentError + if (isRunInMultiThread ) { + %> + ((java.util.Map)threadLocal.get()).put("status", "failure"); + <% + } else { + %> + status = "failure"; + <% + } + } + + %> + <%=subjob_start_node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap); + } + <% + } + } + for (INode node : processNodes) { + if (node.isDesignSubjobStartNode()) { +%> + public void <%=node.getUniqueName() %>_onSubJobError(Exception exception, String errorComponent, final java.util.Map globalMap) throws TalendException { +<% + List< ? extends IConnection> conns = node.getOutgoingConnections(); + int count = 0; + for (IConnection conn : conns) { + if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { + count++; + } + } + + String label = "ERROR"; + + if(count == 0){//FATAL + label = "FATAL"; + }else{//ERROR------>RunSubJobError + label = "ERROR"; + } +%> + +resumeUtil.addLog("SYSTEM_LOG", "NODE:"+ errorComponent, "", Thread.currentThread().getId()+ "", "<%=label %>", "", exception.getMessage(), ResumeUtil.getExceptionStackTrace(exception),""); + +<% + for (IConnection conn : conns) { + if (conn.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)) { +%> + try { + <%if (stats) {%> + if(this.execStat){ + runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "error"); + } + <%}%> +<% + if(isRunInMultiThread ){ +%> + ((java.util.Map)threadLocal.get()).put("errorCode", null); + <%=conn.getTarget().getUniqueName() %>Process(globalMap); + if ( !"failure".equals(((java.util.Map)threadLocal.get()).get("status")) ) { + ((java.util.Map)threadLocal.get()).put("status", "end"); + } +<% + } else { +%> + errorCode = null; + <%=conn.getTarget().getUniqueName() %>Process(globalMap); + if (!"failure".equals(status)) { + status = "end"; + } +<% + } +%> + } catch (Exception e) { + e.printStackTrace(); + } +<% + } + } +%> + } +<% + } + } +%> diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/header_additional.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/header_additional.javajet old mode 100755 new mode 100644 similarity index 96% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/header_additional.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/header_additional.javajet index 89db980..39910a6 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/header_additional.javajet +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/header_additional.javajet @@ -1,4 +1,4 @@ -<%@ jet - package="org.talend.designer.codegen.translators" - class="Header_additional" +<%@ jet + package="org.talend.designer.codegen.translators" + class="Header_additional" %> \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/iterate_subprocess_footer.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/iterate_subprocess_footer.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/iterate_subprocess_footer.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/iterate_subprocess_footer.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/iterate_subprocess_header.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/iterate_subprocess_header.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/iterate_subprocess_header.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/iterate_subprocess_header.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_footer.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_footer.javajet similarity index 99% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_footer.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_footer.javajet index b1082b8..f2d88ab 100644 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_footer.javajet +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_footer.javajet @@ -223,7 +223,7 @@ if(isLog4jEnabled){ %> if(!(e instanceof TalendException)){ - log.fatal(currentComponent + " " + e.getMessage()); + log.fatal(currentComponent + " " + e.getMessage(),e); } <% } diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_header.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_header.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subprocess_header.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_header.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_header_java.skeleton b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_header_java.skeleton similarity index 98% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_header_java.skeleton rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_header_java.skeleton index 213968b..07401b7 100644 --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/resources/subprocess_header_java.skeleton +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subprocess_header_java.skeleton @@ -1,100 +1,100 @@ -public class CLASS -{ - // add the list of the connection names to avoid to declare two times the same name. - public String createPrivateClassInstance(INode node, String parentLastRoot, boolean force) { - return createPrivateClassInstance(node, parentLastRoot, force, new HashSet()); - } - - public String createPrivateClassInstance(INode n, String parentLastRoot, boolean force, Set names) { - String toReturn = ""; - // declare root structs (all main outgoing connections) - for (IConnection conn : n.getOutgoingConnections()) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if ((force)||(n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { - // new Instance - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + "Struct " + conn.getName() + " = new " + conn.getName() - + "Struct();\n"; - names.add(conn.getName()); - parentLastRoot = conn.getName(); - } - } else { - // copy - if (!names.contains(conn.getName())) { - toReturn += parentLastRoot + "Struct " + conn.getName() + " = " + parentLastRoot + ";\n"; - names.add(conn.getName()); - } - } - if(!conn.getTarget().getComponent().useMerge()) { - toReturn += createPrivateClassInstance(conn.getTarget(), parentLastRoot, false, names); - } - } else if (conn.getLineStyle().equals(EConnectionType.ITERATE)||conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { - toReturn += createPrivateClassInstance(conn.getTarget(), parentLastRoot, true, names); - } - } - return toReturn; - } - - public String createPriveClassMethodDeclaration(INode n, String parentLastRoot, boolean force, Set names) { - String toReturn = ""; - // declare root structs (all main outgoing connections) - for (IConnection conn : n.getOutgoingConnections()) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if ((force)||(n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { - // new Instance - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + "Struct " + conn.getName() + ","; - names.add(conn.getName()); - parentLastRoot = conn.getName(); - } - } else { - // copy - if (!names.contains(conn.getName())) { - toReturn += parentLastRoot + "Struct " + conn.getName() + ","; - names.add(conn.getName()); - } - } - if(!conn.getTarget().getComponent().useMerge()) { - toReturn += createPriveClassMethodDeclaration(conn.getTarget(), parentLastRoot, false, names); - } - } else if (conn.getLineStyle().equals(EConnectionType.ITERATE)||conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { - toReturn += createPriveClassMethodDeclaration(conn.getTarget(), parentLastRoot, true, names); - } - } - return toReturn; - } - - public String createPrivateClassMethodInstance(INode n, String parentLastRoot, boolean force, Set names) { - String toReturn = ""; - // declare root structs (all main outgoing connections) - for (IConnection conn : n.getOutgoingConnections()) { - if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { - if ((force) || (n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { - // new Instance - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + ","; - names.add(conn.getName()); - parentLastRoot = conn.getName(); - } - } else { - // copy - if (!names.contains(conn.getName())) { - toReturn += conn.getName() + ","; - names.add(conn.getName()); - } - } - if (!conn.getTarget().getComponent().useMerge()) { - toReturn += createPrivateClassMethodInstance(conn.getTarget(), parentLastRoot, false, names); - } - } else if (conn.getLineStyle().equals(EConnectionType.ITERATE) - || conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { - toReturn += createPrivateClassMethodInstance(conn.getTarget(), parentLastRoot, true, names); - } - } - return toReturn; - } - - public String generate(Object argument) { - return ""; - } +public class CLASS +{ + // add the list of the connection names to avoid to declare two times the same name. + public String createPrivateClassInstance(INode node, String parentLastRoot, boolean force) { + return createPrivateClassInstance(node, parentLastRoot, force, new HashSet()); + } + + public String createPrivateClassInstance(INode n, String parentLastRoot, boolean force, Set names) { + String toReturn = ""; + // declare root structs (all main outgoing connections) + for (IConnection conn : n.getOutgoingConnections()) { + if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { + if ((force)||(n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { + // new Instance + if (!names.contains(conn.getName())) { + toReturn += conn.getName() + "Struct " + conn.getName() + " = new " + conn.getName() + + "Struct();\n"; + names.add(conn.getName()); + parentLastRoot = conn.getName(); + } + } else { + // copy + if (!names.contains(conn.getName())) { + toReturn += parentLastRoot + "Struct " + conn.getName() + " = " + parentLastRoot + ";\n"; + names.add(conn.getName()); + } + } + if(!conn.getTarget().getComponent().useMerge()) { + toReturn += createPrivateClassInstance(conn.getTarget(), parentLastRoot, false, names); + } + } else if (conn.getLineStyle().equals(EConnectionType.ITERATE)||conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { + toReturn += createPrivateClassInstance(conn.getTarget(), parentLastRoot, true, names); + } + } + return toReturn; + } + + public String createPriveClassMethodDeclaration(INode n, String parentLastRoot, boolean force, Set names) { + String toReturn = ""; + // declare root structs (all main outgoing connections) + for (IConnection conn : n.getOutgoingConnections()) { + if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { + if ((force)||(n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { + // new Instance + if (!names.contains(conn.getName())) { + toReturn += conn.getName() + "Struct " + conn.getName() + ","; + names.add(conn.getName()); + parentLastRoot = conn.getName(); + } + } else { + // copy + if (!names.contains(conn.getName())) { + toReturn += parentLastRoot + "Struct " + conn.getName() + ","; + names.add(conn.getName()); + } + } + if(!conn.getTarget().getComponent().useMerge()) { + toReturn += createPriveClassMethodDeclaration(conn.getTarget(), parentLastRoot, false, names); + } + } else if (conn.getLineStyle().equals(EConnectionType.ITERATE)||conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { + toReturn += createPriveClassMethodDeclaration(conn.getTarget(), parentLastRoot, true, names); + } + } + return toReturn; + } + + public String createPrivateClassMethodInstance(INode n, String parentLastRoot, boolean force, Set names) { + String toReturn = ""; + // declare root structs (all main outgoing connections) + for (IConnection conn : n.getOutgoingConnections()) { + if (conn.getLineStyle().equals(EConnectionType.FLOW_MAIN) || conn.getLineStyle().equals(EConnectionType.FLOW_MERGE)) { + if ((force) || (n.isSubProcessStart() || !(NodeUtil.isDataAutoPropagated(n)))) { + // new Instance + if (!names.contains(conn.getName())) { + toReturn += conn.getName() + ","; + names.add(conn.getName()); + parentLastRoot = conn.getName(); + } + } else { + // copy + if (!names.contains(conn.getName())) { + toReturn += conn.getName() + ","; + names.add(conn.getName()); + } + } + if (!conn.getTarget().getComponent().useMerge()) { + toReturn += createPrivateClassMethodInstance(conn.getTarget(), parentLastRoot, false, names); + } + } else if (conn.getLineStyle().equals(EConnectionType.ITERATE) + || conn.getLineStyle().equals(EConnectionType.ON_ROWS_END)) { + toReturn += createPrivateClassMethodInstance(conn.getTarget(), parentLastRoot, true, names); + } + } + return toReturn; + } + + public String generate(Object argument) { + return ""; + } } \ No newline at end of file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subtree_begin.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subtree_begin.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subtree_begin.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subtree_begin.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subtree_end.javajet b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subtree_end.javajet old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/jet_stub/subtree_end.javajet rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/jet_stub/subtree_end.javajet diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/messages.properties b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/messages.properties old mode 100755 new mode 100644 similarity index 95% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/messages.properties rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/messages.properties index 5e2fc32..f9dc18f --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/messages.properties +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/messages.properties @@ -58,9 +58,13 @@ ComponentsPreferencePage.WarningMsg=Need to restart Talend Open Studio to load e ComponentsPreferencePage.WarningTitle=Warning ComponentsPreferencePage.directoryFieldLabel=User component folder\: ComponentsPreferencePage.notValidDirectory=Your selection will result in folder nesting, which is not recommended. Do you want to continue anyway? +ComponentsPreferencePage.installComponentsFailure=Install components failure ComponentsProviderManager.unableLoad=unable to load component provider ComponenttRunJobPreferencePage.label=Don't show corresponding job after double click on a tRunJob Component. ComponentJobletPreferencePage.label=Don't show corresponding job after double click on a Joblet Component. +ComponentsPreferencePage_SuccessTitle=Success +ComponentsPreferencePage_SuccessMessage1=Need restart studio to load the new components. Else, will be loaded in next time when start. +ComponentsPreferencePage_SuccessMessage2=Do you want to restart right now? ComponenttRunJobPreferencePage.showCorrespondingJob=Show corresponding job after double click on a tRunJob Component. XsdValidationCacheManager.unableLoadxsd=unable to load xsd validation cache file XsdValidationCacheManager.unableSavexsd=unable to save xsd validation cache file diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/AbstractSQLPatternSynchronizer.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/AbstractSQLPatternSynchronizer.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/AbstractSQLPatternSynchronizer.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/AbstractSQLPatternSynchronizer.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit$CodeGeneratorManager.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGenInit.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenInit.class diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenerator.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenerator.class new file mode 100644 index 0000000..740d1c1 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGenerator.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGeneratorActivator.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGeneratorActivator.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGeneratorActivator.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGeneratorActivator.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGeneratorService.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGeneratorService.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/CodeGeneratorService.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/CodeGeneratorService.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/ComponentsLocalProviderService$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/ComponentsLocalProviderService$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/ComponentsLocalProviderService$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/ComponentsLocalProviderService$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/ComponentsLocalProviderService.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/ComponentsLocalProviderService.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/ComponentsLocalProviderService.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/ComponentsLocalProviderService.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/JavaRoutineSynchronizer.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/JavaRoutineSynchronizer.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/JavaRoutineSynchronizer.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/JavaRoutineSynchronizer.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/JavaSQLPatternSynchronizer.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/JavaSQLPatternSynchronizer.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/JavaSQLPatternSynchronizer.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/JavaSQLPatternSynchronizer.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/RefreshTemplatesAction.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/RefreshTemplatesAction.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/RefreshTemplatesAction.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/RefreshTemplatesAction.class diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider.class new file mode 100644 index 0000000..c4315d0 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/additionaljet/AbstractJetFileProvider.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/CustomizeJetFilesProviderManager.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/additionaljet/CustomizeJetFilesProviderManager.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/additionaljet/CustomizeJetFilesProviderManager.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/additionaljet/CustomizeJetFilesProviderManager.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentFileChecker.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentFileChecker.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentFileChecker.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentFileChecker.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory$1.class old mode 100755 new mode 100644 similarity index 92% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory$1.class index fde858d..0c2286f Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory$1.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory$1.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory$2.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory$2.class old mode 100755 new mode 100644 similarity index 93% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory$2.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory$2.class index ee10e69..db19f81 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsFactory$2.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory$2.class differ diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory.class new file mode 100644 index 0000000..ab97b3e Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsFactory.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsProviderManager.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsProviderManager.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsProviderManager.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsProviderManager.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsService.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsService.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/ComponentsService.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/ComponentsService.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/MalformedMainXMLComponentFileException.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/MalformedMainXMLComponentFileException.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/MalformedMainXMLComponentFileException.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/MalformedMainXMLComponentFileException.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/MissingComponentFileException.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/MissingComponentFileException.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/MissingComponentFileException.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/MissingComponentFileException.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/MissingMainXMLComponentFileException.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/MissingMainXMLComponentFileException.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/MissingMainXMLComponentFileException.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/MissingMainXMLComponentFileException.class diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/UserComponentsProvider.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/UserComponentsProvider.class new file mode 100644 index 0000000..306e7d7 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/UserComponentsProvider.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsTokenCollector.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/UserComponentsTokenCollector.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/model/UserComponentsTokenCollector.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/model/UserComponentsTokenCollector.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentPreferenceInitializer.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentPreferenceInitializer.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentPreferenceInitializer.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentPreferenceInitializer.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$1.class old mode 100755 new mode 100644 similarity index 94% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$1.class index c5c4b36..7709bc7 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$1.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$1.class differ diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2$1.class new file mode 100644 index 0000000..a87f963 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2$1.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2.class old mode 100755 new mode 100644 similarity index 68% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2.class index bcb364b..cb4b602 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$2.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$ConsoleIntegerFieldEditor.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$ConsoleIntegerFieldEditor.class old mode 100755 new mode 100644 similarity index 85% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$ConsoleIntegerFieldEditor.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$ConsoleIntegerFieldEditor.class index 0e9067e..514d7a3 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$ConsoleIntegerFieldEditor.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage$ConsoleIntegerFieldEditor.class differ diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage.class new file mode 100644 index 0000000..59ca310 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponentsPreferencePage.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponenttRunJobPreferencePage.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponenttRunJobPreferencePage.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/ComponenttRunJobPreferencePage.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/ComponenttRunJobPreferencePage.class diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/IComponentPreferenceConstant.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/IComponentPreferenceConstant.class new file mode 100644 index 0000000..9a48d0c Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/IComponentPreferenceConstant.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/LINK_STYLE.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/LINK_STYLE.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/components/ui/LINK_STYLE.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/components/ui/LINK_STYLE.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$BuildingValueParamAppender.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$BuildingValueParamAppender.class old mode 100755 new mode 100644 similarity index 87% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$BuildingValueParamAppender.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$BuildingValueParamAppender.class index 53720d2..1407d3a Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$BuildingValueParamAppender.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$BuildingValueParamAppender.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$ConditionParamAppender.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$ConditionParamAppender.class old mode 100755 new mode 100644 similarity index 75% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$ConditionParamAppender.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$ConditionParamAppender.class index d3f1eb5..4d3d178 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$ConditionParamAppender.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$ConditionParamAppender.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$NodeParamNotDefaultAppender.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$NodeParamNotDefaultAppender.class old mode 100755 new mode 100644 similarity index 83% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$NodeParamNotDefaultAppender.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$NodeParamNotDefaultAppender.class index d4e86cd..334f737 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$NodeParamNotDefaultAppender.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$NodeParamNotDefaultAppender.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$ParamAppender.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$ParamAppender.class old mode 100755 new mode 100644 similarity index 86% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$ParamAppender.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$ParamAppender.class index 18dfced..d0c4829 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$ParamAppender.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$ParamAppender.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$SBTool.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$SBTool.class old mode 100755 new mode 100644 similarity index 54% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$SBTool.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$SBTool.class index 28259a8..38b19f7 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder$SBTool.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder$SBTool.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder.class old mode 100755 new mode 100644 similarity index 53% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder.class index 614c2d6..4d78c20 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CamelEndpointBuilder.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CamelEndpointBuilder.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CloseBlocksCodeArgument.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CloseBlocksCodeArgument.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CloseBlocksCodeArgument.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CloseBlocksCodeArgument.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorArgument.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorArgument.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorArgument.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorArgument.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$2.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$2.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$2.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$2.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$3.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$3.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$3.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor$3.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/CodeGeneratorProgressMonitor.class diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/EInternalTemplate.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/EInternalTemplate.class new file mode 100644 index 0000000..76b6835 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/EInternalTemplate.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/JetBean.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/JetBean.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/JetBean.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/JetBean.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/LightJetBean.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/LightJetBean.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/LightJetBean.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/LightJetBean.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodeConnectionsHelper.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodeConnectionsHelper.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodeConnectionsHelper.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodeConnectionsHelper.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodeParamsHelper$PropEntry.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodeParamsHelper$PropEntry.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodeParamsHelper$PropEntry.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodeParamsHelper$PropEntry.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodeParamsHelper.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodeParamsHelper.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodeParamsHelper.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodeParamsHelper.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodesSubTree$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodesSubTree$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodesSubTree$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodesSubTree$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodesSubTree.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodesSubTree.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodesSubTree.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodesSubTree.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodesTree.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodesTree.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/NodesTree.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/NodesTree.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/SubTreeArgument.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/SubTreeArgument.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/SubTreeArgument.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/SubTreeArgument.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TalendJETCompiler.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TalendJETCompiler.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TalendJETCompiler.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TalendJETCompiler.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TalendJetEmitter$TalendEclipseHelper.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TalendJetEmitter$TalendEclipseHelper.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TalendJetEmitter$TalendEclipseHelper.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TalendJetEmitter$TalendEclipseHelper.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TalendJetEmitter.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TalendJetEmitter.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/config/TalendJetEmitter.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TalendJetEmitter.class diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TemplateUtil.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TemplateUtil.class new file mode 100644 index 0000000..cc77c05 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/config/TemplateUtil.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/exception/CodeGeneratorException.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/exception/CodeGeneratorException.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/exception/CodeGeneratorException.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/exception/CodeGeneratorException.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/i18n/Messages.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/i18n/Messages.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/i18n/Messages.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/i18n/Messages.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$1.class old mode 100755 new mode 100644 similarity index 91% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$1.class index 8215154..3afc18e Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$1.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$1.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$2.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$2.class old mode 100755 new mode 100644 similarity index 90% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$2.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$2.class index 0961230..db2bab1 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$2.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$2.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager$1.class old mode 100755 new mode 100644 similarity index 92% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager$1.class index e06a015..9838e66 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager$1.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager$1.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager.class old mode 100755 new mode 100644 similarity index 83% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager.class index 79ad5b2..79aa39b Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$CodeGeneratorManager.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateClassLoader.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateClassLoader.class old mode 100755 new mode 100644 similarity index 80% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateClassLoader.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateClassLoader.class index 8c3981d..6958457 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateClassLoader.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateClassLoader.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateProgressMonitor.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateProgressMonitor.class old mode 100755 new mode 100644 similarity index 72% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateProgressMonitor.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateProgressMonitor.class index cb9d735..6e605ab Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateProgressMonitor.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$DelegateProgressMonitor.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable$1.class old mode 100755 new mode 100644 similarity index 89% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable$1.class index aa7c5e5..2f6a463 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable$1.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable$1.class differ diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable.class new file mode 100644 index 0000000..c210cbb Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory$JobRunnable.class differ diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory.class new file mode 100644 index 0000000..eadc2c0 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorEmittersPoolFactory.class differ diff --git a/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory.class new file mode 100644 index 0000000..dfef440 Binary files /dev/null and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactory.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactoryProvider.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactoryProvider.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactoryProvider.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/CodeGeneratorInternalTemplatesFactoryProvider.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/EmfEmittersPersistence.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/EmfEmittersPersistence.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/EmfEmittersPersistence.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/EmfEmittersPersistence.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/EmfEmittersPersistenceFactory.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/EmfEmittersPersistenceFactory.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/EmfEmittersPersistenceFactory.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/EmfEmittersPersistenceFactory.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/JetSkeletonManager$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/JetSkeletonManager$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/JetSkeletonManager$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/JetSkeletonManager$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/JetSkeletonManager.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/JetSkeletonManager.class old mode 100755 new mode 100644 similarity index 80% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/JetSkeletonManager.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/JetSkeletonManager.class index 5ec2314..a1d7543 Binary files a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/model/JetSkeletonManager.class and b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/model/JetSkeletonManager.class differ diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/DocumentRoot.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/DocumentRoot.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/DocumentRoot.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/DocumentRoot.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/EmittersPoolFactory.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/EmittersPoolFactory.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/EmittersPoolFactory.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/EmittersPoolFactory.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/EmittersPoolPackage$Literals.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/EmittersPoolPackage$Literals.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/EmittersPoolPackage$Literals.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/EmittersPoolPackage$Literals.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/EmittersPoolPackage.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/EmittersPoolPackage.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/EmittersPoolPackage.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/EmittersPoolPackage.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/PoolType.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/PoolType.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/PoolType.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/PoolType.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/DocumentRootImpl.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/DocumentRootImpl.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/DocumentRootImpl.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/DocumentRootImpl.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/EmittersPoolFactoryImpl.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/EmittersPoolFactoryImpl.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/EmittersPoolFactoryImpl.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/EmittersPoolFactoryImpl.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/EmittersPoolPackageImpl.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/EmittersPoolPackageImpl.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/EmittersPoolPackageImpl.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/EmittersPoolPackageImpl.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/PoolTypeImpl.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/PoolTypeImpl.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/impl/PoolTypeImpl.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/impl/PoolTypeImpl.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory$1.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory$1.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory$1.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory$1.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolAdapterFactory.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolResourceFactoryImpl.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolResourceFactoryImpl.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolResourceFactoryImpl.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolResourceFactoryImpl.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolResourceImpl.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolResourceImpl.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolResourceImpl.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolResourceImpl.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolSwitch.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolSwitch.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolSwitch.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolSwitch.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolXMLProcessor.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolXMLProcessor.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/persistence/util/EmittersPoolXMLProcessor.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/persistence/util/EmittersPoolXMLProcessor.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/proxy/JetProxy.class b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/proxy/JetProxy.class old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/proxy/JetProxy.class rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/proxy/JetProxy.class diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/utils/emf/EmittersPool.ecore b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/utils/emf/EmittersPool.ecore old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/utils/emf/EmittersPool.ecore rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/utils/emf/EmittersPool.ecore diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/utils/emf/EmittersPool.genmodel b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/utils/emf/EmittersPool.genmodel old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/utils/emf/EmittersPool.genmodel rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/utils/emf/EmittersPool.genmodel diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/utils/emf/EmittersPool.xsd b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/utils/emf/EmittersPool.xsd old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/org/talend/designer/codegen/utils/emf/EmittersPool.xsd rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/org/talend/designer/codegen/utils/emf/EmittersPool.xsd diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/plugin.properties b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/plugin.properties old mode 100755 new mode 100644 similarity index 100% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/plugin.properties rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/plugin.properties diff --git a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/plugin.xml b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/plugin.xml old mode 100755 new mode 100644 similarity index 96% rename from lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/plugin.xml rename to lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/plugin.xml index 02c549c..c7a0b2e --- a/lib/6.2.0/org.talend.designer.codegen_6.2.0.20160510_1709/plugin.xml +++ b/lib/6.4.1/org.talend.designer.codegen_6.4.1.20170623_1246/plugin.xml @@ -2,7 +2,6 @@ -