Compare commits
5 Commits
patch/TPS-
...
patch/TPS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaf915e044 | ||
|
|
dbfa19af43 | ||
|
|
2225889dd7 | ||
|
|
e1310856cb | ||
|
|
a17537e847 |
@@ -3,17 +3,15 @@ version: 7.2.1
|
||||
module: https://talend.poolparty.biz/coretaxonomy/42
|
||||
product:
|
||||
- https://talend.poolparty.biz/coretaxonomy/23
|
||||
- https://talend.poolparty.biz/coretaxonomy/26
|
||||
- https://talend.poolparty.biz/coretaxonomy/24
|
||||
---
|
||||
|
||||
# TPS-3403
|
||||
# TPS-3252
|
||||
|
||||
| Info | Value |
|
||||
| ---------------- | ---------------- |
|
||||
| Patch Name | Patch\_20190907\_TPS-3403\_v1-7.2.1 |
|
||||
| Release Date | 2019-09-07 |
|
||||
| Target Version | 20190620\_1446-V7.2.1 |
|
||||
| Patch Name | Patch\_20190723_TPS-3252\_v1-7.2.1 |
|
||||
| Release Date | 2019-07-23 |
|
||||
| Target Version | Talend-Studio-20190620\_1446-V7.2.1 |
|
||||
| Product affected | Talend Studio |
|
||||
|
||||
## Introduction
|
||||
@@ -23,11 +21,13 @@ This is a self-contained patch.
|
||||
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
|
||||
|
||||
## Fixed issues
|
||||
This patch contains this following fixe:
|
||||
|
||||
- TPS-3403 filecopy fail with java11 (TDI-42230)
|
||||
This patch contains the following fixes:
|
||||
|
||||
- TPS-3252 [7.2.1] tFileFetch not able to connect internet behind NTLM PROXY (TDI-42536)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Consider the following requirements for your system:
|
||||
|
||||
- Talend Studio 7.2.1 must be installed.
|
||||
@@ -37,7 +37,7 @@ Consider the following requirements for your system:
|
||||
|
||||
### Installing the patch using Software update
|
||||
|
||||
1) Logon TAC and switch to Configuration->Software Update, then enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV\_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDejaQ
|
||||
1) Logon TAC and switch to Configuration->Software Update, then enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDejaQ
|
||||
|
||||
2) Switch to Software update page, where the new patch will be listed. The patch can be downloaded from here into the nexus repository.
|
||||
|
||||
@@ -53,14 +53,15 @@ Consider the following requirements for your system:
|
||||
|
||||
Execute the following commands:
|
||||
|
||||
1. Talend-Studio-win-x86\_64.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002 --talendDebug
|
||||
2. initRemote {tac\_url} -ul {TAC login username} -up {TAC login password}
|
||||
1. Talend-Studio-win-x86_64.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002 --talendDebug
|
||||
2. initRemote {tac_url} -ul {TAC login username} -up {TAC login password}
|
||||
3. checkAndUpdate -tu {TAC login username} -tup {TAC login password}
|
||||
|
||||
## Uninstallation
|
||||
Backup the Affected files list below. Uninstall the patch by restore the backup files.
|
||||
|
||||
## Affected files for this patch
|
||||
|
||||
The following files are installed by this patch:
|
||||
|
||||
- plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tFileCopy/tFileCopy\_java.xml
|
||||
- plugins/org.talend.libraries.custom\_7.2.1.20181114\_0551/lib/filecopy-2.0.0.jar
|
||||
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tFileFetch/tFileFetch\_main.javajet
|
||||
@@ -59,76 +59,88 @@ if((codePart.equals(ECodePart.END))&&(stat || logstashCurrent)){
|
||||
List<String> needToEndConnNames = new ArrayList<String>();
|
||||
INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget();
|
||||
NodeUtil.fillConnectionsForStat(needToEndConnNames, nextNode);
|
||||
if(!needToEndConnNames.isEmpty()) {
|
||||
if(stat && logstashCurrent) {
|
||||
%>
|
||||
runStat.updateStatAndLog(execStat,enableLogStash,iterateId,2,0<%for(String connName : needToEndConnNames){%>,"<%=connName%>"<%}%>);
|
||||
%>
|
||||
|
||||
<%if(stat) {%>
|
||||
if(execStat){
|
||||
<%
|
||||
for(String connName : needToEndConnNames){
|
||||
%>
|
||||
runStat.updateStatOnConnection("<%=connName%>"+iterateId,2, 0);
|
||||
<%
|
||||
} else {
|
||||
if(stat) {%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection(iterateId,2,0<%for(String connName : needToEndConnNames){%>,"<%=connName%>"<%}%>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {//now only finish the log, not send, TODO%>
|
||||
if(enableLogStash){
|
||||
runStat.log(iterateId,2,0<%for(String connName : needToEndConnNames){%>,"<%=connName%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
}
|
||||
|
||||
if(connSet.size()>0) {
|
||||
if(stat && logstashCurrent && (connSet.size()==1)) {//the most common case, write this ugly logic for 65535 issue
|
||||
for(IConnection con:connSet){
|
||||
INode source = con.getSource();
|
||||
String sourceNodeId = source.getUniqueName();
|
||||
String sourceNodeComponent = source.getComponent().getName();
|
||||
for (INode jobStructureCatcher : jobCatcherNodes) {
|
||||
%>
|
||||
if(runStat.updateStatAndLog(execStat,enableLogStash,resourceMap,iterateId,"<%=con.getUniqueName()%>",2,0,
|
||||
<%=jobStructureCatcher.getUniqueName()%>,"<%=sourceNodeId%>","<%=sourceNodeComponent%>","<%=node.getUniqueName()%>","<%=node.getComponent().getName()%>","<%="REJECT".equals(con.getConnectorName()) ? "reject" : "output"%>")) {
|
||||
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
}
|
||||
<%
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStat(resourceMap,iterateId,2,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {//now only finish the log, not send, TODO%>
|
||||
if(enableLogStash){
|
||||
<%
|
||||
for(String connName : needToEndConnNames){
|
||||
%>
|
||||
runStat.logStatOnConnection("<%=connName%>"+iterateId,2, 0);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
}
|
||||
if(connSet.size()>0){
|
||||
for(IConnection con:connSet){
|
||||
INode source = con.getSource();
|
||||
String sourceNodeId = source.getUniqueName();
|
||||
String sourceNodeComponent = source.getComponent().getName();
|
||||
%>
|
||||
<%if(stat) {%>
|
||||
if(execStat){
|
||||
if(resourceMap.get("inIterateVComp") == null || !((Boolean)resourceMap.get("inIterateVComp"))){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName()%>"+iterateId,2, 0);
|
||||
}
|
||||
}
|
||||
<%}%>
|
||||
|
||||
if(logstashCurrent){
|
||||
%>
|
||||
if(enableLogStash) {
|
||||
<%
|
||||
for(IConnection con:connSet){
|
||||
INode source = con.getSource();
|
||||
String sourceNodeId = source.getUniqueName();
|
||||
String sourceNodeComponent = source.getComponent().getName();
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash){
|
||||
if(resourceMap.get("inIterateVComp") == null || !((Boolean)resourceMap.get("inIterateVComp"))){
|
||||
<%
|
||||
for (INode jobStructureCatcher : jobCatcherNodes) {
|
||||
%>
|
||||
if(runStat.log(resourceMap,iterateId,"<%=con.getUniqueName()%>",2,0,
|
||||
<%=jobStructureCatcher.getUniqueName()%>,"<%=sourceNodeId%>","<%=sourceNodeComponent%>","<%=node.getUniqueName()%>","<%=node.getComponent().getName()%>","<%="REJECT".equals(con.getConnectorName()) ? "reject" : "output"%>")) {
|
||||
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
}
|
||||
RunStat.StatBean talend_statebean = runStat.logStatOnConnection("<%=con.getUniqueName()%>"+iterateId,2, 0);
|
||||
|
||||
<%=jobStructureCatcher.getUniqueName() %>.addConnectionMessage(
|
||||
"<%=sourceNodeId%>",
|
||||
"<%=sourceNodeComponent%>",
|
||||
false,
|
||||
"<%="REJECT".equals(con.getConnectorName()) ? "reject" : "output"%>",
|
||||
"<%=con.getUniqueName()%>",
|
||||
talend_statebean.getNbLine(),
|
||||
talend_statebean.getStartTime(),
|
||||
talend_statebean.getEndTime()
|
||||
);
|
||||
|
||||
<%=jobStructureCatcher.getUniqueName() %>.addConnectionMessage(
|
||||
"<%=node.getUniqueName()%>",
|
||||
"<%=node.getComponent().getName()%>",
|
||||
true,
|
||||
"input",
|
||||
"<%=con.getUniqueName()%>",
|
||||
talend_statebean.getNbLine(),
|
||||
talend_statebean.getStartTime(),
|
||||
talend_statebean.getEndTime()
|
||||
);
|
||||
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
<%
|
||||
break;
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
%>
|
||||
}
|
||||
}
|
||||
}
|
||||
<%}%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -146,82 +146,83 @@
|
||||
boolean logstashCurrent = !cid.startsWith("tJobStructureCatcher") && !cid.startsWith("talend") && enableLogStash;
|
||||
|
||||
if ((codePart.equals(ECodePart.BEGIN))&&(stat || logstashCurrent)&&connSet.size()>0) {
|
||||
if(containsTPartitioner) {
|
||||
%>
|
||||
if(<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>) {
|
||||
runStat.updateStatOnConnectionAndLog(resourceMap,globalMap,iterateLoop,iterateId,<%if(stat){%>execStat<%} else {%>false<%}%>,enableLogStash,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
if(stat && logstashCurrent) {
|
||||
%>
|
||||
runStat.updateStatAndLog(execStat,enableLogStash,resourceMap,iterateId,0,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
<%
|
||||
} else {
|
||||
if(stat) {
|
||||
%>
|
||||
if(execStat) {
|
||||
runStat.updateStatOnConnection(resourceMap,iterateId,0,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
if (<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>) {
|
||||
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);
|
||||
int step_<%=con.getUniqueName() %> = stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1;
|
||||
<%if(stat) {%>
|
||||
if(execStat) {
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId, step_<%=con.getUniqueName()%>, 0);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.logStatOnConnection("<%=con.getUniqueName()%>"+iterateId, step_<%=con.getUniqueName()%>, 0);
|
||||
}
|
||||
<%}%>
|
||||
<%}else{%>
|
||||
<%if(stat) {%>
|
||||
if(execStat) {
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId, 0, 0);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.logStatOnConnection("<%=con.getUniqueName()%>"+iterateId, 0, 0);
|
||||
}
|
||||
<%}%>
|
||||
<%}%>
|
||||
}
|
||||
|
||||
if(logstashCurrent) {
|
||||
%>
|
||||
if(enableLogStash) {
|
||||
runStat.log(resourceMap,iterateId,0,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
if((codePart.equals(ECodePart.MAIN))&&(stat || logstashCurrent)&&connSet.size()>0){
|
||||
if(!node.getComponent().useMerge()) {
|
||||
if(stat && logstashCurrent) {
|
||||
%>
|
||||
runStat.updateStatAndLog(execStat,enableLogStash,iterateId,1,1<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
<%
|
||||
} else {
|
||||
if(stat) {
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection(iterateId,1,1<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
|
||||
//<%=con.getUniqueName()%>
|
||||
//<%=(String)codeGenArgument.getIncomingName()%>
|
||||
|
||||
|
||||
<%if (!node.getComponent().useMerge()) {%>
|
||||
<%if(stat) {%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
if(logstashCurrent) {
|
||||
%>
|
||||
if(enableLogStash) {
|
||||
runStat.log(iterateId,1,1<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.logStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(IConnection connection:connSet){
|
||||
if(connection.getUniqueName().equals((String)codeGenArgument.getIncomingName())){
|
||||
if(stat && logstashCurrent) {
|
||||
%>
|
||||
runStat.updateStatAndLog(execStat,enableLogStash,iterateId,1,1<%for(IConnection con : connSet){if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){%>,"<%=con.getUniqueName()%>"<%}}%>);
|
||||
<%
|
||||
} else {
|
||||
if(stat) {%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection(iterateId,1,1<%for(IConnection con : connSet){if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){%>,"<%=con.getUniqueName()%>"<%}}%>);
|
||||
}
|
||||
<%}
|
||||
|
||||
if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.log(iterateId,1,1<%for(IConnection con : connSet){if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){%>,"<%=con.getUniqueName()%>"<%}}%>);
|
||||
}
|
||||
<%}
|
||||
}
|
||||
<%}%>
|
||||
<%
|
||||
} else if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){
|
||||
%>
|
||||
<%if(stat) {%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.logStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
<%}%>
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +251,7 @@
|
||||
for (INode jobStructureCatcher : jobCatcherNodes) {
|
||||
%>
|
||||
if(enableLogStash) {
|
||||
<%=jobStructureCatcher.getUniqueName() %>.addCM("<%=node.getUniqueName()%>", "<%=node.getComponent().getName()%>");
|
||||
<%=jobStructureCatcher.getUniqueName() %>.addComponentMessage("<%=node.getUniqueName()%>", "<%=node.getComponent().getName()%>");
|
||||
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
}
|
||||
<%
|
||||
@@ -265,37 +266,46 @@
|
||||
List<String> needToStartConnNames = new ArrayList<String>();
|
||||
INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget();
|
||||
NodeUtil.fillConnectionsForStat(needToStartConnNames, nextNode);
|
||||
if(needToStartConnNames.isEmpty()) {
|
||||
//do nothing
|
||||
} else if(containsTPartitioner){
|
||||
%>
|
||||
if(<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>){
|
||||
runStat.updateStatOnConnectionAndLog(globalMap,iterateLoop,iterateId,<%if(stat){%>execStat<%} else {%>false<%}%>,enableLogStash,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
if(stat && logstashCurrent) {
|
||||
%>
|
||||
runStat.updateStatAndLog(execStat,enableLogStash,iterateId,0,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
|
||||
<%
|
||||
} else {
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection(iterateId,0,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash){
|
||||
runStat.log(iterateId,0,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
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);
|
||||
|
||||
int step_<%=connName %> = stats_<%=connName%>.incrementAndGet()<=1?0:1;
|
||||
<%if(stat) {%>
|
||||
if(execStat) {
|
||||
runStat.updateStatOnConnection("<%=connName%>"+iterateId, step_<%=connName%>, 0);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.logStatOnConnection("<%=connName%>"+iterateId, step_<%=connName%>, 0);
|
||||
}
|
||||
<%}%>
|
||||
<%}else{%>
|
||||
<%if(stat) {%>
|
||||
if(execStat) {
|
||||
runStat.updateStatOnConnection("<%=connName%>"+iterateId, 0, 0);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%if(logstashCurrent) {%>
|
||||
if(enableLogStash) {
|
||||
runStat.logStatOnConnection("<%=connName%>"+iterateId, 0, 0);
|
||||
}
|
||||
<%}%>
|
||||
<%}%>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if(codePart.equals(ECodePart.MAIN)){
|
||||
%>
|
||||
resourceMap.put("inIterateVComp", true);
|
||||
|
||||
@@ -69,140 +69,145 @@ if(hasInput){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean hasValidInput = inputConn!=null;
|
||||
if (hasValidInput) {
|
||||
|
||||
IMetadataTable metadata = null;
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
boolean haveValidNodeMetadata = ((metadatas != null) && (metadatas.size() > 0) && (metadata = metadatas.get(0)) != null);
|
||||
|
||||
if (hasValidInput && haveValidNodeMetadata) {
|
||||
List<IMetadataColumn> input_columnList = inputConn.getMetadataTable().getListColumns();
|
||||
if(input_columnList == null) {
|
||||
input_columnList = new ArrayList<IMetadataColumn>();
|
||||
}
|
||||
// add incoming (not present) columns to enforcer for this comps
|
||||
if (cid.contains("tDataStewardship") || cid.contains("tMarkLogic")){
|
||||
%>
|
||||
boolean shouldCreateRuntimeSchemaForIncomingNode = false;
|
||||
<%
|
||||
for (int i = 0; i < input_columnList.size(); i++) {
|
||||
if(!input_columnList.get(i).getTalendType().equals("id_Dynamic")) {
|
||||
|
||||
if (input_columnList!=null && !input_columnList.isEmpty()) {
|
||||
// add incoming (not present) columns to enforcer for this comps
|
||||
if (cid.contains("tDataStewardship") || cid.contains("tMarkLogic")){
|
||||
%>
|
||||
if (incomingEnforcer_<%=cid%>.getDesignSchema().getField("<%=input_columnList.get(i)%>") == null){
|
||||
incomingEnforcer_<%=cid%>.addIncomingNodeField("<%=input_columnList.get(i)%>", ((Object) <%=inputConn.getName()%>.<%=input_columnList.get(i)%>).getClass().getCanonicalName());
|
||||
shouldCreateRuntimeSchemaForIncomingNode = true;
|
||||
boolean shouldCreateRuntimeSchemaForIncomingNode = false;
|
||||
<%
|
||||
for (int i = 0; i < input_columnList.size(); i++) {
|
||||
if(!input_columnList.get(i).getTalendType().equals("id_Dynamic")) {
|
||||
%>
|
||||
if (incomingEnforcer_<%=cid%>.getDesignSchema().getField("<%=input_columnList.get(i)%>") == null){
|
||||
incomingEnforcer_<%=cid%>.addIncomingNodeField("<%=input_columnList.get(i)%>", ((Object) <%=inputConn.getName()%>.<%=input_columnList.get(i)%>).getClass().getCanonicalName());
|
||||
shouldCreateRuntimeSchemaForIncomingNode = true;
|
||||
}
|
||||
<%
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
if (shouldCreateRuntimeSchemaForIncomingNode){
|
||||
incomingEnforcer_<%=cid%>.createRuntimeSchema();
|
||||
}
|
||||
<%
|
||||
}
|
||||
// If there are dynamic columns in the schema, they need to be
|
||||
// initialized into the runtime schema of the actual IndexedRecord
|
||||
// provided to the component.
|
||||
|
||||
int dynamicPos = -1;
|
||||
for (int i = 0; i < input_columnList.size(); i++) {
|
||||
if (input_columnList.get(i).getTalendType().equals("id_Dynamic")) {
|
||||
dynamicPos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamicPos != -1) {
|
||||
%>
|
||||
if (!incomingEnforcer_<%=cid%>.areDynamicFieldsInitialized()) {
|
||||
// Initialize the dynamic columns when they are first encountered.
|
||||
for (routines.system.DynamicMetadata dm_<%=cid%> : <%=inputConn.getName()%>.<%=input_columnList.get(dynamicPos).getLabel()%>.metadatas) {
|
||||
incomingEnforcer_<%=cid%>.addDynamicField(
|
||||
dm_<%=cid%>.getName(),
|
||||
dm_<%=cid%>.getType(),
|
||||
dm_<%=cid%>.getLogicalType(),
|
||||
dm_<%=cid%>.getFormat(),
|
||||
dm_<%=cid%>.getDescription(),
|
||||
dm_<%=cid%>.isNullable());
|
||||
}
|
||||
incomingEnforcer_<%=cid%>.createRuntimeSchema();
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
%>
|
||||
incomingEnforcer_<%=cid%>.createNewRecord();
|
||||
<%
|
||||
for (int i = 0; i < input_columnList.size(); i++) { // column
|
||||
IMetadataColumn column = input_columnList.get(i);
|
||||
if (dynamicPos != i) {
|
||||
%>
|
||||
//skip the put action if the input column doesn't appear in component runtime schema
|
||||
if (incomingEnforcer_<%=cid%>.getRuntimeSchema().getField("<%=input_columnList.get(i)%>") != null){
|
||||
incomingEnforcer_<%=cid%>.put("<%=column.getLabel()%>", <%=inputConn.getName()%>.<%=column.getLabel()%>);
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
for (int i = 0; i < <%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnCount(); i++) {
|
||||
incomingEnforcer_<%=cid%>.put(<%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnMetadata(i).getName(),
|
||||
<%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnValue(i));
|
||||
if (shouldCreateRuntimeSchemaForIncomingNode){
|
||||
incomingEnforcer_<%=cid%>.createRuntimeSchema();
|
||||
}
|
||||
<%
|
||||
}
|
||||
} // column
|
||||
// If there are dynamic columns in the schema, they need to be
|
||||
// initialized into the runtime schema of the actual IndexedRecord
|
||||
// provided to the component.
|
||||
|
||||
// If necesary, generate the code to handle outgoing connections.
|
||||
// TODO: For now, this can only handle one outgoing record for
|
||||
// each incoming record. To handle multiple outgoing records, code
|
||||
// generation needs to occur in component_begin in order to open
|
||||
// a for() loop.
|
||||
int dynamicPos = -1;
|
||||
for (int i = 0; i < input_columnList.size(); i++) {
|
||||
if (input_columnList.get(i).getTalendType().equals("id_Dynamic")) {
|
||||
dynamicPos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// There will be a ClassCastException if the output component does
|
||||
// not implement WriterWithFeedback, but permits outgoing
|
||||
// connections.
|
||||
|
||||
ComponentProperties componentProps = node.getComponentProperties();
|
||||
ProcessPropertiesGenerator generator = new ProcessPropertiesGenerator(cid, component);
|
||||
List<Component.CodegenPropInfo> propsToProcess = component.getCodegenPropInfos(componentProps);
|
||||
for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
|
||||
List<NamedThing> properties = propInfo.props.getProperties();
|
||||
for (NamedThing prop : properties) { // property
|
||||
if (prop instanceof Property) { // if, only deal with valued Properties
|
||||
Property property = (Property)prop;
|
||||
if (property.getFlags() != null && (property.getFlags().contains(Property.Flags.DESIGN_TIME_ONLY) || property.getFlags().contains(Property.Flags.HIDDEN)))
|
||||
continue;
|
||||
if(property.getTaggedValue(IGenericConstants.DYNAMIC_PROPERTY_VALUE)!=null && Boolean.valueOf(String.valueOf(property.getTaggedValue(IGenericConstants.DYNAMIC_PROPERTY_VALUE)))) {
|
||||
generator.setPropertyValues(property, propInfo, null, false, false);
|
||||
if (dynamicPos != -1) {
|
||||
%>
|
||||
if (!incomingEnforcer_<%=cid%>.areDynamicFieldsInitialized()) {
|
||||
// Initialize the dynamic columns when they are first encountered.
|
||||
for (routines.system.DynamicMetadata dm_<%=cid%> : <%=inputConn.getName()%>.<%=input_columnList.get(dynamicPos).getLabel()%>.metadatas) {
|
||||
incomingEnforcer_<%=cid%>.addDynamicField(
|
||||
dm_<%=cid%>.getName(),
|
||||
dm_<%=cid%>.getType(),
|
||||
dm_<%=cid%>.getLogicalType(),
|
||||
dm_<%=cid%>.getFormat(),
|
||||
dm_<%=cid%>.getDescription(),
|
||||
dm_<%=cid%>.isNullable());
|
||||
}
|
||||
incomingEnforcer_<%=cid%>.createRuntimeSchema();
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
%>
|
||||
incomingEnforcer_<%=cid%>.createNewRecord();
|
||||
<%
|
||||
for (int i = 0; i < input_columnList.size(); i++) { // column
|
||||
IMetadataColumn column = input_columnList.get(i);
|
||||
if (dynamicPos != i) {
|
||||
%>
|
||||
//skip the put action if the input column doesn't appear in component runtime schema
|
||||
if (incomingEnforcer_<%=cid%>.getRuntimeSchema().getField("<%=input_columnList.get(i)%>") != null){
|
||||
incomingEnforcer_<%=cid%>.put("<%=column.getLabel()%>", <%=inputConn.getName()%>.<%=column.getLabel()%>);
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
for (int i = 0; i < <%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnCount(); i++) {
|
||||
incomingEnforcer_<%=cid%>.put(<%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnMetadata(i).getName(),
|
||||
<%=inputConn.getName()%>.<%=column.getLabel()%>.getColumnValue(i));
|
||||
}
|
||||
<%
|
||||
}
|
||||
} // column
|
||||
|
||||
// If necesary, generate the code to handle outgoing connections.
|
||||
// TODO: For now, this can only handle one outgoing record for
|
||||
// each incoming record. To handle multiple outgoing records, code
|
||||
// generation needs to occur in component_begin in order to open
|
||||
// a for() loop.
|
||||
|
||||
// There will be a ClassCastException if the output component does
|
||||
// not implement WriterWithFeedback, but permits outgoing
|
||||
// connections.
|
||||
|
||||
ComponentProperties componentProps = node.getComponentProperties();
|
||||
ProcessPropertiesGenerator generator = new ProcessPropertiesGenerator(cid, component);
|
||||
List<Component.CodegenPropInfo> propsToProcess = component.getCodegenPropInfos(componentProps);
|
||||
for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
|
||||
List<NamedThing> properties = propInfo.props.getProperties();
|
||||
for (NamedThing prop : properties) { // property
|
||||
if (prop instanceof Property) { // if, only deal with valued Properties
|
||||
Property property = (Property)prop;
|
||||
if (property.getFlags() != null && (property.getFlags().contains(Property.Flags.DESIGN_TIME_ONLY) || property.getFlags().contains(Property.Flags.HIDDEN)))
|
||||
continue;
|
||||
if(property.getTaggedValue(IGenericConstants.DYNAMIC_PROPERTY_VALUE)!=null && Boolean.valueOf(String.valueOf(property.getTaggedValue(IGenericConstants.DYNAMIC_PROPERTY_VALUE)))) {
|
||||
generator.setPropertyValues(property, propInfo, null, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // property
|
||||
} // propInfo
|
||||
|
||||
%>
|
||||
org.apache.avro.generic.IndexedRecord data_<%=cid%> = incomingEnforcer_<%=cid%>.getCurrentRecord();
|
||||
|
||||
<%
|
||||
boolean isParallelize ="true".equalsIgnoreCase(ElementParameterParser.getValue(node, "__PARALLELIZE__"));
|
||||
if (isParallelize) {
|
||||
String sourceComponentId = inputConn.getSource().getUniqueName();
|
||||
if(sourceComponentId!=null && sourceComponentId.contains("tAsyncIn")) {
|
||||
%>
|
||||
globalMap.put(buffersSizeKey_<%=cid%>, buffersSize_<%=sourceComponentId%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
writer_<%=cid%>.write(data_<%=cid%>);
|
||||
|
||||
nb_line_<%=cid %>++;
|
||||
<%if(hasMainOutput){
|
||||
} // property
|
||||
} // propInfo
|
||||
|
||||
%>
|
||||
if(!(writer_<%=cid%> instanceof org.talend.components.api.component.runtime.WriterWithFeedback)) {
|
||||
// For no feedback writer,just pass the input record to the output
|
||||
if (data_<%=cid%>!=null) {
|
||||
outgoingMainRecordsList_<%=cid%> = java.util.Arrays.asList(data_<%=cid%>);
|
||||
}
|
||||
}
|
||||
<%
|
||||
org.apache.avro.generic.IndexedRecord data_<%=cid%> = incomingEnforcer_<%=cid%>.getCurrentRecord();
|
||||
|
||||
<%
|
||||
boolean isParallelize ="true".equalsIgnoreCase(ElementParameterParser.getValue(node, "__PARALLELIZE__"));
|
||||
if (isParallelize) {
|
||||
String sourceComponentId = inputConn.getSource().getUniqueName();
|
||||
if(sourceComponentId!=null && sourceComponentId.contains("tAsyncIn")) {
|
||||
%>
|
||||
globalMap.put(buffersSizeKey_<%=cid%>, buffersSize_<%=sourceComponentId%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
writer_<%=cid%>.write(data_<%=cid%>);
|
||||
|
||||
nb_line_<%=cid %>++;
|
||||
<%if(hasMainOutput){
|
||||
%>
|
||||
if(!(writer_<%=cid%> instanceof org.talend.components.api.component.runtime.WriterWithFeedback)) {
|
||||
// For no feedback writer,just pass the input record to the output
|
||||
if (data_<%=cid%>!=null) {
|
||||
outgoingMainRecordsList_<%=cid%> = java.util.Arrays.asList(data_<%=cid%>);
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
} // canStart
|
||||
|
||||
@@ -139,7 +139,7 @@ for (INode node : process.getNodesOfType("tRESTClient")) {
|
||||
}
|
||||
|
||||
boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJob = talendEsbJobFactory || actAsConsumer || ProcessorUtilities.isEsbJob(process);
|
||||
boolean talendEsbJob = talendEsbJobFactory || actAsConsumer || ProcessorUtilities.isEsbJob(process.getId(), process.getVersion());
|
||||
|
||||
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__"));
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
<project name="org.talend.designer.components.libs" default="buildall" basedir=".">
|
||||
|
||||
<target name="buildall">
|
||||
<ant antfile="filecopy/build.xml" target="process" inheritall="no" />
|
||||
<ant antfile="talend_file_enhanced_20070724/build.xml" target="process" inheritall="no" />
|
||||
<ant antfile="sugarCRMManagement/build.xml" target="process" inheritall="no" />
|
||||
<ant antfile="TalendSAX/build.xml" target="process" inheritall="no" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -1,9 +1,9 @@
|
||||
<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.components.lib</groupId>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>commons-net-ftps-proxy</artifactId>
|
||||
<version>3.6.1-talend-20190819</version>
|
||||
<version>3.6.1-talend-20190128</version>
|
||||
|
||||
<name>commons-net-talend</name>
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.talend.ftp;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.Socket;
|
||||
import java.net.InetAddress;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
@@ -30,13 +29,11 @@ public class SSLSessionReuseFTPSClient extends FTPSClient {
|
||||
final Object cache = sessionHostPortCache.get(context);
|
||||
final Method putMethod = cache.getClass().getDeclaredMethod("put", Object.class, Object.class);
|
||||
putMethod.setAccessible(true);
|
||||
InetAddress address = socket.getInetAddress();
|
||||
int port = socket.getPort();
|
||||
|
||||
String key = String.format("%s:%s", address.getHostName(), String.valueOf(port)).toLowerCase(Locale.ROOT);
|
||||
putMethod.invoke(cache, key, session);
|
||||
|
||||
key = String.format("%s:%s", address.getHostAddress(), String.valueOf(port)).toLowerCase(Locale.ROOT);
|
||||
final Method getHostMethod = socket.getClass().getDeclaredMethod("getHost");
|
||||
getHostMethod.setAccessible(true);
|
||||
Object host = getHostMethod.invoke(socket);
|
||||
final String key =
|
||||
String.format("%s:%s", host, String.valueOf(socket.getPort())).toLowerCase(Locale.ROOT);
|
||||
putMethod.invoke(cache, key, session);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
.classpath
|
||||
.project
|
||||
target/
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="org.talend.designer.components.libs" default="process" basedir=".">
|
||||
|
||||
<property name="component.plugin.home" value="../../../org.talend.designer.components.localprovider/components" />
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
<!-- modification 1: config -->
|
||||
<property name="jar.name" value="filecopy.jar" />
|
||||
<property name="component.name" value="tFileCopy" />
|
||||
<property name="author.name" value="wyang" />
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
</path>
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
|
||||
<!-- sourcecode and final jar path -->
|
||||
<property name="source.home" value="." />
|
||||
<property name="jar.home" value="${component.plugin.home}/${component.name}/${jar.name}" />
|
||||
|
||||
<!-- temp dir for clasee files -->
|
||||
<property name="build.dir" value="../../build" />
|
||||
|
||||
<!-- compile option -->
|
||||
<property name="compile.debug" value="true" />
|
||||
<property name="compile.deprecation" value="false" />
|
||||
<property name="compile.optimize" value="true" />
|
||||
|
||||
|
||||
<target name="process" description="prepare a temp dir">
|
||||
<antcall target="prepare" />
|
||||
<antcall target="compile" />
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
<target name="prepare" description="prepare a temp dir">
|
||||
<delete dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}/classes" />
|
||||
</target>
|
||||
|
||||
<target name="compile" description="Compile Java sources">
|
||||
|
||||
<!-- compile -->
|
||||
<javac srcdir="${source.home}" destdir="${build.dir}/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">
|
||||
<classpath refid="compile.classpath" />
|
||||
</javac>
|
||||
|
||||
<!-- include source code -->
|
||||
<copy todir="${build.dir}/classes">
|
||||
<fileset dir="${source.home}">
|
||||
<exclude name="build.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- make jar -->
|
||||
<tstamp>
|
||||
<format property="date" pattern="yyyy-MM-dd HH:mm:ss" />
|
||||
</tstamp>
|
||||
|
||||
<jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/classes">
|
||||
<manifest>
|
||||
<!-- who -->
|
||||
<attribute name="Built-By" value="${author.name}" />
|
||||
<!-- when -->
|
||||
<attribute name="Built-Date" value="${date}"/>
|
||||
<!-- JDK version -->
|
||||
<attribute name="Created-By" value="${java.version} (${java.vendor})" />
|
||||
<!-- Information about the program itself -->
|
||||
<attribute name="Implementation-Vendor" value="Talend SA" />
|
||||
<attribute name="Implementation-Title" value="${jar.name}" />
|
||||
<attribute name="Implementation-Version" value="1.0" />
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
<!-- move jar -->
|
||||
<move file="${build.dir}/${jar.name}" tofile="${jar.home}" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="clean" description="clean the temp dir">
|
||||
<delete dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,190 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.MappedByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
*/
|
||||
public class FileCopy {
|
||||
|
||||
private final static long L_SIZE = 100 * 1024 * 1024; // 100M
|
||||
|
||||
private final static long M_SIZE = 10 * 1024 * 1024; // 10M
|
||||
|
||||
private final static long S_SIZE = 0; // 0M
|
||||
|
||||
public static void copyFile(String srcFileName, String desFileName, boolean delSrc) throws Exception {
|
||||
|
||||
FileInputStream srcInputStream = null;
|
||||
try{
|
||||
srcInputStream = new FileInputStream(srcFileName);
|
||||
long lastModified = new File(srcFileName).lastModified();
|
||||
int available = srcInputStream.available();
|
||||
if (available > L_SIZE) {// X > 100M
|
||||
copyFileL(srcFileName, srcInputStream, desFileName, delSrc);
|
||||
} else if (available > M_SIZE) {// 10M < X <100M
|
||||
copyFileM(srcFileName, srcInputStream, desFileName, delSrc);
|
||||
} else { // X < 10M
|
||||
copyFileS(srcFileName, srcInputStream, desFileName, delSrc);
|
||||
}
|
||||
// keep modification_time
|
||||
new File(desFileName).setLastModified(lastModified);
|
||||
}finally{
|
||||
if(srcInputStream!=null){
|
||||
srcInputStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyFileS(String srcFileName, FileInputStream srcInputStream, String desFileName, boolean delSrc)
|
||||
throws IOException {
|
||||
File source = new File(srcFileName);
|
||||
File dest = new File(desFileName);
|
||||
|
||||
FileInputStream in = null;
|
||||
FileOutputStream out = null;
|
||||
try {
|
||||
in = srcInputStream;
|
||||
out = new FileOutputStream(dest);
|
||||
|
||||
byte[] buf = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = in.read(buf)) != -1) {
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
if (delSrc) {
|
||||
source.delete();
|
||||
}
|
||||
|
||||
} finally {
|
||||
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyFileM(String srcFileName, FileInputStream srcInputStream, String desFileName, boolean delSrc)
|
||||
throws IOException {
|
||||
File source = new File(srcFileName);
|
||||
File dest = new File(desFileName);
|
||||
|
||||
FileChannel in = null;
|
||||
FileChannel out = null;
|
||||
try {
|
||||
in = srcInputStream.getChannel();
|
||||
out = new FileOutputStream(dest).getChannel();
|
||||
|
||||
int maxCount = (32 * 1024 * 1024) - (28 * 1024);
|
||||
long size = in.size();
|
||||
long position = 0;
|
||||
while (position < size) {
|
||||
position += in.transferTo(position, maxCount, out);
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
if (delSrc) {
|
||||
source.delete();
|
||||
}
|
||||
} finally {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyFileL(String srcFileName, FileInputStream srcInputStream, String desFileName, boolean delSrc)
|
||||
throws Exception {
|
||||
File source = new File(srcFileName);
|
||||
File dest = new File(desFileName);
|
||||
|
||||
FileChannel in = null, out = null;
|
||||
try {
|
||||
in = srcInputStream.getChannel();
|
||||
out = new FileOutputStream(dest).getChannel();
|
||||
|
||||
long size = in.size();
|
||||
long position = 0;
|
||||
final long MAP_SIZE = 33525760;
|
||||
MappedByteBuffer buf = null;
|
||||
while (true) {
|
||||
if (position + MAP_SIZE >= size) {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, size - position);
|
||||
out.write(buf);
|
||||
//For But TDI-26493, here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
break;
|
||||
} else {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, MAP_SIZE);
|
||||
out.write(buf);
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
position += MAP_SIZE;
|
||||
}
|
||||
}
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
if (delSrc) {
|
||||
source.delete();
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static void clean(final Object buffer) throws Exception {
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
|
||||
public Object run() {
|
||||
try {
|
||||
Method getCleanerMethod = buffer.getClass().getMethod("cleaner", new Class[0]);
|
||||
getCleanerMethod.setAccessible(true);
|
||||
sun.misc.Cleaner cleaner = (sun.misc.Cleaner) getCleanerMethod.invoke(buffer, new Object[0]);
|
||||
cleaner.clean();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,73 +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.libraries</groupId>
|
||||
<artifactId>filecopy</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>talend-copy</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
<java.source.version>1.8</java.source.version>
|
||||
<junit5.version>5.4.2</junit5.version>
|
||||
</properties>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>talend_nexus_deployment</id>
|
||||
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>talend_nexus_deployment</id>
|
||||
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.source.version}</source>
|
||||
<target>${java.source.version}</target>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<showWarnings>true</showWarnings>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,49 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
*/
|
||||
public class FileCopy {
|
||||
|
||||
/** Private constructor, only static methods */
|
||||
private FileCopy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy files.
|
||||
*
|
||||
* @param srcFileName : file name for source file.
|
||||
* @param desFileName : file name for destination file.
|
||||
* @param delSrc : true if delete source.
|
||||
* @throws IOException : if IO pb.
|
||||
*/
|
||||
public static void copyFile(String srcFileName, String desFileName, boolean delSrc) throws IOException {
|
||||
final File source = new File(srcFileName);
|
||||
final File destination = new File(desFileName);
|
||||
|
||||
if (delSrc) {
|
||||
// move : more efficient if in same FS and mustr delete existing file.
|
||||
Files.move(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
} else {
|
||||
Files.copy(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package org.talend;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test for FileCopy.class with diffents file size.
|
||||
*
|
||||
* @author clesaec
|
||||
*
|
||||
*/
|
||||
class FileCopyTest {
|
||||
|
||||
@Test
|
||||
void testCopyFile() throws Exception {
|
||||
final URL repCopy = Thread.currentThread().getContextClassLoader().getResource("copy");
|
||||
|
||||
File small = this.buildFile("small.txt", 10L * 1024L);
|
||||
small.deleteOnExit();
|
||||
File smallCopy = new File(repCopy.getPath(), "small.txt");
|
||||
smallCopy.deleteOnExit();
|
||||
|
||||
FileCopy.copyFile(small.getPath(), smallCopy.getPath(), false);
|
||||
|
||||
Assertions.assertTrue(smallCopy.exists(), "small file fail to copy (not created)");
|
||||
Assertions.assertTrue(small.exists(), "small file : original file deleted");
|
||||
Assertions.assertEquals(smallCopy.length(), small.length(), "Size error");
|
||||
|
||||
File medium = this.buildFile("medium.txt", 30L * 1024L * 1024L);
|
||||
medium.deleteOnExit();
|
||||
File mediumCopy = new File(repCopy.getPath(), "medium.txt");
|
||||
mediumCopy.deleteOnExit();
|
||||
|
||||
FileCopy.copyFile(medium.getPath(), mediumCopy.getPath(), false);
|
||||
|
||||
Assertions.assertTrue(mediumCopy.exists(), "medium file fail to copy (not created)");
|
||||
Assertions.assertTrue(medium.exists(), "medium file : original file deleted");
|
||||
Assertions.assertEquals(mediumCopy.length(), medium.length(), "Size error");
|
||||
|
||||
File large = this.buildFile("large.txt", 110L * 1024L * 1024L);
|
||||
large.deleteOnExit();
|
||||
long startTime = System.nanoTime();
|
||||
File largeCopy = new File(repCopy.getPath(), "large.txt");
|
||||
long duration = System.nanoTime() - startTime;
|
||||
System.out.println("Duration for 110 Mo file : " + TimeUnit.NANOSECONDS.toMicros(duration) + " µs");
|
||||
largeCopy.deleteOnExit();
|
||||
|
||||
FileCopy.copyFile(large.getPath(), largeCopy.getPath(), false);
|
||||
|
||||
Assertions.assertTrue(largeCopy.exists(), "small file fail to copy (not created)");
|
||||
Assertions.assertTrue(large.exists(), "small file : original file deleted");
|
||||
Assertions.assertEquals(largeCopy.length(), large.length(), "Size error");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCopyMv() throws Exception {
|
||||
final URL repCopy = Thread.currentThread().getContextClassLoader().getResource("copy");
|
||||
|
||||
File file = this.buildFile("fileToMove.txt", 10L * 1024L);
|
||||
file.deleteOnExit();
|
||||
File copy = new File(repCopy.getPath(), "fileToMove.txt");
|
||||
long referenceSize = file.length();
|
||||
if (copy.exists()) {
|
||||
copy.delete();
|
||||
}
|
||||
copy.deleteOnExit();
|
||||
|
||||
FileCopy.copyFile(file.getPath(), copy.getPath(), true);
|
||||
|
||||
Assertions.assertFalse(file.exists(), "file not delete");
|
||||
Assertions.assertTrue(copy.exists(), "small file : original file deleted");
|
||||
Assertions.assertEquals(referenceSize, copy.length(), "Size error");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCopyWithDelete() throws Exception {
|
||||
final URL repCopy = Thread.currentThread().getContextClassLoader().getResource("copy");
|
||||
|
||||
File file = this.buildFile("fileToDelete.txt", 10L * 1024L);
|
||||
file.deleteOnExit();
|
||||
File copy = new File(repCopy.getPath(), "fileToDelete.txt");
|
||||
long referenceSize = file.length();
|
||||
if (!copy.exists()) {
|
||||
copy.createNewFile();
|
||||
}
|
||||
copy.deleteOnExit();
|
||||
|
||||
FileCopy.copyFile(file.getPath(), copy.getPath(), true);
|
||||
|
||||
Assertions.assertFalse(file.exists(), "file not delete");
|
||||
Assertions.assertTrue(copy.exists(), "small file : original file deleted");
|
||||
Assertions.assertEquals(referenceSize, copy.length(), "Size error");
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a new file for testing.
|
||||
*
|
||||
* @param name : name of file.
|
||||
* @param minSize : minimum size.
|
||||
* @return the new file.
|
||||
* @throws IOException : on IO pb.
|
||||
*/
|
||||
private File buildFile(String name, long minSize) throws IOException {
|
||||
final URL repGenerated = Thread.currentThread().getContextClassLoader().getResource("generated");
|
||||
final File generatedFile = new File(repGenerated.getPath(), name);
|
||||
if (generatedFile.exists()) {
|
||||
generatedFile.delete();
|
||||
}
|
||||
final String data = "{ data to put in generated file for it have the desired sized }" + System.lineSeparator();
|
||||
|
||||
long nbeIteration = (minSize / data.length()) + 1;
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(generatedFile.toPath(), StandardOpenOption.CREATE)) {
|
||||
for (long i = 0; i < nbeIteration; i++) {
|
||||
writer.append(data);
|
||||
}
|
||||
}
|
||||
|
||||
return generatedFile;
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
Just here to not have an empty directory.
|
||||
@@ -1 +0,0 @@
|
||||
Just here to not have an empty directory.
|
||||
@@ -7,7 +7,7 @@
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.4.2-talend</version>
|
||||
<version>2.4.1-talend</version>
|
||||
<name>json-lib</name>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package net.sf.json.util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONException;
|
||||
import net.sf.json.JSONNull;
|
||||
@@ -415,7 +414,7 @@ public class JSONTokener {
|
||||
}
|
||||
|
||||
try{
|
||||
return createNumber(s);
|
||||
return NumberUtils.createNumber(s);
|
||||
}catch( Exception e ){
|
||||
return s;
|
||||
}
|
||||
@@ -436,26 +435,6 @@ public class JSONTokener {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method has been added to fix https://jira.talendforge.org/browse/TDI-42689
|
||||
*
|
||||
* @param s The String representation of the number
|
||||
* @return The Number instance
|
||||
*/
|
||||
private Number createNumber(String s){
|
||||
boolean isDecimal = s.indexOf('.') != -1;
|
||||
|
||||
if(isDecimal){
|
||||
Double d = Double.valueOf(s);
|
||||
if(Double.POSITIVE_INFINITY == Math.abs(d)){
|
||||
return new BigDecimal(s);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
return NumberUtils.createNumber(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Look at the next character in the source string.
|
||||
*
|
||||
|
||||
@@ -184,12 +184,14 @@ public final class JSONUtils {
|
||||
return Integer.class;
|
||||
}else if( isLong( n ) ){
|
||||
return Long.class;
|
||||
}else if( isFloat( n ) ){
|
||||
return Float.class;
|
||||
}else if( isBigInteger( n ) ){
|
||||
return BigInteger.class;
|
||||
}else if( isDouble( n ) ){
|
||||
return Double.class;
|
||||
}else if( isBigDecimal( n ) ){
|
||||
return BigDecimal.class;
|
||||
}else if( isDouble( n ) ){
|
||||
return Double.class;
|
||||
}else{
|
||||
throw new JSONException( "Unsupported type" );
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import net.sf.json.processors.PropertyNameProcessor;
|
||||
import net.sf.json.sample.BeanA;
|
||||
import net.sf.json.sample.BeanB;
|
||||
import net.sf.json.sample.BeanC;
|
||||
import net.sf.json.sample.BeanD;
|
||||
import net.sf.json.sample.BeanFoo;
|
||||
import net.sf.json.sample.BeanWithFunc;
|
||||
import net.sf.json.sample.ChildBean;
|
||||
@@ -1043,17 +1042,6 @@ public class TestJSONObject extends TestCase {
|
||||
JSONArray.toArray( jsonObject.getJSONArray( "intarray" ) ) );
|
||||
}
|
||||
|
||||
public void testToBean_BeanD() {
|
||||
String json = "{bool:true,integer:1,string:\"json\",doublearray:[4.2424245783E7, 123456789.2424245783E7, 6.0]}";
|
||||
JSONObject jsonObject = JSONObject.fromObject( json );
|
||||
BeanD bean = (BeanD) JSONObject.toBean( jsonObject, BeanD.class );
|
||||
assertEquals( jsonObject.get( "bool" ), Boolean.valueOf( bean.isBool() ) );
|
||||
assertEquals( jsonObject.get( "integer" ), new Integer( bean.getInteger() ) );
|
||||
assertEquals( jsonObject.get( "string" ), bean.getString() );
|
||||
Assertions.assertEquals( bean.getDoublearray(),
|
||||
JSONArray.toArray( jsonObject.getJSONArray( "doublearray" ) ) );
|
||||
}
|
||||
|
||||
public void testToBean_ClassBean() {
|
||||
JSONObject json = new JSONObject();
|
||||
json.element( "klass", "java.lang.Object" );
|
||||
@@ -1062,29 +1050,9 @@ public class TestJSONObject extends TestCase {
|
||||
assertEquals( Object.class, bean.getKlass() );
|
||||
}
|
||||
|
||||
public void testToBean_DynaBean__BigInteger_Double() {
|
||||
BigInteger l = new BigDecimal( "1.7976931348623157E308" ).toBigInteger();
|
||||
BigDecimal m = new BigDecimal( "1.7976931348623157E307" ).add( new BigDecimal( "0.0001" ) );
|
||||
JSONObject json = new JSONObject().element( "i", BigInteger.ZERO )
|
||||
.element( "d", MorphUtils.BIGDECIMAL_ONE )
|
||||
.element( "bi", l )
|
||||
.element( "bd", m );
|
||||
Object bean = JSONObject.toBean( json );
|
||||
Object i = ((MorphDynaBean) bean).get( "i" );
|
||||
Object d = ((MorphDynaBean) bean).get( "d" );
|
||||
assertTrue( i instanceof Integer );
|
||||
assertTrue( d instanceof Integer );
|
||||
|
||||
Object bi = ((MorphDynaBean) bean).get( "bi" );
|
||||
Object bd = ((MorphDynaBean) bean).get( "bd" );
|
||||
assertTrue( bi instanceof BigInteger );
|
||||
assertTrue( bd instanceof Double );
|
||||
}
|
||||
|
||||
|
||||
public void testToBean_DynaBean__BigInteger_BigDecimal() {
|
||||
BigInteger l = new BigDecimal( "1.7976931348623157E308" ).toBigInteger();
|
||||
BigDecimal m = new BigDecimal( "-1.7976931348623157E309" ).add( new BigDecimal( "0.0001" ) );
|
||||
BigDecimal m = new BigDecimal( "1.7976931348623157E307" ).add( new BigDecimal( "0.0001" ) );
|
||||
JSONObject json = new JSONObject().element( "i", BigInteger.ZERO )
|
||||
.element( "d", MorphUtils.BIGDECIMAL_ONE )
|
||||
.element( "bi", l )
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.sf.json.sample;
|
||||
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Andres Almiray <aalmiray@users.sourceforge.net>
|
||||
*/
|
||||
public class BeanD extends BeanA {
|
||||
private Double[] doublearray = new Double[3];
|
||||
|
||||
public Double[] getDoublearray() {
|
||||
return doublearray;
|
||||
}
|
||||
|
||||
public void setDoublearray(Double[] doublearray) {
|
||||
this.doublearray = doublearray;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString( this, ToStringStyle.MULTI_LINE_STYLE );
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
package net.sf.json.util;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import net.sf.json.JSONFunction;
|
||||
@@ -94,7 +93,7 @@ public class TestJSONBuilder extends TestCase {
|
||||
.endObject();
|
||||
JSONObject jsonObj = JSONObject.fromObject( w.toString() );
|
||||
assertEquals( Boolean.TRUE, jsonObj.get( "bool" ) );
|
||||
assertEquals( Double.valueOf( "1.1" ), jsonObj.get( "numDouble" ) );
|
||||
assertEquals( new Double( 1.1d ), jsonObj.get( "numDouble" ) );
|
||||
assertEquals( new Long( 2 ).longValue(), ((Number) jsonObj.get( "numInt" )).longValue() );
|
||||
assertEquals( "text", jsonObj.get( "text" ) );
|
||||
assertTrue( JSONUtils.isFunction( jsonObj.get( "func" ) ) );
|
||||
|
||||
@@ -20,8 +20,6 @@ import junit.framework.TestCase;
|
||||
import net.sf.json.JSONFunction;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Andres Almiray <aalmiray@users.sourceforge.net>
|
||||
*/
|
||||
@@ -87,7 +85,7 @@ public class TestJSONStringer extends TestCase {
|
||||
.endObject();
|
||||
JSONObject jsonObj = JSONObject.fromObject( b.toString() );
|
||||
assertEquals( Boolean.TRUE, jsonObj.get( "bool" ) );
|
||||
assertEquals( Double.valueOf( "1.1" ), jsonObj.get( "numDouble" ) );
|
||||
assertEquals( new Double( 1.1d ), jsonObj.get( "numDouble" ) );
|
||||
assertEquals( new Long( 2 ).longValue(), ((Number) jsonObj.get( "numInt" )).longValue() );
|
||||
assertEquals( "text", jsonObj.get( "text" ) );
|
||||
assertTrue( JSONUtils.isFunction( jsonObj.get( "func" ) ) );
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>talend-codegen-utils</artifactId>
|
||||
<!-- release for revert version of library -->
|
||||
<version>0.28.0</version>
|
||||
<version>0.25.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -51,8 +51,6 @@ public final class TypeConverter {
|
||||
|
||||
public static final String LIST = "id_List";
|
||||
|
||||
public static final String OBJECT = "id_Object";
|
||||
|
||||
private TypeConverter() {
|
||||
// Class provides static utility methods and shouldn't be instantiated
|
||||
}
|
||||
@@ -169,8 +167,6 @@ public final class TypeConverter {
|
||||
return SHORT;
|
||||
case "java.util.Date":
|
||||
return DATE;
|
||||
case "java.lang.Object":
|
||||
return OBJECT;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unrecognized java class " + javaClass);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.talend.components.lib</groupId>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>talend-db-exasol</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>talend-db-exasol</name>
|
||||
|
||||
@@ -94,11 +94,12 @@ public class EXABulkUtil {
|
||||
private String createNumberFormat(Integer length, Integer precision, boolean hasGroups) {
|
||||
if (length != null && length.intValue() > 0) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = length - 1; i >= 0; i--) {
|
||||
if(hasGroups && i < length - 1 && i > 0 && (i % 3 == 2)) {
|
||||
sb.append("G");
|
||||
}
|
||||
sb.append("9");
|
||||
int numGroups = (length.intValue() / 3) + 1;
|
||||
for (int i = 0; i < numGroups; i++) {
|
||||
if (i > 0 && hasGroups) {
|
||||
sb.append("G");
|
||||
}
|
||||
sb.append("999");
|
||||
}
|
||||
if (precision != null && precision.intValue() > 0) {
|
||||
sb.append("D");
|
||||
|
||||
@@ -258,80 +258,76 @@
|
||||
|
||||
com.google.api.services.bigquery.model.JobConfiguration config_<%=cid%> = new com.google.api.services.bigquery.model.JobConfiguration();
|
||||
com.google.api.services.bigquery.model.JobConfigurationLoad queryLoad_<%=cid%> = new com.google.api.services.bigquery.model.JobConfigurationLoad();
|
||||
|
||||
if (<%=ElementParameterParser.getBooleanValue(node, "__CREATE_TABLE_IF_NOT_EXIST__")%>) {
|
||||
com.google.api.services.bigquery.model.TableSchema schema_<%=cid%> = new com.google.api.services.bigquery.model.TableSchema();
|
||||
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.info("<%=cid%> - Table field schema:");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
java.util.List<com.google.api.services.bigquery.model.TableFieldSchema> fields_<%=cid%> = new java.util.ArrayList<com.google.api.services.bigquery.model.TableFieldSchema>();
|
||||
<%
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas!=null) && (metadatas.size() > 0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata != null) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int nbColumns = columns.size();
|
||||
for (int i = 0; i < nbColumns; i++ ) {
|
||||
IMetadataColumn column = columns.get(i);
|
||||
String columnName = column.getLabel();
|
||||
String typeToGenerate = "string";
|
||||
if("id_Float".equals(column.getTalendType()) || "id_Double".equals(column.getTalendType())) {
|
||||
typeToGenerate = "float";
|
||||
}else if("id_Integer".equals(column.getTalendType()) || "id_Long".equals(column.getTalendType()) || "id_Short".equals(column.getTalendType())) {
|
||||
typeToGenerate = "integer";
|
||||
} else if("id_Character".equals(column.getTalendType())) {
|
||||
typeToGenerate = "string";
|
||||
} else if("id_BigDecimal".equals(column.getTalendType())) {
|
||||
typeToGenerate = "numeric";
|
||||
} else if("id_Boolean".equals(column.getTalendType())) {
|
||||
typeToGenerate = "boolean";
|
||||
} else if("id_Date".equals(column.getTalendType())) {
|
||||
String pattern = column.getPattern();
|
||||
if(pattern.length() == 12 || pattern.isEmpty() || "\"\"".equals(pattern)) {
|
||||
typeToGenerate = "date";
|
||||
}else if(pattern.length() > 12){
|
||||
typeToGenerate = "timestamp";
|
||||
}else{
|
||||
typeToGenerate = "string";
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%
|
||||
String modeType = null;
|
||||
if (!column.isNullable()) {
|
||||
modeType = "REQUIRED";
|
||||
} else {
|
||||
modeType = "NULLABLE";
|
||||
}
|
||||
%>
|
||||
com.google.api.services.bigquery.model.TableFieldSchema <%=columnName%>_<%=cid%> = new com.google.api.services.bigquery.model.TableFieldSchema();
|
||||
<%=columnName%>_<%=cid%>.setName("<%=columnName%>");
|
||||
<%=columnName%>_<%=cid%>.setType("<%=typeToGenerate%>");
|
||||
<%=columnName%>_<%=cid%>.setMode("<%=modeType%>");
|
||||
fields_<%=cid%>.add(<%=columnName%>_<%=cid%>);
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.debug("<%=cid%> - Field index[<%=i%>] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\",\"mode\":\"<%=modeType%>\"}");
|
||||
<%
|
||||
com.google.api.services.bigquery.model.TableSchema schema_<%=cid%> = new com.google.api.services.bigquery.model.TableSchema();
|
||||
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.info("<%=cid%> - Table field schema:");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
java.util.List<com.google.api.services.bigquery.model.TableFieldSchema> fields_<%=cid%> = new java.util.ArrayList<com.google.api.services.bigquery.model.TableFieldSchema>();
|
||||
<%
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas!=null) && (metadatas.size() > 0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata != null) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int nbColumns = columns.size();
|
||||
for (int i = 0; i < nbColumns; i++ ) {
|
||||
IMetadataColumn column = columns.get(i);
|
||||
String columnName = column.getLabel();
|
||||
String typeToGenerate = "string";
|
||||
if("id_Float".equals(column.getTalendType()) || "id_Double".equals(column.getTalendType())) {
|
||||
typeToGenerate = "float";
|
||||
}else if("id_Integer".equals(column.getTalendType()) || "id_Long".equals(column.getTalendType()) || "id_Short".equals(column.getTalendType())) {
|
||||
typeToGenerate = "integer";
|
||||
} else if("id_Character".equals(column.getTalendType())) {
|
||||
typeToGenerate = "string";
|
||||
} else if("id_BigDecimal".equals(column.getTalendType())) {
|
||||
typeToGenerate = "numeric";
|
||||
} else if("id_Boolean".equals(column.getTalendType())) {
|
||||
typeToGenerate = "boolean";
|
||||
} else if("id_Date".equals(column.getTalendType())) {
|
||||
String pattern = column.getPattern();
|
||||
if(pattern.length() == 12 || pattern.isEmpty() || "\"\"".equals(pattern)) {
|
||||
typeToGenerate = "date";
|
||||
}else if(pattern.length() > 12){
|
||||
typeToGenerate = "timestamp";
|
||||
}else{
|
||||
typeToGenerate = "string";
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%
|
||||
String modeType = null;
|
||||
if (!column.isNullable()) {
|
||||
modeType = "REQUIRED";
|
||||
} else {
|
||||
modeType = "NULLABLE";
|
||||
}
|
||||
%>
|
||||
com.google.api.services.bigquery.model.TableFieldSchema <%=columnName%>_<%=cid%> = new com.google.api.services.bigquery.model.TableFieldSchema();
|
||||
<%=columnName%>_<%=cid%>.setName("<%=columnName%>");
|
||||
<%=columnName%>_<%=cid%>.setType("<%=typeToGenerate%>");
|
||||
<%=columnName%>_<%=cid%>.setMode("<%=modeType%>");
|
||||
fields_<%=cid%>.add(<%=columnName%>_<%=cid%>);
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.debug("<%=cid%> - Field index[<%=i%>] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\",\"mode\":\"<%=modeType%>\"}");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
schema_<%=cid%>.setFields(fields_<%=cid%>);
|
||||
|
||||
queryLoad_<%=cid%>.setSchema(schema_<%=cid%>);
|
||||
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
schema_<%=cid%>.setFields(fields_<%=cid%>);
|
||||
|
||||
queryLoad_<%=cid%>.setSchema(schema_<%=cid%>);
|
||||
<%
|
||||
if("true".equals(ElementParameterParser.getValue(node, "__CREATE_TABLE_IF_NOT_EXIST__"))) {
|
||||
%>
|
||||
@@ -583,7 +579,7 @@
|
||||
|
||||
loadJobBuilder_<%=cid%>.setNullMarker("\\N");
|
||||
com.google.cloud.bigquery.Job job_<%=cid%> = bigquery_<%=cid%>.create(com.google.cloud.bigquery.JobInfo.of(loadJobBuilder_<%=cid%>.build()));
|
||||
job_<%=cid%> = job_<%=cid%>.waitFor(com.google.cloud.RetryOption.initialRetryDelay(org.threeten.bp.Duration.ofSeconds(1)));
|
||||
job_<%=cid%> = job_<%=cid%>.waitFor(com.google.cloud.RetryOption.initialRetryDelay(org.threeten.bp.Duration.ofSeconds(1)), com.google.cloud.RetryOption.totalTimeout(org.threeten.bp.Duration.ofSeconds(30)));
|
||||
if (job_<%=cid%> != null && job_<%=cid%>.getStatus().getError() == null) {
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
|
||||
<PARAMETER
|
||||
NAME="DBTYPE"
|
||||
REPOSITORY_VALUE="DBTYPE"
|
||||
FIELD="CLOSED_LIST"
|
||||
NUM_ROW="10"
|
||||
>
|
||||
|
||||
@@ -36,8 +36,6 @@ skeleton="@{org.talend.designer.components.localprovider}/components/templates/d
|
||||
String defaultDateFormat = ElementParameterParser.getValue(node, "__DEFAULT_DATE_FORMAT__");
|
||||
String defaultTimestampFormat = ElementParameterParser.getValue(node, "__DEFAULT_TIMESTAMP_FORMAT__");
|
||||
String numGroupSep = ElementParameterParser.getValue(node, "__THOUSANDS_SEPARATOR__");
|
||||
boolean useLenPrecision = "true".equals(ElementParameterParser.getValue(node, "__USE_PRECISION_LENGTH_FROM_SCHEMA__"));
|
||||
|
||||
if (numGroupSep == null|| numGroupSep.trim().isEmpty()) {
|
||||
numGroupSep = "null";
|
||||
}
|
||||
@@ -209,24 +207,12 @@ org.talend.database.exasol.imp.EXABulkUtil <%=cid%> = new org.talend.database.ex
|
||||
String lengthStr = "null";
|
||||
String precisionStr = "null";
|
||||
Integer length = column.getLength();
|
||||
if(useLenPrecision) {
|
||||
if (length != null) {
|
||||
lengthStr = String.valueOf(length);
|
||||
}
|
||||
} else {
|
||||
if (length != null && hasGroupSep) {
|
||||
lengthStr = String.valueOf(length);
|
||||
}
|
||||
}
|
||||
if (length != null) {
|
||||
lengthStr = String.valueOf(length);
|
||||
}
|
||||
Integer precision = column.getPrecision();
|
||||
if(useLenPrecision) {
|
||||
if (precision != null) {
|
||||
precisionStr = String.valueOf(precision);
|
||||
}
|
||||
} else {
|
||||
if (precision != null && hasGroupSep) {
|
||||
precisionStr = String.valueOf(precision);
|
||||
}
|
||||
if (precision != null) {
|
||||
precisionStr = String.valueOf(precision);
|
||||
}
|
||||
String talendType = column.getTalendType();
|
||||
if ("id_Date".equals(talendType)
|
||||
|
||||
@@ -635,23 +635,14 @@
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_PRECISION_LENGTH_FROM_SCHEMA"
|
||||
FIELD="CHECK"
|
||||
NUM_ROW="115"
|
||||
REQUIRED="true"
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-EXASolution" MODULE="exajdbc-6.0.9302.jar" MVN="mvn:org.talend.libraries/exajdbc-6.0.9302/6.3.0" REQUIRED="true" />
|
||||
<IMPORT NAME="Talend-DB-Exasol-Util" MODULE="talend-db-exasol-2.1.4.jar" MVN="mvn:org.talend.components.lib/talend-db-exasol/2.1.4"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.jdbc.exasol/lib/talend-db-exasol-2.1.4.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="Talend-DB-Exasol-Util" MODULE="talend-db-exasol-2.1.2.jar" MVN="mvn:org.talend.libraries/talend-db-exasol-2.1.2/6.2.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.jdbc.exasol/lib/talend-db-exasol-2.1.2.jar" REQUIRED="true" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -108,6 +108,4 @@ NB_LINE_INSERTED.NAME=Rows inserted
|
||||
NB_LINE_DELETED.NAME=Rows deleted
|
||||
SOURCE_QUERY.NAME=Source query
|
||||
|
||||
TEST_MODE.NAME=Test mode (no statements are executed)
|
||||
|
||||
USE_PRECISION_LENGTH_FROM_SCHEMA.NAME=Use precision and length from schema
|
||||
TEST_MODE.NAME=Test mode (no statements are executed)
|
||||
@@ -178,7 +178,7 @@
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Java_DOM4J1.6" MODULE="dom4j-1.6.1.jar" MVN="mvn:dom4j/dom4j/1.6.1" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/dom4j-1.6.1.jar" REQUIRED_IF="READ_BY == 'XPATH'" BundleID="" />
|
||||
<IMPORT NAME="Java_JAXEN1.1" MODULE="jaxen-1.1.1.jar" MVN="mvn:org.talend.libraries/jaxen-1.1.1/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/jaxen-1.1.1.jar" REQUIRED_IF="READ_BY == 'XPATH'" BundleID="" />
|
||||
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.2-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.2-talend" REQUIRED_IF="READ_BY == 'XPATH'" />
|
||||
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.1-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.1-talend" REQUIRED_IF="READ_BY == 'XPATH'" />
|
||||
<IMPORT NAME="commons_lang" MODULE="commons-lang-2.6.jar" MVN="mvn:commons-lang/commons-lang/2.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.6.jar" REQUIRED_IF="READ_BY == 'XPATH'" />
|
||||
<IMPORT NAME="commons_logging" MODULE="commons-logging-1.1.1.jar" MVN="mvn:org.talend.libraries/commons-logging-1.1.1/6.0.0" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar" REQUIRED_IF="READ_BY == 'XPATH'" />
|
||||
<IMPORT NAME="ezmorph" MODULE="ezmorph-1.0.6.jar" MVN="mvn:org.talend.libraries/ezmorph-1.0.6/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.jackson/lib/ezmorph-1.0.6.jar" REQUIRED_IF="READ_BY == 'XPATH'" />
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false')"/>
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true')"/>
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar" MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819" REQUIRED_IF="(FTPS == 'true')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar" MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" REQUIRED_IF="(FTPS == 'true')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -296,8 +296,8 @@
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="jakarta-oro" MODULE="jakarta-oro-2.0.8.jar" MVN="mvn:org.talend.libraries/jakarta-oro-2.0.8/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/jakarta-oro-2.0.8.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -283,8 +283,8 @@ COMPATIBILITY="ALL"
|
||||
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -261,8 +261,8 @@
|
||||
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -258,8 +258,8 @@
|
||||
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -302,8 +302,8 @@ COMPATIBILITY="ALL"
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="jakarta-oro" MODULE="jakarta-oro-2.0.8.jar" MVN="mvn:org.talend.libraries/jakarta-oro-2.0.8/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/jakarta-oro-2.0.8.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -346,8 +346,8 @@ COMPATIBILITY="ALL"
|
||||
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -264,8 +264,8 @@ COMPATIBILITY="ALL"
|
||||
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -253,8 +253,8 @@ COMPATIBILITY="ALL"
|
||||
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
|
||||
<IMPORT NAME="jakarta-oro" MODULE="jakarta-oro-2.0.8.jar" MVN="mvn:org.talend.libraries/jakarta-oro-2.0.8/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/jakarta-oro-2.0.8.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
|
||||
MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
|
||||
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar"
|
||||
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
Binary file not shown.
@@ -143,10 +143,7 @@
|
||||
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="filecopy" MODULE="filecopy-2.0.0.jar"
|
||||
MVN="mvn:org.talend.libraries/filecopy/2.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.custom/lib/filecopy-2.0.0.jar"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="filecopy" MODULE="filecopy.jar" MVN="mvn:org.talend.libraries/filecopy/6.0.0" REQUIRED="true" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -253,6 +253,9 @@ if ("http".equals(protocol) || "https".equals(protocol)) {
|
||||
client_<%=cid %>.getState().setProxyCredentials(
|
||||
new org.apache.commons.httpclient.auth.AuthScope(<%=proxyHost %>, Integer.parseInt(<%=proxyPort%>), null),
|
||||
new org.apache.commons.httpclient.UsernamePasswordCredentials(<%=proxyUser %>, decryptedPassword_<%=cid%>));
|
||||
|
||||
java.util.List<String> authPrefs_<%=cid %> = java.util.Collections.singletonList(org.apache.commons.httpclient.auth.AuthPolicy.BASIC);
|
||||
client_<%=cid %>.getParams().setParameter(org.apache.commons.httpclient.auth.AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs_<%=cid %>);
|
||||
<%}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
REQUIRED_IF="(READ_BY == 'XPATH')" BundleID="" />
|
||||
<IMPORT NAME="Java_JAXEN1.1" MODULE="jaxen-1.1.1.jar" MVN="mvn:org.talend.libraries/jaxen-1.1.1/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/jaxen-1.1.1.jar"
|
||||
REQUIRED_IF="(READ_BY == 'XPATH')" BundleID="" />
|
||||
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.2-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.2-talend" REQUIRED_IF="(READ_BY == 'XPATH')" />
|
||||
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.1-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.1-talend" REQUIRED_IF="(READ_BY == 'XPATH')" />
|
||||
<IMPORT NAME="commons_lang" MODULE="commons-lang-2.6.jar" MVN="mvn:commons-lang/commons-lang/2.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.6.jar"
|
||||
REQUIRED_IF="(READ_BY == 'XPATH')" />
|
||||
<IMPORT NAME="commons_logging" MODULE="commons-logging-1.1.1.jar" MVN="mvn:org.talend.libraries/commons-logging-1.1.1/6.0.0" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar"
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Java_Excel" MODULE="jxl.jar" MVN="mvn:org.talend.libraries/jxl/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.jexcel/lib/jxl.jar" REQUIRED_IF="(VERSION_2007 == 'false')" />
|
||||
<IMPORT NAME="TALEND_EXCEL" MODULE="talendExcel-1.5-20190731.jar" MVN="mvn:org.talend.libraries/talendExcel-1.5-20190731/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.excel/lib/talendExcel-1.5-20190731.jar" REQUIRED_IF="(VERSION_2007 == 'true')" />
|
||||
<IMPORT NAME="TALEND_EXCEL" MODULE="talendExcel-1.4-20190531.jar" MVN="mvn:org.talend.libraries/talendExcel-1.4-20190531/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.excel/lib/talendExcel-1.4-20190531.jar" REQUIRED_IF="(VERSION_2007 == 'true')" />
|
||||
<IMPORT NAME="commons-lang3" MODULE="commons-lang3-3.8.1.jar" MVN="mvn:org.apache.commons/commons-lang3/3.8.1" REQUIRED_IF="(VERSION_2007 == 'true')" />
|
||||
<IMPORT NAME="dom4j" MODULE="dom4j-1.6.1.jar" MVN="mvn:dom4j/dom4j/1.6.1" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/dom4j-1.6.1.jar" REQUIRED_IF="(VERSION_2007 == 'true')" BundleID="" />
|
||||
<IMPORT NAME="geronimo-stax-api" MODULE="geronimo-stax-api_1.0_spec-1.0.1.jar" MVN="mvn:org.talend.libraries/geronimo-stax-api_1.0_spec-1.0.1/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/geronimo-stax-api_1.0_spec-1.0.1.jar" REQUIRED_IF="(VERSION_2007 == 'true')" BundleID="" />
|
||||
|
||||
@@ -134,12 +134,12 @@
|
||||
|
||||
<!-- S3 -->
|
||||
<PARAMETER NAME="ACCESS_KEY" FIELD="TEXT" NUM_ROW="50"
|
||||
REQUIRED="true" GROUP="S3_CONFIG" SHOW_IF="(DATA_SOURCE_TYPE == 'S3') AND (ASSUME_ROLE == 'false')">
|
||||
REQUIRED="true" GROUP="S3_CONFIG" NOT_SHOW_IF="isShow[ASSUME_ROLE] AND (ASSUME_ROLE == 'true')">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="SECRET_KEY" FIELD="PASSWORD" NUM_ROW="50"
|
||||
REQUIRED="true" GROUP="S3_CONFIG" SHOW_IF="(DATA_SOURCE_TYPE == 'S3') AND (ASSUME_ROLE == 'false')">
|
||||
REQUIRED="true" GROUP="S3_CONFIG" NOT_SHOW_IF="isShow[ASSUME_ROLE] AND (ASSUME_ROLE == 'true')">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
@@ -419,7 +419,7 @@
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-logging-1.1.3.jar"
|
||||
REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar"
|
||||
MVN="mvn:commons-codec/commons-codec/1.6"
|
||||
MVN="mvn:org.talend.libraries/commons-codec-1.6/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar"
|
||||
REQUIRED="true" />
|
||||
</IMPORTS>
|
||||
|
||||
@@ -207,7 +207,6 @@
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9" REQUIRED_IF="(JDBC_URL == 'SSO')" />
|
||||
<IMPORT NAME="httpclient-4.5.5.jar" MODULE="httpclient-4.5.5.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.5" REQUIRED_IF="(JDBC_URL == 'SSO')" />
|
||||
<IMPORT NAME="joda-time-2.8.1.jar" MODULE="joda-time-2.8.1.jar" MVN="mvn:joda-time/joda-time/2.8.1" REQUIRED_IF="(JDBC_URL == 'SSO')" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar" MVN="mvn:commons-codec/commons-codec/1.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar" REQUIRED_IF="(JDBC_URL == 'SSO')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -288,7 +288,6 @@
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="httpclient-4.5.5.jar" MODULE="httpclient-4.5.5.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.5" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="joda-time-2.8.1.jar" MODULE="joda-time-2.8.1.jar" MVN="mvn:joda-time/joda-time/2.8.1" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar" MVN="mvn:commons-codec/commons-codec/1.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -378,7 +378,6 @@
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="httpclient-4.5.5.jar" MODULE="httpclient-4.5.5.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.5" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="joda-time-2.8.1.jar" MODULE="joda-time-2.8.1.jar" MVN="mvn:joda-time/joda-time/2.8.1" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar" MVN="mvn:commons-codec/commons-codec/1.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -538,7 +538,7 @@
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-logging-1.1.3.jar"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar"
|
||||
MVN="mvn:commons-codec/commons-codec/1.6"
|
||||
MVN="mvn:org.talend.libraries/commons-codec-1.6/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar"
|
||||
REQUIRED="true" />
|
||||
</IMPORTS>
|
||||
|
||||
@@ -306,7 +306,6 @@
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="httpclient-4.5.5.jar" MODULE="httpclient-4.5.5.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.5" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="joda-time-2.8.1.jar" MODULE="joda-time-2.8.1.jar" MVN="mvn:joda-time/joda-time/2.8.1" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar" MVN="mvn:commons-codec/commons-codec/1.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -281,7 +281,6 @@
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="httpclient-4.5.5.jar" MODULE="httpclient-4.5.5.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.5" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="joda-time-2.8.1.jar" MODULE="joda-time-2.8.1.jar" MVN="mvn:joda-time/joda-time/2.8.1" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="commons-codec-1.6.jar" MODULE="commons-codec-1.6.jar" MVN="mvn:commons-codec/commons-codec/1.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.6.jar" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
<RETURNS />
|
||||
|
||||
@@ -425,7 +425,7 @@ String inputConnName = null;
|
||||
%>
|
||||
<%=childJob %> childJob_<%=cid %> = new <%=childJob %>();
|
||||
<%
|
||||
if (ProcessorUtilities.isEsbJob(currentProcess)) {
|
||||
if (ProcessorUtilities.isEsbJob(process, version)) {
|
||||
%>
|
||||
childJob_<%=cid %>.setEndpointRegistry(registry);
|
||||
<%
|
||||
@@ -572,9 +572,7 @@ String inputConnName = null;
|
||||
reader.close();
|
||||
}
|
||||
} catch (java.io.IOException ioe) {
|
||||
<%if(isLog4jEnabled){%>
|
||||
log.error("<%=cid %> - " + ioe.getMessage());
|
||||
<%}%>
|
||||
log.error("<%=cid %> - " + ioe.getMessage());
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -598,9 +596,7 @@ String inputConnName = null;
|
||||
reader.close();
|
||||
}
|
||||
} catch (java.io.IOException ioe) {
|
||||
<%if(isLog4jEnabled){%>
|
||||
log.error("<%=cid %> - " + ioe.getMessage());
|
||||
<%}%>
|
||||
log.error("<%=cid %> - " + ioe.getMessage());
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -634,9 +630,7 @@ String inputConnName = null;
|
||||
normal_<%=cid %>.join(10000);
|
||||
error_<%=cid %>.join(10000);
|
||||
} catch (ThreadDeath tde) {
|
||||
<%if(isLog4jEnabled){%>
|
||||
log.error("<%=cid %> - thread was terminated.");
|
||||
<%}%>
|
||||
log.error("<%=cid %> - thread was terminated.");
|
||||
ps_<%=cid %>.destroy();
|
||||
throw tde;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
com.amazonaws.auth.AWSCredentialsProvider credentialsProvider_<%=cid%> = new com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper();
|
||||
com.amazonaws.auth.AWSCredentialsProvider credentialsProvider_<%=cid%> = new com.amazonaws.auth.InstanceProfileCredentialsProvider();
|
||||
<%
|
||||
}
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
java.util.List
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Input/HelpClass.javajet"%>
|
||||
<%
|
||||
|
||||
class DBInputBeginUtil extends DefaultDBInputUtil{
|
||||
|
||||
public void setURL(INode node) {
|
||||
|
||||
String jdbcUrl = ElementParameterParser.getValue(node, "__URL__");
|
||||
%>
|
||||
String url_<%=cid %> = <%=jdbcUrl%>;
|
||||
<%
|
||||
}
|
||||
|
||||
public String getDirverClassName(INode node){
|
||||
return "org.jdbc4olap.jdbc.OlapDriver";
|
||||
}
|
||||
|
||||
//-----------according schema type to generate ResultSet
|
||||
public void generateTimestampResultSet(String firstConnName, IMetadataColumn column, int currentColNo) {
|
||||
%>
|
||||
java.util.Date date_<%=cid%> = null;
|
||||
try{
|
||||
date_<%=cid%> = rs_<%=cid %>.getTimestamp(<%if(isDynamic){%>column_index_<%=cid%><%}else{%><%=currentColNo%><%}%>);
|
||||
}catch(java.lang.Exception e){
|
||||
date_<%=cid%> = rs_<%=cid %>.getDate(<%if(isDynamic){%>column_index_<%=cid%><%}else{%><%=currentColNo%><%}%>);
|
||||
}
|
||||
<%=firstConnName%>.<%=column.getLabel()%> = date_<%=cid%>;
|
||||
<%
|
||||
}
|
||||
|
||||
//---------end according schema type to generate ResultSet
|
||||
}//end class
|
||||
|
||||
dbInputBeginUtil = new DBInputBeginUtil();
|
||||
%>
|
||||
|
||||
<%@ include file="../templates/DB/Input/AbstractDBInputBegin.javajet"%>
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
"
|
||||
%>
|
||||
|
||||
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
%>
|
||||
}
|
||||
}finally{
|
||||
if(rs_<%=cid%> !=null){
|
||||
rs_<%=cid %>.close();
|
||||
}
|
||||
stmt_<%=cid%>.close();
|
||||
|
||||
if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed()) {
|
||||
<%log4jCodeGenerateUtil.close(node);%>
|
||||
}
|
||||
}
|
||||
globalMap.put("<%=cid %>_NB_LINE", nb_line_<%=cid%>);
|
||||
<%
|
||||
log4jCodeGenerateUtil.retrieveRecordsCount(node);
|
||||
%>
|
||||
|
||||
|
||||
@@ -41,6 +41,16 @@
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="DRIVER_CLASS" FIELD="TEXT" NUM_ROW="50"
|
||||
REQUIRED="true" SHOW="false">
|
||||
<DEFAULT>"org.jdbc4olap.jdbc.OlapDriver"</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="CODE" FIELD="MEMO_JAVA" RAW="true" REQUIRED="false"
|
||||
NUM_ROW="60" SHOW="false">
|
||||
<DEFAULT></DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="70">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
@@ -58,6 +68,11 @@
|
||||
</PARAMETERS>
|
||||
|
||||
<ADVANCED_PARAMETERS>
|
||||
<PARAMETER NAME="ENCODING" FIELD="ENCODING_TYPE" NUM_ROW="10"
|
||||
REQUIRED="true" SHOW="false">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="TRIM_ALL_COLUMN" FIELD="CHECK" NUM_ROW="20">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
@@ -71,6 +86,28 @@
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
<TEMPLATES INPUT="In" OUTPUT="Out">
|
||||
<TEMPLATE NAME="In" COMPONENT="tJava">
|
||||
<LINK_TO NAME="Out" CTYPE="FLOW" />
|
||||
</TEMPLATE>
|
||||
|
||||
<TEMPLATE NAME="Out" COMPONENT="tJDBCInput" />
|
||||
<TEMPLATE_PARAM SOURCE="self.CODE" TARGET="In.CODE" />
|
||||
|
||||
<TEMPLATE_PARAM SOURCE="self.URL" TARGET="Out.URL" />
|
||||
<TEMPLATE_PARAM SOURCE="self.USER" TARGET="Out.USER" />
|
||||
<TEMPLATE_PARAM SOURCE="self.PASS" TARGET="Out.PASS" />
|
||||
<TEMPLATE_PARAM SOURCE="self.SCHEMA" TARGET="Out.SCHEMA" />
|
||||
<TEMPLATE_PARAM SOURCE="self.DRIVER_CLASS" TARGET="Out.DRIVER_CLASS" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TABLE" TARGET="Out.TABLE" />
|
||||
<TEMPLATE_PARAM SOURCE="self.QUERYSTORE" TARGET="Out.QUERYSTORE" />
|
||||
<TEMPLATE_PARAM SOURCE="self.QUERY" TARGET="Out.QUERY" />
|
||||
|
||||
<TEMPLATE_PARAM SOURCE="self.ENCODING" TARGET="Out.ENCODING" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TRIM_ALL_COLUMN" TARGET="Out.TRIM_ALL_COLUMN" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TRIM_COLUMN" TARGET="Out.TRIM_COLUMN" />
|
||||
|
||||
</TEMPLATES>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-OLAP" MODULE="jdbc4olap-1.1.4.jar" MVN="mvn:org.jdbc4olap/jdbc4olap/1.1.4"
|
||||
REQUIRED="true" />
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<IMPORT NAME="commons_lang" MODULE="commons-lang-2.6.jar" MVN="mvn:commons-lang/commons-lang/2.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.6.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="commons_logging" MODULE="commons-logging-1.1.1.jar" MVN="mvn:org.talend.libraries/commons-logging-1.1.1/6.0.0" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="ezmorph" MODULE="ezmorph-1.0.6.jar" MVN="mvn:org.talend.libraries/ezmorph-1.0.6/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.jackson/lib/ezmorph-1.0.6.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.2-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.2-talend" REQUIRED="true" />
|
||||
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.1-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.1-talend" REQUIRED="true" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ imports="
|
||||
%>
|
||||
String driverClass_<%=cid%> = "<%=this.getDirverClassName(node)%>";
|
||||
java.lang.Class jdbcclazz_<%=cid%> = java.lang.Class.forName(driverClass_<%=cid%>);
|
||||
globalMap.put("driverClass_<%=cid%>", driverClass_<%=cid%>);
|
||||
<%
|
||||
newInstance(node);
|
||||
}
|
||||
|
||||
@@ -165,12 +165,6 @@ imports="
|
||||
close_begin();
|
||||
%>
|
||||
conn_<%=cid%>.close();
|
||||
<% /* TESB-24900 - graceful shutdown for MYSQL connection */ %>
|
||||
if("com.mysql.cj.jdbc.Driver".equals((String)globalMap.get("driverClass_<%=(connection!=null)?connection.replaceAll("'","").trim():""%>"))
|
||||
&& routines.system.BundleUtils.inOSGi()) {
|
||||
Class.forName("com.mysql.cj.jdbc.AbandonedConnectionCleanupThread").
|
||||
getMethod("checkedShutdown").invoke(null, (Object[]) null);
|
||||
}
|
||||
<%
|
||||
close_end();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<thashfile.dir>${project.basedir}/components/tHashInput</thashfile.dir>
|
||||
<thashfile.version>3.0-20170711</thashfile.version>
|
||||
<ftpProxy.dir>${project.basedir}/components/tFTPConnection</ftpProxy.dir>
|
||||
<ftpProxy.version>3.6.1-talend-20190819</ftpProxy.version>
|
||||
<ftpProxy.version>3.6.1-talend-20190128</ftpProxy.version>
|
||||
<talendMQRFH2.dir>${project.basedir}/components/tMomInput</talendMQRFH2.dir>
|
||||
<talendMQRFH2.version>1.0.1-20190206</talendMQRFH2.version>
|
||||
<talendMQConnectionUtil.dir>${project.basedir}/components/tMomConnection</talendMQConnectionUtil.dir>
|
||||
@@ -125,7 +125,7 @@
|
||||
<outputDirectory>${thashfile.dir}</outputDirectory>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.talend.components.lib</groupId>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>commons-net-ftps-proxy</artifactId>
|
||||
<version>${ftpProxy.version}</version>
|
||||
<type>jar</type>
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.beans.PropertyChangeEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.swt.SWT;
|
||||
@@ -127,9 +126,7 @@ public class ButtonController extends AbstractElementPropertySectionController {
|
||||
continue;
|
||||
}
|
||||
for(String path : listString){
|
||||
if (!StringUtils.isBlank(path)) {
|
||||
jars.add(GenericTableUtils.getDriverJarPath(path));
|
||||
}
|
||||
jars.add(GenericTableUtils.getDriverJarPath(path));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1262,7 +1262,7 @@ public class Component extends AbstractBasicComponent {
|
||||
}
|
||||
ModuleNeeded moduleNeeded = new ModuleNeeded(getName(), "", true, "mvn:org.talend.libraries/slf4j-log4j12-1.7.10/6.0.0");
|
||||
componentImportNeedsList.add(moduleNeeded);
|
||||
moduleNeeded = new ModuleNeeded(getName(), "", true, "mvn:org.talend.libraries/talend-codegen-utils/0.28.0");
|
||||
moduleNeeded = new ModuleNeeded(getName(), "", true, "mvn:org.talend.libraries/talend-codegen-utils/0.25.4");
|
||||
componentImportNeedsList.add(moduleNeeded);
|
||||
return componentImportNeedsList;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ import org.talend.designer.core.ui.views.jobsettings.JobSettings;
|
||||
import org.talend.designer.core.ui.views.problems.Problems;
|
||||
import org.talend.designer.core.ui.views.properties.ComponentSettings;
|
||||
import org.talend.designer.core.ui.views.properties.ComponentSettingsView;
|
||||
import org.talend.designer.core.utils.BigDataJobUtil;
|
||||
import org.talend.designer.core.utils.JavaProcessUtil;
|
||||
import org.talend.designer.core.utils.UnifiedComponentUtil;
|
||||
import org.talend.designer.runprocess.ProcessorException;
|
||||
@@ -875,9 +874,4 @@ public class DesignerCoreService implements IDesignerCoreService {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNeedContextInJar(IProcess process) {
|
||||
return new BigDataJobUtil(process).needsToHaveContextInsideJar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,10 +624,8 @@ public class ChangeMetadataCommand extends Command {
|
||||
setTableMAPPING();
|
||||
|
||||
if (!internal) {
|
||||
if (!oldOutputMetadata.sameMetadataAs(newOutputMetadata, IMetadataColumn.OPTIONS_NONE)) {
|
||||
updateColumnList(oldOutputMetadata, newOutputMetadata);
|
||||
((Process) node.getProcess()).checkProcess();
|
||||
}
|
||||
updateColumnList(oldOutputMetadata, newOutputMetadata);
|
||||
((Process) node.getProcess()).checkProcess();
|
||||
}
|
||||
refreshMetadataChanged();
|
||||
}
|
||||
|
||||
@@ -142,9 +142,6 @@ public class ExternalNodeChangeCommand extends Command {
|
||||
}
|
||||
|
||||
for (Connection connection : (List<Connection>) node.getIncomingConnections()) {
|
||||
if (!connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
continue;
|
||||
}
|
||||
String schemaType = (String) connection.getSource().getPropertyValue(EParameterName.SCHEMA_TYPE.getName());
|
||||
if (schemaType != null) {
|
||||
if (schemaType.equals(EmfComponent.REPOSITORY)) {
|
||||
|
||||
@@ -1383,7 +1383,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
// MetadataTool.copyTable(inputTable, targetTable);
|
||||
// add by wzhang for feature 7611.
|
||||
String dbmsId = targetTable.getDbms();
|
||||
MetadataToolHelper.copyTable(inputTable, targetTable, null, false);
|
||||
MetadataToolHelper.copyTable(inputTable, targetTable, null, false, true);
|
||||
MetadataToolHelper.setDBType(targetTable, dbmsId);
|
||||
ChangeMetadataCommand cmc = new ChangeMetadataCommand(this, null,
|
||||
tmpTableCreated ? targetTable : null, targetTable, inputSchemaParam);
|
||||
@@ -1436,7 +1436,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
}
|
||||
boolean isJunitInput = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
|
||||
ITestContainerProviderService testContainerService = GlobalServiceRegister
|
||||
ITestContainerProviderService testContainerService = (ITestContainerProviderService) GlobalServiceRegister
|
||||
.getDefault().getService(ITestContainerProviderService.class);
|
||||
if (testContainerService != null
|
||||
&& testContainerService.isTestCaseComponent(connection.getSource().getComponent())) {
|
||||
@@ -1888,7 +1888,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
connectionToParse = (String) value;
|
||||
boolean isTestCase = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
|
||||
ITestContainerProviderService testContainerService = GlobalServiceRegister
|
||||
ITestContainerProviderService testContainerService = (ITestContainerProviderService) GlobalServiceRegister
|
||||
.getDefault().getService(ITestContainerProviderService.class);
|
||||
isTestCase = getProcess() != null && testContainerService.isTestContainerProcess(getProcess());
|
||||
}
|
||||
@@ -3361,7 +3361,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
private void checkHasMultiPrejobOrPostJobComponents() {
|
||||
Map<String, INode> multiNodes = new HashMap<String, INode>();
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService jobletService = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService jobletService = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (jobletService != null) {
|
||||
// need to check all node from the process
|
||||
@@ -3414,7 +3414,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public void checkLinks() {
|
||||
boolean isJoblet = false;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent(this)) {
|
||||
isJoblet = true;
|
||||
@@ -3812,7 +3812,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
}
|
||||
ICoreTisService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreTisService.class)) {
|
||||
service = GlobalServiceRegister.getDefault().getService(ICoreTisService.class);
|
||||
service = (ICoreTisService) GlobalServiceRegister.getDefault().getService(ICoreTisService.class);
|
||||
}
|
||||
|
||||
// test in case several Dynamic type has been set or if Dynamic is not the last type in schema
|
||||
@@ -4441,16 +4441,16 @@ public class Node extends Element implements IGraphicalNode {
|
||||
.getLastVersion(value.toString());
|
||||
if (lastVersion != null) {
|
||||
if (isMRServiceRegistered) {
|
||||
if (GlobalServiceRegister.getDefault()
|
||||
.getService(IMRProcessService.class)
|
||||
if (((IMRProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IMRProcessService.class))
|
||||
.isMapReduceItem(lastVersion.getProperty().getItem())) {
|
||||
targetIsBigdata = true;
|
||||
bigDataType = "Batch"; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
if (isStormServiceRegistered) {
|
||||
if (GlobalServiceRegister.getDefault()
|
||||
.getService(IStormProcessService.class)
|
||||
if (((IStormProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IStormProcessService.class))
|
||||
.isStormItem(lastVersion.getProperty().getItem())) {
|
||||
targetIsBigdata = true;
|
||||
bigDataType = "Streaming"; //$NON-NLS-1$
|
||||
@@ -4927,7 +4927,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
}
|
||||
boolean isJobletNode = false;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent(this)) {
|
||||
isJobletNode = true;
|
||||
@@ -5302,7 +5302,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public boolean isStandardJoblet() {
|
||||
boolean isJoblet = false;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null && service.isStandardJobletComponent(this)) {
|
||||
isJoblet = true;
|
||||
@@ -5314,7 +5314,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public boolean isJoblet() {
|
||||
boolean isJoblet = false;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent(this)) {
|
||||
isJoblet = true;
|
||||
@@ -5326,7 +5326,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public boolean isSparkJoblet() {
|
||||
boolean isSparkJoblet = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ISparkJobletProviderService.class)) {
|
||||
ISparkJobletProviderService sparkJobletService = GlobalServiceRegister.getDefault()
|
||||
ISparkJobletProviderService sparkJobletService = (ISparkJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(ISparkJobletProviderService.class);
|
||||
if (sparkJobletService != null) {
|
||||
isSparkJoblet = sparkJobletService.isSparkJobletComponent(this);
|
||||
@@ -5338,7 +5338,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public boolean isSparkStreamingJoblet() {
|
||||
boolean isSparkStreamingJoblet = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ISparkStreamingJobletProviderService.class)) {
|
||||
ISparkStreamingJobletProviderService sparkJobletService = GlobalServiceRegister
|
||||
ISparkStreamingJobletProviderService sparkJobletService = (ISparkStreamingJobletProviderService) GlobalServiceRegister
|
||||
.getDefault().getService(ISparkStreamingJobletProviderService.class);
|
||||
if (sparkJobletService != null) {
|
||||
isSparkStreamingJoblet = sparkJobletService.isSparkStreamingJobletComponent(this);
|
||||
@@ -5375,7 +5375,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public boolean isProgressBarNeeded() {
|
||||
boolean needBar = true;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IMRProcessService.class)) {
|
||||
IMRProcessService mrService = GlobalServiceRegister.getDefault()
|
||||
IMRProcessService mrService = (IMRProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IMRProcessService.class);
|
||||
needBar = mrService.isProgressBarNeeded(process);
|
||||
}
|
||||
@@ -5571,7 +5571,7 @@ public class Node extends Element implements IGraphicalNode {
|
||||
public void refreshNodeContainer() {
|
||||
boolean isRunning = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService runProcessService = GlobalServiceRegister.getDefault()
|
||||
IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
if (runProcessService != null) {
|
||||
isRunning = runProcessService.isJobRunning();
|
||||
|
||||
@@ -123,7 +123,6 @@ import org.talend.core.model.update.IUpdateManager;
|
||||
import org.talend.core.model.utils.TalendTextUtils;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ConvertJobsUtil;
|
||||
import org.talend.core.repository.utils.ProjectHelper;
|
||||
import org.talend.core.repository.utils.XmiResourceManager;
|
||||
import org.talend.core.runtime.repository.item.ItemProductKeys;
|
||||
import org.talend.core.runtime.util.ItemDateParser;
|
||||
@@ -1080,7 +1079,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
ElementParameterType pType;
|
||||
boolean isJoblet = false;
|
||||
if (param.getElement() instanceof INode && PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent((INode) param.getElement())) {
|
||||
isJoblet = true;
|
||||
@@ -1921,25 +1920,12 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
boolean isLimited = false;
|
||||
org.talend.core.model.properties.Project currProject = getProject().getEmfProject();
|
||||
org.talend.core.model.properties.Project project = ProjectManager.getInstance().getProject(this.property);
|
||||
if (currProject != null && project != null && !currProject.equals(project)) {
|
||||
int currOrdinal = ProjectHelper.getProjectTypeOrdinal(currProject);
|
||||
int ordinal = ProjectHelper.getProjectTypeOrdinal(project);
|
||||
if (currOrdinal > ordinal) {
|
||||
isLimited = true;
|
||||
}
|
||||
}
|
||||
if (!isLimited) {
|
||||
for (IRepositoryViewObject object : routines) {
|
||||
if (routinesToAdd.contains(object.getLabel()) && !routinesAlreadySetup.contains(object.getLabel())) {
|
||||
RoutinesParameterType routinesParameterType = TalendFileFactory.eINSTANCE.createRoutinesParameterType();
|
||||
routinesParameterType.setId(object.getId());
|
||||
routinesParameterType.setName(object.getLabel());
|
||||
routinesDependencies.add(routinesParameterType);
|
||||
}
|
||||
for (IRepositoryViewObject object : routines) {
|
||||
if (routinesToAdd.contains(object.getLabel()) && !routinesAlreadySetup.contains(object.getLabel())) {
|
||||
RoutinesParameterType routinesParameterType = TalendFileFactory.eINSTANCE.createRoutinesParameterType();
|
||||
routinesParameterType.setId(object.getId());
|
||||
routinesParameterType.setName(object.getLabel());
|
||||
routinesDependencies.add(routinesParameterType);
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
@@ -2297,7 +2283,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
if (EParameterName.PROCESS_TYPE_VERSION.name().equals(pType.getName())) {
|
||||
String jobletVersion = pType.getValue();
|
||||
if (!RelationshipItemBuilder.LATEST_VERSION.equals(jobletVersion)) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
Property jobletProperty = service.getJobletComponentItem(component);
|
||||
@@ -2467,7 +2453,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
updateAllMappingTypes();
|
||||
nc.setNeedLoadLib(false);
|
||||
if (nc.isJoblet()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
// reload only for stuido ,because joblet can be changed in the job editor
|
||||
@@ -2481,7 +2467,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
NodeContainer nodeContainer = null;
|
||||
if (isJunitContainer) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerGEFService.class)) {
|
||||
ITestContainerGEFService testContainerService = GlobalServiceRegister.getDefault()
|
||||
ITestContainerGEFService testContainerService = (ITestContainerGEFService) GlobalServiceRegister.getDefault()
|
||||
.getService(ITestContainerGEFService.class);
|
||||
if (testContainerService != null) {
|
||||
nodeContainer = testContainerService.createJunitContainer(node);
|
||||
@@ -2683,7 +2669,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IScdComponentService.class)) {
|
||||
IScdComponentService service = GlobalServiceRegister.getDefault().getService(
|
||||
IScdComponentService service = (IScdComponentService) GlobalServiceRegister.getDefault().getService(
|
||||
IScdComponentService.class);
|
||||
service.updateOutputMetadata(nc, metadataTable);
|
||||
}
|
||||
@@ -2810,7 +2796,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
} else {
|
||||
if (PluginChecker.isJobLetPluginLoaded()) { // bug 12764
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent(source)) {
|
||||
continue;
|
||||
@@ -4586,7 +4572,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
Item item = ((IProcess2) jobletProcess).getProperty().getItem();
|
||||
if (item instanceof JobletProcessItem) {
|
||||
JobletProcessItem jobletItem = ((JobletProcessItem) item);
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
service.saveJobletNode(jobletItem, jobletContainer);
|
||||
@@ -4635,7 +4621,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
|
||||
IJobletProviderService jobletService = null;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
jobletService = GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
|
||||
jobletService = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
|
||||
for (INode node : getGraphicalNodes()) {
|
||||
if (jobletService.isJobletComponent(node)) {
|
||||
listRoutines.addAll(getJobletRoutines(jobletService, node));
|
||||
|
||||
@@ -598,11 +598,6 @@ public class TalendJavaSourceViewer extends ReconcilerViewer {
|
||||
StringTokenizer token = new StringTokenizer(var.getName(), "."); //$NON-NLS-1$
|
||||
String className = token.nextToken();
|
||||
if (token.hasMoreTokens()) {
|
||||
String subVarName = var.getName().substring(className.length() + 1);
|
||||
if (subVarName.contains("(") && subVarName.contains("")) {
|
||||
// no need for method like TalendDate.addDate(row1.test,arg2,arg3)
|
||||
continue;
|
||||
}
|
||||
String newVarName = token.nextToken();
|
||||
Variable newVar = new Variable(newVarName, var.getValue(), var.getTalendType(), var.isNullable());
|
||||
if (!classesToGenerate.containsKey(className)) {
|
||||
|
||||
@@ -151,12 +151,7 @@ public class BigDataJobUtil {
|
||||
|
||||
for (IElementParameter pt : parameters) {
|
||||
if (pt.getName().equals("DISTRIBUTION")) { //$NON-NLS-1$
|
||||
String value = String.valueOf(pt.getValue());
|
||||
if ("MICROSOFT_HD_INSIGHT".equals(value) //$NON-NLS-1$
|
||||
|| "GOOGLE_CLOUD_DATAPROC".equals(value) //$NON-NLS-1$
|
||||
|| "CLOUDERA_ALTUS".equals(value) || "DATABRICKS".equals(value) || "QUBOLE".equals(value)) { //$NON-NLS-1$
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (isSparkWithYarnClusterMode()) {
|
||||
|
||||
@@ -436,9 +436,7 @@ public class JavaProcessUtil {
|
||||
if (var.equals(contextPara.getName())) {
|
||||
String value =
|
||||
context.getContextParameter(contextPara.getName()).getValue();
|
||||
if (StringUtils.isBlank(value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (curParam.getName().equals(EParameterName.DRIVER_JAR.getName())
|
||||
&& value.contains(";")) { //$NON-NLS-1$
|
||||
String[] jars = value.split(";"); //$NON-NLS-1$
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.talend.designer.runprocess;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -32,6 +31,7 @@ import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.model.process.IContainerEntry;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
@@ -61,15 +61,15 @@ public class JobErrorsChecker {
|
||||
|
||||
public static List<IContainerEntry> getErrors() {
|
||||
List<IContainerEntry> input = new ArrayList<IContainerEntry>();
|
||||
if (LastGenerationInfo.getInstance() == null || LastGenerationInfo.getInstance().getLastMainJob() == null) {
|
||||
return input;
|
||||
if(LastGenerationInfo.getInstance() == null ||
|
||||
LastGenerationInfo.getInstance().getLastMainJob() == null) {
|
||||
return input;
|
||||
}
|
||||
try {
|
||||
Item item = null;
|
||||
IProxyRepositoryFactory proxyRepositoryFactory =
|
||||
CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
|
||||
ITalendSynchronizer synchronizer =
|
||||
CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
|
||||
IProxyRepositoryFactory proxyRepositoryFactory = CorePlugin.getDefault().getRepositoryService()
|
||||
.getProxyRepositoryFactory();
|
||||
ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
|
||||
|
||||
Set<String> jobIds = new HashSet<String>();
|
||||
HashSet<JobInfo> jobInfos = new HashSet<>();
|
||||
@@ -94,15 +94,14 @@ public class JobErrorsChecker {
|
||||
}
|
||||
jobIds.add(item.getProperty().getId());
|
||||
|
||||
// Property property = process.getProperty();
|
||||
Problems.addJobRoutineFile(sourceFile, ProblemType.JOB, item, true);
|
||||
}
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
List<IRepositoryViewObject> routinesObjects =
|
||||
proxyRepositoryFactory.getAll(ERepositoryObjectType.ROUTINES, false);
|
||||
Set<String> dependentRoutines = LastGenerationInfo
|
||||
.getInstance()
|
||||
.getRoutinesNeededWithSubjobPerJob(LastGenerationInfo.getInstance().getLastMainJob().getJobId(),
|
||||
LastGenerationInfo.getInstance().getLastMainJob().getJobVersion());
|
||||
List<IRepositoryViewObject> routinesObjects = proxyRepositoryFactory.getAll(ERepositoryObjectType.ROUTINES, false);
|
||||
Set<String> dependentRoutines = LastGenerationInfo.getInstance().getRoutinesNeededWithSubjobPerJob(
|
||||
LastGenerationInfo.getInstance().getLastMainJob().getJobId(),
|
||||
LastGenerationInfo.getInstance().getLastMainJob().getJobVersion());
|
||||
if (routinesObjects != null) {
|
||||
for (IRepositoryViewObject obj : routinesObjects) {
|
||||
Property property = obj.getProperty();
|
||||
@@ -111,7 +110,7 @@ public class JobErrorsChecker {
|
||||
IFile routineFile = synchronizer.getFile(routinesitem);
|
||||
Problems.addJobRoutineFile(routineFile, ProblemType.ROUTINE, routinesitem, true);
|
||||
} else {
|
||||
Problems.clearAllComliationError(property.getLabel());
|
||||
Problems.clearAllComliationError(property.getLabel());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,11 +153,11 @@ public class JobErrorsChecker {
|
||||
|
||||
public static boolean checkExportErrors(IStructuredSelection selection, boolean isJob) {
|
||||
if (!selection.isEmpty()) {
|
||||
final ITalendSynchronizer synchronizer =
|
||||
CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
|
||||
final ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService()
|
||||
.createRoutineSynchronizer();
|
||||
Set<String> jobIds = new HashSet<String>();
|
||||
|
||||
List<RepositoryNode> nodes = extractNodes(selection);
|
||||
List<RepositoryNode> nodes = selection.toList();
|
||||
if (nodes.size() > 1) {
|
||||
// in case it's a multiple export, only check the status of the latest job to export
|
||||
for (RepositoryNode node : nodes) {
|
||||
@@ -190,35 +189,22 @@ public class JobErrorsChecker {
|
||||
}
|
||||
if (ret) {
|
||||
if (isJob) {
|
||||
throw new ProcessorException(
|
||||
Messages.getString("JobErrorsChecker_compile_errors") + '\n' + //$NON-NLS-1$
|
||||
Messages
|
||||
.getString("JobErrorsChecker_compile_error_content", //$NON-NLS-1$
|
||||
item.getProperty().getLabel())
|
||||
+ '\n' + message);
|
||||
throw new ProcessorException(Messages.getString("JobErrorsChecker_compile_errors") + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("JobErrorsChecker_compile_error_content", item.getProperty() //$NON-NLS-1$
|
||||
.getLabel()) + '\n' + message);
|
||||
} else {
|
||||
throw new ProcessorException(
|
||||
Messages.getString("CamelJobErrorsChecker_compile_errors") + '\n' + //$NON-NLS-1$
|
||||
Messages
|
||||
.getString("CamelJobErrorsChecker_compile_error_content", //$NON-NLS-1$
|
||||
item.getProperty().getLabel())
|
||||
+ '\n' + message);
|
||||
throw new ProcessorException(Messages.getString("CamelJobErrorsChecker_compile_errors") + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("CamelJobErrorsChecker_compile_error_content", item.getProperty() //$NON-NLS-1$
|
||||
.getLabel()) + '\n' + message);
|
||||
}
|
||||
}
|
||||
|
||||
jobIds.add(item.getProperty().getId());
|
||||
|
||||
Problems
|
||||
.addRoutineFile(sourceFile, ProblemType.JOB, item.getProperty().getLabel(),
|
||||
item.getProperty().getVersion(), true);
|
||||
Problems.addRoutineFile(sourceFile, ProblemType.JOB, item.getProperty().getLabel(), item.getProperty()
|
||||
.getVersion(), true);
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
// [TESB-8953] avoid SWT invoked and also throw Exception let Command Executor to have
|
||||
// detailed
|
||||
// trace in command status.
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
MessageBoxExceptionHandler.process(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -228,12 +214,13 @@ public class JobErrorsChecker {
|
||||
try {
|
||||
checkLastGenerationHasCompilationError(true);
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
CommonExceptionHandler.process(e);
|
||||
// [TESB-8953] avoid SWT invoked and also throw Exception let Command Executor to have detailed
|
||||
// trace in command status.
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
MessageBoxExceptionHandler.process(e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -262,12 +249,7 @@ public class JobErrorsChecker {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
// [TESB-8953] avoid SWT invoked and also throw Exception let Command Executor to have detailed
|
||||
// trace in command status.
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
MessageBoxExceptionHandler.process(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -282,10 +264,9 @@ public class JobErrorsChecker {
|
||||
boolean hasError = false;
|
||||
boolean isJob = true;
|
||||
Item item = null;
|
||||
final IProxyRepositoryFactory proxyRepositoryFactory =
|
||||
CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
|
||||
final ITalendSynchronizer synchronizer =
|
||||
CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
|
||||
final IProxyRepositoryFactory proxyRepositoryFactory = CorePlugin.getDefault().getRepositoryService()
|
||||
.getProxyRepositoryFactory();
|
||||
final ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
|
||||
Integer line = null;
|
||||
String errorMessage = null;
|
||||
try {
|
||||
@@ -318,7 +299,7 @@ public class JobErrorsChecker {
|
||||
// one job
|
||||
final IResource[] members = file.getParent().members();
|
||||
for (IResource member : members) {
|
||||
if (member instanceof IFile && "java".equals(member.getFileExtension())) { //$NON-NLS-1$
|
||||
if (member instanceof IFile && "java".equals(member.getFileExtension())) {
|
||||
IMarker[] markers = ((IFile) member).findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ONE);
|
||||
for (IMarker marker : markers) {
|
||||
Integer lineNr = (Integer) marker.getAttribute(IMarker.LINE_NUMBER);
|
||||
@@ -341,9 +322,8 @@ public class JobErrorsChecker {
|
||||
}
|
||||
}
|
||||
if (updateProblemsView) {
|
||||
Problems
|
||||
.addRoutineFile(file, ProblemType.JOB, item.getProperty().getLabel(),
|
||||
item.getProperty().getVersion(), true);
|
||||
Problems.addRoutineFile(file, ProblemType.JOB, item.getProperty().getLabel(),
|
||||
item.getProperty().getVersion(), true);
|
||||
}
|
||||
if (hasError) {
|
||||
break;
|
||||
@@ -355,17 +335,17 @@ public class JobErrorsChecker {
|
||||
}
|
||||
if (hasError && item != null) {
|
||||
if (isJob) {
|
||||
throw new ProcessorException(Messages.getString("JobErrorsChecker_compile_errors") + ' ' + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("JobErrorsChecker_compile_error_message", item.getProperty().getLabel()) //$NON-NLS-1$
|
||||
+ '\n' + Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + line + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' + errorMessage //$NON-NLS-1$
|
||||
+ '\n' + Messages.getString("JobErrorsChecker_compile_error_jvmmessage")); //$NON-NLS-1$
|
||||
throw new ProcessorException(Messages.getString("JobErrorsChecker_compile_errors") + " " + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("JobErrorsChecker_compile_error_message", item.getProperty().getLabel()) + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + line + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' + errorMessage + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_jvmmessage")); //$NON-NLS-1$
|
||||
} else {
|
||||
throw new ProcessorException(Messages.getString("CamelJobErrorsChecker_compile_errors") + ' ' + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("JobErrorsChecker_compile_error_message", item.getProperty().getLabel()) //$NON-NLS-1$
|
||||
+ '\n' + Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + line + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' + errorMessage //$NON-NLS-1$
|
||||
+ '\n' + Messages.getString("JobErrorsChecker_compile_error_jvmmessage")); //$NON-NLS-1$
|
||||
throw new ProcessorException(Messages.getString("CamelJobErrorsChecker_compile_errors") + " " + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("JobErrorsChecker_compile_error_message", item.getProperty().getLabel()) + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + line + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' + errorMessage + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_jvmmessage")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,48 +356,44 @@ public class JobErrorsChecker {
|
||||
}
|
||||
|
||||
private static void checkRoutinesCompilationError() throws ProcessorException {
|
||||
if (LastGenerationInfo.getInstance() == null || LastGenerationInfo.getInstance().getLastMainJob() == null) {
|
||||
return;
|
||||
}
|
||||
Set<String> dependentRoutines = LastGenerationInfo
|
||||
.getInstance()
|
||||
.getRoutinesNeededWithSubjobPerJob(LastGenerationInfo.getInstance().getLastMainJob().getJobId(),
|
||||
LastGenerationInfo.getInstance().getLastMainJob().getJobVersion());
|
||||
if(LastGenerationInfo.getInstance() == null || LastGenerationInfo.getInstance().getLastMainJob() == null) {
|
||||
return;
|
||||
}
|
||||
Set<String> dependentRoutines = LastGenerationInfo.getInstance().getRoutinesNeededWithSubjobPerJob(
|
||||
LastGenerationInfo.getInstance().getLastMainJob().getJobId(),
|
||||
LastGenerationInfo.getInstance().getLastMainJob().getJobVersion());
|
||||
|
||||
// from Problems
|
||||
List<Problem> errors = Problems.getProblemList().getProblemsBySeverity(ProblemStatus.ERROR);
|
||||
for (Problem p : errors) {
|
||||
if (p instanceof TalendProblem) {
|
||||
TalendProblem talendProblem = (TalendProblem) p;
|
||||
if (talendProblem.getType() == ProblemType.ROUTINE
|
||||
&& dependentRoutines.contains(talendProblem.getJavaUnitName())) {
|
||||
if (talendProblem.getType() == ProblemType.ROUTINE && dependentRoutines.contains(talendProblem.getJavaUnitName())) {
|
||||
int line = talendProblem.getLineNumber();
|
||||
String errorMessage = talendProblem.getDescription();
|
||||
throw new ProcessorException(Messages
|
||||
.getString("JobErrorsChecker_routines_compile_errors", talendProblem.getJavaUnitName()) //$NON-NLS-1$
|
||||
+ '\n' + Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + line + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' //$NON-NLS-1$
|
||||
+ errorMessage);
|
||||
throw new ProcessorException(Messages.getString(
|
||||
"JobErrorsChecker_routines_compile_errors", talendProblem.getJavaUnitName()) + '\n'//$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + line + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' + errorMessage); //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
// for now not to check components errors when building jobs in studio/commandline
|
||||
// throw new ProcessorException(Messages.getString("JobErrorsChecker_jobDesign_errors",
|
||||
// p.getType().getTypeName(), //$NON-NLS-1$
|
||||
// p.getJobInfo().getJobName(), p.getComponentName(), p.getDescription()));
|
||||
// throw new ProcessorException(Messages.getString("JobErrorsChecker_jobDesign_errors", p.getType().getTypeName(), //$NON-NLS-1$
|
||||
// p.getJobInfo().getJobName(), p.getComponentName(), p.getDescription()));
|
||||
}
|
||||
}
|
||||
|
||||
// if can't find the routines problem, try to check the file directly(mainly for commandline)
|
||||
try {
|
||||
final ITalendSynchronizer synchronizer =
|
||||
CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
|
||||
final ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService()
|
||||
.createRoutineSynchronizer();
|
||||
IProxyRepositoryFactory factory = CorePlugin.getDefault().getProxyRepositoryFactory();
|
||||
List<IRepositoryViewObject> routinesObjects = factory.getAll(ERepositoryObjectType.ROUTINES, false);
|
||||
if (routinesObjects != null) {
|
||||
for (IRepositoryViewObject obj : routinesObjects) {
|
||||
Property property = obj.getProperty();
|
||||
if (!dependentRoutines.contains(property.getLabel())) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
Item routinesitem = property.getItem();
|
||||
IFile routinesFile = synchronizer.getFile(routinesitem);
|
||||
@@ -431,12 +407,10 @@ public class JobErrorsChecker {
|
||||
if (lineNr != null && message != null && severity != null && start != null && end != null) {
|
||||
switch (severity) {
|
||||
case IMarker.SEVERITY_ERROR:
|
||||
throw new ProcessorException(Messages
|
||||
.getString("JobErrorsChecker_routines_compile_errors", property.getLabel()) //$NON-NLS-1$
|
||||
+ '\n' + Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' //$NON-NLS-1$
|
||||
+ lineNr + '\n'
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") //$NON-NLS-1$
|
||||
+ ':' + ' ' + message);
|
||||
throw new ProcessorException(
|
||||
Messages.getString("JobErrorsChecker_routines_compile_errors", property.getLabel()) + '\n'//$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_line") + ':' + ' ' + lineNr + '\n' //$NON-NLS-1$
|
||||
+ Messages.getString("JobErrorsChecker_compile_error_detailmessage") + ':' + ' ' + message); //$NON-NLS-1$
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -466,9 +440,8 @@ public class JobErrorsChecker {
|
||||
if (lineNr != null && message != null && severity != null && start != null && end != null) {
|
||||
switch (severity) {
|
||||
case IMarker.SEVERITY_ERROR:
|
||||
throw new ProcessorException(
|
||||
Messages.getString("JobErrorsChecker_compile_error_errormessage") + ": " //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ message);
|
||||
throw new ProcessorException(Messages.getString("JobErrorsChecker_compile_error_errormessage") + ": " //$NON-NLS-1$
|
||||
+ message);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -481,10 +454,9 @@ public class JobErrorsChecker {
|
||||
}
|
||||
|
||||
protected static void checkSubJobMultipleVersionsError() throws ProcessorException {
|
||||
if (LastGenerationInfo.getInstance() == null
|
||||
|| LastGenerationInfo.getInstance().getLastGeneratedjobs() == null) {
|
||||
return;
|
||||
}
|
||||
if(LastGenerationInfo.getInstance() == null || LastGenerationInfo.getInstance().getLastGeneratedjobs() == null) {
|
||||
return;
|
||||
}
|
||||
Set<JobInfo> jobInfos = LastGenerationInfo.getInstance().getLastGeneratedjobs();
|
||||
Map<String, Set<String>> jobInfoMap = new HashMap<>();
|
||||
for (JobInfo jobInfo : jobInfos) {
|
||||
@@ -511,14 +483,4 @@ public class JobErrorsChecker {
|
||||
}
|
||||
}
|
||||
|
||||
private static List<RepositoryNode> extractNodes(IStructuredSelection selection) {
|
||||
List<RepositoryNode> nodes = new ArrayList<>();
|
||||
for (Iterator<?> iterator = selection.iterator(); iterator.hasNext();) {
|
||||
Object o = iterator.next();
|
||||
if (o instanceof RepositoryNode)
|
||||
nodes.add((RepositoryNode) o);
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.ui.runtime.exception.RuntimeExceptionHandler;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.resource.FileExtensions;
|
||||
import org.talend.commons.utils.system.EnvironmentUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.PluginChecker;
|
||||
@@ -367,14 +366,16 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
outputFolder = tProcessJavaProject.getTestOutputFolder();
|
||||
} else {
|
||||
srcFolder = tProcessJavaProject.getSrcFolder();
|
||||
boolean needContextInJar = false;
|
||||
if (process != null) {
|
||||
needContextInJar = new BigDataJobUtil(process).needsToHaveContextInsideJar();
|
||||
boolean needsToHaveContextInsideJar = true;
|
||||
|
||||
if (property != null && property.getItem() instanceof ProcessItem) {
|
||||
needsToHaveContextInsideJar = !new BigDataJobUtil(process).needsToHaveContextInsideJar();
|
||||
}
|
||||
if (needContextInJar) {
|
||||
resourcesFolder = tProcessJavaProject.getResourcesFolder();
|
||||
} else {
|
||||
|
||||
if (ProcessorUtilities.isExportConfig() && property != null && needsToHaveContextInsideJar) {
|
||||
resourcesFolder = tProcessJavaProject.getExternalResourcesFolder();
|
||||
} else {
|
||||
resourcesFolder = tProcessJavaProject.getResourcesFolder();
|
||||
}
|
||||
outputFolder = tProcessJavaProject.getOutputFolder();
|
||||
}
|
||||
@@ -1181,12 +1182,7 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
} else {
|
||||
List<String> asList = convertArgsToList(cmd2);
|
||||
if ((!isExternalUse() && isStandardJob()) || isGuessSchemaJob(property)) {
|
||||
String localM2Path = "-Dtalend.component.manager.m2.repository="; //$NON-NLS-1$
|
||||
if (EnvironmentUtils.isWindowsSystem()) {
|
||||
localM2Path = localM2Path + PomUtil.getLocalRepositoryPath().replaceAll("%20", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
localM2Path = localM2Path + PomUtil.getLocalRepositoryPath();
|
||||
}
|
||||
String localM2Path = "-Dtalend.component.manager.m2.repository=\"" + PomUtil.getLocalRepositoryPath() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
asList.add(3, localM2Path);
|
||||
}
|
||||
return asList.toArray(new String[0]);
|
||||
|
||||
@@ -14,12 +14,10 @@ package org.talend.designer.runprocess.maven;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
@@ -28,20 +26,15 @@ import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.resource.FileExtensions;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ItemResourceUtil;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
@@ -65,7 +58,6 @@ import org.talend.designer.runprocess.ProcessorException;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.designer.runprocess.java.JavaProcessor;
|
||||
import org.talend.repository.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
* created by ggu on 2 Feb 2015 Detailled comment
|
||||
@@ -311,30 +303,6 @@ public class MavenJavaProcessor extends JavaProcessor {
|
||||
|
||||
buildTypeName = exportType != null ? exportType.toString() : null;
|
||||
|
||||
if (StringUtils.isBlank(buildTypeName)) {
|
||||
List<IRepositoryViewObject> serviceRepoList = null;
|
||||
|
||||
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
|
||||
try {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
serviceRepoList = factory.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "SERVICES"));
|
||||
|
||||
for (IRepositoryViewObject serviceItem : serviceRepoList) {
|
||||
if (service != null) {
|
||||
List<String> jobIds = service.getSerivceRelatedJobIds(serviceItem.getProperty().getItem());
|
||||
if (jobIds.contains(itemProperty.getId())) {
|
||||
buildTypeName = "OSGI";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
parameters.put(IBuildParametes.ITEM, itemProperty.getItem());
|
||||
parameters.put(IBuildPomCreatorParameters.PROCESSOR, this);
|
||||
|
||||
@@ -126,8 +126,6 @@ public class ProcessChangeListener implements PropertyChangeListener {
|
||||
// version change, will create new item
|
||||
// create new job project.
|
||||
TalendJavaProjectManager.generatePom(property.getItem());
|
||||
AggregatorPomsHelper helper = new AggregatorPomsHelper();
|
||||
helper.syncParentJobPomsForPropertyChange(property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.expressionbuilder.test.shadow;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -90,14 +89,6 @@ public class VirtualRowGeneratorNode extends RowGeneratorComponent {
|
||||
|
||||
}
|
||||
|
||||
protected List<Variable> getVariableList() {
|
||||
return ExpressionBuilderDialog.getTestComposite().getVariableList();
|
||||
}
|
||||
|
||||
protected String getExpression() {
|
||||
return ExpressionBuilderDialog.getExpressionComposite().getExpression();
|
||||
}
|
||||
|
||||
/**
|
||||
* yzhang Comment method "initArray".
|
||||
*/
|
||||
@@ -108,8 +99,8 @@ public class VirtualRowGeneratorNode extends RowGeneratorComponent {
|
||||
VirtualMetadataColumn ext = (VirtualMetadataColumn) col;
|
||||
Map<String, String> value = new HashMap<String, String>();
|
||||
value.put(RowGeneratorComponent.COLUMN_NAME, ext.getLabel());
|
||||
List<Variable> variables = getVariableList();
|
||||
String expression = getExpression();
|
||||
List<Variable> variables = ExpressionBuilderDialog.getTestComposite().getVariableList();
|
||||
String expression = ExpressionBuilderDialog.getExpressionComposite().getExpression();
|
||||
// modify for bug 9471
|
||||
try {
|
||||
for (Variable varible : variables) {
|
||||
@@ -120,7 +111,7 @@ public class VirtualRowGeneratorNode extends RowGeneratorComponent {
|
||||
}
|
||||
String currentValue = varible.getValue();
|
||||
String newValue = renameVaribleValue(currentValue, type);
|
||||
if (valueContains(expression, varible.getName()) && !newValue.equals("null")) {
|
||||
if (valueContains(expression, varible.getName())) {
|
||||
if (currentValue != null && !currentValue.equals(newValue)) {
|
||||
expression = renameValues(expression, varible.getName(), newValue);
|
||||
} else {
|
||||
@@ -191,17 +182,12 @@ public class VirtualRowGeneratorNode extends RowGeneratorComponent {
|
||||
}
|
||||
|
||||
private String renameVaribleValue(String newValue, String type) {
|
||||
if (newValue == null || newValue.equals("null")) {
|
||||
return newValue;
|
||||
}
|
||||
if (JavaTypesManager.BIGDECIMAL.getLabel().equals(type)) {
|
||||
newValue = " new " + JavaTypesManager.BIGDECIMAL.getNullableClass().getName() + "(" + newValue + ")";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
} else if (JavaTypesManager.CHARACTER.getLabel().contains(type)) {
|
||||
if (newValue.length() == 1) {
|
||||
newValue = " new " + JavaTypesManager.CHARACTER.getNullableClass().getName() + "('" + newValue.charAt(0) + "')";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
} else if (JavaTypesManager.DATE.getLabel().equals(type)) {
|
||||
newValue = " ParserUtils.parseTo_Date(" + (newValue.equals("") ? "\"\"" : newValue) + ", \"dd-MM-yyyy\")";
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
context="plugin:org.talend.libraries.custom"
|
||||
language="java"
|
||||
message="Library for components API"
|
||||
name="talend-codegen-utils.jar" mvn_uri="mvn:org.talend.libraries/talend-codegen-utils/0.28.0"
|
||||
name="talend-codegen-utils.jar" mvn_uri="mvn:org.talend.libraries/talend-codegen-utils/0.25.4"
|
||||
required="true">
|
||||
</libraryNeeded>
|
||||
</extension>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<artifactItem>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>talend-codegen-utils</artifactId>
|
||||
<version>0.28.0</version>
|
||||
<version>0.25.4</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
@@ -58,11 +58,6 @@
|
||||
<artifactId>talendzip</artifactId>
|
||||
<version>1.0-20190527</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>filecopy</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<classpathentry exported="true" kind="lib" path="lib/poi-ooxml-schemas-4.1.0-20190523141255_modified_talend.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/poi-scratchpad-4.1.0-20190523141255_modified_talend.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/simpleexcel-2.1-20190507.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/talendExcel-1.5-20190731.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/talendExcel-1.4-20190531.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/talendMsgMailUtil-1.1-20170419.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
|
||||
@@ -1,98 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>7.2.2-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.excel</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<properties>
|
||||
<talend.groupid>org.talend.libraries</talend.groupid>
|
||||
<talend.version.610>6.1.0</talend.version.610>
|
||||
<talend.version.600>6.0.0</talend.version.600>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-maven-repository1</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-scratchpad</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.18</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-math3</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-maven-repository2</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<stripVersion>true</stripVersion>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>simpleexcel-2.1-20190507</artifactId>
|
||||
<version>${talend.version.600}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>talendMsgMailUtil-1.1-20170419</artifactId>
|
||||
<version>${talend.version.600}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>talendExcel-1.5-20190731</artifactId>
|
||||
<version>${talend.version.600}</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>7.2.2-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.excel</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<properties>
|
||||
<talend.groupid>org.talend.libraries</talend.groupid>
|
||||
<talend.version.610>6.1.0</talend.version.610>
|
||||
<talend.version.600>6.0.0</talend.version.600>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-maven-repository1</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-scratchpad</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.0-20190523141255_modified_talend</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.18</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-math3</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-maven-repository2</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<stripVersion>true</stripVersion>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>simpleexcel-2.1-20190507</artifactId>
|
||||
<version>${talend.version.600}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>talendMsgMailUtil-1.1-20170419</artifactId>
|
||||
<version>${talend.version.600}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>${talend.groupid}</groupId>
|
||||
<artifactId>talendExcel-1.4-20190531</artifactId>
|
||||
<version>${talend.version.600}</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.MatchResult;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
@@ -55,9 +54,8 @@ import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.swt.widgets.Tree;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.swt.formtools.Form;
|
||||
import org.talend.commons.ui.swt.formtools.LabelledCombo;
|
||||
import org.talend.commons.ui.swt.formtools.LabelledFileField;
|
||||
@@ -81,7 +79,6 @@ import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.json.i18n.Messages;
|
||||
import org.talend.repository.json.util.JSONUtil;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.xml.TreePopulator;
|
||||
|
||||
import orgomg.cwm.resource.record.RecordFactory;
|
||||
import orgomg.cwm.resource.record.RecordFile;
|
||||
|
||||
@@ -154,7 +151,7 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
}
|
||||
if (JSONFileOutputStep1Form.this.tempPath == null) {
|
||||
if (jsonXmlPath != null && !jsonXmlPath.equals("")) {
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(jsonXmlPath, getConnection().getEncoding());
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(jsonXmlPath);
|
||||
} else {
|
||||
JSONFileOutputStep1Form.this.tempPath = "";
|
||||
}
|
||||
@@ -318,7 +315,7 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
|
||||
List<FOXTreeNode> rootFoxTreeNodes = null;
|
||||
if (JSONFileOutputStep1Form.this.tempPath == null) {
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(text, getConnection().getEncoding());
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(text);
|
||||
}
|
||||
if (treeNode == null) {
|
||||
rootFoxTreeNodes = TreeUtil.getFoxTreeNodes(JSONFileOutputStep1Form.this.tempPath);
|
||||
@@ -365,12 +362,12 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
}
|
||||
// getConnection().setJSONFilePath(PathUtils.getPortablePath(JSONXsdFilePath.getText()));
|
||||
if (JSONFileOutputStep1Form.this.tempPath == null) {
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(text, getConnection().getEncoding());
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(text);
|
||||
}
|
||||
File file = new File(text);
|
||||
if (file.exists()) {
|
||||
List<ATreeNode> treeNodes = new ArrayList<ATreeNode>();
|
||||
valid = treePopulator.populateTree(JSONUtil.changeJsonToXml(text, getConnection().getEncoding()), treeNode);
|
||||
valid = treePopulator.populateTree(JSONUtil.changeJsonToXml(text), treeNode);
|
||||
checkFieldsValue();
|
||||
if (!valid) {
|
||||
return;
|
||||
@@ -394,7 +391,130 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent event) {
|
||||
validateJsonFile();
|
||||
String text = jsonFilePath.getText();
|
||||
if (isContextMode()) {
|
||||
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(
|
||||
connectionItem.getConnection(), true);
|
||||
text = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType, text));
|
||||
}
|
||||
|
||||
if (getConnection().getJSONFilePath() != null && !getConnection().getJSONFilePath().equals(text)) {
|
||||
getConnection().getLoop().clear();
|
||||
getConnection().getRoot().clear();
|
||||
getConnection().getGroup().clear();
|
||||
xsdPathChanged = true;
|
||||
} else {
|
||||
xsdPathChanged = false;
|
||||
}
|
||||
if (Path.fromOSString(jsonFilePath.getText()).toFile().isFile()) {
|
||||
getConnection().setJSONFilePath(PathUtils.getPortablePath(jsonFilePath.getText()));
|
||||
} else {
|
||||
getConnection().setJSONFilePath(jsonFilePath.getText());
|
||||
}
|
||||
|
||||
// updateConnection(text);
|
||||
|
||||
StringBuilder fileContent = new StringBuilder();
|
||||
BufferedReader in = null;
|
||||
File file = null;
|
||||
if (tempJSONPath != null && getConnection().getFileContent() != null
|
||||
&& getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
file = new File(tempJSONPath);
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e2) {
|
||||
ExceptionHandler.process(e2);
|
||||
}
|
||||
FileOutputStream outStream;
|
||||
try {
|
||||
outStream = new FileOutputStream(file);
|
||||
outStream.write(getConnection().getFileContent());
|
||||
outStream.close();
|
||||
} catch (FileNotFoundException e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
file = new File(text);
|
||||
}
|
||||
String str;
|
||||
try {
|
||||
Charset guessCharset = CharsetToolkit.guessEncoding(file, 4096);
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(file), guessCharset.displayName()));
|
||||
|
||||
while ((str = in.readLine()) != null) {
|
||||
fileContent.append(str + "\n");
|
||||
// for encoding
|
||||
if (str.contains("encoding")) {
|
||||
String regex = "^<\\?JSON\\s*version=\\\"[^\\\"]*\\\"\\s*encoding=\\\"([^\\\"]*)\\\"\\?>$";
|
||||
Perl5Compiler compiler = new Perl5Compiler();
|
||||
Perl5Matcher matcher = new Perl5Matcher();
|
||||
Pattern pattern = null;
|
||||
try {
|
||||
pattern = compiler.compile(regex);
|
||||
if (matcher.contains(str, pattern)) {
|
||||
MatchResult matchResult = matcher.getMatch();
|
||||
if (matchResult != null) {
|
||||
encoding = matchResult.group(1);
|
||||
}
|
||||
}
|
||||
} catch (MalformedPatternException malE) {
|
||||
ExceptionHandler.process(malE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileContentText.setText(new String(fileContent));
|
||||
|
||||
} catch (Exception e) {
|
||||
String msgError = "File" + " \"" + jsonFilePath.getText().replace("\\\\", "\\") + "\"\n";
|
||||
if (e instanceof FileNotFoundException) {
|
||||
msgError = msgError + "is not found";
|
||||
} else if (e instanceof EOFException) {
|
||||
msgError = msgError + "have an incorrect character EOF";
|
||||
} else if (e instanceof IOException) {
|
||||
msgError = msgError + "is locked by another soft";
|
||||
} else {
|
||||
msgError = msgError + "doesn't exist";
|
||||
}
|
||||
fileContentText.setText(msgError);
|
||||
if (!isReadOnly()) {
|
||||
updateStatus(IStatus.ERROR, msgError);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
ExceptionHandler.process(exception);
|
||||
}
|
||||
}
|
||||
if (getConnection().getEncoding() == null || "".equals(getConnection().getEncoding())) {
|
||||
getConnection().setEncoding(encoding);
|
||||
if (encoding != null && !"".equals(encoding)) {
|
||||
encodingCombo.setText(encoding);
|
||||
} else {
|
||||
encodingCombo.setText("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
// if (tempJSONXsdPath != null && getConnection().getFileContent() != null
|
||||
// && getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
// valid = treePopulator.populateTree(tempJSONXsdPath, treeNode);
|
||||
// } else {
|
||||
// valid = treePopulator.populateTree(text, treeNode);
|
||||
// }
|
||||
if (file.exists()) {
|
||||
valid = treePopulator.populateTree(JSONUtil.changeJsonToXml(text), treeNode);
|
||||
updateConnection(text);
|
||||
}
|
||||
checkFieldsValue();
|
||||
isModifing = true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -403,16 +523,6 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
getConnection().setEncoding(encodingCombo.getText());
|
||||
String encoding = getConnection().getEncoding();
|
||||
try {
|
||||
Charset charSet = Charset.forName(encoding);
|
||||
if (charSet != null) {
|
||||
validateJsonFile();
|
||||
return;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// ignore
|
||||
}
|
||||
checkFieldsValue();
|
||||
}
|
||||
});
|
||||
@@ -430,8 +540,7 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
labelLimitation.setToolTipText(MessageFormat.format(Messages.JSONLimitToolTip, str));
|
||||
}
|
||||
if (JSONFileOutputStep1Form.this.tempPath == null) {
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(jsonFilePath.getText(),
|
||||
getConnection().getEncoding());
|
||||
JSONFileOutputStep1Form.this.tempPath = JSONUtil.changeJsonToXml(jsonFilePath.getText());
|
||||
}
|
||||
|
||||
File file = new File(JSONFileOutputStep1Form.this.tempPath);
|
||||
@@ -670,141 +779,4 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
// valid = this.treePopulator.populateTree(tempJSONXsdPath, treeNode);
|
||||
|
||||
}
|
||||
|
||||
private void validateJsonFile() {
|
||||
String text = jsonFilePath.getText();
|
||||
if (isContextMode()) {
|
||||
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(
|
||||
connectionItem.getConnection(), true);
|
||||
text = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType, text));
|
||||
}
|
||||
|
||||
if (getConnection().getJSONFilePath() != null && !getConnection().getJSONFilePath().equals(text)) {
|
||||
getConnection().getLoop().clear();
|
||||
getConnection().getRoot().clear();
|
||||
getConnection().getGroup().clear();
|
||||
xsdPathChanged = true;
|
||||
} else {
|
||||
xsdPathChanged = false;
|
||||
}
|
||||
if (Path.fromOSString(jsonFilePath.getText()).toFile().isFile()) {
|
||||
getConnection().setJSONFilePath(PathUtils.getPortablePath(jsonFilePath.getText()));
|
||||
} else {
|
||||
getConnection().setJSONFilePath(jsonFilePath.getText());
|
||||
}
|
||||
|
||||
// updateConnection(text);
|
||||
|
||||
StringBuilder fileContent = new StringBuilder();
|
||||
BufferedReader in = null;
|
||||
File file = null;
|
||||
if (tempJSONPath != null && getConnection().getFileContent() != null
|
||||
&& getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
file = new File(tempJSONPath);
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e2) {
|
||||
ExceptionHandler.process(e2);
|
||||
}
|
||||
FileOutputStream outStream;
|
||||
try {
|
||||
outStream = new FileOutputStream(file);
|
||||
outStream.write(getConnection().getFileContent());
|
||||
outStream.close();
|
||||
} catch (FileNotFoundException e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
file = new File(text);
|
||||
}
|
||||
String str;
|
||||
try {
|
||||
Charset guessCharset = null;
|
||||
try {
|
||||
guessCharset = Charset.forName(getConnection().getEncoding());
|
||||
} catch (Exception e) {
|
||||
if (CommonsPlugin.isDebugMode()) {
|
||||
ExceptionHandler.process(e, Priority.INFO);
|
||||
}
|
||||
}
|
||||
if (guessCharset == null) {
|
||||
guessCharset = CharsetToolkit.guessEncoding(file, 4096);
|
||||
}
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(file), guessCharset.displayName()));
|
||||
|
||||
while ((str = in.readLine()) != null) {
|
||||
fileContent.append(str + "\n");
|
||||
// for encoding
|
||||
if (str.contains("encoding")) {
|
||||
String regex = "^<\\?JSON\\s*version=\\\"[^\\\"]*\\\"\\s*encoding=\\\"([^\\\"]*)\\\"\\?>$";
|
||||
Perl5Compiler compiler = new Perl5Compiler();
|
||||
Perl5Matcher matcher = new Perl5Matcher();
|
||||
Pattern pattern = null;
|
||||
try {
|
||||
pattern = compiler.compile(regex);
|
||||
if (matcher.contains(str, pattern)) {
|
||||
MatchResult matchResult = matcher.getMatch();
|
||||
if (matchResult != null) {
|
||||
encoding = matchResult.group(1);
|
||||
}
|
||||
}
|
||||
} catch (MalformedPatternException malE) {
|
||||
ExceptionHandler.process(malE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileContentText.setText(new String(fileContent));
|
||||
|
||||
} catch (Exception e) {
|
||||
String msgError = "File" + " \"" + jsonFilePath.getText().replace("\\\\", "\\") + "\"\n";
|
||||
if (e instanceof FileNotFoundException) {
|
||||
msgError = msgError + "is not found";
|
||||
} else if (e instanceof EOFException) {
|
||||
msgError = msgError + "have an incorrect character EOF";
|
||||
} else if (e instanceof IOException) {
|
||||
msgError = msgError + "is locked by another soft";
|
||||
} else {
|
||||
msgError = msgError + "doesn't exist";
|
||||
}
|
||||
fileContentText.setText(msgError);
|
||||
if (!isReadOnly()) {
|
||||
updateStatus(IStatus.ERROR, msgError);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
ExceptionHandler.process(exception);
|
||||
}
|
||||
}
|
||||
if (getConnection().getEncoding() == null || "".equals(getConnection().getEncoding())) {
|
||||
getConnection().setEncoding(encoding);
|
||||
if (encoding != null && !"".equals(encoding)) {
|
||||
encodingCombo.setText(encoding);
|
||||
} else {
|
||||
encodingCombo.setText("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
// if (tempJSONXsdPath != null && getConnection().getFileContent() != null
|
||||
// && getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
// valid = treePopulator.populateTree(tempJSONXsdPath, treeNode);
|
||||
// } else {
|
||||
// valid = treePopulator.populateTree(text, treeNode);
|
||||
// }
|
||||
if (file.exists()) {
|
||||
valid = treePopulator.populateTree(JSONUtil.changeJsonToXml(text, getConnection().getEncoding()), treeNode);
|
||||
updateConnection(text);
|
||||
}
|
||||
checkFieldsValue();
|
||||
isModifing = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
if (JSONFileStep1Form.this.wizard.getTempJsonPath() == null
|
||||
|| JSONFileStep1Form.this.wizard.getTempJsonPath().length() == 0) {
|
||||
if (EJsonReadbyMode.XPATH.getValue().equals(JSONFileStep1Form.this.wizard.getReadbyMode())) {
|
||||
tempxml = JSONUtil.changeJsonToXml(jsonFilePath, getConnection().getEncoding());
|
||||
tempxml = JSONUtil.changeJsonToXml(jsonFilePath);
|
||||
} else {
|
||||
tempxml = jsonFilePath;
|
||||
}
|
||||
@@ -271,7 +271,6 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
treePopulator.setLimit(limit);
|
||||
this.treePopulator.configureDefaultTreeViewer();
|
||||
if (filePath != null && !filePath.isEmpty()) {
|
||||
this.treePopulator.setEncoding(getConnection().getEncoding());
|
||||
valid = this.treePopulator.populateTree(filePath, treeNode);
|
||||
}
|
||||
}
|
||||
@@ -507,7 +506,7 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
if (EJsonReadbyMode.JSONPATH.getValue().equals(readbyMode)) {
|
||||
tempxml = text;
|
||||
} else {
|
||||
tempxml = JSONUtil.changeJsonToXml(text, getConnection().getEncoding());
|
||||
tempxml = JSONUtil.changeJsonToXml(text);
|
||||
}
|
||||
JSONFileStep1Form.this.wizard.setTempJsonPath(tempxml);
|
||||
switchPopulator(readbyMode, tempxml);
|
||||
@@ -519,7 +518,170 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
|
||||
@Override
|
||||
public void modifyText(final ModifyEvent e) {
|
||||
validateJsonFile();
|
||||
String jsonPath = fileFieldJSON.getText();
|
||||
String _jsonPath = jsonPath;
|
||||
if (isContextMode()) {
|
||||
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(
|
||||
connectionItem.getConnection(), connectionItem.getConnection().getContextName());
|
||||
jsonPath = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,
|
||||
jsonPath));
|
||||
|
||||
}
|
||||
String text = validateJsonFilePath(jsonPath);
|
||||
if (text == null || text.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String tempxml = null;
|
||||
String readbyMode = JSONFileStep1Form.this.wizard.getReadbyMode();
|
||||
|
||||
if (EJsonReadbyMode.JSONPATH.getValue().equals(readbyMode)) {
|
||||
tempxml = text;
|
||||
} else {
|
||||
tempxml = JSONUtil.changeJsonToXml(text);
|
||||
}
|
||||
File file = new File(text);
|
||||
if (!file.exists()) {
|
||||
file = new File(JSONUtil.tempJSONXsdPath);
|
||||
}
|
||||
JSONFileStep1Form.this.wizard.setTempJsonPath(tempxml);
|
||||
String limitString = commonNodesLimitation.getText();
|
||||
try {
|
||||
limit = Integer.valueOf(limitString);
|
||||
labelLimitation.setToolTipText(MessageFormat.format(Messages.JSONLimitToolTip, limit));
|
||||
} catch (Exception excpt) {
|
||||
// nothing need to do
|
||||
}
|
||||
switchPopulator(readbyMode, tempxml);
|
||||
// }
|
||||
// add for bug TDI-20432
|
||||
checkFieldsValue();
|
||||
// }
|
||||
|
||||
// String text = fileFieldJSON.getText();
|
||||
// File temp = new File(text);
|
||||
// if (!temp.exists()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (getConnection().getJSONFilePath() != null && !getConnection().getJSONFilePath().equals(text)) {
|
||||
getConnection().getLoop().clear();
|
||||
xsdPathChanged = true;
|
||||
} else {
|
||||
xsdPathChanged = false;
|
||||
}
|
||||
|
||||
if (isContextMode()) {
|
||||
jsonPath = _jsonPath;
|
||||
}
|
||||
if (Path.fromOSString(jsonPath).toFile().isFile()) {
|
||||
getConnection().setJSONFilePath(PathUtils.getPortablePath(jsonPath));
|
||||
} else {
|
||||
getConnection().setJSONFilePath(jsonPath);
|
||||
}
|
||||
|
||||
JSONWizard wizard = ((JSONWizard) getPage().getWizard());
|
||||
wizard.setTreeRootNode(treeNode);
|
||||
|
||||
BufferedReader in = null;
|
||||
|
||||
// File file = null;
|
||||
//
|
||||
// if (tempJSONXsdPath != null && getConnection().getFileContent() != null
|
||||
// && getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
// file = new File(tempJSONXsdPath);
|
||||
// if (!file.exists()) {
|
||||
// try {
|
||||
// file.createNewFile();
|
||||
// } catch (IOException e2) {
|
||||
// ExceptionHandler.process(e2);
|
||||
// }
|
||||
// FileOutputStream outStream;
|
||||
// try {
|
||||
// outStream = new FileOutputStream(file);
|
||||
// outStream.write(getConnection().getFileContent());
|
||||
// outStream.close();
|
||||
// } catch (FileNotFoundException e1) {
|
||||
// ExceptionHandler.process(e1);
|
||||
// } catch (IOException e3) {
|
||||
// ExceptionHandler.process(e3);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// file = new File(text);
|
||||
// }
|
||||
|
||||
// setFileContent(file);
|
||||
// }
|
||||
|
||||
try {
|
||||
|
||||
Charset guessedCharset = CharsetToolkit.guessEncoding(file, 4096);
|
||||
String str;
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(file), guessedCharset.displayName()));
|
||||
while ((str = in.readLine()) != null) {
|
||||
if (str.contains("encoding")) { //$NON-NLS-1$
|
||||
String regex = "^<\\?JSON\\s*version=\\\"[^\\\"]*\\\"\\s*encoding=\\\"([^\\\"]*)\\\"\\?>$"; //$NON-NLS-1$
|
||||
|
||||
Perl5Compiler compiler = new Perl5Compiler();
|
||||
Perl5Matcher matcher = new Perl5Matcher();
|
||||
Pattern pattern = null;
|
||||
try {
|
||||
pattern = compiler.compile(regex);
|
||||
if (matcher.contains(str, pattern)) {
|
||||
MatchResult matchResult = matcher.getMatch();
|
||||
if (matchResult != null) {
|
||||
encoding = matchResult.group(1);
|
||||
}
|
||||
}
|
||||
} catch (MalformedPatternException malE) {
|
||||
ExceptionHandler.process(malE);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
String fileStr = text;
|
||||
String msgError = "JSON" + " \"" + fileStr.replace("\\\\", "\\") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
+ "\"\n"; //$NON-NLS-1$
|
||||
if (ex instanceof FileNotFoundException) {
|
||||
msgError = msgError + "is not found";
|
||||
} else if (ex instanceof EOFException) {
|
||||
msgError = msgError + "have an incorrect character EOF";
|
||||
} else if (ex instanceof IOException) {
|
||||
msgError = msgError + "is locked by another soft";
|
||||
} else {
|
||||
msgError = msgError + "doesn't exist";
|
||||
}
|
||||
if (!isReadOnly()) {
|
||||
updateStatus(IStatus.ERROR, msgError);
|
||||
}
|
||||
// ExceptionHandler.process(ex);
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (Exception ex2) {
|
||||
ExceptionHandler.process(ex2);
|
||||
}
|
||||
}
|
||||
if (getConnection().getEncoding() == null || "".equals(getConnection().getEncoding())) { //$NON-NLS-1$
|
||||
getConnection().setEncoding(encoding);
|
||||
if (encoding != null && !("").equals(encoding)) { //$NON-NLS-1$
|
||||
encodingCombo.setText(encoding);
|
||||
} else {
|
||||
encodingCombo.setText("UTF-8"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
// if (tempJSONXsdPath != null && getConnection().getFileContent() != null
|
||||
// && getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
// valid = treePopulator.populateTree(tempJSONXsdPath, treeNode);
|
||||
// } else {
|
||||
// valid = treePopulator.populateTree(text, treeNode);
|
||||
// }
|
||||
checkFieldsValue();
|
||||
isModifing = true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -529,19 +691,6 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
@Override
|
||||
public void modifyText(final ModifyEvent e) {
|
||||
getConnection().setEncoding(encodingCombo.getText());
|
||||
String encoding = getConnection().getEncoding();
|
||||
if (treePopulator != null) {
|
||||
treePopulator.setEncoding(encoding);
|
||||
}
|
||||
try {
|
||||
Charset charSet = Charset.forName(encoding);
|
||||
if (charSet != null) {
|
||||
validateJsonFile();
|
||||
return;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// ignore
|
||||
}
|
||||
checkFieldsValue();
|
||||
}
|
||||
});
|
||||
@@ -734,171 +883,4 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
// valid = this.treePopulator.populateTree(tempJSONXsdPath, treeNode);
|
||||
// temfile.delete();
|
||||
}
|
||||
|
||||
private void validateJsonFile() {
|
||||
String jsonPath = fileFieldJSON.getText();
|
||||
String _jsonPath = jsonPath;
|
||||
if (isContextMode()) {
|
||||
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(
|
||||
connectionItem.getConnection(), connectionItem.getConnection().getContextName());
|
||||
jsonPath = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,
|
||||
jsonPath));
|
||||
|
||||
}
|
||||
String text = validateJsonFilePath(jsonPath);
|
||||
if (text == null || text.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String tempxml = null;
|
||||
String readbyMode = JSONFileStep1Form.this.wizard.getReadbyMode();
|
||||
|
||||
if (EJsonReadbyMode.JSONPATH.getValue().equals(readbyMode)) {
|
||||
tempxml = text;
|
||||
} else {
|
||||
tempxml = JSONUtil.changeJsonToXml(text, getConnection().getEncoding());
|
||||
}
|
||||
File file = new File(text);
|
||||
if (!file.exists()) {
|
||||
file = new File(JSONUtil.tempJSONXsdPath);
|
||||
}
|
||||
JSONFileStep1Form.this.wizard.setTempJsonPath(tempxml);
|
||||
String limitString = commonNodesLimitation.getText();
|
||||
try {
|
||||
limit = Integer.valueOf(limitString);
|
||||
labelLimitation.setToolTipText(MessageFormat.format(Messages.JSONLimitToolTip, limit));
|
||||
} catch (Exception excpt) {
|
||||
// nothing need to do
|
||||
}
|
||||
switchPopulator(readbyMode, tempxml);
|
||||
// }
|
||||
// add for bug TDI-20432
|
||||
checkFieldsValue();
|
||||
// }
|
||||
|
||||
// String text = fileFieldJSON.getText();
|
||||
// File temp = new File(text);
|
||||
// if (!temp.exists()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (getConnection().getJSONFilePath() != null && !getConnection().getJSONFilePath().equals(text)) {
|
||||
getConnection().getLoop().clear();
|
||||
xsdPathChanged = true;
|
||||
} else {
|
||||
xsdPathChanged = false;
|
||||
}
|
||||
|
||||
if (isContextMode()) {
|
||||
jsonPath = _jsonPath;
|
||||
}
|
||||
if (Path.fromOSString(jsonPath).toFile().isFile()) {
|
||||
getConnection().setJSONFilePath(PathUtils.getPortablePath(jsonPath));
|
||||
} else {
|
||||
getConnection().setJSONFilePath(jsonPath);
|
||||
}
|
||||
|
||||
JSONWizard wizard = ((JSONWizard) getPage().getWizard());
|
||||
wizard.setTreeRootNode(treeNode);
|
||||
|
||||
BufferedReader in = null;
|
||||
|
||||
// File file = null;
|
||||
//
|
||||
// if (tempJSONXsdPath != null && getConnection().getFileContent() != null
|
||||
// && getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
// file = new File(tempJSONXsdPath);
|
||||
// if (!file.exists()) {
|
||||
// try {
|
||||
// file.createNewFile();
|
||||
// } catch (IOException e2) {
|
||||
// ExceptionHandler.process(e2);
|
||||
// }
|
||||
// FileOutputStream outStream;
|
||||
// try {
|
||||
// outStream = new FileOutputStream(file);
|
||||
// outStream.write(getConnection().getFileContent());
|
||||
// outStream.close();
|
||||
// } catch (FileNotFoundException e1) {
|
||||
// ExceptionHandler.process(e1);
|
||||
// } catch (IOException e3) {
|
||||
// ExceptionHandler.process(e3);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// file = new File(text);
|
||||
// }
|
||||
|
||||
// setFileContent(file);
|
||||
// }
|
||||
|
||||
try {
|
||||
|
||||
Charset guessedCharset = CharsetToolkit.guessEncoding(file, 4096);
|
||||
String str;
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(file), guessedCharset.displayName()));
|
||||
while ((str = in.readLine()) != null) {
|
||||
if (str.contains("encoding")) { //$NON-NLS-1$
|
||||
String regex = "^<\\?JSON\\s*version=\\\"[^\\\"]*\\\"\\s*encoding=\\\"([^\\\"]*)\\\"\\?>$"; //$NON-NLS-1$
|
||||
|
||||
Perl5Compiler compiler = new Perl5Compiler();
|
||||
Perl5Matcher matcher = new Perl5Matcher();
|
||||
Pattern pattern = null;
|
||||
try {
|
||||
pattern = compiler.compile(regex);
|
||||
if (matcher.contains(str, pattern)) {
|
||||
MatchResult matchResult = matcher.getMatch();
|
||||
if (matchResult != null) {
|
||||
encoding = matchResult.group(1);
|
||||
}
|
||||
}
|
||||
} catch (MalformedPatternException malE) {
|
||||
ExceptionHandler.process(malE);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
String fileStr = text;
|
||||
String msgError = "JSON" + " \"" + fileStr.replace("\\\\", "\\") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
+ "\"\n"; //$NON-NLS-1$
|
||||
if (ex instanceof FileNotFoundException) {
|
||||
msgError = msgError + "is not found";
|
||||
} else if (ex instanceof EOFException) {
|
||||
msgError = msgError + "have an incorrect character EOF";
|
||||
} else if (ex instanceof IOException) {
|
||||
msgError = msgError + "is locked by another soft";
|
||||
} else {
|
||||
msgError = msgError + "doesn't exist";
|
||||
}
|
||||
if (!isReadOnly()) {
|
||||
updateStatus(IStatus.ERROR, msgError);
|
||||
}
|
||||
// ExceptionHandler.process(ex);
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (Exception ex2) {
|
||||
ExceptionHandler.process(ex2);
|
||||
}
|
||||
}
|
||||
if (getConnection().getEncoding() == null || "".equals(getConnection().getEncoding())) { //$NON-NLS-1$
|
||||
getConnection().setEncoding(encoding);
|
||||
if (encoding != null && !("").equals(encoding)) { //$NON-NLS-1$
|
||||
encodingCombo.setText(encoding);
|
||||
} else {
|
||||
encodingCombo.setText("UTF-8"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
// if (tempJSONXsdPath != null && getConnection().getFileContent() != null
|
||||
// && getConnection().getFileContent().length > 0 && !isModifing) {
|
||||
// valid = treePopulator.populateTree(tempJSONXsdPath, treeNode);
|
||||
// } else {
|
||||
// valid = treePopulator.populateTree(text, treeNode);
|
||||
// }
|
||||
checkFieldsValue();
|
||||
isModifing = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
@@ -53,7 +52,6 @@ import org.eclipse.swt.widgets.ScrollBar;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.swt.widgets.Tree;
|
||||
import org.eclipse.swt.widgets.TreeItem;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.ui.command.CommandStackForComposite;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.ws.WindowSystem;
|
||||
@@ -224,7 +222,6 @@ public class JSONFileStep2Form extends AbstractJSONFileStepForm implements IRefr
|
||||
jsonXPathLoopDescriptor.setLimitBoucle(XmlArray.getRowLimit());
|
||||
|
||||
}
|
||||
treePopulator.setEncoding(getConnection().getEncoding());
|
||||
treePopulator.populateTree(wizard.getTempJsonPath(), treeNode);
|
||||
fieldsModel.setJSONXPathLoopDescriptor(jsonXPathLoopDescriptor.getSchemaTargets());
|
||||
fieldsTableEditorView.getTableViewerCreator().layout();
|
||||
@@ -611,22 +608,7 @@ public class JSONFileStep2Form extends AbstractJSONFileStepForm implements IRefr
|
||||
}
|
||||
};
|
||||
|
||||
ProcessDescription processDescription = getProcessDescription(false);
|
||||
EJsonReadbyMode mode = null;
|
||||
String readbyMode = getConnection().getReadbyMode();
|
||||
if (StringUtils.isNotBlank(readbyMode)) {
|
||||
mode = EJsonReadbyMode.getEJsonReadbyModeByValue(readbyMode);
|
||||
}
|
||||
if (EJsonReadbyMode.XPATH.equals(mode)) {
|
||||
/**
|
||||
* JSON XPATH mode uses the temp generated xml file to execute the preview, the generated xml file is
|
||||
* encoded using UTF-8. <br/>
|
||||
* (The generated xml file can't be encoded using other charset, otherwise the converted xml file will be
|
||||
* empty)
|
||||
*/
|
||||
processDescription.setEncoding(TalendQuoteUtils.addQuotes("UTF-8"));
|
||||
}
|
||||
previewLoader.load(processDescription);
|
||||
previewLoader.load(getProcessDescription(false));
|
||||
|
||||
}
|
||||
|
||||
@@ -889,20 +871,10 @@ public class JSONFileStep2Form extends AbstractJSONFileStepForm implements IRefr
|
||||
}
|
||||
}
|
||||
|
||||
Charset guessedCharset = null;
|
||||
try {
|
||||
guessedCharset = Charset.forName(getConnection().getEncoding());
|
||||
} catch (Exception e) {
|
||||
if (CommonsPlugin.isDebugMode()) {
|
||||
ExceptionHandler.process(e, Priority.WARN);
|
||||
}
|
||||
}
|
||||
if (guessedCharset == null) {
|
||||
guessedCharset = CharsetToolkit.guessEncoding(file, 4096);
|
||||
}
|
||||
Charset guessedCharset = CharsetToolkit.guessEncoding(file, 4096);
|
||||
|
||||
String str;
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(pathStr), guessedCharset));
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(pathStr), guessedCharset.displayName()));
|
||||
|
||||
while ((str = in.readLine()) != null) {
|
||||
previewRows.append(str + "\n"); //$NON-NLS-1$
|
||||
@@ -975,7 +947,6 @@ public class JSONFileStep2Form extends AbstractJSONFileStepForm implements IRefr
|
||||
// fix bug: when the JSON file is changed, the linker doesn't work.
|
||||
resetStatusIfNecessary();
|
||||
String tempJson = this.wizard.getTempJsonPath();
|
||||
this.treePopulator.setEncoding(getConnection().getEncoding());
|
||||
this.treePopulator.populateTree(tempJson, treeNode);
|
||||
|
||||
ScrollBar verticalBar = availableJSONTree.getVerticalBar();
|
||||
|
||||
@@ -328,7 +328,7 @@ public class JSONFileStep3Form extends AbstractJSONFileStepForm {
|
||||
processDescription = JSONShadowProcessHelper.getProcessDescription(connection2, connection2.getJSONFilePath());
|
||||
} else {
|
||||
processDescription = JSONShadowProcessHelper.getProcessDescription(connection2,
|
||||
JSONUtil.changeJsonToXml(connection2.getJSONFilePath(), getConnection().getEncoding()));
|
||||
JSONUtil.changeJsonToXml(connection2.getJSONFilePath()));
|
||||
}
|
||||
}
|
||||
return processDescription;
|
||||
@@ -357,18 +357,10 @@ public class JSONFileStep3Form extends AbstractJSONFileStepForm {
|
||||
informationLabel.setText(" " + "Guess in progress...");
|
||||
|
||||
CsvArray csvArray = null;
|
||||
ProcessDescription processDescription = getProcessDescription(false);
|
||||
if (EJsonReadbyMode.JSONPATH.getValue().equals(connection2.getReadbyMode())) {
|
||||
csvArray = JSONShadowProcessHelper.getCsvArray(processDescription, "FILE_JSON"); //$NON-NLS-1$
|
||||
csvArray = JSONShadowProcessHelper.getCsvArray(getProcessDescription(false), "FILE_JSON"); //$NON-NLS-1$
|
||||
} else {
|
||||
/**
|
||||
* JSON XPATH mode uses the temp generated xml file to execute the preview, the generated xml file is
|
||||
* encoded using UTF-8. <br/>
|
||||
* (The generated xml file can't be encoded using other charset, otherwise the converted xml file will
|
||||
* be empty)
|
||||
*/
|
||||
processDescription.setEncoding(TalendQuoteUtils.addQuotes("UTF-8"));
|
||||
csvArray = JSONShadowProcessHelper.getCsvArray(processDescription, "FILE_XML"); //$NON-NLS-1$
|
||||
csvArray = JSONShadowProcessHelper.getCsvArray(getProcessDescription(false), "FILE_XML"); //$NON-NLS-1$
|
||||
}
|
||||
if (csvArray == null) {
|
||||
informationLabel.setText(" " + "Guess failure");
|
||||
|
||||
@@ -52,9 +52,7 @@ import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
@@ -129,8 +127,6 @@ public class JSONWizard extends CheckLastVersionRepositoryWizard implements INew
|
||||
private List<ATreeNode> rootNodes;
|
||||
|
||||
private final Map<String, List<FOXTreeNode>> foxNodesMap = new HashMap<String, List<FOXTreeNode>>();
|
||||
|
||||
private List<IMetadataTable> oldMetadataTable = new ArrayList<IMetadataTable>();
|
||||
|
||||
private boolean isToolbar;
|
||||
|
||||
@@ -236,10 +232,6 @@ public class JSONWizard extends CheckLastVersionRepositoryWizard implements INew
|
||||
this.originalDescription = this.connectionItem.getProperty().getDescription();
|
||||
this.originalPurpose = this.connectionItem.getProperty().getPurpose();
|
||||
this.originalStatus = this.connectionItem.getProperty().getStatusCode();
|
||||
MetadataTable[] tables = ConnectionHelper.getTables(connectionItem.getConnection()).toArray(new MetadataTable[0]);
|
||||
for (MetadataTable table : tables) {
|
||||
this.oldMetadataTable.add(ConvertionHelper.convert(table));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,10 +297,6 @@ public class JSONWizard extends CheckLastVersionRepositoryWizard implements INew
|
||||
this.originalDescription = this.connectionItem.getProperty().getDescription();
|
||||
this.originalPurpose = this.connectionItem.getProperty().getPurpose();
|
||||
this.originalStatus = this.connectionItem.getProperty().getStatusCode();
|
||||
MetadataTable[] tables = ConnectionHelper.getTables(connectionItem.getConnection()).toArray(new MetadataTable[0]);
|
||||
for (MetadataTable table : tables) {
|
||||
this.oldMetadataTable.add(ConvertionHelper.convert(table));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,7 +505,7 @@ public class JSONWizard extends CheckLastVersionRepositoryWizard implements INew
|
||||
"There are some new fields to extract, guess your schema manually if you want to apply the update.");
|
||||
}
|
||||
// update
|
||||
RepositoryUpdateManager.updateFileConnection(connectionItem, oldMetadataTable);
|
||||
RepositoryUpdateManager.updateFileConnection(connectionItem);
|
||||
refreshInFinish(propertiesWizardPage.isNameModifiedByUser());
|
||||
final RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("", this) {
|
||||
|
||||
@@ -643,6 +631,11 @@ public class JSONWizard extends CheckLastVersionRepositoryWizard implements INew
|
||||
file = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType, file));
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
// prepareColumnsFromXSD(file, newColumns, schemaTarget);
|
||||
return;
|
||||
}
|
||||
|
||||
if (csvArray == null || csvArray.getRows().isEmpty()) {
|
||||
return;
|
||||
} else {
|
||||
|
||||
@@ -20,13 +20,10 @@ import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode;
|
||||
import org.talend.metadata.managment.ui.wizard.metadata.xml.utils.TreeUtil;
|
||||
import org.talend.repository.json.ui.wizards.AbstractJSONStepForm;
|
||||
import org.talend.repository.json.util.JSONUtil;
|
||||
import org.talend.repository.model.json.JSONFileConnection;
|
||||
|
||||
/**
|
||||
* hwang class global comment. Detailled comment
|
||||
@@ -59,17 +56,7 @@ public class ImportTreeFromJSONAction extends SelectionProviderAction {
|
||||
|
||||
boolean changed = true;
|
||||
try {
|
||||
String encoding = "UTF-8";
|
||||
if (this.form != null) {
|
||||
ConnectionItem connectionItem = this.form.getConnectionItem();
|
||||
if (connectionItem != null) {
|
||||
Connection connection = connectionItem.getConnection();
|
||||
if (connection instanceof JSONFileConnection) {
|
||||
encoding = ((JSONFileConnection) connection).getEncoding();
|
||||
}
|
||||
}
|
||||
}
|
||||
newInput = TreeUtil.getFoxTreeNodes(JSONUtil.changeJsonToXml(filePath, encoding));
|
||||
newInput = TreeUtil.getFoxTreeNodes(JSONUtil.changeJsonToXml(filePath));
|
||||
changed = true;
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
|
||||
@@ -135,10 +135,7 @@ public class JSONToJsonPathLinker extends JSONToXPathLinker {
|
||||
} else {
|
||||
fullPath = relativeXpathPrm;
|
||||
}
|
||||
TreeItem treeItemFromAbsoluteXPath = null;
|
||||
if(fieldToExtract(relativeXpathPrm, treePopulator.getAllNodes())) {
|
||||
treeItemFromAbsoluteXPath = treePopulator.getTreeItem(fullPath);
|
||||
}
|
||||
TreeItem treeItemFromAbsoluteXPath = treePopulator.getTreeItem(fullPath);
|
||||
if (treeItemFromAbsoluteXPath != null) {
|
||||
addFieldLink(treeItemFromAbsoluteXPath, treeItemFromAbsoluteXPath.getData(), tableItemTarget.getParent(),
|
||||
(SchemaTarget) tableItemTarget.getData());
|
||||
|
||||
@@ -71,7 +71,6 @@ import org.talend.commons.utils.data.list.IListenableListListener;
|
||||
import org.talend.commons.utils.data.list.ListenableListEvent;
|
||||
import org.talend.commons.utils.data.list.ListenableListEvent.TYPE;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.datatools.xml.utils.ATreeNode;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
|
||||
import org.talend.metadata.managment.ui.wizard.metadata.xml.XmlExtractorBgRefresher;
|
||||
@@ -275,7 +274,6 @@ public class JSONToXPathLinker extends TreeToTablesLinker<Object, Object> {
|
||||
}
|
||||
|
||||
if (originalValue != null) {
|
||||
loadItemDataForLazyLoad(loopTableEditorView);
|
||||
createLoopLinks(originalValue, tableItem, monitorWrap);
|
||||
}
|
||||
|
||||
@@ -315,7 +313,7 @@ public class JSONToXPathLinker extends TreeToTablesLinker<Object, Object> {
|
||||
List<SchemaTarget> schemaTargetList, int startTableItem, int tableItemLength) {
|
||||
monitorWrap.beginTask("Fields links creation ...", totalWork);
|
||||
|
||||
loadItemDataForLazyLoad(fieldsTableEditorView);
|
||||
loadItemDataForLazyLoad();
|
||||
TableItem[] fieldsTableItems = fieldsTableEditorView.getTable().getItems();
|
||||
for (int i = startTableItem, indexShemaTarget = 0; i < startTableItem + tableItemLength; i++, indexShemaTarget++) {
|
||||
|
||||
@@ -332,30 +330,33 @@ public class JSONToXPathLinker extends TreeToTablesLinker<Object, Object> {
|
||||
TableItem tableItem = fieldsTableItems[i];
|
||||
SchemaTarget schemaTarget = schemaTargetList.get(indexShemaTarget);
|
||||
String relativeXpathQuery = schemaTarget.getRelativeXPathQuery();
|
||||
if(fieldToExtract(schemaTarget.getTagName(), treePopulator.getAllNodes())) {
|
||||
createFieldLinks(relativeXpathQuery, tableItem, monitorWrap, schemaTarget);
|
||||
}
|
||||
createFieldLinks(relativeXpathQuery, tableItem, monitorWrap, schemaTarget);
|
||||
monitorWrap.worked(1);
|
||||
}
|
||||
fieldsTableEditorView.getTableViewerCreator().getTableViewer().refresh();
|
||||
getLinksManager().sortLinks(getDrawingLinksComparator());
|
||||
getBackgroundRefresher().refreshBackground();
|
||||
}
|
||||
|
||||
private void loadItemDataForLazyLoad() {
|
||||
if (!fieldsTableEditorView.getTableViewerCreator().isLazyLoad()) {
|
||||
return;
|
||||
}
|
||||
List<SchemaTarget> beansList = fieldsTableEditorView.getExtendedTableModel().getBeansList();
|
||||
Table table = fieldsTableEditorView.getTable();
|
||||
for (TableItem tableItem : table.getItems()) {
|
||||
if (tableItem.getData() == null) {
|
||||
int index = table.indexOf(tableItem);
|
||||
SchemaTarget schemaTarget = beansList.get(index);
|
||||
tableItem.setData(schemaTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IModifiedBeanListener loopModelModifiedBeanListener;
|
||||
|
||||
private IExtendedControlListener loopTableExtendedControlListener;
|
||||
|
||||
private ILineSelectionListener afterLineSelectionListener;
|
||||
|
||||
public boolean fieldToExtract(String relativeXpathQuery, List<ATreeNode> nodes) {
|
||||
for(ATreeNode node : nodes) {
|
||||
if(relativeXpathQuery.equals(node.getLabel())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC amaumont Comment method "initListeners".
|
||||
@@ -792,10 +793,7 @@ public class JSONToXPathLinker extends TreeToTablesLinker<Object, Object> {
|
||||
} else {
|
||||
fullPath = relativeXpath;
|
||||
}
|
||||
TreeItem treeItemFromAbsoluteXPath = null;
|
||||
if(fieldToExtract(relativeXpath, treePopulator.getAllNodes())) {
|
||||
treeItemFromAbsoluteXPath = treePopulator.getTreeItem(fullPath);
|
||||
}
|
||||
TreeItem treeItemFromAbsoluteXPath = treePopulator.getTreeItem(fullPath);
|
||||
if (treeItemFromAbsoluteXPath != null && !alreadyProcessedXPath.contains(fullPath)) {
|
||||
addFieldLink(treeItemFromAbsoluteXPath, treeItemFromAbsoluteXPath.getData(), tableItemTarget.getParent(),
|
||||
(SchemaTarget) tableItemTarget.getData());
|
||||
|
||||
@@ -111,7 +111,7 @@ public class JSONUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static String changeJsonToXml(String jsonPath, String encoding) {
|
||||
public static String changeJsonToXml(String jsonPath) {
|
||||
Project project = ProjectManager.getInstance().getCurrentProject();
|
||||
IProject fsProject = null;
|
||||
try {
|
||||
@@ -166,9 +166,10 @@ public class JSONUtil {
|
||||
}
|
||||
|
||||
try {
|
||||
String jsonStr = IOUtils.toString(input, encoding);
|
||||
String jsonStr = IOUtils.toString(input);
|
||||
|
||||
convertJSON.setJsonString(jsonStr);
|
||||
|
||||
convertJSON.generate();
|
||||
jsonStr = convertJSON.getJsonString4XML();
|
||||
inStream = new ByteArrayInputStream(jsonStr.getBytes());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,84 +0,0 @@
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.repository.model.migration;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.model.components.ComponentUtilities;
|
||||
import org.talend.core.model.components.ModifyComponentsAction;
|
||||
import org.talend.core.model.components.conversions.IComponentConversion;
|
||||
import org.talend.core.model.components.filters.IComponentFilter;
|
||||
import org.talend.core.model.components.filters.NameComponentFilter;
|
||||
import org.talend.core.model.migration.AbstractJobMigrationTask;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
import org.talend.migration.IMigrationTask.ExecutionResult;
|
||||
|
||||
public class changeDBVersionForMapROJAIOutputMigrationTask extends AbstractJobMigrationTask {
|
||||
|
||||
@Override
|
||||
public Date getOrder() {
|
||||
GregorianCalendar gc = new GregorianCalendar(2019, 8, 12, 12, 0, 0);
|
||||
return gc.getTime();
|
||||
}
|
||||
@Override
|
||||
public ExecutionResult execute(Item item) {
|
||||
final ProcessType processType = getProcessType(item);
|
||||
String[] compNames = {"tMapROjaiOutput"};
|
||||
|
||||
IComponentConversion changeDBNVersion = new IComponentConversion() {
|
||||
|
||||
public void transform(NodeType node) {
|
||||
if(node == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ElementParameterType database = ComponentUtilities.getNodeProperty(node, "DB_VERSION"); //$NON-NLS-1$
|
||||
|
||||
if (database == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String dbname = database.getValue();
|
||||
|
||||
if("MAPROJAI_5_1".equals(dbname)) {
|
||||
database.setValue("MAPR510");
|
||||
} else if ("MAPROJAI_5_2".equals(dbname)) {
|
||||
database.setValue("MAPR520");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
for (String name : compNames) {
|
||||
IComponentFilter filter = new NameComponentFilter(name);
|
||||
|
||||
try {
|
||||
ModifyComponentsAction.searchAndModify(item, processType, filter, Arrays
|
||||
.<IComponentConversion> asList(changeDBNVersion));
|
||||
} catch (PersistenceException e) {
|
||||
// TODO Auto-generated catch block
|
||||
ExceptionHandler.process(e);
|
||||
return ExecutionResult.FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return ExecutionResult.SUCCESS_NO_ALERT;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -961,9 +961,6 @@ public class JavaJobScriptsExportWSWizardPage extends JavaJobScriptsExportWizard
|
||||
log4jLevelCombo.select(2);
|
||||
}
|
||||
}
|
||||
// contextCombo applyToChildrenButton control by contextbutton
|
||||
contextCombo.setEnabled(contextButton.getSelection());
|
||||
applyToChildrenButton.setEnabled(contextButton.getSelection());
|
||||
}
|
||||
|
||||
private void restoreWidgetValuesForImage() {
|
||||
|
||||
@@ -39,9 +39,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
|
||||
@@ -419,14 +416,7 @@ public class BuildJobHandler extends AbstractBuildJobHandler {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Shell shell = null;
|
||||
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||
|
||||
if (activeWorkbenchWindow != null) {
|
||||
shell = activeWorkbenchWindow.getShell();
|
||||
}
|
||||
|
||||
MessageBoxExceptionHandler.process(e, shell);
|
||||
MessageBoxExceptionHandler.process(e, Display.getDefault().getActiveShell());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -24,6 +24,7 @@ package org.talend.repository.ui.wizards.exportjob.handler;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -35,6 +36,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.designer.maven.launch.MavenPomCommandLauncher;
|
||||
import org.talend.designer.maven.model.MavenSystemFolders;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
@@ -159,7 +161,7 @@ public class BuildOSGiBundleHandler extends BuildJobHandler {
|
||||
fileExtension = esbExportType;
|
||||
}
|
||||
|
||||
if (fileExtension.equals(file.getFileExtension())) {
|
||||
if (fileExtension.equals(file.getFileExtension()) && file.getName().contains("bundle")) {
|
||||
bundleFile = file;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.talend.core.runtime.repository.build.BuildExportManager;
|
||||
import org.talend.core.runtime.repository.build.IBuildExportHandler;
|
||||
import org.talend.core.runtime.repository.build.IBuildJobParameters;
|
||||
import org.talend.core.runtime.repository.build.IBuildParametes;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.repository.constants.BuildJobConstants;
|
||||
import org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.JobExportType;
|
||||
import org.talend.repository.ui.wizards.exportjob.handler.BuildJobHandler;
|
||||
@@ -96,6 +97,16 @@ public class BuildJobFactory {
|
||||
ERepositoryObjectType repositoryObjectType = ERepositoryObjectType.getItemType(processItem);
|
||||
if (repositoryObjectType == ERepositoryObjectType.PROCESS_ROUTE && "ROUTE_MICROSERVICE".equals(type)) {
|
||||
esb = true;
|
||||
} else {
|
||||
for (Object o : ((ProcessItem) processItem).getProcess().getNode()) {
|
||||
if (o instanceof NodeType) {
|
||||
NodeType currentNode = (NodeType) o;
|
||||
if (BuildJobConstants.esbComponents.contains(currentNode.getComponentName())) {
|
||||
esb = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
pom.xml
1
pom.xml
@@ -156,7 +156,6 @@
|
||||
<module>test/plugins/org.talend.designer.webservice.test</module>
|
||||
<module>test/plugins/org.talend.designer.scd.test</module>
|
||||
<module>test/plugins/org.talend.designer.unifiedcomponent.test</module>
|
||||
<module>test/plugins/org.talend.expressionbuilder.test</module>
|
||||
</modules>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -151,8 +151,6 @@ public class DbGenerationManagerTestHelper {
|
||||
tName = TalendTextUtils.removeQuotes(tName);
|
||||
when(connection.getName()).thenReturn(tName);
|
||||
when(connection.getSource()).thenReturn(node);
|
||||
when(connection.getMetaName()).thenReturn(tName);
|
||||
when(connection.getUniqueName()).thenReturn(tName);
|
||||
IMetadataTable table = new MetadataTable();
|
||||
table.setLabel(tableName);
|
||||
table.setTableName(tableName);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package java;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* DOC bqian class global comment. Detailled comment <br/>
|
||||
*
|
||||
*/
|
||||
public class JavaProcessorTest {
|
||||
|
||||
/**
|
||||
* Test method for {@link org.talend.designer.runprocess.Processor#replaceSnippet(java.lang.String)}.
|
||||
*/
|
||||
@Test
|
||||
public void testReplaceSnippet() {
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user