Compare commits

..

11 Commits

Author SHA1 Message Date
cmeng-talend
74d8de2ee9 TDI-31531 fix bug: Bug with txmlmap used in a joblet
https://jira.talendforge.org/browse/TDI-31531

Checked with bugfixer, forgot to commit on this branch, commit it
2015-05-20 10:19:57 +08:00
xhkong
5ce4b4f7d0 TPS-909 [5.4.2] Sometime Routines don't saves (TDI-32401)
https://jira.talendforge.org/browse/TPS-909
2015-05-11 17:13:17 +08:00
xhkong
c3bf8b1d34 TPS-909 [5.4.2] Sometime Routines don't saves (TDI-32401)
https://jira.talendforge.org/browse/TPS-909
2015-05-06 18:36:22 +08:00
jzhao
4117f9c7cb Fixed Bug TDI TDI-29348: tAggregateRow(MR) don't support character type with min function
https://jira.talendforge.org/browse/TDI-29348 
Note:Revert code.

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117441 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 08:50:52 +00:00
jzhao
ab034bf7aa Fixed Bug TDI-29370: tVerticaOutput has two problems with Enable parallel execution
https://jira.talendforge.org/browse/TDI-29370 
Note:Revert code

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117440 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 08:49:42 +00:00
jzhao
9936c8345e Fixed Bug TDI-29362: Component Flow: SortRow? -> FlowMeter? -> FileOutput? causes compilation errors
https://jira.talendforge.org/browse/TDI-29362 
Note:Revert code

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117439 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 08:48:23 +00:00
jzhao
26e3603db5 Fixed TDI-29309: The compile errors of tAggregateRow, when check overflow or ULP is triggered, the function is sum/average, and the input is BigDecimal? type, output is float/double type respectively.
https://jira.talendforge.org/browse/TDI-29309 
Note:revert code

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117436 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 08:46:35 +00:00
jzhao
9c54df2e86 Fixed TDI-29309: The compile errors of tAggregateRow, when check overflow or ULP is triggered, the function is sum/average, and the input is BigDecimal type, output is float/double type respectively.
https://jira.talendforge.org/browse/TDI-29309
Note:Fixed branch 5.4

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117425 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 06:59:09 +00:00
jzhao
e508388dfa Fixed Bug TDI-29362: Component Flow: SortRow -> FlowMeter -> FileOutput causes compilation errors
https://jira.talendforge.org/browse/TDI-29362
Note:1.Fixed compile error for there are muilt flow line between tFileOutptuPositional/tSchemaComplianceCheck and data input component
2.Remove useless code.

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117422 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 06:55:14 +00:00
jzhao
b4d6c66b2c Fixed Bug TDI-29370: tVerticaOutput has two problems with Enable parallel execution
https://jira.talendforge.org/browse/TDI-29370 
Note:Fixed branch 5.4

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117419 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 06:15:15 +00:00
jzhao
090875ac09 Fixed Bug TDI TDI-29348: tAggregateRow(MR) don't support character type with min function
https://jira.talendforge.org/browse/TDI-29348 
Note:1.Fixed MR component compile error for Character type min/max function 
2.Fixed DI and MR tAggrgateRow Character type min/max return wrong result. 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_4@117412 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2014-05-14 05:43:27 +00:00
606 changed files with 8172 additions and 8215 deletions

6
.gitignore vendored
View File

@@ -1,6 +0,0 @@
/*/target
/*/bin
/*/class
/*/classes
/*/.settings
/**/dev_con

View File

@@ -63,7 +63,6 @@ import org.talend.designer.business.model.business.diagram.edit.parts.BusinessPr
import org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider;
import org.talend.designer.core.ui.ActiveProcessTracker;
import org.talend.designer.core.ui.views.jobsettings.JobSettingsView;
import org.talend.repository.RepositoryWorkUnit;
import org.talend.repository.editor.RepositoryEditorInput;
import org.talend.repository.model.ERepositoryStatus;
import org.talend.repository.model.IProxyRepositoryFactory;
@@ -176,7 +175,7 @@ public class BusinessDiagramEditor extends FileDiagramEditor implements IGotoMar
@Override
public void doSave(IProgressMonitor progressMonitor) {
if (repositoryEditorInput != null) {
final BusinessProcessItem businessProcessItem = (BusinessProcessItem) repositoryEditorInput.getItem();
BusinessProcessItem businessProcessItem = (BusinessProcessItem) repositoryEditorInput.getItem();
IRepositoryService service = CorePlugin.getDefault().getRepositoryService();
IProxyRepositoryFactory repFactory = service.getProxyRepositoryFactory();
try {
@@ -199,17 +198,14 @@ public class BusinessDiagramEditor extends FileDiagramEditor implements IGotoMar
super.doSave(progressMonitor);
DiagramResourceManager diagramResourceManager = new DiagramResourceManager();
diagramResourceManager.updateFromResource(businessProcessItem, repositoryEditorInput.getFile());
final IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
RepositoryWorkUnit rwu = new RepositoryWorkUnit("save Business") {
@Override
protected void run() throws LoginException, PersistenceException {
ProxyRepositoryFactory.getInstance().save(businessProcessItem);
}
};
rwu.setAvoidUnloadResources(true);
rwu.setAvoidSvnUpdate(true);
factory.executeRepositoryWorkUnit(rwu);
// remove the function of sve SVG file because the imported business model can't save SVG file.
// saveSVG(businessProcessItem);
try {
ProxyRepositoryFactory.getInstance().save(businessProcessItem);
} catch (PersistenceException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
propertyIsDirty = false;
firePropertyChange(IEditorPart.PROP_DIRTY);

View File

@@ -266,6 +266,7 @@
//Username and password, http://jira.talendforge.org/browse/TESB-4073
String username = ElementParameterParser.getValue(node, "__WMQ_USERNAME__");
String password = ElementParameterParser.getValue(node, "__WMQ_PASSWORD__");
String useAuth = ElementParameterParser.getValue(node, "__WMQ_AUTH__");
if(wmqPort.startsWith("\"")){
@@ -303,12 +304,7 @@
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter connectionFactoryAdapter<%=node.getUniqueName()%>
= new org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter();
connectionFactoryAdapter<%=node.getUniqueName()%>.setUsername(<%=username%>);
<%
String cid = node.getUniqueName();
String passwordFieldName = "__WMQ_PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
connectionFactoryAdapter<%=node.getUniqueName()%>.setPassword(decryptedPassword_<%=cid%>);
connectionFactoryAdapter<%=node.getUniqueName()%>.setPassword(<%=password%>);
connectionFactoryAdapter<%=node.getUniqueName()%>.setTargetConnectionFactory(jmsConnectionFactory);
camelContext.addComponent(<%=name%>,

View File

@@ -910,6 +910,7 @@ if (isProvider) {
String securityType = ElementParameterParser.getValue(node, "__SECURITY_TYPE__");
String username = ElementParameterParser.getValue(node, "__USERNAME__");
String password = ElementParameterParser.getValue(node, "__PASSWORD__");
String roleName = "\"\"";
String alias = ElementParameterParser.getValue(node, "__ALIASNAME__").trim();
boolean isProvider = node.getIncomingConnections().size()>0?false:true;
@@ -956,21 +957,13 @@ if (isProvider) {
roleName = "\"\"";
}
}
if((useSecurity || useRegistry) && !isProvider) {
String passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
<%
}
%>
// CXF endpoint for <%=cid%>
org.apache.camel.component.cxf.CxfEndpoint <%=endpointVar%> = getCxfEndpoint(<%=uriRef%>, <%=isProvider%>, <%=isUseAuthorization%>, <%=isUsePropagateSamlAP%>, <%=securityToken%>
<%
if((useSecurity || useRegistry) && !isProvider){
%>
,<%=username%>,decryptedPassword_<%=cid%>, <%=roleName%>, <%=alias%>
,<%=username%>,<%=password%>, <%=roleName%>, <%=alias%>
<%
}
%>
@@ -1064,10 +1057,8 @@ if (isProvider) {
if("".trim().equals(directory)){
directory = null;
}
String passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
org.apache.camel.component.file.remote.RemoteFileEndpoint<?> <%=ftpEndpointVar%> = getFtpEndpoint(<%=uriRef%>, <%=ftpServer%>, <%=userName%>, decryptedPassword_<%=cid%>, <%=directory%>);
org.apache.camel.component.file.remote.RemoteFileEndpoint<?> <%=ftpEndpointVar%> = getFtpEndpoint(<%=uriRef%>, <%=ftpServer%>, <%=userName%>, <%=password%>, <%=directory%>);
<%
}else if("cMail".equals(nodeComponentName)){
@@ -1080,15 +1071,15 @@ if (isProvider) {
String uriRef = "uriMap.get(\"" + cid + "\")";
String userName = ElementParameterParser.getValue(node, "__USERNAME__");
String password = ElementParameterParser.getValue(node, "__PASSWORD__");
String subject = ElementParameterParser.getValue(node, "__SUBJECT__");
String from = ElementParameterParser.getValue(node, "__FROM__");
String to = ElementParameterParser.getValue(node, "__TO__");
String cc = ElementParameterParser.getValue(node, "__CC__");
String bcc = ElementParameterParser.getValue(node, "__BCC__");
String passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
org.apache.camel.component.mail.MailEndpoint <%=mailEndpointVar%> = getMailEndpoint(<%=uriRef%>, <%=userName%>, decryptedPassword_<%=cid%>, <%=subject%>, <%=from%>, <%=to%>, <%=cc%>, <%=bcc%>);
org.apache.camel.component.mail.MailEndpoint <%=mailEndpointVar%> = getMailEndpoint(<%=uriRef%>, <%=userName%>, <%=password%>, <%=subject%>, <%=from%>, <%=to%>, <%=cc%>, <%=bcc%>);
<% }else if("cAggregate".equals(nodeComponentName)){
boolean usePersistence = "true".equals(ElementParameterParser.getValue(node, "__USE_PERSISTENCE__"));
String repository = ElementParameterParser.getValue(node, "__REPOSITORY__");

View File

@@ -21,7 +21,6 @@
<%
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
boolean containsTPartitioner = node.getProcess().getNodesOfType("tPartitioner").size() > 0 ? true : false;
String startNodeCid=node.getDesignSubjobStartNode().getUniqueName();
ECodePart codePart = codeGenArgument.getCodePart();
boolean trace = codeGenArgument.isTrace();
@@ -49,15 +48,25 @@
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;
<%
if(!hasParallelIterate){
hasParallelIterate = true;
%>
final Object[] lockWrite = new Object[0];
int threadIdCounter =0;
<%
}
%>
<%
}
String iterateNodeName = iterateConn.getTarget().getUniqueName();
%>
int NB_ITERATE_<%=iterateNodeName %> = 0; //for statistics
<%
@@ -141,14 +150,10 @@
%>
if (execStat) {
if(resourceMap.get("inIterateVComp") == null){
<%if(containsTPartitioner){%>
java.util.concurrent.ConcurrentHashMap<Object, Object> 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);
<%}%>
java.util.concurrent.ConcurrentHashMap<Object, Object> 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);
}
}
@@ -199,14 +204,10 @@
<%
for(String connName : needToStartConnNames){
%>
<%if(containsTPartitioner){%>
java.util.concurrent.ConcurrentHashMap<Object, Object> 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);
<%}%>
java.util.concurrent.ConcurrentHashMap<Object, Object> 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);
<%
}
%>

View File

@@ -26,7 +26,7 @@
Vector v = (Vector) codeGenArgument.getArgument();
IProcess process = (IProcess)v.get(0);
List<INode> rootNodes = (List<INode>)v.get(1);
boolean containsTPartitioner = process.getNodesOfType("tPartitioner").size() > 0 ? true : false;
boolean stats = codeGenArgument.isStatistics();
boolean trace = codeGenArgument.isTrace();
boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread();
@@ -388,10 +388,9 @@ if(execStat) {
%>
<%= ElementParameterParser.getValue(process, "__HEADER_CODE__")%>
<%//if(containsTPartitioner){//as tMatchGroupIn and tFuzzyUniqRow use this concurrentHashMap, so generate always%>
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap = new java.util.concurrent.ConcurrentHashMap<Object, Object>();
globalMap.put("concurrentHashMap", concurrentHashMap);
<%//}%>
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap = new java.util.concurrent.ConcurrentHashMap<Object, Object>();
globalMap.put("concurrentHashMap", concurrentHashMap);
long startUsedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
long endUsedMemory = 0;

View File

@@ -111,7 +111,7 @@
}
}
<%=node.getUniqueName() %>Thread bt_<%=node.getUniqueName() %> = new <%=node.getUniqueName() %>Thread(globalMap<%=schemaInstanceDeclaration %>,threadIdCounter_<%=node.getUniqueName()%>++);
<%=node.getUniqueName() %>Thread bt_<%=node.getUniqueName() %> = new <%=node.getUniqueName() %>Thread(globalMap<%=schemaInstanceDeclaration %>,threadIdCounter++);
mtp_<%=node.getUniqueName() %>.execute(bt_<%=node.getUniqueName() %>);
<%
@@ -134,4 +134,4 @@
}//3
}//2
}//1
%>
%>

View File

@@ -25,7 +25,6 @@
<%
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();
@@ -53,9 +52,7 @@ boolean parallelIterate = false;
for (IConnection iterateConn : iterateConnSet) { //1
%>
NB_ITERATE_<%=iterateNodeName %>++;
<%if(containsTPartitioner){%>
iterateLoop++;
<%}%>
iterateLoop++;
<%
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
if (parallelIterate) {//2
@@ -67,6 +64,7 @@ for (IConnection iterateConn : iterateConnSet) { //1
rowList = rowList.substring(0, rowList.length()-1);
%>
class <%=node.getUniqueName() %>Thread extends TalendThread {//implements routines.system.TalendThreadPool.PropertySettable
class ThreadedMap extends java.util.HashMap<String, Object> {
private static final long serialVersionUID = 0L;
@@ -93,9 +91,7 @@ for (IConnection iterateConn : iterateConnSet) { //1
private java.util.Map<String, Object> globalMap = null;
boolean isRunning = false;
String iterateId = "";
<%if(containsTPartitioner){%>
int iterateLoop = 0;
<%}%>
int iterateLoop = 0;
<%
if(!subTree.isMergeSubTree()) {
List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections();
@@ -163,9 +159,7 @@ for (IConnection iterateConn : iterateConnSet) { //1
<%}%>
}
iterateId = "." + threadID;
<%if(containsTPartitioner){%>
iterateLoop++;
<%}%>
iterateLoop++;
<%if(isRunJob) {%>
//bug21906 copy context to local for mutilthread
context.synchronizeContext();

View File

@@ -29,7 +29,6 @@
NodesSubTree subTree = (NodesSubTree) codeGenArgument.getArgument();
boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread();
boolean stat = codeGenArgument.isStatistics();
boolean containsTPartitioner = subTree.getRootNode().getProcess().getNodesOfType("tPartitioner").size() > 0 ? true : false;
%>
<%
@@ -1033,9 +1032,7 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
}
boolean isRunning = false;
String iterateId = "";
<%if(containsTPartitioner){%>
int iterateLoop = 0;
<%}%>
int iterateLoop = 0;
public void run() {
java.util.Map threadRunResultMap = new java.util.HashMap();
@@ -1067,9 +1064,7 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
<%
}
%>
<%if(containsTPartitioner){%>
int iterateLoop = 0;
<%}%>
int iterateLoop = 0;
String currentComponent = "";
java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();

View File

@@ -868,6 +868,7 @@ public class CodeGenerator implements ICodeGenerator {
CodeGeneratorArgument argument = new CodeGeneratorArgument();
argument.setNode(node);
argument.setAllMainSubTreeConnections(subProcess.getAllMainSubTreeConnections());
argument.setSubTreeContainsParallelIterate(subProcess.subTreeContainsParallelIterate());
argument.setCodePart(part);
argument.setStatistics(statistics);
argument.setTrace(trace);

View File

@@ -70,7 +70,6 @@ import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IComponentsFactory;
import org.talend.core.model.components.IComponentsHandler;
import org.talend.core.model.general.Project;
import org.talend.core.ui.IJobletProviderService;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.core.ui.images.CoreImageProvider;
import org.talend.core.utils.TalendCacheUtils;
@@ -801,18 +800,14 @@ public class ComponentsFactory implements IComponentsFactory {
componentList = null;
skeletonList = null;
customComponentList = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IJobletProviderService.class)) {
IJobletProviderService jobletService = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
IJobletProviderService.class);
if (jobletService != null) {
jobletService.clearJobletComponent();
}
}
}
@Override
public void resetCache() {
reset();
componentList = null;
skeletonList = null;
customComponentList = null;
if (!CommonsPlugin.isHeadless()) {
CoreImageProvider.clearComponentIconImages();
}

View File

@@ -60,7 +60,6 @@ public class CodeGeneratorArgument {
private int pauseTime;
@Deprecated
private boolean subTreeContainsParallelIterate;
/**
@@ -278,15 +277,10 @@ public class CodeGeneratorArgument {
this.subTree = subTree;
}
@Deprecated
/*
* use org.talend.core.model.process.AbstractNode.getParallelIterator()
*/
public boolean subTreeContainsParallelIterate() {
return subTreeContainsParallelIterate;
}
@Deprecated
public void setSubTreeContainsParallelIterate(boolean subTreeContainsParallelIterate) {
this.subTreeContainsParallelIterate = subTreeContainsParallelIterate;
}

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.talend.core.model.process.AbstractNode;
import org.talend.core.model.process.EConnectionType;
import org.talend.core.model.process.ElementParameterParser;
import org.talend.core.model.process.IConnection;
import org.talend.core.model.process.IConnectionCategory;
import org.talend.core.model.process.INode;
@@ -60,7 +61,6 @@ public class NodesSubTree {
List<IConnection> allMainSubTreeConnections = null;
@Deprecated
boolean subTreeContainsParallelIterate = false;
List<INode> mergeBranchStarts;
@@ -136,22 +136,22 @@ public class NodesSubTree {
buildMRSubTree(node);
// if (refNodes != null) {
// for (INode refNode : refNodes) {
// this.nodes.add(refNode);
// for (IConnection connection : refNode.getOutgoingSortedConnections()) {
// if (connection.getTarget().isActivate()) {
//
// if (connection.getLineStyle().equals(EConnectionType.RUN_AFTER)) {
// afterSubProcesses.add(connection.getTarget().getUniqueName());
// }
// if (connection.getLineStyle().equals(EConnectionType.ON_SUBJOB_OK)) {
// beforeSubProcesses.add(connection.getTarget().getUniqueName());
// }
// }
// }
// }
// }
if (refNodes != null) {
for (INode refNode : refNodes) {
this.nodes.add(refNode);
for (IConnection connection : refNode.getOutgoingSortedConnections()) {
if (connection.getTarget().isActivate()) {
if (connection.getLineStyle().equals(EConnectionType.RUN_AFTER)) {
afterSubProcesses.add(connection.getTarget().getUniqueName());
}
if (connection.getLineStyle().equals(EConnectionType.ON_SUBJOB_OK)) {
beforeSubProcesses.add(connection.getTarget().getUniqueName());
}
}
}
}
}
}
}
@@ -204,11 +204,6 @@ public class NodesSubTree {
if (((AbstractNode) node).isThereLinkWithRef()) {
this.isRefSubTree = true;
this.refNodes = ((AbstractNode) node).getRefNodes();
if (refNodes != null) {
for (INode refNode : refNodes) {
buildMRSubTree(refNode);
}
}
}
for (IConnection connection : node.getOutgoingSortedConnections()) {
if (connection.getTarget().isActivate()) {
@@ -251,7 +246,11 @@ public class NodesSubTree {
if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN)) {
if (!connection.getLineStyle().hasConnectionCategory(IConnectionCategory.USE_ITERATE)) {
allMainSubTreeConnections.add(connection);
}
} else {
if (Boolean.TRUE.toString().equals(ElementParameterParser.getValue(connection, "__ENABLE_PARALLEL__"))) { //$NON-NLS-1$
subTreeContainsParallelIterate = true;
}
}
if (DEBUG) {
System.out.print(" -> "); //$NON-NLS-1$
}
@@ -501,10 +500,6 @@ public class NodesSubTree {
this.allMainSubTreeConnections = allMainSubTreeConnections;
}
@Deprecated
/*
* use org.talend.core.model.process.AbstractNode.getParallelIterator()
*/
public boolean subTreeContainsParallelIterate() {
return subTreeContainsParallelIterate;
}

View File

@@ -16,7 +16,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.talend.core.model.process.AbstractNode;
import org.talend.core.model.process.EConnectionType;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.temp.ETypeGen;
@@ -101,8 +101,13 @@ public class NodesTree {
private void buildMRSubTrees() {
subTrees = new ArrayList<NodesSubTree>();
for (INode node : nodes) {
if (((node.isSubProcessStart()) && (node.isActivate()) && !((AbstractNode) node).isRefNode())
|| (rootNodes.contains(node))) {
if (((node.isSubProcessStart()) && (node.isActivate())) || (rootNodes.contains(node))) {
if (node.getOutgoingConnections(EConnectionType.FLOW_REF) != null
&& node.getOutgoingConnections(EConnectionType.FLOW_REF).size() == 1) {
// ignore the node when it output connection is flow_ref, because it has been added in
// AbstractNode.setRefNodes
continue;
}
subTrees.add(new NodesSubTree(node, nodes, ETypeGen.MR));
}
}

View File

@@ -10306,23 +10306,7 @@ public class SforceServiceStub extends org.apache.axis2.client.Stub implements
"urn:partner.soap.sforce.com:Soap:describeGlobalRequest");
_operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(
true);
{
/*- ADD - START - BY cmeng - 20140901*/
/**
* https://jira.talendforge.org/browse/TDI-30366<br>
* 1. Because this API seems not support this case: server use HTTP Protocol 1.0(not support CHUNKED) while client use HTTP Protocol 1.1<br>
* , then client will throw exception(org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required)<br>
* 2. If the new API can support this case, then this additional codes can be cancelled.
*
* Some information I searched on the net:<br>
* https://www.mail-archive.com/basedb-devel@lists.sourceforge.net/msg00309.html
* http://axis.apache.org/axis2/java/core/docs/http-transport.html
* http://en.wikipedia.org/wiki/Chunked_transfer_encoding
*/
_operationClient.getOptions().setProperty(
org.apache.axis2.transport.http.HTTPConstants.CHUNKED, "false");
/*- ADD - END - BY cmeng* - 20140901*/
}
addPropertyToOperationClient(
_operationClient,
org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
@@ -12832,23 +12816,7 @@ public class SforceServiceStub extends org.apache.axis2.client.Stub implements
"urn:partner.soap.sforce.com:Soap:describeSObjectRequest");
_operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(
true);
{
/*- ADD - START - BY cmeng - 20140901*/
/**
* https://jira.talendforge.org/browse/TDI-30366<br>
* 1. Because this API seems not support this case: server use HTTP Protocol 1.0(not support CHUNKED) while client use HTTP Protocol 1.1<br>
* , then client will throw exception(org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required)<br>
* 2. If the new API can support this case, then this additional codes can be cancelled.
*
* Some information I searched on the net:<br>
* https://www.mail-archive.com/basedb-devel@lists.sourceforge.net/msg00309.html
* http://axis.apache.org/axis2/java/core/docs/http-transport.html
* http://en.wikipedia.org/wiki/Chunked_transfer_encoding
*/
_operationClient.getOptions().setProperty(
org.apache.axis2.transport.http.HTTPConstants.CHUNKED, "false");
/*- ADD - END - BY cmeng - 20140901*/
}
addPropertyToOperationClient(
_operationClient,
org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,

View File

@@ -1,15 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend</groupId>
<artifactId>talend-azure-storage-utils</artifactId>
<version>1.0.0</version>
<name>talend-azure-storage-utils</name>
<dependencies>
<dependency>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.6</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,99 +0,0 @@
package org.talend.azurestorage.utils;
import java.io.File;
import java.util.HashMap;
public class AzureStorageUtils {
public java.util.Map<String, String> genAzureObjectList(File file,
String keyParent) {
java.util.Map<String, String> map = new java.util.HashMap<String, String>();
if (file.isDirectory()) {
if (keyParent != null && !"".equals(keyParent)) {
if (keyParent.trim().lastIndexOf("/") != keyParent.trim()
.length() - 1) {
keyParent = keyParent + "/";
}
}
File[] files = file.listFiles();
for (File f : files) {
if (f.isDirectory()) {
map.putAll(genAzureObjectList(f, keyParent + f.getName() + "/"));
} else {
map.put(f.getAbsolutePath(), keyParent + f.getName());
}
}
} else {
map.put(file.getAbsolutePath(), keyParent);
}
return map;
}
public java.util.Map<String, String> genFileFilterList(
java.util.List<java.util.Map<String, String>> list,
String localdir, String remotedir) {
if (remotedir != null && !"".equals(remotedir)) {
if (remotedir.trim().lastIndexOf("/") != remotedir.trim().length() - 1) {
remotedir = remotedir + "/";
}
}
java.util.Map<String, String> fileMap = new HashMap<String, String>();
for (java.util.Map<String, String> map : list) {
java.util.Set<String> keySet = map.keySet();
for (String key : keySet) {
String tempdir = localdir;
String filemask = key;
String dir = null;
String mask = filemask.replaceAll("\\\\", "/");
int i = mask.lastIndexOf('/');
if (i != -1) {
dir = mask.substring(0, i);
mask = mask.substring(i + 1);
}
if (dir != null && !"".equals(dir))
tempdir = tempdir + "/" + dir;
mask = mask.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*");
final String finalMask = mask;
java.io.File[] listings = null;
java.io.File file = new java.io.File(tempdir);
if (file.isDirectory()) {
listings = file.listFiles(new java.io.FileFilter() {
public boolean accept(java.io.File pathname) {
boolean result = false;
if (pathname != null && pathname.isFile()) {
result = java.util.regex.Pattern
.compile(finalMask)
.matcher(pathname.getName()).find();
}
return result;
}
});
}
if (listings == null || listings.length <= 0) {
System.err.println("No match file(" + key + ") exist!");
} else {
String localFilePath = "";
String newObjectKey = "";
for (int m = 0; m < listings.length; m++) {
if (listings[m].getName().matches(mask)) {
localFilePath = listings[m].getAbsolutePath();
if (map.get(key) != null
&& map.get(key).length() > 0) {
newObjectKey = remotedir + map.get(key);
} else {
newObjectKey = remotedir
+ listings[m].getName();
}
fileMap.put(localFilePath, newObjectKey);
}
}
}
}
}
return fileMap;
}
}

View File

@@ -35,7 +35,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
</PARAMETERS>

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
<PARAMETER

View File

@@ -45,7 +45,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -48,7 +48,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="20"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -73,7 +73,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="3"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true">

View File

@@ -764,9 +764,39 @@ skeleton="../templates/db_output_bulk.skeleton"
%>
updateFlag_<%=cid%>=pstmtUpdate_<%=cid %>.executeUpdate();
updatedCount_<%=cid%> = updatedCount_<%=cid%>+updateFlag_<%=cid%>;
} catch(java.sql.SQLException e) {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
%>
throw(e);
<%
} else {
if(rejectConnName != null && rejectColumnList != null && rejectColumnList.size() > 0) {
%>
<%=rejectConnName %> = new <%=rejectConnName %>Struct();
<%
for(IMetadataColumn column : columnList) {
%>
<%=rejectConnName%>.<%=column.getLabel()%> = <%=incomingConnName%>.<%=column.getLabel()%>;
<%
}
%>
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
<%
} else {
%>
System.err.println(e.getMessage() + " SQLSTATE=[" + e.getSQLState() + "] " + "CODE[" + e.getErrorCode() + "]");
<%
}
}
%>
}
if(updateFlag_<%=cid%> == 0) {
try {
<%
if(isEnableDebug) {
%>
@@ -789,15 +819,10 @@ skeleton="../templates/db_output_bulk.skeleton"
}
}
if(isDynamic) {
Column dynamicColumn = getColumn(talendDynCol);
Column dynamicColumn = getColumn(getDynamicColumn());
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
if("Dynamic".equals(typeToGenerate)) {
if(isEnableDebug) {
%>
routines.system.DynamicUtils.debugDynamicSql(query_<%=cid%>,<%=incomingConnName%>.<%=dynamicColumn.getName()%>, <%=counter%>,insertSQLSplits_<%=cid%>);
<%
}
%>
%>
DynamicUtils.writeColumnsToDatabse(<%=incomingConnName%>.<%=dynamicColumn.getName()%>, pstmtInsert_<%=cid%>, <%=counter-1%>, "<%=dbmsId%>");
<%
}
@@ -809,7 +834,6 @@ skeleton="../templates/db_output_bulk.skeleton"
}
%>
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
}
} catch(java.sql.SQLException e) {
whetherReject_<%=cid%> = true;
<%
@@ -840,6 +864,7 @@ skeleton="../templates/db_output_bulk.skeleton"
}
%>
}
}
nb_line_<%=cid%>++;
<%
} else if (("DELETE").equals(dataAction)) {

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
<PARAMETER

View File

@@ -48,7 +48,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -51,7 +51,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAccessConnection"
FILTER="tAccessConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -35,7 +35,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAccessConnection"
FILTER="tAccessConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
</PARAMETERS>

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAccessConnection"
FILTER="tAccessConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
<PARAMETER

View File

@@ -33,7 +33,7 @@
NUM_ROW="2">
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" REQUIRED="true" FILTER="tAccessConnection"
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" FILTER="tAccessConnection"
NUM_ROW="2" SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"/>
<PARAMETER NAME="DB_VERSION" FIELD="CLOSED_LIST" NUM_ROW="10"

View File

@@ -35,7 +35,7 @@
NUM_ROW="2">
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" REQUIRED="true" FILTER="tAccessConnection"
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" FILTER="tAccessConnection"
NUM_ROW="2" SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"/>
<PARAMETER NAME="DB_VERSION" FIELD="CLOSED_LIST" NUM_ROW="10"

View File

@@ -51,7 +51,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAccessConnection"
FILTER="tAccessConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAccessConnection"
FILTER="tAccessConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>

View File

@@ -33,7 +33,7 @@
NUM_ROW="2">
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" REQUIRED="true" FILTER="tAccessConnection"
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" FILTER="tAccessConnection"
NUM_ROW="2" SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"/>
<PARAMETER NAME="DB_VERSION" FIELD="CLOSED_LIST" NUM_ROW="10"

View File

@@ -644,7 +644,7 @@ if(sizeOps>0){ // T_OutBegin_AggR_114
&& !function.equals(MAX)
&& !function.equals(FIRST)
&& !function.equals(LAST)
) {
|| outputJavaType == JavaTypesManager.CHARACTER) {
%> = (<%=JavaTypesManager.getTypeToGenerate(outputColumn.getTalendType(), false) %>) <%= JavaTypesManager.getDefaultValueFromJavaIdType(outputColumn.getTalendType(), false) %><%

View File

@@ -445,15 +445,15 @@ if(inputConn != null) { // T_OutMain_AggR_501
if(checkTypeOverflow || checkUlp) {
if(forceUseDoubleAvgSum) {
%>utilClass_<%=cid %>.checkedIADD( operation_result_<%=cid %>.<%=outputColumnName %>_<%= SUM%>, <%=inputConn.getName() %>.<%=inputColumnName %>.doubleValue(), <%= checkTypeOverflow %>, <%= checkUlp %>);
%>utilClass_<%=cid %>.checkedIADD( operation_result_<%=cid %>.<%=outputColumnName %>_<%=function %>, (double)<%=inputConn.getName() %>.<%=inputColumnName %>, <%= checkTypeOverflow %>.doubleValue(), <%= checkUlp %>);
<%
} else {
%>utilClass_<%=cid %>.checkedIADD( (<%= primitiveTypeToGenerate%>) operation_result_<%=cid %>.<%=outputColumnName %>_<%= SUM%>, <%=inputConn.getName() %>.<%=inputColumnName %>.<%=primitiveTypeToGenerate%>Value(), <%= checkTypeOverflow %>, <%= checkUlp %>);
%>utilClass_<%=cid %>.checkedIADD( (<%= primitiveTypeToGenerate%>) operation_result_<%=cid %>.<%=outputColumnName %>_<%=function %>, (<%= primitiveTypeToGenerate%>) <%=inputConn.getName() %>.<%=inputColumnName %>, <%= checkTypeOverflow %>.doubleValue(), <%= checkUlp %>);
<%
}
}
%>
operation_result_<%=cid %>.<%=outputColumnName %>_<%= SUM %> += <%=inputConn.getName() %>.<%=inputColumnName %>.<%=forceUseDoubleAvgSum?"double":primitiveTypeToGenerate%>Value();
operation_result_<%=cid %>.<%=outputColumnName %>_<%= SUM %> += <%=inputConn.getName() %>.<%=inputColumnName %>.doubleValue();
<%
} else {

View File

@@ -29,6 +29,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
// getting useful parameters
String alfrescoServerUrl = ElementParameterParser.getValue(node, "__ALFRESCO_SERVER_URL__");
String alfrescoUserLogin = ElementParameterParser.getValue(node, "__ALFRESCO_USER_LOGIN__");
String alfrescoUserPassword = ElementParameterParser.getValue(node, "__ALFRESCO_USER_PASSWORD__");
String restEncodingString = ElementParameterParser.getValue(node, "__REST_ENCODING__");
@@ -90,11 +91,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
alfrescoRestClient_<%=cid%> = new fr.openwide.talendalfresco.rest.client.AlfrescoRestClient(<%=alfrescoServerUrl%>, <%=restEncodingString%>);
alfrescoRestClient_<%=cid%>.setTimeout(5000);
// default server : localhost
<%
String passwordFieldName = "__ALFRESCO_USER_PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
alfrescoRestClient_<%=cid%>.login(<%=alfrescoUserLogin%>, decryptedPassword_<%=cid%>);
alfrescoRestClient_<%=cid%>.login(<%=alfrescoUserLogin%>, <%=alfrescoUserPassword%>);
} catch (fr.openwide.talendalfresco.rest.client.RestClientException e) {
throw new fr.openwide.talendalfresco.rest.client.RestClientException("Error initing client", e);
}

View File

@@ -35,7 +35,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonMysqlConnection"
FILTER="tAmazonMysqlConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonMysqlConnection"
FILTER="tAmazonMysqlConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -66,7 +66,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonMysqlConnection"
FILTER="tAmazonMysqlConnection"
NUM_ROW="20"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"

View File

@@ -71,7 +71,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonMysqlConnection"
FILTER="tAmazonMysqlConnection"
NUM_ROW="20"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -1332,6 +1332,35 @@ if(columnList != null && columnList.size() > 0) {
updateFlag_<%=cid%>=pstmtUpdate_<%=cid %>.executeUpdate();
updatedCount_<%=cid%> = updatedCount_<%=cid%>+updateFlag_<%=cid%>;
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
%>
throw(e);
<%
} else {
if(rejectConnName != null && rejectColumnList != null && rejectColumnList.size() > 0) {%>
<%=rejectConnName %> = new <%=rejectConnName %>Struct();
<%
for(IMetadataColumn column : columnList) {
%>
<%=rejectConnName%>.<%=column.getLabel()%> = <%=incomingConnName%>.<%=column.getLabel()%>;
<%
}
%>
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
<%
} else {
%>
System.err.print(e.getMessage());
<%
}
}
%>
}
if(updateFlag_<%=cid%> == 0) {
<%
@@ -1376,8 +1405,8 @@ if(columnList != null && columnList.size() > 0) {
<%
}
%>
try {
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
}
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
@@ -1407,6 +1436,7 @@ if(columnList != null && columnList.size() > 0) {
}
%>
}
}
nb_line_<%=cid%>++;
<%

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonMysqlConnection"
FILTER="tAmazonMysqlConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -67,7 +67,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonMysqlConnection"
FILTER="tAmazonMysqlConnection"
NUM_ROW="20"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"

View File

@@ -35,7 +35,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonOracleConnection"
FILTER="tAmazonOracleConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonOracleConnection"
FILTER="tAmazonOracleConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -28,7 +28,7 @@
NUM_ROW="2">
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" REQUIRED="true" FILTER="tAmazonOracleConnection"
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST" FILTER="tAmazonOracleConnection"
NUM_ROW="2" SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"/>
<PARAMETER NAME="CONNECTION_TYPE" FIELD="CLOSED_LIST"

View File

@@ -60,7 +60,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonOracleConnection"
FILTER="tAmazonOracleConnection"
NUM_ROW="20"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"

View File

@@ -990,6 +990,36 @@ IMetadataColumn talendDynCol = null;
try {
updateFlag_<%=cid%> = pstmtUpdate_<%=cid %>.executeUpdate();
updatedCount_<%=cid%> = updatedCount_<%=cid%>+updateFlag_<%=cid%>;
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
%>
throw(e);
<%
} else {
if(rejectConnName != null && rejectColumnList != null && rejectColumnList.size() > 0) {
%>
<%=rejectConnName %> = new <%=rejectConnName %>Struct();
<%
for(IMetadataColumn column : columnList) {
%>
<%=rejectConnName%>.<%=column.getLabel()%> = <%=incomingConnName%>.<%=column.getLabel()%>;
<%
}
%>
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
<%
} else {
%>
System.err.print(e.getMessage());
<%
}
}
%>
}
if(updateFlag_<%=cid%> == 0) {
<%
@@ -1018,14 +1048,9 @@ IMetadataColumn talendDynCol = null;
}
}
if(isDynamic) {
Column dynamicColumn = getColumn(talendDynCol);
Column dynamicColumn = getColumn(getDynamicColumn());
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
if("Dynamic".equals(typeToGenerate)) {
if(isEnableDebug) {
%>
routines.system.DynamicUtils.debugDynamicSql(query_<%=cid%>,<%=incomingConnName%>.<%=dynamicColumn.getName()%>, <%=counter%>,insertSQLSplits_<%=cid%>);
<%
}
%>
DynamicUtils.writeColumnsToDatabse(<%=incomingConnName%>.<%=dynamicColumn.getName()%>, pstmtInsert_<%=cid%>, <%=counter-1%>, "<%=dbmsId%>");
<%
@@ -1037,8 +1062,9 @@ IMetadataColumn talendDynCol = null;
<%
}
%>
try {
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
}
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
@@ -1069,6 +1095,7 @@ IMetadataColumn talendDynCol = null;
}
%>
}
}
nb_line_<%=cid%>++;
<%

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonOracleConnection"
FILTER="tAmazonOracleConnection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"
/>

View File

@@ -55,7 +55,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAmazonOracleConnection"
FILTER="tAmazonOracleConnection"
NUM_ROW="20"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"

View File

@@ -13,6 +13,7 @@ imports="
String businessArchive = ElementParameterParser.getValue(node, "__BUSINESS_ARCHIVE__");
String userName = ElementParameterParser.getValue(node, "__USERNAME__");
String password = ElementParameterParser.getValue(node, "__PASSWORD__");
boolean dieOnError = ("true").equals(ElementParameterParser.getValue(node, "__DIE_ON_ERROR__"));
@@ -42,12 +43,8 @@ imports="
String processDefinitionUUID_<%=cid%> = null;
try {
<%
String passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
loginContext_<%=cid%> = new javax.security.auth.login.LoginContext(<%=loginModule%>, new org.ow2.bonita.util.SimpleCallbackHandler(<%=userName%>, decryptedPassword_<%=cid%>));
loginContext_<%=cid%> = new javax.security.auth.login.LoginContext(<%=loginModule%>, new org.ow2.bonita.util.SimpleCallbackHandler(<%=userName%>, <%=password%>));
loginContext_<%=cid%>.login();
process_<%=cid%> = managementAPI_<%=cid%>.deploy(org.ow2.bonita.util.BusinessArchiveFactory.getBusinessArchive(new java.io.File(<%=businessArchive%>).toURI().toURL()));
processDefinitionUUID_<%=cid%> = process_<%=cid%>.getUUID().getValue();

View File

@@ -15,6 +15,7 @@ imports="
if ("HTTP_CLIENT".equals(clientMode)) {
String url = ElementParameterParser.getValue(node, "__BONITA_URL__");
String authUserName = ElementParameterParser.getValue(node, "__AUTH_USERNAME__");
String authPasswd = ElementParameterParser.getValue(node, "__AUTH_PASSWD__");
String process_name = ElementParameterParser.getValue(node, "__PROCESS_NAME__");
String process_version = ElementParameterParser.getValue(node, "__PROCESS_VERSION__");
String userName = ElementParameterParser.getValue(node, "__USERNAME__");
@@ -33,16 +34,13 @@ imports="
httpConn_<%=cid %>.setInstanceFollowRedirects(false);
httpConn_<%=cid %>.setRequestMethod("POST");
httpConn_<%=cid %>.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
<%
String passwordFieldName = "__AUTH_PASSWD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
httpConn_<%=cid %>.setRequestProperty("Authorization", "Basic " + new String(org.apache.commons.codec.binary.Base64.encodeBase64((<%=authUserName%>+ ":"+ decryptedPassword_<%=cid%>).getBytes(utf8Charset)),utf8Charset));
httpConn_<%=cid %>.setRequestProperty("Authorization", "Basic " + new String(org.apache.commons.codec.binary.Base64.encodeBase64((<%=authUserName%>+ ":"+ <%=authPasswd%>).getBytes(utf8Charset)),utf8Charset));
<%
} else { // JAVA CLIENT
String processID = ElementParameterParser.getValue(node, "__PROCESS_ID__");
String userName = ElementParameterParser.getValue(node, "__USERNAME__");
String password = ElementParameterParser.getValue(node, "__PASSWORD__");
String use_process_id = ElementParameterParser.getValue(node, "__USE_PROCESS_ID__");
@@ -78,12 +76,8 @@ imports="
String processInstanceUUID_<%=cid%> = null;
java.util.Map<String, Object> parameters_<%=cid%>=new java.util.HashMap<String, Object>();
<%
String passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
loginContext_<%=cid%> = new javax.security.auth.login.LoginContext(<%=loginModule%>, new org.ow2.bonita.util.SimpleCallbackHandler(<%=userName%>, decryptedPassword_<%=cid%>));
loginContext_<%=cid%> = new javax.security.auth.login.LoginContext(<%=loginModule%>, new org.ow2.bonita.util.SimpleCallbackHandler(<%=userName%>, <%=password%>));
resourceMap.put("loginContext_<%=cid%>", loginContext_<%=cid%>);
loginContext_<%=cid%>.login();
<%

View File

@@ -19,6 +19,7 @@ imports="
String url = ElementParameterParser.getValue(node, "__CENTRIC-URL__");
String modulename = ElementParameterParser.getValue(node, "__MODULENAME__");
String userid = ElementParameterParser.getValue(node, "__CLIENT__");
String password = ElementParameterParser.getValue(node, "__CODE__");
String server = ElementParameterParser.getValue(node, "__SERVER-ID__");
String classname=ElementParameterParser.getValue(node, "__CLASSNAME__");
List< ? extends IConnection> conns = node.getOutgoingSortedConnections();
@@ -35,11 +36,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
System.out.println(crm<%=cid%>.getDescription());
crm<%=cid%>.setUrl(<%=url%>);
crm<%=cid%>.setId(<%=server%>);
<%
String passwordFieldName = "__CODE__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
crm<%=cid%>.setCode(decryptedPassword_<%=cid%>);
crm<%=cid%>.setCode(<%=password%>);
crm<%=cid%>.setClientId(<%=userid%>);
java.util.ArrayList meta<%=cid%> = new java.util.ArrayList();

View File

@@ -14,6 +14,7 @@ imports="
String url = ElementParameterParser.getValue(node, "__CENTRIC-URL__");
String modulename = ElementParameterParser.getValue(node, "__MODULENAME__");
String userid = ElementParameterParser.getValue(node, "__CLIENT__");
String password = ElementParameterParser.getValue(node, "__CODE__");
String server = ElementParameterParser.getValue(node, "__SERVER-ID__");
String action=ElementParameterParser.getValue(node, "__ACTION__");
%>
@@ -28,11 +29,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
org.aspcfs.utils.CRMConnection crm<%=cid%> = new org.aspcfs.utils.CRMConnection();
crm<%=cid%>.setUrl(<%=url%>);
crm<%=cid%>.setId(<%=server%>);
<%
String passwordFieldName = "__CODE__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
crm<%=cid%>.setCode(decryptedPassword_<%=cid%>);
crm<%=cid%>.setCode(<%=password%>);
crm<%=cid%>.setClientId(<%=userid%>);
crm<%=cid%>.setAutoCommit(false);
org.aspcfs.apps.transfer.DataRecord <%=modulename%><%=cid%> = new org.aspcfs.apps.transfer.DataRecord();

View File

@@ -57,7 +57,7 @@
<PARAMETER
NAME="STARTER"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tChronometerStart"
FILTER="tChronometerStart"
NUM_ROW="2"
SHOW_IF="SINCE_STARTER == 'true'"
GROUP="SINCE"

View File

@@ -14,6 +14,7 @@
String cid = node.getUniqueName();
String accesskey = ElementParameterParser.getValue(node, "__ACCESS_KEY__");
String secretkey = ElementParameterParser.getValue(node, "__SECRET_KEY__");
String provider = ElementParameterParser.getValue(node, "__PROVIDER__");
String imageId = ElementParameterParser.getValue(node, "__IMAGE_ID__");
String region = ElementParameterParser.getValue(node, "__REGION__");
@@ -57,11 +58,8 @@
<%
}
%>
<%
String passwordFieldName = "__SECRET_KEY__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
org.jclouds.compute.ComputeServiceContext context_<%=cid%> = new org.jclouds.compute.ComputeServiceContextFactory().createContext("<%=providerId%>", <%=accesskey%>, decryptedPassword_<%=cid%>);
org.jclouds.compute.ComputeServiceContext context_<%=cid%> = new org.jclouds.compute.ComputeServiceContextFactory().createContext("<%=providerId%>", <%=accesskey%>, <%=secretkey%>);
org.jclouds.compute.ComputeService client_<%=cid%> = context_<%=cid%>.getComputeService();
<%

View File

@@ -14,6 +14,7 @@
String cid = node.getUniqueName();
String accesskey = ElementParameterParser.getValue(node, "__ACCESS_KEY__");
String secretkey = ElementParameterParser.getValue(node, "__SECRET_KEY__");
String provider = ElementParameterParser.getValue(node, "__PROVIDER__");
String predicates = ElementParameterParser.getValue(node, "__PREDICATES__");
@@ -26,11 +27,7 @@
}
%>
<%
String passwordFieldName = "__SECRET_KEY__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
org.jclouds.compute.ComputeServiceContext context_<%=cid%> = new org.jclouds.compute.ComputeServiceContextFactory().createContext("<%=providerId%>", <%=accesskey%>, decryptedPassword_<%=cid%>);
org.jclouds.compute.ComputeServiceContext context_<%=cid%> = new org.jclouds.compute.ComputeServiceContextFactory().createContext("<%=providerId%>", <%=accesskey%>, <%=secretkey%>);
org.jclouds.compute.ComputeService client_<%=cid%> = context_<%=cid%>.getComputeService();
<%

View File

@@ -63,7 +63,7 @@
<PARAMETER
NAME="CONNECTION_AS400"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tAS400Connection|tJDBCConnection$"
FILTER="REGEXP:^tAS400Connection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='AS400'"
/>
@@ -72,7 +72,7 @@
<PARAMETER
NAME="CONNECTION_DB2"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tDB2Connection|tJDBCConnection$"
FILTER="REGEXP:^tDB2Connection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='DB2'"
/>
@@ -81,7 +81,7 @@
<PARAMETER
NAME="CONNECTION_FIREBIRD"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tFirebirdConnection|tJDBCConnection$"
FILTER="REGEXP:^tFirebirdConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='FIREBIRD'"
/>
@@ -90,7 +90,7 @@
<PARAMETER
NAME="CONNECTION_GREENPLUM"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tGreenplumConnection|tJDBCConnection$"
FILTER="REGEXP:^tGreenplumConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='GREENPLUM'"
/>
@@ -99,7 +99,7 @@
<PARAMETER
NAME="CONNECTION_HIVE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tHiveConnection|tJDBCConnection$"
FILTER="REGEXP:^tHiveConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='HIVE'"
/>
@@ -108,7 +108,7 @@
<PARAMETER
NAME="CONNECTION_INGRES"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tIngresConnection|tJDBCConnection$"
FILTER="REGEXP:^tIngresConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='INGRES'"
/>
@@ -117,7 +117,7 @@
<PARAMETER
NAME="CONNECTION_INTERBASE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tInterbaseConnection|tJDBCConnection$"
FILTER="REGEXP:^tInterbaseConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='INTERBASE'"
/>
@@ -126,7 +126,7 @@
<PARAMETER
NAME="CONNECTION_MSSQL"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tMSSqlConnection|tJDBCConnection$"
FILTER="REGEXP:^tMSSqlConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='MSSQL'"
/>
@@ -135,7 +135,7 @@
<PARAMETER
NAME="CONNECTION_MYSQL"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tMysqlConnection|tJDBCConnection$"
FILTER="REGEXP:^tMysqlConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='MYSQL'"
/>
@@ -144,7 +144,7 @@
<PARAMETER
NAME="CONNECTION_DBORACLE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tOracleConnection|tJDBCConnection$"
FILTER="REGEXP:^tOracleConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='DBORACLE'"
/>
@@ -153,7 +153,7 @@
<PARAMETER
NAME="CONNECTION_PARACCEL"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tParAccelConnection|tJDBCConnection$"
FILTER="REGEXP:^tParAccelConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='PARACCEL'"
/>
@@ -162,7 +162,7 @@
<PARAMETER
NAME="CONNECTION_POSTGREPLUS"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tPostgresPlusConnection|tJDBCConnection$"
FILTER="REGEXP:^tPostgresPlusConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='POSTGREPLUS'"
/>
@@ -171,7 +171,7 @@
<PARAMETER
NAME="CONNECTION_POSTGRE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tPostgresqlConnection|tJDBCConnection$"
FILTER="REGEXP:^tPostgresqlConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='POSTGRE'"
/>
@@ -180,7 +180,7 @@
<PARAMETER
NAME="CONNECTION_SQLITE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tSQLiteConnection|tJDBCConnection$"
FILTER="REGEXP:^tSQLiteConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='SQLITE'"
/>
@@ -189,7 +189,7 @@
<PARAMETER
NAME="CONNECTION_SYBASE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tSybaseConnection|tJDBCConnection$"
FILTER="REGEXP:^tSybaseConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='SYBASE'"
/>
@@ -198,7 +198,7 @@
<PARAMETER
NAME="CONNECTION_TERADATA"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tTeradataConnection|tJDBCConnection$"
FILTER="REGEXP:^tTeradataConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='TERADATA'"
/>
@@ -207,7 +207,7 @@
<PARAMETER
NAME="CONNECTION_VERTICA"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="REGEXP:^tVerticaConnection|tJDBCConnection$"
FILTER="REGEXP:^tVerticaConnection|tJDBCConnection$"
NUM_ROW="3"
SHOW_IF="DBTYPE=='VERTICA'"
/>

View File

@@ -217,7 +217,7 @@
<PARAMETER
NAME="CONNECTION_ACCESS"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAccessConnection"
FILTER="tAccessConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='ACCESS') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -239,7 +239,7 @@
<PARAMETER
NAME="CONNECTION_AS400"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tAS400Connection"
FILTER="tAS400Connection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='AS400') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -249,7 +249,7 @@
<PARAMETER
NAME="CONNECTION_DB2"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='DB2') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -259,7 +259,7 @@
<PARAMETER
NAME="CONNECTION_FIREBIRD"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tFirebirdConnection"
FILTER="tFirebirdConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='FIREBIRD') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -317,7 +317,7 @@
<PARAMETER
NAME="CONNECTION_INFORMIX"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tInformixConnection"
FILTER="tInformixConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='INFORMIX') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -337,7 +337,7 @@
<PARAMETER
NAME="CONNECTION_INGRES"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tIngresConnection"
FILTER="tIngresConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='INGRES') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -347,7 +347,7 @@
<PARAMETER
NAME="CONNECTION_INTERBASE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tInterbaseConnection"
FILTER="tInterbaseConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='INTERBASE') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -392,7 +392,7 @@
<PARAMETER
NAME="CONNECTION_MSSQL"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tMSSqlConnection"
FILTER="tMSSqlConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='MSSQL') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -411,7 +411,7 @@
<PARAMETER
NAME="CONNECTION_MYSQL"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tMysqlConnection"
FILTER="tMysqlConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='MYSQL') and (USE_EXISTING_CONNECTION == 'true')"
></PARAMETER>
@@ -433,7 +433,7 @@
<PARAMETER
NAME="CONNECTION_NETEZZA"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tNetezzaConnection"
FILTER="tNetezzaConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='NETEZZA') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -443,7 +443,7 @@
<PARAMETER
NAME="CONNECTION_ORACLE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tOracleConnection"
FILTER="tOracleConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='DBORACLE') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -478,7 +478,7 @@
<PARAMETER
NAME="CONNECTION_POSTGRE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tPostgresqlConnection"
FILTER="tPostgresqlConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='POSTGRE') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -501,7 +501,7 @@
<PARAMETER
NAME="CONNECTION_POSTGREPLUS"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tPostgresPlusConnection"
FILTER="tPostgresPlusConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='POSTGREPLUS') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -511,7 +511,7 @@
<PARAMETER
NAME="CONNECTION_SQLITE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tSQLiteConnection"
FILTER="tSQLiteConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='SQLITE') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -525,7 +525,7 @@
<PARAMETER
NAME="CONNECTION_SYBASE"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tSybaseConnection"
FILTER="tSybaseConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='SYBASE') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -535,7 +535,7 @@
<PARAMETER
NAME="CONNECTION_TERADATA"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tTeradataConnection"
FILTER="tTeradataConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='TERADATA') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -552,7 +552,7 @@
<PARAMETER
NAME="CONNECTION_GREENPLUM"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tGreenplumConnection"
FILTER="tGreenplumConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='GREENPLUM') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -577,13 +577,12 @@
<ITEM NAME="VERTICA_5_1" VALUE="VERTICA_5_1" />
<ITEM NAME="VERTICA_6_0" VALUE="VERTICA_6_0" />
<ITEM NAME="VERTICA_6_1_X" VALUE="VERTICA_6_1_X" />
<ITEM NAME="VERTICA_7_0_X" VALUE="VERTICA_7_0_X" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="CONNECTION_VERTICA"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tVerticaConnection"
FILTER="tVerticaConnection"
NUM_ROW="30"
SHOW_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'true')"
/>
@@ -713,7 +712,6 @@
<IMPORT NAME="Driver-VERTICA_5.1" MODULE="vertica_5.1.6_jdk_5.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_5_1')" />
<IMPORT NAME="Driver-VERTICA_6.0" MODULE="vertica-jdk5-6.0.2-0.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_6_0')" />
<IMPORT NAME="Driver-VERTICA_6.1.2" MODULE="vertica-jdk5-6.1.2-0.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_6_1_X')" />
<IMPORT NAME="Driver-VERTICA_7.0.1" MODULE="vertica-jdbc-7.0.1-0.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_7_0_X')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -1635,7 +1635,7 @@ class VerticaManager extends Manager {
this.connection = connection;
}
protected String getDriver() {
if("VERTICA_7_0_X".equals(db_version) || "VERTICA_6_1_X".equals(db_version) || "VERTICA_6_0".equals(db_version) || "VERTICA_5_1".equals(db_version)){
if("VERTICA_6_1_X".equals(db_version) || "VERTICA_6_0".equals(db_version) || "VERTICA_5_1".equals(db_version)){
return "com.vertica.jdbc.Driver";
}else{
return "com.vertica.Driver";

View File

@@ -101,7 +101,6 @@ DB_VERTICA_VERSION.ITEM.VERTICA_5.0=Vertica 5.0
DB_VERTICA_VERSION.ITEM.VERTICA_5_1=Vertica 5.1
DB_VERTICA_VERSION.ITEM.VERTICA_6_0=Vertica 6.0
DB_VERTICA_VERSION.ITEM.VERTICA_6_1_X=Vertica 6.1.X
DB_VERTICA_VERSION.ITEM.VERTICA_7_0_X=Vertica 7.0.X
DB_POSTGRE_VERSION.NAME=DB Version
DB_POSTGRE_VERSION.ITEM.PRIOR_TO_V9=Prior to v9
DB_POSTGRE_VERSION.ITEM.V9_X=v9.X

View File

@@ -51,7 +51,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="10"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -35,7 +35,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
</PARAMETERS>

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
<PARAMETER

View File

@@ -31,7 +31,7 @@
</PARAMETER>
<PARAMETER NAME="CONNECTION" FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection" NUM_ROW="5"
FILTER="tDB2Connection" NUM_ROW="5"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"/>
<PARAMETER NAME="PROPERTY" FIELD="PROPERTY_TYPE" SHOW="true"

View File

@@ -50,7 +50,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="5"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -227,15 +227,13 @@ skeleton="../templates/db_output_bulk.skeleton"
} else if (("DELETE").equals(dataAction)) {
%>
String delete_<%=cid%> = "DELETE FROM \"" + tableName_<%=cid%> + "\" WHERE <%=deleteWhereStmt.toString()%>";
pstmt_<%=cid %> = conn_<%=cid%>.prepareStatement(delete_<%=cid%>);
<%
if(convertToUppercase){
%>
delete_<%=cid%> = delete_<%=cid%>.toUpperCase();
<%
}
%>
pstmt_<%=cid %> = conn_<%=cid%>.prepareStatement(delete_<%=cid%>);
<%
}
if(isEnableDebug) {
%>
@@ -801,6 +799,36 @@ skeleton="../templates/db_output_bulk.skeleton"
try {
updateFlag_<%=cid%>=pstmtUpdate_<%=cid %>.executeUpdate();
updatedCount_<%=cid%> = updatedCount_<%=cid%> + updateFlag_<%=cid%>;
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
%>
throw(e);
<%
} else {
if(rejectConnName != null && rejectColumnList != null && rejectColumnList.size() > 0) {
%>
<%=rejectConnName %> = new <%=rejectConnName %>Struct();
<%
for(IMetadataColumn column : columnList) {
%>
<%=rejectConnName%>.<%=column.getLabel()%> = <%=incomingConnName%>.<%=column.getLabel()%>;
<%
}
%>
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
<%
} else {
%>
System.err.print(e.getMessage());
<%
}
}
%>
}
if(updateFlag_<%=cid%> == 0) {
<%
if(isEnableDebug) {
@@ -824,15 +852,10 @@ skeleton="../templates/db_output_bulk.skeleton"
}
}
if(isDynamic) {
Column dynamicColumn = getColumn(talendDynCol);
Column dynamicColumn = getColumn(getDynamicColumn());
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
if("Dynamic".equals(typeToGenerate)) {
if(isEnableDebug) {
%>
routines.system.DynamicUtils.debugDynamicSql(query_<%=cid%>,<%=incomingConnName%>.<%=dynamicColumn.getName()%>, <%=counter%>,insertSQLSplits_<%=cid%>);
<%
}
%>
%>
DynamicUtils.writeColumnsToDatabse(<%=incomingConnName%>.<%=dynamicColumn.getName()%>, pstmtInsert_<%=cid%>, <%=counter-1%>, "<%=dbmsId%>");
<%
}
@@ -843,8 +866,8 @@ skeleton="../templates/db_output_bulk.skeleton"
<%
}
%>
try {
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
}
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
@@ -875,6 +898,7 @@ skeleton="../templates/db_output_bulk.skeleton"
}
%>
}
}
nb_line_<%=cid%>++;
<%

View File

@@ -36,7 +36,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="10"
DYNAMIC_SETTINGS="true"/>
<PARAMETER

View File

@@ -47,7 +47,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="5"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -49,7 +49,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="5"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -54,7 +54,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="11"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -45,7 +45,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tDB2Connection"
FILTER="tDB2Connection"
NUM_ROW="5"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -457,6 +457,37 @@ skeleton="../templates/db_output_bulk.skeleton"
updateFlag_<%=cid%>=pstmtUpdate_<%=cid %>.executeUpdate();
<%}%>
updatedCount_<%=cid%> = updatedCount_<%=cid%> + updateFlag_<%=cid%>;
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
%>
throw(e);
<%
} else {
if(rejectConnName != null && rejectColumnList != null && rejectColumnList.size() > 0) {
%>
<%=rejectConnName %> = new <%=rejectConnName %>Struct();
<%
for(IMetadataColumn column : columnList) {
%>
<%=rejectConnName%>.<%=column.getLabel()%> = <%=incomingConnName%>.<%=column.getLabel()%>;
<%
}
%>
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
<%
} else {
%>
System.err.print(e.getMessage());
<%
}
}
%>
}
if(updateFlag_<%=cid%> == 0) {
<%
if(useStatement || isEnableDebug) {
@@ -486,12 +517,12 @@ skeleton="../templates/db_output_bulk.skeleton"
<%
}
%>
try {
<%if(useStatement){%>
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate(query_<%=cid%>.toString().trim());
<%}else{%>
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
<%}%>
}
} catch(java.lang.Exception e) {
whetherReject_<%=cid%> = true;
<%
@@ -523,6 +554,7 @@ skeleton="../templates/db_output_bulk.skeleton"
}
%>
}
}
nb_line_<%=cid%>++;
<%
} else if (("DELETE").equals(dataAction)) {

View File

@@ -37,7 +37,7 @@
NUM_ROW="5" SHOW_IF="USE_STATIC_METHOD == 'false'">
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER NAME="INSTANCE" FIELD="COMPONENT_LIST" REQUIRED="true" FILTER="REGEXP:^tDotNET.*$"
<PARAMETER NAME="INSTANCE" FIELD="COMPONENT_LIST" FILTER="REGEXP:^tDotNET.*$"
NUM_ROW="5"
SHOW_IF="(USE_EXISTING_INSTANCE == 'true') AND (USE_STATIC_METHOD == 'false')" />

View File

@@ -49,7 +49,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tGreenplumConnection"
FILTER="tGreenplumConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -54,7 +54,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tJDBCConnection"
FILTER="tJDBCConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -54,7 +54,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tMSSqlConnection"
FILTER="tMSSqlConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -66,7 +66,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tMysqlConnection"
FILTER="tMysqlConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -47,7 +47,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tNetezzaConnection"
FILTER="tNetezzaConnection"
NUM_ROW="10"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -54,7 +54,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tOracleConnection"
FILTER="tOracleConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -54,7 +54,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tPostgresqlConnection"
FILTER="tPostgresqlConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -50,7 +50,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tSybaseConnection"
FILTER="tSybaseConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -51,7 +51,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tTeradataConnection"
FILTER="tTeradataConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"/>

View File

@@ -45,7 +45,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tEXistConnection"
FILTER="tEXistConnection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -45,7 +45,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tEXistConnection"
FILTER="tEXistConnection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -44,7 +44,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tEXistConnection"
FILTER="tEXistConnection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -45,7 +45,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tEXistConnection"
FILTER="tEXistConnection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -44,7 +44,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tEXistConnection"
FILTER="tEXistConnection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -44,7 +44,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tEXistConnection"
FILTER="tEXistConnection"
NUM_ROW="1"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -12,17 +12,20 @@ String cid = node.getUniqueName();
String host = ElementParameterParser.getValue(node, "__HOST__");
String port = ElementParameterParser.getValue(node, "__PORT__");
String user = ElementParameterParser.getValue(node, "__USER__");
String pass = ElementParameterParser.getValue(node, "__PASS__");
String connectMode = ElementParameterParser.getValue(node, "__CONNECT_MODE__");
boolean useProxy = ("true").equals(ElementParameterParser.getValue(node, "__USE_PROXY__"));
String proxyHost = ElementParameterParser.getValue(node, "__PROXY_HOST__");
String proxyPort = ElementParameterParser.getValue(node, "__PROXY_PORT__");
String proxyUser = ElementParameterParser.getValue(node, "__PROXY_USERNAME__");
String proxyPassword = ElementParameterParser.getValue(node, "__PROXY_PASSWORD__");
boolean sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
String authMethod = ElementParameterParser.getValue(node, "__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node, "__PRIVATEKEY__");
String passPhrase = ElementParameterParser.getValue(node, "__PASSPHRASE__");
boolean ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__"));
String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__");
String keystorePass = ElementParameterParser.getValue(node, "__KEYSTORE_PASS__");
String sEncoding = ElementParameterParser.getValue(node, "__ENCODING__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
@@ -30,22 +33,13 @@ boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.ge
if(isLog4jEnabled){%>
log.info("<%=cid%> - Start to work.");
<%}
String passwordFieldName = "";
if (useProxy) {
%>
java.util.Properties props_<%=cid%> = System.getProperties();
props_<%=cid%>.put("socksProxyPort", <%=proxyPort %>);
props_<%=cid%>.put("socksProxyHost", <%=proxyHost %>);
props_<%=cid%>.put("java.net.socks.username", <%=proxyUser %>);
<%
passwordFieldName = "__PROXY_PASSWORD__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedProxyPassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedProxyPassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
props_<%=cid%>.put("java.net.socks.password", decryptedProxyPassword_<%=cid%>);
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
<%
}
@@ -67,14 +61,8 @@ if (!sftp && !ftps) { // *** ftp *** //
log.info("<%=cid%> - Authentication using a password.");
log.info("<%=cid%> - Connection attempt to '" + <%=host %> + "' as '" +<%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASS__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.connect();
ftp_<%=cid %>.login(<%=user %>, <%=pass %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to '" + <%=host %> + "' has succeeded.");
<%}%>
@@ -83,16 +71,8 @@ if (!sftp && !ftps) { // *** ftp *** //
} else if (!ftps) { // *** sftp *** //
%>
class MyUserInfo implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive {
<%
passwordFieldName = "__PASSPHRASE__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedPassphrase_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedPassphrase_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
String passphrase_<%=cid %> = decryptedPassphrase_<%=cid%>;
String passphrase_<%=cid %> = <%=passPhrase %>;
public String getPassphrase() { return passphrase_<%=cid %>; }
@@ -108,11 +88,7 @@ if (!sftp && !ftps) { // *** ftp *** //
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt,
boolean[] echo) {
<%
passwordFieldName = "__PASS__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String[] password_<%=cid%> = {decryptedPassword_<%=cid%>};
String[] password_<%=cid%> = {<%=pass%>};
return password_<%=cid%>;
}
};
@@ -132,12 +108,7 @@ if (!sftp && !ftps) { // *** ftp *** //
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - SFTP authentication using a password.");
<%}%>
<%
passwordFieldName = "__PASS__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
session_<%=cid%>.setPassword(<%=pass%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
@@ -172,15 +143,7 @@ if (!sftp && !ftps) { // *** ftp *** //
java.security.cert.CertificateException, java.security.UnrecoverableKeyException,
java.io.FileNotFoundException, java.io.IOException{
java.security.KeyStore ks = java.security.KeyStore.getInstance("JKS");
<%
passwordFieldName = "__KEYSTORE_PASS__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedKeyStorePassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedKeyStorePassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
ks.load(new java.io.FileInputStream(<%=keystoreFile%>), decryptedKeyStorePassword_<%=cid%>.toCharArray());
ks.load(new java.io.FileInputStream(<%=keystoreFile%>), <%=keystorePass%>.toCharArray());
javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm());
tmf.init(ks);
return tmf.getTrustManagers();
@@ -219,12 +182,7 @@ if (!sftp && !ftps) { // *** ftp *** //
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to '" + <%=host %> + "' has succeeded.");
<%}%>
<%
passwordFieldName = "__PASS__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=user %>, <%=pass %>);
} catch (java.lang.IllegalStateException e) {
<%if(isLog4jEnabled){%>
log.error("<%=cid%> - " + e.getMessage());

View File

@@ -14,17 +14,18 @@ String cid = node.getUniqueName();
String host = ElementParameterParser.getValue(node, "__HOST__");
String port = ElementParameterParser.getValue(node, "__PORT__");
String user = ElementParameterParser.getValue(node, "__USERNAME__");
String pass = ElementParameterParser.getValue(node, "__PASSWORD__");
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
String remotedir = ElementParameterParser.getValue(node, "__REMOTEDIR__");
String authMethod = ElementParameterParser.getValue(node,"__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node,"__PRIVATEKEY__");
String passPhrase = ElementParameterParser.getValue(node,"__PASSPHRASE__");
List<Map<String, String>> files = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__FILES__");
boolean useProxy = ("true").equals(ElementParameterParser.getValue(node,"__USE_PROXY__"));
String proxyHost = ElementParameterParser.getValue(node,"__PROXY_HOST__");
String proxyPort = ElementParameterParser.getValue(node,"__PROXY_PORT__");
String proxyUser = ElementParameterParser.getValue(node,"__PROXY_USERNAME__");
String proxyPassword = ElementParameterParser.getValue(node,"__PROXY_PASSWORD__");
String connectMode = ElementParameterParser.getValue(node,"__CONNECT_MODE__");
String fileOrDir = ElementParameterParser.getValue(node, "__FILE_OR_DIRECTORY__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
@@ -44,7 +45,6 @@ if (("true").equals(useExistingConn)) {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
}
String passwordFieldName = "";
//The following part support the socks proxy for FTP and SFTP (Socks V4 or V5, they are all OK).
//And it can not work with the FTP proxy directly, only support the socks proxy.
if(useProxy){
@@ -53,15 +53,7 @@ if(useProxy){
props_<%=cid%>.put("socksProxyPort", <%=proxyPort %>);
props_<%=cid%>.put("socksProxyHost", <%=proxyHost %>);
props_<%=cid%>.put("java.net.socks.username", <%=proxyUser %>);
<%
passwordFieldName = "__PROXY_PASSWORD__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedProxyPassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedProxyPassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
props_<%=cid%>.put("java.net.socks.password", decryptedProxyPassword_<%=cid%>);
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
<%}%>
int nb_file_<%=cid%> = 0;
@@ -71,15 +63,7 @@ if (sftp) {
if (("false").equals(useExistingConn)) {
%>
class MyUserInfo_<%=cid %> implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive {
<%
passwordFieldName = "__PASSPHRASE__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedPassphrase_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedPassphrase_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
String passphrase_<%=cid %> = decryptedPassphrase_<%=cid%>;
String passphrase_<%=cid %> = <%=passPhrase %>;
public String getPassphrase() { return passphrase_<%=cid %>; }
public String getPassword() { return null; }
public boolean promptPassword(String arg0) { return true; }
@@ -89,11 +73,7 @@ if (sftp) {
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt,
boolean[] echo) {
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String[] password_<%=cid%> = {decryptedPassword_<%=cid%>};
String[] password_<%=cid%> = {<%=pass%>};
return password_<%=cid%>;
}
};
@@ -106,11 +86,7 @@ if (sftp) {
com.jcraft.jsch.Session session_<%=cid%>=jsch_<%=cid%>.getSession(<%=user%>, <%=host%>, <%=port%>);
<%if (("PASSWORD").equals(authMethod)){ %>
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
session_<%=cid%>.setPassword(<%=pass%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
<%if (!useProxy) {%>
@@ -165,11 +141,7 @@ if (sftp) {
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=user %>, <%=pass %>);
<%}%>
java.util.List<java.util.Map<String,String>> list<%=cid %> = new java.util.ArrayList<java.util.Map<String,String>>();

View File

@@ -51,7 +51,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tFTPConnection"
FILTER="tFTPConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -13,20 +13,20 @@ String cid = node.getUniqueName();
String host=ElementParameterParser.getValue(node, "__HOST__");
String port=ElementParameterParser.getValue(node, "__PORT__");
String username=ElementParameterParser.getValue(node, "__USERNAME__");
String password=ElementParameterParser.getValue(node, "__PASSWORD__");
String remoteDir = ElementParameterParser.getValue(node, "__REMOTEDIR__");
String filename = ElementParameterParser.getValue(node, "__FILENAME__");
boolean useProxy = ("true").equals(ElementParameterParser.getValue(node, "__USE_PROXY__"));
String proxyHost = ElementParameterParser.getValue(node, "__PROXY_HOST__");
String proxyPort = ElementParameterParser.getValue(node, "__PROXY_PORT__");
String proxyUser = ElementParameterParser.getValue(node, "__PROXY_USERNAME__");
String proxyPass = ElementParameterParser.getValue(node, "__PROXY_PASSWORD__");
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
String user = ElementParameterParser.getValue(node, "__USERNAME__");
String pass = ElementParameterParser.getValue(node, "__PASSWORD__");
String authMethod = ElementParameterParser.getValue(node, "__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node, "__PRIVATEKEY__");
String passPhrase = ElementParameterParser.getValue(node, "__PASSPHRASE__");
String connectMode = ElementParameterParser.getValue(node, "__CONNECT_MODE__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
String conn= "conn_" + connection;
@@ -50,9 +50,6 @@ if (("true").equals(useExistingConn)) {
log.info("<%=cid%> - Start to work.");
<%
}
String passwordFieldName = "";
//The following part support the socks proxy for FTP and SFTP (Socks V4 or V5, they are all OK).
//And it can not work with the FTP proxy directly, only support the socks proxy.
if (useProxy) {
@@ -61,15 +58,7 @@ if (useProxy) {
props_<%=cid%>.put("socksProxyPort", <%=proxyPort %>);
props_<%=cid%>.put("socksProxyHost", <%=proxyHost %>);
props_<%=cid%>.put("java.net.socks.username", <%=proxyUser %>);
<%
passwordFieldName = "__PROXY_PASSWORD__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedProxyPassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedProxyPassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
props_<%=cid%>.put("java.net.socks.password", decryptedProxyPassword_<%=cid%>);
props_<%=cid%>.put("java.net.socks.password", <%=proxyPass %>);
<%
}
@@ -78,15 +67,7 @@ if (sftp) {
%>
class MyUserInfo_<%=cid%> implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive {
<%
passwordFieldName = "__PASSPHRASE__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedPassphrase_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedPassphrase_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
String passphrase_<%=cid %> = decryptedPassphrase_<%=cid%>;
String passphrase_<%=cid %> = <%=passPhrase %>;
public String getPassphrase() { return passphrase_<%=cid %>; }
@@ -102,11 +83,7 @@ if (sftp) {
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt,
boolean[] echo) {
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String[] password_<%=cid%> = {decryptedPassword_<%=cid%>};
String[] password_<%=cid%> = {<%=pass%>};
return password_<%=cid%>;
}
};
@@ -126,11 +103,7 @@ if (sftp) {
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - SFTP authentication using a password.");
<%}%>
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
session_<%=cid%>.setPassword(<%=pass%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
<%if (!useProxy) {%>
@@ -197,11 +170,7 @@ if (sftp) {
log.info("<%=cid%> - Connection attempt to '" + <%=host %> + "' as '" +<%=username %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=username %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=username %>, <%=password %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to '" + <%=host%> + "' has succeeded.");
<%}%>

View File

@@ -51,7 +51,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tFTPConnection"
FILTER="tFTPConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -13,19 +13,19 @@ INode node = (INode)codeGenArgument.getArgument();
String host = ElementParameterParser.getValue(node, "__HOST__");
String port = ElementParameterParser.getValue(node, "__PORT__");
String user = ElementParameterParser.getValue(node, "__USERNAME__");
String pass = ElementParameterParser.getValue(node, "__PASSWORD__");
String remotedir = ElementParameterParser.getValue(node, "__REMOTEDIR__");
boolean dirFull = ("true").equals(ElementParameterParser.getValue(node, "__DIR_FULL__"));
String cid = node.getUniqueName();
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
String authMethod = ElementParameterParser.getValue(node, "__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node, "__PRIVATEKEY__");
String passPhrase = ElementParameterParser.getValue(node, "__PASSPHRASE__");
boolean useProxy = ("true").equals(ElementParameterParser.getValue(node, "__USE_PROXY__"));
String proxyHost = ElementParameterParser.getValue(node, "__PROXY_HOST__");
String proxyPort = ElementParameterParser.getValue(node, "__PROXY_PORT__");
String proxyUser = ElementParameterParser.getValue(node, "__PROXY_USERNAME__");
String proxyPassword = ElementParameterParser.getValue(node, "__PROXY_PASSWORD__");
String connectMode = ElementParameterParser.getValue(node, "__CONNECT_MODE__");
List<Map<String, String>> files = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__FILES__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
@@ -45,7 +45,6 @@ if (("true").equals(useExistingConn)) {
} else {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
}
String passwordFieldName = "";
%>
java.util.List<String> maskList_<%=cid %> = new java.util.ArrayList<String>();
@@ -71,15 +70,7 @@ if (useProxy) {
props_<%=cid%>.put("socksProxyPort", <%=proxyPort %>);
props_<%=cid%>.put("socksProxyHost", <%=proxyHost %>);
props_<%=cid%>.put("java.net.socks.username", <%=proxyUser %>);
<%
passwordFieldName = "__PROXY_PASSWORD__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedProxyPassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedProxyPassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
props_<%=cid%>.put("java.net.socks.password", decryptedProxyPassword_<%=cid%>);
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
<%
}
@@ -88,15 +79,7 @@ if (sftp) {
if (("false").equals(useExistingConn)) {
%>
class MyUserInfo_<%=cid%> implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive {
<%
passwordFieldName = "__PASSPHRASE__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedPassphrase_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedPassphrase_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
String passphrase_<%=cid %> = decryptedPassphrase_<%=cid%>;
String passphrase_<%=cid %> = <%=passPhrase %>;
public String getPassphrase() { return passphrase_<%=cid %>; }
@@ -112,11 +95,7 @@ if (sftp) {
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt,
boolean[] echo) {
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String[] password_<%=cid%> = {decryptedPassword_<%=cid%>};
String[] password_<%=cid%> = {<%=pass%>};
return password_<%=cid%>;
}
};
@@ -129,11 +108,7 @@ if (sftp) {
com.jcraft.jsch.Session session_<%=cid%>=jsch_<%=cid%>.getSession(<%=user%>, <%=host%>, <%=port%>);
<%if (("PASSWORD").equals(authMethod)) {%>
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
session_<%=cid%>.setPassword(<%=pass%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
<%if (!useProxy) {%>
@@ -208,11 +183,7 @@ if (sftp) {
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=user %>, <%=pass %>);
<%}%>
String remotedir_<%=cid %> = <%=remotedir%>;
ftp_<%=cid %>.chdir(remotedir_<%=cid %>);

View File

@@ -40,7 +40,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tFTPConnection"
FILTER="tFTPConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>
@@ -84,7 +84,7 @@
NAME="PRIVATEKEY"
FIELD="FILE"
NUM_ROW="22"
SHOW_IF="(SFTP=='true') AND (AUTH_METHOD == 'PUBLICKEY') AND (USE_EXISTING_CONNECTION == 'false')"
SHOW_IF="(SFTP=='true') AND (AUTH_METHOD == 'PUBLICKEY')"
>
<DEFAULT>"/.ssh/id_dsa"</DEFAULT>
</PARAMETER>
@@ -93,7 +93,7 @@
NAME="PASSPHRASE"
FIELD="PASSWORD"
NUM_ROW="23"
SHOW_IF="(SFTP=='true') AND (AUTH_METHOD == 'PUBLICKEY') AND (USE_EXISTING_CONNECTION == 'false')"
SHOW_IF="(SFTP=='true') AND (AUTH_METHOD == 'PUBLICKEY')"
>
<DEFAULT>"secret"</DEFAULT>
</PARAMETER>

View File

@@ -15,7 +15,7 @@ String cid = node.getUniqueName();
String host = ElementParameterParser.getValue(node, "__HOST__");
String port = ElementParameterParser.getValue(node, "__PORT__");
String username = ElementParameterParser.getValue(node, "__USERNAME__");
String password = ElementParameterParser.getValue(node, "__PASSWORD__");
String filename = ElementParameterParser.getValue(node, "__FILENAME__");
String remoteDir = ElementParameterParser.getValue(node, "__REMOTEDIR__");
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
@@ -23,12 +23,12 @@ String user = ElementParameterParser.getValue(node, "__USERNAME__");
String pass = ElementParameterParser.getValue(node, "__PASSWORD__");
String authMethod = ElementParameterParser.getValue(node, "__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node, "__PRIVATEKEY__");
String passPhrase = ElementParameterParser.getValue(node, "__PASSPHRASE__");
boolean useProxy = ("true").equals(ElementParameterParser.getValue(node, "__USE_PROXY__"));
String proxyHost = ElementParameterParser.getValue(node, "__PROXY_HOST__");
String proxyPort = ElementParameterParser.getValue(node, "__PROXY_PORT__");
String proxyUser = ElementParameterParser.getValue(node, "__PROXY_USERNAME__");
String proxyPassword = ElementParameterParser.getValue(node, "__PROXY_PASSWORD__");
String connectMode = ElementParameterParser.getValue(node, "__CONNECT_MODE__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
String conn= "conn_" + connection;
@@ -49,22 +49,13 @@ if (("true").equals(useExistingConn)) {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
}
String passwordFieldName = "";
if (useProxy) {
%>
java.util.Properties props_<%=cid%> = System.getProperties();
props_<%=cid%>.put("socksProxyPort", <%=proxyPort %>);
props_<%=cid%>.put("socksProxyHost", <%=proxyHost %>);
props_<%=cid%>.put("java.net.socks.username", <%=proxyUser %>);
<%
passwordFieldName = "__PROXY_PASSWORD__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedProxyPassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedProxyPassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
props_<%=cid%>.put("java.net.socks.password", decryptedProxyPassword_<%=cid%>);
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
<%
}
String outputConnName = null;
@@ -93,15 +84,7 @@ if (sftp) {
if (("false").equals(useExistingConn)) {
%>
class MyUserInfo_<%=cid%> implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive {
<%
passwordFieldName = "__PASSPHRASE__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedPassphrase_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedPassphrase_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
String passphrase_<%=cid %> = decryptedPassphrase_<%=cid%>;
String passphrase_<%=cid %> = <%=passPhrase %>;
public String getPassphrase() { return passphrase_<%=cid %>; }
public String getPassword() { return null; }
public boolean promptPassword(String arg0) { return true; }
@@ -111,11 +94,7 @@ if (sftp) {
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt,
boolean[] echo) {
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String[] password_<%=cid%> = {decryptedPassword_<%=cid%>};
String[] password_<%=cid%> = {<%=pass%>};
return password_<%=cid%>;
}
};
@@ -128,11 +107,7 @@ if (sftp) {
com.jcraft.jsch.Session session_<%=cid%>=jsch_<%=cid%>.getSession(<%=user%>, <%=host%>, <%=port%>);
<%if (("PASSWORD").equals(authMethod)) {%>
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
session_<%=cid%>.setPassword(<%=pass%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
<%if (!useProxy) {%>
@@ -201,11 +176,7 @@ if (sftp) {
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=username %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=username %>, <%=password %>);
<%}%>
<%
//add feature 19709,add the "Transfer mode" option,

View File

@@ -61,7 +61,7 @@
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tFTPConnection"
FILTER="tFTPConnection"
NUM_ROW="11"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

View File

@@ -14,7 +14,7 @@ String cid = node.getUniqueName();
String host = ElementParameterParser.getValue(node, "__HOST__");
String port = ElementParameterParser.getValue(node, "__PORT__");
String user = ElementParameterParser.getValue(node, "__USERNAME__");
String pass = ElementParameterParser.getValue(node, "__PASSWORD__");
String overwrite = ElementParameterParser.getValue(node, "__OVERWRITE__");
String sftpoverwrite =ElementParameterParser.getValue(node, "__SFTPOVERWRITE__");
String localdir = ElementParameterParser.getValue(node, "__LOCALDIR__");
@@ -22,15 +22,15 @@ String remotedir = ElementParameterParser.getValue(node, "__REMOTEDIR__");
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
String authMethod = ElementParameterParser.getValue(node,"__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node,"__PRIVATEKEY__");
String passPhrase = ElementParameterParser.getValue(node,"__PASSPHRASE__");
List<Map<String, String>> files = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__FILES__");
boolean useProxy = ("true").equals(ElementParameterParser.getValue(node,"__USE_PROXY__"));
String proxyHost = ElementParameterParser.getValue(node,"__PROXY_HOST__");
String proxyPort = ElementParameterParser.getValue(node,"__PROXY_PORT__");
String proxyUser = ElementParameterParser.getValue(node,"__PROXY_USERNAME__");
String proxyPassword = ElementParameterParser.getValue(node,"__PROXY_PASSWORD__");
String keystoreFile = ElementParameterParser.getValue(node,"__KEYSTORE_FILE__");
String keystorePass = ElementParameterParser.getValue(node,"__KEYSTORE_PASS__");
boolean append = "true".equals(ElementParameterParser.getValue(node, "__APPEND__"));
String connectMode = ElementParameterParser.getValue(node,"__CONNECT_MODE__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
@@ -42,7 +42,6 @@ boolean sftp = false;
boolean ftps = false;
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
String passwordFieldName = "";
if ("true".equals(useExistingConn)) {
List<? extends INode> nodeList = node.getProcess().getGeneratingNodes();
@@ -72,15 +71,7 @@ if (useProxy){
props_<%=cid%>.put("socksProxyPort", <%=proxyPort %>);
props_<%=cid%>.put("socksProxyHost", <%=proxyHost %>);
props_<%=cid%>.put("java.net.socks.username", <%=proxyUser %>);
<%
passwordFieldName = "__PROXY_PASSWORD__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedProxyPassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedProxyPassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
props_<%=cid%>.put("java.net.socks.password", decryptedProxyPassword_<%=cid%>);
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
<%
}
@@ -92,15 +83,7 @@ if (sftp) { // *** sftp *** //
if ("false".equals(useExistingConn)) {
%>
class MyUserInfo_<%=cid %> implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive {
<%
passwordFieldName = "__PASSPHRASE__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedPassphrase_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedPassphrase_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
String passphrase_<%=cid %> = decryptedPassphrase_<%=cid%>;
String passphrase_<%=cid %> = <%=passPhrase %>;
public String getPassphrase() { return passphrase_<%=cid %>; }
@@ -116,11 +99,7 @@ if (sftp) { // *** sftp *** //
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt,
boolean[] echo) {
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String[] password_<%=cid%> = {decryptedPassword_<%=cid%>};
String[] password_<%=cid%> = {<%=pass%>};
return password_<%=cid%>;
}
};
@@ -281,11 +260,7 @@ if (sftp) { // *** sftp *** //
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - SFTP authentication using a password.");
<%}%>
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
session_<%=cid%>.setPassword(<%=pass%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
@@ -564,11 +539,7 @@ if (sftp) { // *** sftp *** //
log.info("<%=cid%> - Connection attempt to '" + <%=host %> + "' as '" +<%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=user %>, <%=pass %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to '" + <%=host %> + "' has succeeded.");
<%}%>
@@ -675,15 +646,7 @@ if (sftp) { // *** sftp *** //
java.io.FileNotFoundException, java.io.IOException {
java.security.KeyStore ks = java.security.KeyStore.getInstance("JKS");
<%
passwordFieldName = "__KEYSTORE_PASS__";
if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
%>
String decryptedKeyStorePassword_<%=cid%> = routines.system.PasswordEncryptUtil.decryptPassword(<%=ElementParameterParser.getEncryptedValue(node, passwordFieldName)%>);
<%} else {%>
String decryptedKeyStorePassword_<%=cid%> = <%= ElementParameterParser.getValue(node, passwordFieldName)%>;
<%}%>
ks.load(new java.io.FileInputStream(<%=keystoreFile%>), decryptedKeyStorePassword_<%=cid%>.toCharArray());
ks.load(new java.io.FileInputStream(<%=keystoreFile%>), <%=keystorePass%>.toCharArray());
javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm());
tmf.init(ks);
return tmf.getTrustManagers();
@@ -727,11 +690,7 @@ if (sftp) { // *** sftp *** //
log.info("<%=cid%> - Connection attempt to '" + <%=host %> + "' as '" + <%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect(<%=host %>,<%=port %>);
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
ftp_<%=cid %>.login(<%=user %>, <%=pass %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to '" + <%=host %> + "' has succeeded.");
<%}%>

View File

@@ -52,7 +52,7 @@ COMPATIBILITY="ALL"
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tFTPConnection"
FILTER="tFTPConnection"
NUM_ROW="2"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
/>

Some files were not shown because too many files have changed in this diff Show More