Compare commits
205 Commits
release/7.
...
hwang/TUP-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64a057c4ae | ||
|
|
15b95db3d1 | ||
|
|
467f9e7964 | ||
|
|
8a4074ee05 | ||
|
|
ee3d82ae24 | ||
|
|
658b16c6bb | ||
|
|
5c0ae7bc06 | ||
|
|
bd9e958749 | ||
|
|
9a27b823cd | ||
|
|
fc3a36e509 | ||
|
|
6e9bc05e41 | ||
|
|
dff062b7ef | ||
|
|
e86646a9f5 | ||
|
|
491b85c20c | ||
|
|
f9c38abf9e | ||
|
|
0570c402bc | ||
|
|
4cae11c6f5 | ||
|
|
54e246df6d | ||
|
|
3a054b8430 | ||
|
|
820367d52f | ||
|
|
cfe44195d0 | ||
|
|
6b6439a434 | ||
|
|
0730f6ea3b | ||
|
|
2a6d86c39a | ||
|
|
94e6f53b47 | ||
|
|
a1e8aebf87 | ||
|
|
666fe63e7a | ||
|
|
4e167cea3f | ||
|
|
4153b50336 | ||
|
|
2d16bae768 | ||
|
|
2ed876833f | ||
|
|
05f87d09e3 | ||
|
|
444d28c48d | ||
|
|
a7d010413d | ||
|
|
6c4981c2bf | ||
|
|
ae3e6bf7be | ||
|
|
730d9cb8e9 | ||
|
|
e58754832e | ||
|
|
d6927c33fa | ||
|
|
7ea06495a6 | ||
|
|
8b4dd6398d | ||
|
|
5e65e4ed26 | ||
|
|
49a907b477 | ||
|
|
68758eadc7 | ||
|
|
d9f8f4edcd | ||
|
|
a5c06b4267 | ||
|
|
b2fd2e2a60 | ||
|
|
f5bbcdb213 | ||
|
|
95e561d5ff | ||
|
|
bf8d944ed1 | ||
|
|
1f1bceca93 | ||
|
|
6f5a6e0443 | ||
|
|
9892b271ea | ||
|
|
3ff14ecbb5 | ||
|
|
cd7f09fc90 | ||
|
|
10d4f8dcb6 | ||
|
|
1c58501af2 | ||
|
|
a2f0a61607 | ||
|
|
0095b468f9 | ||
|
|
7bfad56c30 | ||
|
|
efbf56f6d0 | ||
|
|
c29f483f2c | ||
|
|
c05d88ee3d | ||
|
|
ecdf7a18b0 | ||
|
|
6eddb2cd20 | ||
|
|
0bd016b1c5 | ||
|
|
93b97ab0ed | ||
|
|
0e08ab1a54 | ||
|
|
c3f79cd79e | ||
|
|
29c1c47d97 | ||
|
|
ccdaa1af1c | ||
|
|
25857d0c10 | ||
|
|
0f3a3dda19 | ||
|
|
943dbe61b2 | ||
|
|
2c7dca1458 | ||
|
|
06a4ca938c | ||
|
|
217360420f | ||
|
|
9bf91aca62 | ||
|
|
155973785f | ||
|
|
5e0f8e9194 | ||
|
|
64b049164c | ||
|
|
1be6c8fdd4 | ||
|
|
73e7d360d0 | ||
|
|
ec490c589e | ||
|
|
2a67448f58 | ||
|
|
617095c83b | ||
|
|
1c857a778a | ||
|
|
568c60df0f | ||
|
|
425dce5d7a | ||
|
|
30b9a6af9d | ||
|
|
c782cdc070 | ||
|
|
7bd4d48476 | ||
|
|
99ad6fb48b | ||
|
|
92c5a956b8 | ||
|
|
a3daac36e9 | ||
|
|
b7c5bb914c | ||
|
|
3f9f37bf90 | ||
|
|
24471c3ed3 | ||
|
|
e592a52dfa | ||
|
|
b0d4990091 | ||
|
|
4766e40047 | ||
|
|
78bbfc61fb | ||
|
|
f3bd46488e | ||
|
|
36f98068e5 | ||
|
|
41cbeeb140 | ||
|
|
c96bae71da | ||
|
|
eedf273635 | ||
|
|
d047644d8b | ||
|
|
bd04ae1b54 | ||
|
|
8641ad63d1 | ||
|
|
9f80f3f7ff | ||
|
|
bbb2bddea5 | ||
|
|
ad193ddfd8 | ||
|
|
8ee5787201 | ||
|
|
7f91106ec7 | ||
|
|
f7607f6e8a | ||
|
|
5027f0fd3b | ||
|
|
504a5477bc | ||
|
|
196bec65e5 | ||
|
|
c6fdf4da5b | ||
|
|
f52c9c2584 | ||
|
|
0fb3315eee | ||
|
|
ba12b6577a | ||
|
|
ce7bfa060f | ||
|
|
a8155b659c | ||
|
|
f0c4517bbc | ||
|
|
247fc84baa | ||
|
|
1b8fe81314 | ||
|
|
5d32586b46 | ||
|
|
4596f2a3a8 | ||
|
|
f5001bcddf | ||
|
|
15f87a595f | ||
|
|
74d0a5fc4d | ||
|
|
9a7f158ea8 | ||
|
|
76aff58dc9 | ||
|
|
ab1c2ac982 | ||
|
|
856a9343b8 | ||
|
|
1db0ec3664 | ||
|
|
b39ca1b28e | ||
|
|
54e445bdd2 | ||
|
|
9cbe98d4ef | ||
|
|
26e88b26be | ||
|
|
6217c3042d | ||
|
|
2c8df34e97 | ||
|
|
86b8e75e73 | ||
|
|
f2bcb6d71f | ||
|
|
0403d4d7d4 | ||
|
|
4198afd1d2 | ||
|
|
a971215151 | ||
|
|
14c59926c6 | ||
|
|
374903d266 | ||
|
|
abab035072 | ||
|
|
03c3e264e6 | ||
|
|
948eb33247 | ||
|
|
70b86c3519 | ||
|
|
57ef3ab3f6 | ||
|
|
bb0dc580a2 | ||
|
|
2f1029eba9 | ||
|
|
fff59f3b2f | ||
|
|
712db2045d | ||
|
|
96bc7ed4c5 | ||
|
|
f749ac3e2a | ||
|
|
91e83eedf0 | ||
|
|
4d5844376e | ||
|
|
e56ccf3f62 | ||
|
|
e04ef82e30 | ||
|
|
273a5025c7 | ||
|
|
612e5a5c27 | ||
|
|
38f544be0a | ||
|
|
3b872b62e5 | ||
|
|
1910ed40e5 | ||
|
|
d0912599ec | ||
|
|
ee20cf02ca | ||
|
|
5427bc53f1 | ||
|
|
9b4bfe85be | ||
|
|
b5916d9122 | ||
|
|
5e9f08c9ff | ||
|
|
8e977f5110 | ||
|
|
90c7f820b9 | ||
|
|
1d5f0bacc6 | ||
|
|
8a3ef5e9ad | ||
|
|
47bd697fbe | ||
|
|
926cb4f36b | ||
|
|
2ffffcc703 | ||
|
|
c010bc5084 | ||
|
|
3dc2aac9bb | ||
|
|
9f7ad6f9dd | ||
|
|
7426a93b49 | ||
|
|
c3e5d003be | ||
|
|
cf5ea4e526 | ||
|
|
4914a382fc | ||
|
|
30caab1c84 | ||
|
|
da989e3f8c | ||
|
|
77754871b5 | ||
|
|
b024dd0ec0 | ||
|
|
b4d3e5ebea | ||
|
|
29f74206d5 | ||
|
|
445c9fc74b | ||
|
|
9f0b02c045 | ||
|
|
e3f4be3219 | ||
|
|
dc47689710 | ||
|
|
936cf7958f | ||
|
|
8f842b2155 | ||
|
|
db23bf8ec1 | ||
|
|
99ba1911f3 |
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.talend.help.tos.components.feature</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.FeatureBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1 @@
|
||||
bin.includes = feature.xml
|
||||
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="org.talend.help.tos.components.feature"
|
||||
label="Talend COMPONENTS help feature"
|
||||
version="7.3.1.qualifier"
|
||||
provider-name=".Talend SA.">
|
||||
|
||||
<description url="http://www.example.com/description">
|
||||
[Enter Feature Description here.]
|
||||
</description>
|
||||
|
||||
<copyright url="http://www.example.com/copyright">
|
||||
[Enter Copyright Description here.]
|
||||
</copyright>
|
||||
|
||||
<license url="http://www.example.com/license">
|
||||
[Enter License Description here.]
|
||||
</license>
|
||||
|
||||
<url>
|
||||
<update label="CORE Talend update site for milestones" url="http://talendforge.org/core/updatesite/testing/"/>
|
||||
</url>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.azurestorage"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.filedelimited"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.filterrow"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.googledrive"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.jdbc"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.jira"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.marketo"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.salesforce"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.snowflake"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.help.splunk"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
12
main/features/org.talend.help.tos.components.feature/pom.xml
Normal file
12
main/features/org.talend.help.tos.components.feature/pom.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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.3.1-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.help.tos.components.feature</artifactId>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
@@ -9,6 +9,7 @@
|
||||
</url>
|
||||
<requires>
|
||||
<import feature="org.talend.tos.feature" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import feature="org.talend.help.di.feature" version="0.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
<plugin id="org.talend.designer.maven.tos" download-size="0" install-size="0" version="0.0.0" fragment="true"/>
|
||||
<plugin id="org.talend.presentation.onboarding" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
|
||||
@@ -53,16 +53,6 @@
|
||||
<plugin id="org.talend.designer.xmlmap.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.expressionbuilder" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.expressionbuilder.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.help.azurestorage" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.filedelimited" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.filterrow" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.googledrive" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.jdbc" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.jira" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.marketo" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.salesforce" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.snowflake" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.help.splunk" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.repository.generic" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.sdk.component.studio-integration" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
</feature>
|
||||
|
||||
@@ -23,7 +23,8 @@ Require-Bundle: org.talend.core.repository,
|
||||
org.talend.components.api,
|
||||
org.talend.daikon,
|
||||
org.talend.daikon.crypto.utils,
|
||||
org.talend.designer.core.generic
|
||||
org.talend.designer.core.generic,
|
||||
org.talend.updates.runtime
|
||||
Eclipse-LazyStart: true
|
||||
Bundle-ClassPath: .
|
||||
Export-Package: org.talend.designer.codegen,
|
||||
|
||||
@@ -329,14 +329,26 @@ end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
}
|
||||
// Else, that means the component is a ON_COMPONENT_OK virtual component typed.
|
||||
}
|
||||
|
||||
|
||||
if(generateMethodCall) {
|
||||
/*check if parralel iterate call not finished from this component */
|
||||
boolean parallelIterate = false;
|
||||
for (IConnection iterateConn : iterateConnSet) {
|
||||
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
|
||||
if (parallelIterate) {
|
||||
if (codePart.equals(ECodePart.END)) {
|
||||
String iterateTargetNodeName = iterateConn.getTarget().getUniqueName();
|
||||
%>
|
||||
mtp_<%=iterateTargetNodeName %>.waitForEndOfQueue();
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%=outgoingConn.getTarget().getUniqueName() %>Process(globalMap);
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (outgoingConn.getLineStyle().equals(EConnectionType.RUN_IF)) {
|
||||
%>
|
||||
@@ -344,12 +356,27 @@ end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
<%//send the true status to socket
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=outgoingConn.getUniqueName() %>", 0, "true");
|
||||
}
|
||||
<%}%>
|
||||
<%=outgoingConn.getTarget().getUniqueName() %>Process(globalMap);
|
||||
}
|
||||
<%
|
||||
}
|
||||
/*check if parralel iterate call not finished from this component */
|
||||
boolean parallelIterate = false;
|
||||
for (IConnection iterateConn : iterateConnSet) {
|
||||
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
|
||||
if (parallelIterate) {
|
||||
if (codePart.equals(ECodePart.END)) {
|
||||
String iterateTargetNodeName = iterateConn.getTarget().getUniqueName();
|
||||
%>
|
||||
mtp_<%=iterateTargetNodeName %>.waitForEndOfQueue();
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%=outgoingConn.getTarget().getUniqueName() %>Process(globalMap);
|
||||
}
|
||||
|
||||
<%
|
||||
//send the false status to socket
|
||||
@@ -376,7 +403,7 @@ end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
|
||||
if (parallelIterate) {
|
||||
if (codePart.equals(ECodePart.END)) {
|
||||
String iterateTargetNodeName = iterateConn.getTarget().getUniqueName();
|
||||
String iterateTargetNodeName = iterateConn.getTarget().getUniqueName();
|
||||
%>
|
||||
mtp_<%=iterateTargetNodeName %>.waitForEndOfQueue();
|
||||
|
||||
|
||||
@@ -54,7 +54,9 @@
|
||||
jobFolderName = jobFolderName + JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion());
|
||||
String jobClassPackageFolder = codeGenArgument.getCurrentProjectName().toLowerCase() + '/' + jobFolderName;
|
||||
|
||||
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__"));
|
||||
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__"));//log4j enable
|
||||
boolean isLog4j2Enabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J2_ACTIVATE__"));//log4j2 enable
|
||||
boolean isLog4j1Enabled = !isLog4j2Enabled;//log4j1 enable
|
||||
|
||||
boolean exist_tParallelize = false;
|
||||
List<? extends INode> tParallelizeList = process.getNodesOfType("tParallelize");
|
||||
@@ -449,6 +451,7 @@
|
||||
|
||||
<%if(isLog4jEnabled){%>
|
||||
if(!"".equals(log4jLevel)){
|
||||
<%if(isLog4j1Enabled){%>
|
||||
if("trace".equalsIgnoreCase(log4jLevel)){
|
||||
log.setLevel(org.apache.log4j.Level.TRACE);
|
||||
}else if("debug".equalsIgnoreCase(log4jLevel)){
|
||||
@@ -465,6 +468,26 @@
|
||||
log.setLevel(org.apache.log4j.Level.OFF);
|
||||
}
|
||||
org.apache.log4j.Logger.getRootLogger().setLevel(log.getLevel());
|
||||
<%}%>
|
||||
|
||||
<%if(isLog4j2Enabled){%>
|
||||
if("trace".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.TRACE);
|
||||
}else if("debug".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.DEBUG);
|
||||
}else if("info".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.INFO);
|
||||
}else if("warn".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.WARN);
|
||||
}else if("error".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.ERROR);
|
||||
}else if("fatal".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.FATAL);
|
||||
}else if ("off".equalsIgnoreCase(log4jLevel)){
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(log.getName(), org.apache.logging.log4j.Level.OFF);
|
||||
}
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(org.apache.logging.log4j.LogManager.getRootLogger().getName(), log.getLevel());
|
||||
<%}%>
|
||||
}
|
||||
log.info("TalendJob: '<%=codeGenArgument.getJobName()%>' - Start.");
|
||||
<%}%>
|
||||
@@ -499,6 +522,13 @@
|
||||
.filter(it -> it.startsWith("monitoring.audit.logger.properties."))
|
||||
.forEach(key -> properties_<%=jobCatcherNode.getUniqueName()%>.setProperty(key.substring("monitoring.audit.logger.properties.".length()), System.getProperty(key)));
|
||||
|
||||
<%if(isLog4j1Enabled) {%>
|
||||
org.apache.log4j.Logger.getLogger("audit").setLevel(org.apache.log4j.Level.DEBUG);
|
||||
<%}%>
|
||||
|
||||
<%if(isLog4j2Enabled) {%>
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel("audit", org.apache.logging.log4j.Level.DEBUG);
|
||||
<%}%>
|
||||
auditLogger_<%=jobCatcherNode.getUniqueName()%> = org.talend.job.audit.JobEventAuditLoggerFactory.createJobAuditLogger(properties_<%=jobCatcherNode.getUniqueName()%>);
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -141,7 +141,9 @@ for (INode node : process.getNodesOfType("tRESTClient")) {
|
||||
boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJob = talendEsbJobFactory || actAsConsumer || ProcessorUtilities.isEsbJob(process);
|
||||
|
||||
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__"));
|
||||
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J_ACTIVATE__"));//log4j enable
|
||||
boolean isLog4j2Enabled = ("true").equals(ElementParameterParser.getValue(process, "__LOG4J2_ACTIVATE__"));//log4j2 enable
|
||||
boolean isLog4j1Enabled = !isLog4j2Enabled;//log4j1 enable
|
||||
|
||||
if (talendMdmJob) {
|
||||
talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job
|
||||
@@ -156,7 +158,14 @@ if (talendEsbJobFactory) {
|
||||
public class <%=className%> implements <%=talendJobInterfaces%> {
|
||||
<%if(isLog4jEnabled){%>
|
||||
static {System.setProperty("TalendJob.log", "<%=className%>.log");}
|
||||
|
||||
<%if(isLog4j1Enabled){%>
|
||||
private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(<%=className%>.class);
|
||||
<%}%>
|
||||
|
||||
<%if(isLog4j2Enabled){%>
|
||||
private static org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(<%=className%>.class);
|
||||
<%}%>
|
||||
<%}%>
|
||||
|
||||
protected static void logIgnoredError(String message, Throwable cause) {
|
||||
|
||||
@@ -66,6 +66,11 @@ ComponentJobletPreferencePage.label=Don't show corresponding job after double cl
|
||||
ComponentsPreferencePage_SuccessTitle=Success
|
||||
ComponentsPreferencePage_SuccessMessage1=Need restart studio to load the new components. Else, will be loaded in next time when start.
|
||||
ComponentsPreferencePage_SuccessMessage2=Do you want to restart right now?
|
||||
ComponentsPreferencePage.enableOnLineHelp=Enable online help for components
|
||||
ComponentsPreferencePage.titleInstallHelp=Install offline help feature?
|
||||
ComponentsPreferencePage.msgInstallHelp=This will open additional packages dialog to install offline help feature, do you want to continue?
|
||||
ComponentsPreferencePage.grpHelp=Help
|
||||
|
||||
ComponenttRunJobPreferencePage.showCorrespondingJob=Show corresponding job after double click on a tRunJob Component.
|
||||
XsdValidationCacheManager.unableLoadxsd=unable to load xsd validation cache file
|
||||
XsdValidationCacheManager.unableSavexsd=unable to save xsd validation cache file
|
||||
|
||||
@@ -14,6 +14,8 @@ package org.talend.designer.codegen.components.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
@@ -30,6 +32,7 @@ import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
@@ -52,6 +55,12 @@ import org.talend.designer.codegen.i18n.Messages;
|
||||
import org.talend.designer.core.DesignerPlugin;
|
||||
import org.talend.designer.core.assist.TalendEditorComponentCreationUtil;
|
||||
import org.talend.designer.core.ui.preferences.TalendDesignerPrefConstants;
|
||||
import org.talend.designer.core.utils.ComponentsHelpUtil;
|
||||
import org.talend.updates.runtime.InstallFeatureObserver;
|
||||
import org.talend.updates.runtime.engine.ExtraFeaturesUpdatesFactory;
|
||||
import org.talend.updates.runtime.model.AbstractExtraFeature;
|
||||
import org.talend.updates.runtime.model.ExtraFeature;
|
||||
import org.talend.updates.runtime.ui.ShowWizardHandler;
|
||||
|
||||
/**
|
||||
* This class represents a preference page that is contributed to the Preferences dialog. By subclassing
|
||||
@@ -71,6 +80,8 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
|
||||
private DirectoryFieldEditor filePathTemp;
|
||||
|
||||
private CheckBoxFieldEditor enableOnLineHelpField;
|
||||
|
||||
private final String dataViewer = "Data Viewer"; //$NON-NLS-1$
|
||||
|
||||
private final String mapper = "Mapper "; //$NON-NLS-1$
|
||||
@@ -81,6 +92,8 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
|
||||
private final String assist = "Component Assist"; //$NON-NLS-1$
|
||||
|
||||
private final String HELP_FEATURE_NAME = "Talend Help"; //$NON-NLS-1$
|
||||
|
||||
private static String oldPath = null;
|
||||
|
||||
/**
|
||||
@@ -209,6 +222,16 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
return group;
|
||||
}
|
||||
|
||||
protected Composite createForHelpType(Composite parent) {
|
||||
Group group = createGroup(parent);
|
||||
group.setText(Messages.getString("ComponentsPreferencePage.grpHelp"));
|
||||
Composite composite = createComposite(group);
|
||||
addHelpTypeFiled(composite);
|
||||
GridLayout layout = createLayout();
|
||||
composite.setLayout(layout);
|
||||
return group;
|
||||
}
|
||||
|
||||
protected Group createGroup(Composite parent) {
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
@@ -271,6 +294,46 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
addField(enableComponentAssistCheckBoxField);
|
||||
}
|
||||
|
||||
protected void addHelpTypeFiled(Composite composite) {
|
||||
enableOnLineHelpField = new CheckBoxFieldEditor(TalendDesignerPrefConstants.HELP_OFFLINE,
|
||||
Messages.getString("ComponentsPreferencePage.enableOnLineHelp"), composite) {
|
||||
|
||||
@Override
|
||||
protected void doLoad() {
|
||||
boolean isOffLine = DesignerPlugin.getDefault().getPreferenceStore().getBoolean(getPreferenceName());
|
||||
Button checkBox = getButton();
|
||||
if (checkBox != null) {
|
||||
if (isOffLine && !ComponentsHelpUtil.isHelpInstalled()) {
|
||||
checkBox.setSelection(true);
|
||||
doStore();
|
||||
} else {
|
||||
checkBox.setSelection(!isOffLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStore() {
|
||||
Button checkBox = getButton();
|
||||
if (checkBox != null) {
|
||||
DesignerPlugin.getDefault().getPreferenceStore().setValue(getPreferenceName(), !checkBox.getSelection());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doLoadDefault() {
|
||||
Button checkBox = getButton();
|
||||
if (checkBox != null) {
|
||||
checkBox.setSelection(true);
|
||||
}
|
||||
}
|
||||
|
||||
}; // $NON-NLS-1$
|
||||
|
||||
addField(enableOnLineHelpField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createFieldEditors() {
|
||||
final Composite parent = getFieldEditorParent();
|
||||
@@ -316,6 +379,8 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
createForJoblet(parent);
|
||||
}
|
||||
createForComponentAssist(parent);
|
||||
createForHelpType(parent);
|
||||
|
||||
parent.pack();
|
||||
}
|
||||
|
||||
@@ -382,8 +447,8 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
if ("".equals(newPath)) { //$NON-NLS-1$
|
||||
newPath = null;
|
||||
}
|
||||
DesignerPlugin.getDefault().getPreferenceStore()
|
||||
.setValue(TalendDesignerPrefConstants.COMPONENT_ASSIST, enableComponentAssistCheckBoxField.getBooleanValue());
|
||||
DesignerPlugin.getDefault().getPreferenceStore().setValue(TalendDesignerPrefConstants.COMPONENT_ASSIST,
|
||||
enableComponentAssistCheckBoxField.getBooleanValue());
|
||||
TalendEditorComponentCreationUtil.updateAssistListener();
|
||||
if (this.oldPath != newPath) {
|
||||
|
||||
@@ -432,8 +497,9 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(component.getFailureMessage())) {
|
||||
MessageDialog.openError(getShell(), Messages
|
||||
.getString("ComponentsPreferencePage.installComponentsFailure"),//$NON-NLS-1$
|
||||
MessageDialog.openError(getShell(),
|
||||
Messages.getString(
|
||||
"ComponentsPreferencePage.installComponentsFailure"), //$NON-NLS-1$
|
||||
component.getFailureMessage());
|
||||
}
|
||||
} finally {
|
||||
@@ -472,6 +538,51 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
this.oldPath = newPath;
|
||||
|
||||
}
|
||||
|
||||
if (enableOnLineHelpField != null && !enableOnLineHelpField.getBooleanValue()
|
||||
&& !ComponentsHelpUtil.isHelpInstalled()
|
||||
&& InstallFeatureObserver.getInstance().isNeedLanuchInstallWizard(HELP_FEATURE_NAME)) {
|
||||
if (MessageDialog.openConfirm(getShell(), Messages.getString("ComponentsPreferencePage.titleInstallHelp"),
|
||||
Messages.getString("ComponentsPreferencePage.msgInstallHelp"))) {
|
||||
installHelpFeature();
|
||||
flag = true;
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private void installHelpFeature() {
|
||||
final Set<ExtraFeature> installSet = new HashSet<ExtraFeature>();
|
||||
final IRunnableWithProgress runnable = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
ExtraFeaturesUpdatesFactory extraFeaturesFactory = new ExtraFeaturesUpdatesFactory(false);
|
||||
final Set<ExtraFeature> uninstalledExtraFeatures = new HashSet<ExtraFeature>();
|
||||
extraFeaturesFactory.retrieveUninstalledExtraFeatures(monitor, uninstalledExtraFeatures, false);
|
||||
|
||||
for (ExtraFeature feature : uninstalledExtraFeatures) {
|
||||
if (HELP_FEATURE_NAME.equalsIgnoreCase(feature.getName())) {
|
||||
if (feature instanceof AbstractExtraFeature) {
|
||||
((AbstractExtraFeature) feature).setMustBeInstalled(true);
|
||||
}
|
||||
installSet.add(feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
final ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
|
||||
try {
|
||||
dialog.run(true, true, runnable);
|
||||
} catch (InvocationTargetException e) {
|
||||
return;
|
||||
} catch (InterruptedException e) {
|
||||
return;
|
||||
}
|
||||
synchronized (ShowWizardHandler.showWizardLock) {
|
||||
new ShowWizardHandler().showUpdateWizard(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), installSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<?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.bigdata/components" />
|
||||
<!-- #################################################### -->
|
||||
|
||||
<!-- modification 1: config -->
|
||||
<property name="jar.name" value="GoogleStorageUtils.jar" />
|
||||
<property name="component.name" value="tGSPut" />
|
||||
<property name="author.name" value="jzhao" />
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${component.plugin.home}/tBigQueryBulkExec/jets3t-0.9.0.jar" />
|
||||
</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>
|
||||
@@ -1,127 +0,0 @@
|
||||
package org.talend.gs.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jets3t.service.model.GSObject;
|
||||
import org.jets3t.service.utils.Mimetypes;
|
||||
|
||||
public class GSObjectUtil {
|
||||
|
||||
public List<GSObject> genGSObjectList(List<GSObject> objects, File file,
|
||||
String keyParent, boolean isGenFileObject, boolean isGenFolderObject)
|
||||
throws NoSuchAlgorithmException, IOException {
|
||||
if (file.isDirectory()) {
|
||||
if (keyParent != null && !"".equals(keyParent)) {
|
||||
if (keyParent.trim().lastIndexOf("/") != keyParent.trim()
|
||||
.length() - 1) {
|
||||
keyParent = keyParent + "/";
|
||||
}
|
||||
if(isGenFolderObject){
|
||||
objects.add(new GSObject(keyParent));
|
||||
}
|
||||
}
|
||||
File[] files = file.listFiles();
|
||||
for (File f : files) {
|
||||
if (f.isDirectory()) {
|
||||
objects = genGSObjectList(objects, f,
|
||||
keyParent + f.getName() + "/", isGenFileObject,
|
||||
isGenFolderObject);
|
||||
} else {
|
||||
objects = genGSObjectList(objects, f,
|
||||
keyParent + f.getName(), isGenFileObject,
|
||||
isGenFolderObject);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isGenFileObject) {
|
||||
GSObject obj = new GSObject(file);
|
||||
obj.setKey(keyParent);
|
||||
objects.add(obj);
|
||||
}
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
public java.util.Map<String,String> genFileFilterList(java.util.List<java.util.Map<String,String>> list,String localdir,String remotedir){
|
||||
if (remotedir != null && !"".equals(remotedir)) {
|
||||
if (remotedir.trim().lastIndexOf("/") != remotedir.trim()
|
||||
.length() - 1) {
|
||||
remotedir = remotedir + "/";
|
||||
}
|
||||
}
|
||||
java.util.Map<String,String> fileMap=new HashMap<String,String>();
|
||||
for (java.util.Map<String, String> map : list) {
|
||||
java.util.Set<String> keySet = map.keySet();
|
||||
for (String key : keySet){
|
||||
String tempdir = localdir;
|
||||
String filemask = key;
|
||||
String dir = null;
|
||||
String mask = filemask.replaceAll("\\\\", "/") ;
|
||||
int i = mask.lastIndexOf('/');
|
||||
if (i!=-1){
|
||||
dir = mask.substring(0, i);
|
||||
mask = mask.substring(i+1);
|
||||
}
|
||||
if (dir!=null && !"".equals(dir)) tempdir = tempdir + "/" + dir;
|
||||
mask = mask.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*");
|
||||
final String finalMask = mask;
|
||||
java.io.File[] listings = null;
|
||||
java.io.File file = new java.io.File(tempdir);
|
||||
if (file.isDirectory()) {
|
||||
listings = file.listFiles(new java.io.FileFilter() {
|
||||
public boolean accept(java.io.File pathname) {
|
||||
boolean result = false;
|
||||
if (pathname != null && pathname.isFile()) {
|
||||
result = java.util.regex.Pattern.compile(finalMask).matcher(pathname.getName()).find();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(listings == null || listings.length <= 0){
|
||||
System.err.println("No match file("+key+") exist!");
|
||||
}else{
|
||||
String localFilePath = "";
|
||||
String newObjectKey = "";
|
||||
for (int m = 0; m < listings.length; m++){
|
||||
if (listings[m].getName().matches(mask)){
|
||||
localFilePath = listings[m].getAbsolutePath();
|
||||
if(map.get(key)!=null && map.get(key).length()>0){
|
||||
newObjectKey = remotedir+map.get(key);
|
||||
}else{
|
||||
newObjectKey = remotedir+listings[m].getName();
|
||||
}
|
||||
fileMap.put(localFilePath, newObjectKey);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return fileMap;
|
||||
}
|
||||
|
||||
public List<GSObject> genObjectByFileMap(java.util.Map<String,String> fileMap) throws Exception, IOException{
|
||||
Set<String> localFiles=fileMap.keySet();
|
||||
List<GSObject> objects=new ArrayList<GSObject>();
|
||||
for(String localFilePath:localFiles){
|
||||
GSObject object=new GSObject(new File(localFilePath));
|
||||
object.setKey(fileMap.get(localFilePath));
|
||||
objects.add(object);
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
public void initMimeTypes() throws IOException {
|
||||
InputStream mimetypesFile = this.getClass().getResourceAsStream(
|
||||
"/resource/mime.types");
|
||||
Mimetypes.getInstance().loadAndReplaceMimetypes(mimetypesFile);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>com.microsoft.azure</groupId>
|
||||
<artifactId>adal4j</artifactId>
|
||||
|
||||
<version>1.1.1-patch</version>
|
||||
<version>1.1.1-20191012</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>adal4j</name>
|
||||
<description>
|
||||
@@ -105,7 +105,7 @@
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.5</version>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
|
||||
@@ -33,10 +33,15 @@
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.5</version>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<!-- Spring 3 dependencies -->
|
||||
<dependency>
|
||||
|
||||
@@ -27,7 +27,8 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -41,7 +42,7 @@ import org.json.JSONObject;
|
||||
*/
|
||||
public class JSONHelper {
|
||||
|
||||
private static Logger logger = Logger.getLogger(JSONHelper.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(JSONHelper.class);
|
||||
|
||||
JSONHelper() {
|
||||
// PropertyConfigurator.configure("log4j.properties");
|
||||
|
||||
@@ -1,88 +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="external_sort.jar" />
|
||||
<property name="component.name" value="tSortOut" />
|
||||
<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>
|
||||
<?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="external_sort.jar" />
|
||||
<property name="component.name" value="tSortOut" />
|
||||
<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,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
<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</groupId>
|
||||
<artifactId>google-storage-utils</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
</properties>
|
||||
<name>Google Storage Utils</name>
|
||||
<description>Talend Helper library for Google Storage</description>
|
||||
<url>
|
||||
https://github.com/Talend/tdi-studio-se/
|
||||
</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache-2.0</name>
|
||||
<url>
|
||||
http://www.talendforge.org/modules/licenses/APACHE_v2.txt
|
||||
</url>
|
||||
</license>
|
||||
</licenses>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jets3t</groupId>
|
||||
<artifactId>jets3t</artifactId>
|
||||
<version>0.9.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>talend_nexus_deployment</id>
|
||||
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>talend_nexus_deployment</id>
|
||||
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<targetPath>resource</targetPath>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,123 @@
|
||||
package org.talend.gs.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jets3t.service.model.GSObject;
|
||||
import org.jets3t.service.utils.Mimetypes;
|
||||
|
||||
public class GSObjectUtil {
|
||||
|
||||
public List<GSObject> genGSObjectList(List<GSObject> objects, File file, String keyParent, boolean isGenFileObject,
|
||||
boolean isGenFolderObject) throws NoSuchAlgorithmException, IOException {
|
||||
if (file.isDirectory()) {
|
||||
if (keyParent != null && !"".equals(keyParent)) {
|
||||
if (keyParent.trim().lastIndexOf("/") != keyParent.trim().length() - 1) {
|
||||
keyParent = keyParent + "/";
|
||||
}
|
||||
if (isGenFolderObject) {
|
||||
objects.add(new GSObject(keyParent));
|
||||
}
|
||||
}
|
||||
File[] files = file.listFiles();
|
||||
for (File f : files) {
|
||||
if (f.isDirectory()) {
|
||||
objects = genGSObjectList(objects, f, keyParent + f.getName() + "/", isGenFileObject,
|
||||
isGenFolderObject);
|
||||
} else {
|
||||
objects = genGSObjectList(objects, f, keyParent + f.getName(), isGenFileObject, isGenFolderObject);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isGenFileObject) {
|
||||
GSObject obj = new GSObject(file);
|
||||
obj.setKey(keyParent);
|
||||
objects.add(obj);
|
||||
}
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
public java.util.Map<String, String> genFileFilterList(java.util.List<java.util.Map<String, String>> list,
|
||||
String localdir, String remotedir) {
|
||||
if (remotedir != null && !"".equals(remotedir)) {
|
||||
if (remotedir.trim().lastIndexOf("/") != remotedir.trim().length() - 1) {
|
||||
remotedir = remotedir + "/";
|
||||
}
|
||||
}
|
||||
java.util.Map<String, String> fileMap = new HashMap<String, String>();
|
||||
for (java.util.Map<String, String> map : list) {
|
||||
java.util.Set<String> keySet = map.keySet();
|
||||
for (String key : keySet) {
|
||||
String tempdir = localdir;
|
||||
String filemask = key;
|
||||
String dir = null;
|
||||
String mask = filemask.replaceAll("\\\\", "/");
|
||||
int i = mask.lastIndexOf('/');
|
||||
if (i != -1) {
|
||||
dir = mask.substring(0, i);
|
||||
mask = mask.substring(i + 1);
|
||||
}
|
||||
if (dir != null && !"".equals(dir))
|
||||
tempdir = tempdir + "/" + dir;
|
||||
mask = mask.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*");
|
||||
final String finalMask = mask;
|
||||
java.io.File[] listings = null;
|
||||
java.io.File file = new java.io.File(tempdir);
|
||||
if (file.isDirectory()) {
|
||||
listings = file.listFiles(new java.io.FileFilter() {
|
||||
|
||||
public boolean accept(java.io.File pathname) {
|
||||
boolean result = false;
|
||||
if (pathname != null && pathname.isFile()) {
|
||||
result = java.util.regex.Pattern.compile(finalMask).matcher(pathname.getName()).find();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (listings == null || listings.length <= 0) {
|
||||
System.err.println("No match file(" + key + ") exist!");
|
||||
} else {
|
||||
String localFilePath = "";
|
||||
String newObjectKey = "";
|
||||
for (int m = 0; m < listings.length; m++) {
|
||||
if (listings[m].getName().matches(mask)) {
|
||||
localFilePath = listings[m].getAbsolutePath();
|
||||
if (map.get(key) != null && map.get(key).length() > 0) {
|
||||
newObjectKey = remotedir + map.get(key);
|
||||
} else {
|
||||
newObjectKey = remotedir + listings[m].getName();
|
||||
}
|
||||
fileMap.put(localFilePath, newObjectKey);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return fileMap;
|
||||
}
|
||||
|
||||
public List<GSObject> genObjectByFileMap(java.util.Map<String, String> fileMap) throws Exception, IOException {
|
||||
Set<String> localFiles = fileMap.keySet();
|
||||
List<GSObject> objects = new ArrayList<GSObject>();
|
||||
for (String localFilePath : localFiles) {
|
||||
GSObject object = new GSObject(new File(localFilePath));
|
||||
object.setKey(fileMap.get(localFilePath));
|
||||
objects.add(object);
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
public void initMimeTypes() throws IOException {
|
||||
InputStream mimetypesFile = this.getClass().getResourceAsStream("/resource/mime.types");
|
||||
Mimetypes.getInstance().loadAndReplaceMimetypes(mimetypesFile);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.4.3-talend</version>
|
||||
<version>2.4.4-talend</version>
|
||||
<name>json-lib</name>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -25,12 +25,12 @@ import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import net.sf.json.util.JSONUtils;
|
||||
import net.sf.json.util.JsonEventListener;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import net.sf.json.util.JSONUtils;
|
||||
import net.sf.json.util.JsonEventListener;
|
||||
|
||||
/**
|
||||
* Base class for JSONObject and JSONArray.
|
||||
*
|
||||
@@ -227,7 +227,8 @@ abstract class AbstractJSON implements JSON {
|
||||
}
|
||||
|
||||
protected Object _processValue( Object value, JsonConfig jsonConfig ) {
|
||||
if( JSONNull.getInstance().equals( value ) ) {
|
||||
if( JSONNull.getInstance().equals( value ) &&
|
||||
((jsonConfig.getJsonStandard() != JsonStandard.WRAP_NULL_STRINGS) || !"null".equals(value))) {
|
||||
return JSONNull.getInstance();
|
||||
} else if( Class.class.isAssignableFrom( value.getClass() ) || value instanceof Class ) {
|
||||
return ((Class) value).getName();
|
||||
|
||||
@@ -2391,7 +2391,7 @@ public final class JSONObject extends AbstractJSON implements JSON, Map, Compara
|
||||
}
|
||||
try{
|
||||
Iterator keys = keys();
|
||||
StringBuffer sb = new StringBuffer( "{" );
|
||||
StringBuilder sb = new StringBuilder( "{" );
|
||||
|
||||
while( keys.hasNext() ){
|
||||
if( sb.length() > 1 ){
|
||||
@@ -2460,7 +2460,7 @@ public final class JSONObject extends AbstractJSON implements JSON, Map, Compara
|
||||
return this.toString();
|
||||
}
|
||||
Iterator keys = keys();
|
||||
StringBuffer sb = new StringBuffer( "{" );
|
||||
StringBuilder sb = new StringBuilder( "{" );
|
||||
int newindent = indent + indentFactor;
|
||||
Object o;
|
||||
if( n == 1 ){
|
||||
@@ -2549,7 +2549,7 @@ public final class JSONObject extends AbstractJSON implements JSON, Map, Compara
|
||||
if( o instanceof JSONArray ){
|
||||
((JSONArray) o).element( value, jsonConfig );
|
||||
}else{
|
||||
setInternal( key, new JSONArray().element( o )
|
||||
setInternal( key, new JSONArray().element( o, jsonConfig )
|
||||
.element( value, jsonConfig ), jsonConfig );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,6 @@ public class JsonConfig {
|
||||
private boolean handleJettisonEmptyElement;
|
||||
private boolean handleJettisonSingleElementArray;
|
||||
private boolean ignoreDefaultExcludes;
|
||||
//private boolean ignoreJPATransient;
|
||||
private boolean ignoreTransientFields;
|
||||
private boolean ignorePublicFields = true;
|
||||
private boolean javascriptCompliant;
|
||||
@@ -110,6 +109,7 @@ public class JsonConfig {
|
||||
private Map typeMap = new HashMap();
|
||||
private List ignoreFieldAnnotations = new ArrayList();
|
||||
private boolean allowNonStringKeys = false;
|
||||
private JsonStandard jsonStandard = JsonStandard.LEGACY;
|
||||
|
||||
public JsonConfig() {
|
||||
}
|
||||
@@ -1246,7 +1246,20 @@ public class JsonConfig {
|
||||
this.newBeanInstanceStrategy = newBeanInstanceStrategy == null ? DEFAULT_NEW_BEAN_INSTANCE_STRATEGY
|
||||
: newBeanInstanceStrategy;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the config to wrap "null" strings as strings instead of JsonNull.
|
||||
*
|
||||
*/
|
||||
|
||||
public void setJsonStandard(JsonStandard wrapNullStringValues) {
|
||||
this.jsonStandard = wrapNullStringValues;
|
||||
}
|
||||
|
||||
public JsonStandard getJsonStandard() {
|
||||
return jsonStandard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a PropertyExclusionClassMatcher to use.<br>
|
||||
* Will set default value (PropertyExclusionClassMatcher.DEFAULT) if null.<br>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package net.sf.json;
|
||||
|
||||
public enum JsonStandard {
|
||||
/**
|
||||
* Out of date standard used to be default before
|
||||
*/
|
||||
LEGACY,
|
||||
|
||||
/**
|
||||
* Updated standard due to RFC 7159 to not unwrap "null" strings (keep quotations)
|
||||
*/
|
||||
WRAP_NULL_STRINGS
|
||||
|
||||
}
|
||||
@@ -24,6 +24,8 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.beanutils.DynaBean;
|
||||
|
||||
import net.sf.ezmorph.MorphUtils;
|
||||
import net.sf.ezmorph.MorpherRegistry;
|
||||
import net.sf.ezmorph.bean.MorphDynaBean;
|
||||
@@ -36,10 +38,9 @@ import net.sf.json.JSONNull;
|
||||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JSONString;
|
||||
import net.sf.json.JsonConfig;
|
||||
import net.sf.json.JsonStandard;
|
||||
import net.sf.json.regexp.RegexpUtils;
|
||||
|
||||
import org.apache.commons.beanutils.DynaBean;
|
||||
|
||||
/**
|
||||
* Provides useful methods on java objects and JSON values.
|
||||
*
|
||||
@@ -124,7 +125,7 @@ public final class JSONUtils {
|
||||
public static String getFunctionBody( String function ) {
|
||||
return RegexpUtils.getMatcher( FUNCTION_BODY_PATTERN, true ).getGroupIfMatches( function, 1 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the params of a function literal.
|
||||
*/
|
||||
@@ -605,7 +606,7 @@ public final class JSONUtils {
|
||||
return input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) ||
|
||||
input.startsWith( DOUBLE_QUOTE ) && input.endsWith( DOUBLE_QUOTE );
|
||||
}
|
||||
|
||||
|
||||
public static boolean isJsonKeyword( String input, JsonConfig jsonConfig ) {
|
||||
if( input == null ){
|
||||
return false;
|
||||
@@ -615,7 +616,7 @@ public final class JSONUtils {
|
||||
"false".equals( input ) ||
|
||||
(jsonConfig.isJavascriptCompliant() && "undefined".equals( input ));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Throw an exception if the object is an NaN or infinite number.
|
||||
*
|
||||
@@ -754,7 +755,77 @@ public final class JSONUtils {
|
||||
return quote( value.toString() );
|
||||
}
|
||||
|
||||
/**
|
||||
public static String jsonToStandardizedString(JSON json, JsonStandard standard) {
|
||||
switch (standard) {
|
||||
case WRAP_NULL_STRINGS:
|
||||
if (json.isArray()) {
|
||||
JSONArray jsonArray = (JSONArray) json;
|
||||
return jsonArrayToWrappedNullStrings(jsonArray);
|
||||
} else if (!JSONNull.getInstance().equals(json)) {
|
||||
return jsonToWrappedNullStrings((JSONObject) json);
|
||||
}
|
||||
default:
|
||||
return json.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return plain String from JSONObject (@see JSONObject#toString()), but wrap null strings to quotation
|
||||
*/
|
||||
private static String jsonToWrappedNullStrings(JSONObject json) {
|
||||
if (json.isNullObject()) {
|
||||
return JSONNull.getInstance()
|
||||
.toString();
|
||||
}
|
||||
try {
|
||||
Iterator keys = json.keys();
|
||||
StringBuilder sb = new StringBuilder("{");
|
||||
|
||||
while (keys.hasNext()) {
|
||||
if (sb.length() > 1) {
|
||||
sb.append(',');
|
||||
}
|
||||
Object o = keys.next();
|
||||
sb.append(quote(o.toString()));
|
||||
sb.append(':');
|
||||
sb.append(valueToStringWrappedNullStrings(json.get(o)));
|
||||
}
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static String jsonArrayToWrappedNullStrings(JSONArray jsonArray) {
|
||||
final String separator = ",";
|
||||
StringBuilder sb = new StringBuilder("[");
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
if (i > 0) {
|
||||
sb.append(separator);
|
||||
}
|
||||
sb.append(JSONUtils.valueToStringWrappedNullStrings(jsonArray.get(i)));
|
||||
}
|
||||
|
||||
return sb.append("]").toString();
|
||||
}
|
||||
|
||||
private static String valueToStringWrappedNullStrings(Object o) {
|
||||
if ("null".equals(o)) {
|
||||
return quote(o.toString());
|
||||
} else if (o instanceof JSONArray) {
|
||||
return jsonArrayToWrappedNullStrings((JSONArray) o);
|
||||
} else if (o instanceof JSONObject) {
|
||||
return jsonToWrappedNullStrings((JSONObject) o);
|
||||
} else {
|
||||
return valueToString(o);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds out if n represents a BigInteger
|
||||
*
|
||||
* @return true if n is instanceOf BigInteger or the literal value can be
|
||||
|
||||
@@ -22,6 +22,8 @@ import net.sf.json.JSONException;
|
||||
import net.sf.json.JSONFunction;
|
||||
import net.sf.json.JSONNull;
|
||||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
import net.sf.json.JsonStandard;
|
||||
import net.sf.json.util.JSONUtils;
|
||||
import nu.xom.Attribute;
|
||||
import nu.xom.Builder;
|
||||
@@ -29,7 +31,6 @@ import nu.xom.Document;
|
||||
import nu.xom.Element;
|
||||
import nu.xom.Elements;
|
||||
import nu.xom.Node;
|
||||
import nu.xom.ProcessingInstruction;
|
||||
import nu.xom.Serializer;
|
||||
import nu.xom.Text;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
@@ -163,6 +164,10 @@ public class XMLSerializer {
|
||||
*/
|
||||
private boolean useLongDecimals;
|
||||
|
||||
/**
|
||||
* The config parameter to wrap "null" strings as strings instead of JsonNull.
|
||||
*/
|
||||
private JsonStandard jsonStandard;
|
||||
/**
|
||||
* flag for if parse empty elements as empty strings
|
||||
*/
|
||||
@@ -372,17 +377,19 @@ public class XMLSerializer {
|
||||
return JSONNull.getInstance();
|
||||
}
|
||||
String defaultType = getType( root, JSONTypes.STRING );
|
||||
JsonConfig config = new JsonConfig();
|
||||
config.setJsonStandard(jsonStandard);
|
||||
if( isArray( root, true ) ){
|
||||
json = processArrayElement( root, defaultType );
|
||||
if( forceTopLevelObject ){
|
||||
String key = removeNamespacePrefix( root.getQualifiedName() );
|
||||
json = new JSONObject().element( key, json );
|
||||
json = new JSONObject().element(key, json, config);
|
||||
}
|
||||
}else{
|
||||
json = processObjectElement( root, defaultType );
|
||||
if( forceTopLevelObject ){
|
||||
String key = removeNamespacePrefix( root.getQualifiedName() );
|
||||
json = new JSONObject().element( key, json );
|
||||
json = new JSONObject().element(key, json, config);
|
||||
}
|
||||
}
|
||||
}catch( JSONException jsone ){
|
||||
@@ -660,6 +667,10 @@ public class XMLSerializer {
|
||||
this.useLongDecimals = useLongDecimals;
|
||||
}
|
||||
|
||||
public void setJsonStandard(JsonStandard jsonStandard) {
|
||||
this.jsonStandard = jsonStandard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a JSON value into a XML string with UTF-8 encoding.<br>
|
||||
*
|
||||
@@ -1264,14 +1275,16 @@ public class XMLSerializer {
|
||||
}
|
||||
|
||||
private void setOrAccumulate( JSONObject jsonObject, String key, Object value ) {
|
||||
JsonConfig config = new JsonConfig();
|
||||
config.setJsonStandard(jsonStandard);
|
||||
if( jsonObject.has( key ) ){
|
||||
jsonObject.accumulate( key, value );
|
||||
jsonObject.accumulate(key, value, config);
|
||||
Object val = jsonObject.get( key );
|
||||
if( val instanceof JSONArray ){
|
||||
((JSONArray) val).setExpandElements( true );
|
||||
}
|
||||
}else{
|
||||
jsonObject.element( key, value );
|
||||
jsonObject.element( key, value, config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1279,9 +1292,10 @@ public class XMLSerializer {
|
||||
String clazz = getClass( element );
|
||||
String type = getType( element );
|
||||
type = (type == null) ? defaultType : type;
|
||||
|
||||
JsonConfig config = new JsonConfig();
|
||||
config.setJsonStandard(jsonStandard);
|
||||
if( hasNamespaces( element ) && !skipNamespaces ){
|
||||
jsonArray.element( simplifyValue( null, processElement( element, type ) ) );
|
||||
jsonArray.element(simplifyValue(null, processElement(element, type)), config);
|
||||
return;
|
||||
}else if( element.getAttributeCount() > 0 ){
|
||||
if( isFunction( element ) ){
|
||||
@@ -1289,10 +1303,10 @@ public class XMLSerializer {
|
||||
String[] params = null;
|
||||
String text = element.getValue();
|
||||
params = StringUtils.split( paramsAttribute.getValue(), "," );
|
||||
jsonArray.element( new JSONFunction( params, text ) );
|
||||
jsonArray.element(new JSONFunction(params, text));
|
||||
return;
|
||||
}else{
|
||||
jsonArray.element( simplifyValue( null, processElement( element, type ) ) );
|
||||
jsonArray.element(simplifyValue(null, processElement(element, type)), config);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1300,10 +1314,10 @@ public class XMLSerializer {
|
||||
boolean classProcessed = false;
|
||||
if( clazz != null ){
|
||||
if( clazz.compareToIgnoreCase( JSONTypes.ARRAY ) == 0 ){
|
||||
jsonArray.element( processArrayElement( element, type ) );
|
||||
jsonArray.element(processArrayElement(element, type), config);
|
||||
classProcessed = true;
|
||||
}else if( clazz.compareToIgnoreCase( JSONTypes.OBJECT ) == 0 ){
|
||||
jsonArray.element( simplifyValue( null, processObjectElement( element, type ) ) );
|
||||
jsonArray.element(simplifyValue(null, processObjectElement( element, type)), config);
|
||||
classProcessed = true;
|
||||
}
|
||||
}
|
||||
@@ -1339,12 +1353,12 @@ public class XMLSerializer {
|
||||
jsonArray.element( new JSONFunction( params, text ) );
|
||||
}else{
|
||||
if( isArray( element, false ) ){
|
||||
jsonArray.element( processArrayElement( element, defaultType ) );
|
||||
jsonArray.element(processArrayElement(element, defaultType), config);
|
||||
}else if( isObject( element, false ) ){
|
||||
jsonArray.element( simplifyValue( null, processObjectElement( element,
|
||||
defaultType ) ) );
|
||||
jsonArray.element(simplifyValue(null, processObjectElement(element,
|
||||
defaultType)), config);
|
||||
}else{
|
||||
jsonArray.element( trimSpaceFromValue( element.getValue() ) );
|
||||
jsonArray.element(trimSpaceFromValue(element.getValue()), config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,25 @@
|
||||
package net.sf.json.util;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONException;
|
||||
import net.sf.json.JSONFunction;
|
||||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
import net.sf.json.JsonStandard;
|
||||
|
||||
/**
|
||||
* @author Andres Almiray <aalmiray@users.sourceforge.net>
|
||||
*/
|
||||
public class TestJSONUtils extends TestCase {
|
||||
private static Map<String, String> valuesMap;
|
||||
|
||||
public static void main( String[] args ) {
|
||||
junit.textui.TestRunner.run( TestJSONUtils.class );
|
||||
}
|
||||
@@ -35,6 +44,14 @@ public class TestJSONUtils extends TestCase {
|
||||
super( name );
|
||||
}
|
||||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
valuesMap = new LinkedHashMap<>();
|
||||
|
||||
valuesMap.put("key1", "null");
|
||||
valuesMap.put("key2", "not_null");
|
||||
}
|
||||
|
||||
public void testDoubleToString_infinite() {
|
||||
assertEquals( "null", JSONUtils.doubleToString( Double.POSITIVE_INFINITY ) );
|
||||
}
|
||||
@@ -177,4 +194,48 @@ public class TestJSONUtils extends TestCase {
|
||||
// ok
|
||||
}
|
||||
}
|
||||
|
||||
public void testNullStringsWrapped() {
|
||||
JsonConfig config = new JsonConfig();
|
||||
config.setJsonStandard(JsonStandard.WRAP_NULL_STRINGS);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.putAll(valuesMap, config);
|
||||
|
||||
String resultingString = JSONUtils.jsonToStandardizedString(jsonObject, JsonStandard.WRAP_NULL_STRINGS);
|
||||
assertFalse("Wrapping null strings standard's broken", Objects.equals(jsonObject.toString(), resultingString));
|
||||
assertTrue(resultingString.contains("\"null\""));
|
||||
}
|
||||
|
||||
public void testNullStringsUnwrapped() {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.putAll(valuesMap);
|
||||
|
||||
String resultingString = JSONUtils.jsonToStandardizedString(jsonObject, JsonStandard.WRAP_NULL_STRINGS);
|
||||
assertEquals(jsonObject.toString(), resultingString);
|
||||
}
|
||||
|
||||
public void testNullStringsOnArrayWrapped() {
|
||||
JsonConfig config = new JsonConfig();
|
||||
config.setJsonStandard(JsonStandard.WRAP_NULL_STRINGS);
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add("abc");
|
||||
jsonArray.add("null", config);
|
||||
jsonArray.add(null);
|
||||
|
||||
String resultingString = JSONUtils.jsonToStandardizedString(jsonArray, JsonStandard.WRAP_NULL_STRINGS);;
|
||||
assertFalse("Wrapping null strings standard's broken", Objects.equals(jsonArray.toString(), resultingString));
|
||||
assertTrue(resultingString.contains("\"null\""));
|
||||
}
|
||||
|
||||
public void testNullStringsOnArrayUnwrapped() {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add("abc");
|
||||
jsonArray.add("null");
|
||||
jsonArray.add(null);
|
||||
|
||||
String resultingString = JSONUtils.jsonToStandardizedString(jsonArray, JsonStandard.LEGACY);
|
||||
assertEquals(jsonArray.toString(), resultingString);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>org.neo4j.talend</groupId>
|
||||
<artifactId>neo4j-talend-component</artifactId>
|
||||
<version>1.3-20171206</version>
|
||||
<version>1.3-20191012</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Neo4j Talend </name>
|
||||
@@ -100,12 +100,23 @@
|
||||
<artifactId>neo4j-import-tool</artifactId>
|
||||
<version>${neo4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<!-- Talend log4j library -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.25</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<scope>provided</scope>
|
||||
<version>1.2.17</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- JUnit -->
|
||||
<dependency>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.neo4j.talend;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.neo4j.graphdb.DynamicLabel;
|
||||
import org.neo4j.graphdb.index.IndexHits;
|
||||
import org.neo4j.helpers.collection.MapUtil;
|
||||
@@ -23,7 +24,7 @@ public class Neo4jBatchDatabase {
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(Neo4jBatchDatabase.class);
|
||||
private static Logger log = LoggerFactory.getLogger(Neo4jBatchDatabase.class);
|
||||
|
||||
/**
|
||||
* Name of the field index for the importId
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package org.neo4j.talend;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.neo4j.graphdb.DynamicRelationshipType;
|
||||
|
||||
@@ -11,7 +12,7 @@ import java.util.Map;
|
||||
|
||||
public class Neo4jBatchInserterRelationship extends Neo4jBatchInserterAbstract {
|
||||
|
||||
private static Logger log = Logger.getLogger(Neo4jBatchInserterRelationship.class);
|
||||
private static Logger log = LoggerFactory.getLogger(Neo4jBatchInserterRelationship.class);
|
||||
|
||||
private String relationshipTypeField;
|
||||
private String direction;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package org.neo4j.talend;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.neo4j.tooling.ImportTool;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
@@ -18,7 +19,7 @@ public class Neo4jImportTool {
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
private final static Logger log = Logger.getLogger(Neo4jImportTool.class);
|
||||
private final static Logger log = LoggerFactory.getLogger(Neo4jImportTool.class);
|
||||
|
||||
protected final static String HEADERS_KEY = "HEADERS";
|
||||
protected final static String FILE_KEY = "FILE";
|
||||
|
||||
@@ -1,95 +1,125 @@
|
||||
<!--
|
||||
Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
<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</groupId>
|
||||
<artifactId>components-servicenow</artifactId>
|
||||
<name>servicenow</name>
|
||||
<version>1.0.0</version>
|
||||
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</groupId>
|
||||
<artifactId>components-servicenow</artifactId>
|
||||
<name>servicenow</name>
|
||||
<version>1.0.1</version>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
</properties>
|
||||
<description>Talend Helper library for ServiceNow components</description>
|
||||
<url>
|
||||
https://github.com/Talend/tdi-studio-se/
|
||||
</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache-2.0</name>
|
||||
<url>
|
||||
http://www.talendforge.org/modules/licenses/APACHE_v2.txt
|
||||
</url>
|
||||
</license>
|
||||
</licenses>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.6</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient-cache</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20150729</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.0</version>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>talend_nexus_deployment</id>
|
||||
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>talend_nexus_deployment</id>
|
||||
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.6</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient-cache</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20150729</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.0</version>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<!-- TODO
|
||||
<testResources>
|
||||
<testResource>
|
||||
<directory>src/test/java</directory>
|
||||
</testResource>
|
||||
</testResources>
|
||||
-->
|
||||
</build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,274 +1,269 @@
|
||||
package org.talend.servicenow;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.ParseException;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
|
||||
|
||||
public class Util {
|
||||
|
||||
private HttpClient client;
|
||||
private String baseurl;
|
||||
|
||||
public Util(HttpClient client, String baseurl) {
|
||||
this.client = client;
|
||||
this.baseurl = baseurl;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static void main(String[] args) throws ClientProtocolException, IOException {
|
||||
boolean exception = true;
|
||||
org.apache.http.impl.client.CloseableHttpClient client = null;
|
||||
while(exception) {
|
||||
try {
|
||||
//login
|
||||
org.apache.http.client.CredentialsProvider credsProvider = new org.apache.http.impl.client.BasicCredentialsProvider();
|
||||
credsProvider.setCredentials(
|
||||
new org.apache.http.auth.AuthScope(new org.apache.http.HttpHost("sandbox.service-now.com")), new org.apache.http.auth.UsernamePasswordCredentials("talend", "talend")
|
||||
);
|
||||
client = org.apache.http.impl.client.HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
|
||||
|
||||
//get metadata
|
||||
Util util = new Util(client,"https://sandbox.service-now.com");
|
||||
|
||||
Object result = util.getMetadata("incident");
|
||||
System.out.println(result);
|
||||
System.out.println(((Map)result).size());
|
||||
} catch(Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
continue;
|
||||
} finally {
|
||||
client.close();
|
||||
}
|
||||
|
||||
exception = false;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String,String> typeMapping = new HashMap<String,String>();
|
||||
|
||||
{
|
||||
typeMapping.put("string", "id_String");
|
||||
typeMapping.put("boolean", "id_Boolean");
|
||||
typeMapping.put("integer", "id_Integer");
|
||||
typeMapping.put("decimal", "id_BigDecimal");
|
||||
typeMapping.put("float", "id_Float");
|
||||
typeMapping.put("glide_date_time", "id_Date");
|
||||
typeMapping.put("glide_date", "id_Date");
|
||||
typeMapping.put("glide_time", "id_Date");
|
||||
}
|
||||
|
||||
public static class ColumnMetadata {
|
||||
private String name;
|
||||
private String type;
|
||||
private int maxlength;
|
||||
private String pattern;
|
||||
|
||||
public ColumnMetadata(String name, String type, int maxlength, String pattern) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.maxlength = maxlength;
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getMaxLength() {
|
||||
return maxlength;
|
||||
}
|
||||
|
||||
public String getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return name + ":" + type + ":" + maxlength;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String,ColumnMetadata> getMetadata(String tablename) throws ClientProtocolException, IOException {
|
||||
Map<String,ColumnMetadata> result = new HashMap<String,ColumnMetadata>();
|
||||
List<String> relation = getRelationship(tablename);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(String tname : relation) {
|
||||
sb.setLength(0);
|
||||
sb.append(this.baseurl);
|
||||
sb.append("/api/now/table/");
|
||||
sb.append("sys_dictionary");
|
||||
sb.append("?sysparm_exclude_reference_link=true");
|
||||
sb.append("&sysparm_query=name=");
|
||||
sb.append(tname);
|
||||
sb.append("&sysparm_fields=element,internal_type,max_length,active");
|
||||
|
||||
HttpGet httpget = new HttpGet(sb.toString());
|
||||
httpget.setHeader("Accept", "application/json");
|
||||
|
||||
HttpResponse response = this.client.execute(httpget);
|
||||
List<Map<String, String>> info = extractResponse4MultiRowFromArray(response);
|
||||
|
||||
for(Map<String, String> row : info) {
|
||||
String element = row.get("element");
|
||||
boolean active = Boolean.parseBoolean(row.get("active"));
|
||||
if(element!=null && !element.isEmpty() && active) {
|
||||
String talend_type = null;
|
||||
String pattern = null;
|
||||
|
||||
String servicenow_type = (String)row.get("internal_type");
|
||||
|
||||
if(servicenow_type!=null && !servicenow_type.isEmpty()) {
|
||||
talend_type = typeMapping.get(servicenow_type);
|
||||
|
||||
//need date pattern
|
||||
if("glide_date_time".equals(servicenow_type)) {
|
||||
pattern = "yyyy-MM-dd HH:mm:ss";
|
||||
} else if("glide_date".equals(servicenow_type)) {
|
||||
pattern = "yyyy-MM-dd";
|
||||
} else if("glide_time".equals(servicenow_type)) {
|
||||
pattern = "HH:mm:ss";
|
||||
}
|
||||
}
|
||||
|
||||
if(talend_type == null) {
|
||||
talend_type = "id_String";
|
||||
}
|
||||
|
||||
int mlength = 64;
|
||||
String maxlength = (String)row.get("max_length");
|
||||
if(maxlength!=null && !maxlength.isEmpty()) {
|
||||
mlength = Integer.parseInt(maxlength);
|
||||
}
|
||||
|
||||
ColumnMetadata column = new ColumnMetadata(element,talend_type,mlength,pattern);
|
||||
result.put(element, column);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String> getRelationship(String tablename) throws ClientProtocolException, IOException {
|
||||
LinkedList<String> result = new LinkedList<String>();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(this.baseurl);
|
||||
sb.append("/api/now/table/");
|
||||
sb.append("sys_db_object");
|
||||
sb.append("?sysparm_exclude_reference_link=true");
|
||||
sb.append("&sysparm_query=name=");
|
||||
sb.append(tablename);
|
||||
sb.append("&sysparm_fields=name,super_class");
|
||||
|
||||
HttpGet httpget = new HttpGet(sb.toString());
|
||||
httpget.setHeader("Accept", "application/json");
|
||||
|
||||
HttpResponse response = this.client.execute(httpget);
|
||||
Map<String,String> info = extractResponse4OneRowFromArray(response);
|
||||
|
||||
result.add(info.get("name"));
|
||||
|
||||
String superclass = info.get("super_class");
|
||||
while(superclass!=null && !superclass.isEmpty()) {
|
||||
sb.setLength(0);
|
||||
sb.append(this.baseurl);
|
||||
sb.append("/api/now/table/");
|
||||
sb.append("sys_db_object/");
|
||||
sb.append(superclass);
|
||||
sb.append("?sysparm_exclude_reference_link=true");
|
||||
sb.append("&sysparm_fields=name,super_class");
|
||||
|
||||
httpget = new HttpGet(sb.toString());
|
||||
httpget.setHeader("Accept", "application/json");
|
||||
|
||||
response = this.client.execute(httpget);
|
||||
info = extractResponse4OneRowFromObject(response);
|
||||
|
||||
result.add(info.get("name"));
|
||||
|
||||
superclass = info.get("super_class");
|
||||
}
|
||||
|
||||
Collections.reverse(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String,String> extractResponse4OneRowFromArray(HttpResponse response) throws ParseException, IOException {
|
||||
validateResponse(response);
|
||||
|
||||
Map<String,String> result = new HashMap<String,String>();
|
||||
|
||||
org.json.JSONArray array = (org.json.JSONArray)getResult(response);
|
||||
|
||||
for(int i=0;i<array.length();i++) {
|
||||
org.json.JSONObject row = (org.json.JSONObject)array.get(i);
|
||||
for(String key : row.keySet()) {
|
||||
result.put(key, (String)row.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String,String> extractResponse4OneRowFromObject(HttpResponse response) throws ParseException, IOException {
|
||||
validateResponse(response);
|
||||
|
||||
Map<String,String> result = new HashMap<String,String>();
|
||||
|
||||
org.json.JSONObject object = (org.json.JSONObject)getResult(response);
|
||||
|
||||
for(String key : object.keySet()) {
|
||||
result.put(key, (String)object.get(key));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<Map<String, String>> extractResponse4MultiRowFromArray(HttpResponse response) throws ParseException, IOException {
|
||||
validateResponse(response);
|
||||
|
||||
List<Map<String, String>> result = new ArrayList<Map<String,String>>();
|
||||
|
||||
org.json.JSONArray array = (org.json.JSONArray)getResult(response);
|
||||
|
||||
for(int i=0;i<array.length();i++) {
|
||||
Map<String,String> element = new HashMap<String,String>();
|
||||
org.json.JSONObject row = (org.json.JSONObject)array.get(i);
|
||||
for(String key : row.keySet()) {
|
||||
element.put(key, (String)row.get(key));
|
||||
}
|
||||
result.add(element);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void validateResponse(HttpResponse response) {
|
||||
if(response.getStatusLine().getStatusCode() != 200) {
|
||||
throw new RuntimeException("Fail to get the table metadata. The operation has returned the code : " + response.getStatusLine() + ".");
|
||||
}
|
||||
}
|
||||
|
||||
private Object getResult(HttpResponse response) throws ParseException, IOException {
|
||||
String responseBody = org.apache.http.util.EntityUtils.toString(response.getEntity());
|
||||
org.json.JSONObject json = new org.json.JSONObject(responseBody);
|
||||
return json.get("result");
|
||||
}
|
||||
/**
|
||||
* Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
*
|
||||
* 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 org.talend.servicenow;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.ParseException;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
|
||||
public class Util {
|
||||
|
||||
private HttpClient client;
|
||||
|
||||
private String baseurl;
|
||||
|
||||
public Util(HttpClient client, String baseurl) {
|
||||
this.client = client;
|
||||
this.baseurl = baseurl;
|
||||
}
|
||||
|
||||
private Map<String, String> typeMapping = new HashMap<String, String>();
|
||||
|
||||
{
|
||||
typeMapping.put("string", "id_String");
|
||||
typeMapping.put("boolean", "id_Boolean");
|
||||
typeMapping.put("integer", "id_Integer");
|
||||
typeMapping.put("decimal", "id_BigDecimal");
|
||||
typeMapping.put("float", "id_Float");
|
||||
typeMapping.put("glide_date_time", "id_Date");
|
||||
typeMapping.put("glide_date", "id_Date");
|
||||
typeMapping.put("glide_time", "id_Date");
|
||||
}
|
||||
|
||||
public static class ColumnMetadata {
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private int maxlength;
|
||||
|
||||
private String pattern;
|
||||
|
||||
public ColumnMetadata(String name, String type, int maxlength, String pattern) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.maxlength = maxlength;
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getMaxLength() {
|
||||
return maxlength;
|
||||
}
|
||||
|
||||
public String getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return name + ":" + type + ":" + maxlength;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, ColumnMetadata> getMetadata(String tablename) throws ClientProtocolException, IOException {
|
||||
Map<String, ColumnMetadata> result = new HashMap<String, ColumnMetadata>();
|
||||
List<String> relation = getRelationship(tablename);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String tname : relation) {
|
||||
sb.setLength(0);
|
||||
sb.append(this.baseurl);
|
||||
sb.append("/api/now/table/");
|
||||
sb.append("sys_dictionary");
|
||||
sb.append("?sysparm_exclude_reference_link=true");
|
||||
sb.append("&sysparm_query=name=");
|
||||
sb.append(tname);
|
||||
sb.append("&sysparm_fields=element,internal_type,max_length,active");
|
||||
|
||||
HttpGet httpget = new HttpGet(sb.toString());
|
||||
httpget.setHeader("Accept", "application/json");
|
||||
|
||||
HttpResponse response = this.client.execute(httpget);
|
||||
List<Map<String, String>> info = extractResponse4MultiRowFromArray(response);
|
||||
|
||||
for (Map<String, String> row : info) {
|
||||
String element = row.get("element");
|
||||
boolean active = Boolean.parseBoolean(row.get("active"));
|
||||
if (element != null && !element.isEmpty() && active) {
|
||||
String talend_type = null;
|
||||
String pattern = null;
|
||||
|
||||
String servicenow_type = (String) row.get("internal_type");
|
||||
|
||||
if (servicenow_type != null && !servicenow_type.isEmpty()) {
|
||||
talend_type = typeMapping.get(servicenow_type);
|
||||
|
||||
//need date pattern
|
||||
if ("glide_date_time".equals(servicenow_type)) {
|
||||
pattern = "yyyy-MM-dd HH:mm:ss";
|
||||
} else if ("glide_date".equals(servicenow_type)) {
|
||||
pattern = "yyyy-MM-dd";
|
||||
} else if ("glide_time".equals(servicenow_type)) {
|
||||
pattern = "HH:mm:ss";
|
||||
}
|
||||
}
|
||||
|
||||
if (talend_type == null) {
|
||||
talend_type = "id_String";
|
||||
}
|
||||
|
||||
int mlength = 64;
|
||||
String maxlength = (String) row.get("max_length");
|
||||
if (maxlength != null && !maxlength.isEmpty()) {
|
||||
mlength = Integer.parseInt(maxlength);
|
||||
}
|
||||
|
||||
ColumnMetadata column = new ColumnMetadata(element, talend_type, mlength, pattern);
|
||||
result.put(element, column);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String> getRelationship(String tablename) throws ClientProtocolException, IOException {
|
||||
LinkedList<String> result = new LinkedList<String>();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(this.baseurl);
|
||||
sb.append("/api/now/table/");
|
||||
sb.append("sys_db_object");
|
||||
sb.append("?sysparm_exclude_reference_link=true");
|
||||
sb.append("&sysparm_query=name=");
|
||||
sb.append(tablename);
|
||||
sb.append("&sysparm_fields=name,super_class");
|
||||
|
||||
HttpGet httpget = new HttpGet(sb.toString());
|
||||
httpget.setHeader("Accept", "application/json");
|
||||
|
||||
HttpResponse response = this.client.execute(httpget);
|
||||
Map<String, String> info = extractResponse4OneRowFromArray(response);
|
||||
|
||||
result.add(info.get("name"));
|
||||
|
||||
String superclass = info.get("super_class");
|
||||
while (superclass != null && !superclass.isEmpty()) {
|
||||
sb.setLength(0);
|
||||
sb.append(this.baseurl);
|
||||
sb.append("/api/now/table/");
|
||||
sb.append("sys_db_object/");
|
||||
sb.append(superclass);
|
||||
sb.append("?sysparm_exclude_reference_link=true");
|
||||
sb.append("&sysparm_fields=name,super_class");
|
||||
|
||||
httpget = new HttpGet(sb.toString());
|
||||
httpget.setHeader("Accept", "application/json");
|
||||
|
||||
response = this.client.execute(httpget);
|
||||
info = extractResponse4OneRowFromObject(response);
|
||||
|
||||
result.add(info.get("name"));
|
||||
|
||||
superclass = info.get("super_class");
|
||||
}
|
||||
|
||||
Collections.reverse(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, String> extractResponse4OneRowFromArray(HttpResponse response)
|
||||
throws ParseException, IOException {
|
||||
validateResponse(response);
|
||||
|
||||
Map<String, String> result = new HashMap<String, String>();
|
||||
|
||||
org.json.JSONArray array = (org.json.JSONArray) getResult(response);
|
||||
|
||||
for (int i = 0; i < array.length(); i++) {
|
||||
org.json.JSONObject row = (org.json.JSONObject) array.get(i);
|
||||
for (String key : row.keySet()) {
|
||||
result.put(key, (String) row.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, String> extractResponse4OneRowFromObject(HttpResponse response)
|
||||
throws ParseException, IOException {
|
||||
validateResponse(response);
|
||||
|
||||
Map<String, String> result = new HashMap<String, String>();
|
||||
|
||||
org.json.JSONObject object = (org.json.JSONObject) getResult(response);
|
||||
|
||||
for (String key : object.keySet()) {
|
||||
result.put(key, (String) object.get(key));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<Map<String, String>> extractResponse4MultiRowFromArray(HttpResponse response)
|
||||
throws ParseException, IOException {
|
||||
validateResponse(response);
|
||||
|
||||
List<Map<String, String>> result = new ArrayList<Map<String, String>>();
|
||||
|
||||
org.json.JSONArray array = (org.json.JSONArray) getResult(response);
|
||||
|
||||
for (int i = 0; i < array.length(); i++) {
|
||||
Map<String, String> element = new HashMap<String, String>();
|
||||
org.json.JSONObject row = (org.json.JSONObject) array.get(i);
|
||||
for (String key : row.keySet()) {
|
||||
element.put(key, (String) row.get(key));
|
||||
}
|
||||
result.add(element);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void validateResponse(HttpResponse response) {
|
||||
if (response.getStatusLine().getStatusCode() != 200) {
|
||||
throw new RuntimeException(
|
||||
"Fail to get the table metadata. The operation has returned the code : " + response.getStatusLine()
|
||||
+ ".");
|
||||
}
|
||||
}
|
||||
|
||||
private Object getResult(HttpResponse response) throws ParseException, IOException {
|
||||
String responseBody = org.apache.http.util.EntityUtils.toString(response.getEntity());
|
||||
org.json.JSONObject json = new org.json.JSONObject(responseBody);
|
||||
return json.get("result");
|
||||
}
|
||||
}
|
||||
@@ -1,95 +1,95 @@
|
||||
<?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="sugarCRMManagement.jar" />
|
||||
<property name="component.name" value="tSugarCRMInput" />
|
||||
<property name="author.name" value="wyang" />
|
||||
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/axis.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/commons-discovery-0.2.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/wsdl4j-1.5.1.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/saaj.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/jaxrpc.jar" />
|
||||
<pathelement location="${component.plugin.home}/tXMLRPCInput/commons-logging-1.1.jar" />
|
||||
</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>
|
||||
<?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="sugarCRMManagement.jar" />
|
||||
<property name="component.name" value="tSugarCRMInput" />
|
||||
<property name="author.name" value="wyang" />
|
||||
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/axis.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/commons-discovery-0.2.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/wsdl4j-1.5.1.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/saaj.jar" />
|
||||
<pathelement location="${component.plugin.home}/tWebServiceInput/jaxrpc.jar" />
|
||||
<pathelement location="${component.plugin.home}/tXMLRPCInput/commons-logging-1.1.jar" />
|
||||
</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>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<groupId>org.talend.components.lib</groupId>
|
||||
<artifactId>talend-db-exasol</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.5</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>talend-db-exasol</name>
|
||||
@@ -33,10 +33,22 @@
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.25</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
||||
@@ -27,15 +27,15 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* This class provides an IMPORT command for the EXASol database.
|
||||
* @author Jan Lolling, jan.lolling@cimt-ag.de
|
||||
*/
|
||||
public class EXABulkUtil {
|
||||
|
||||
private static Logger logger = Logger.getLogger(EXABulkUtil.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(EXABulkUtil.class);
|
||||
public static final String CSV = "CSV";
|
||||
public static final String FBV = "FBV";
|
||||
public static final String ORA = "ORA";
|
||||
@@ -83,14 +83,6 @@ public class EXABulkUtil {
|
||||
private int sourceIdentifierCase = 0; // 0 = unchanged, 1 = lower case, 2 = upper case
|
||||
private boolean onlyBuildSQLCode = false;
|
||||
|
||||
public void setDebug(boolean debug) {
|
||||
if (debug) {
|
||||
logger.setLevel(Level.DEBUG);
|
||||
} else {
|
||||
logger.setLevel(Level.INFO);
|
||||
}
|
||||
}
|
||||
|
||||
private String createNumberFormat(Integer length, Integer precision, boolean hasGroups) {
|
||||
if (length != null && length.intValue() > 0) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -39,7 +39,6 @@ public class TestEXABulkUtil {
|
||||
truncateStat.execute("truncate table " + errorTable);
|
||||
truncateStat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setTransferSecure(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
@@ -83,7 +82,6 @@ public class TestEXABulkUtil {
|
||||
}
|
||||
truncateStat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
u.setRemoteFileUrl("sftp://172.16.214.132/home/tisadmin/Downloads/");
|
||||
@@ -130,7 +128,6 @@ public class TestEXABulkUtil {
|
||||
}
|
||||
truncateStat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
u.setDbmsSourceType("JDBC");
|
||||
@@ -170,7 +167,6 @@ public class TestEXABulkUtil {
|
||||
}
|
||||
truncateStat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
u.setDbmsSourceType("ORA");
|
||||
@@ -211,7 +207,6 @@ public class TestEXABulkUtil {
|
||||
}
|
||||
stat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
u.setDbmsSourceType("JDBC");
|
||||
@@ -250,7 +245,6 @@ public class TestEXABulkUtil {
|
||||
}
|
||||
stat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
u.setDbmsSourceType("JDBC");
|
||||
@@ -290,7 +284,6 @@ public class TestEXABulkUtil {
|
||||
}
|
||||
stat.close();
|
||||
EXABulkUtil u = new EXABulkUtil();
|
||||
u.setDebug(true);
|
||||
u.setConnection(connection);
|
||||
u.setTable(table);
|
||||
u.setDbmsSourceType("EXA");
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.talend</groupId>
|
||||
<artifactId>talend-httputil</artifactId>
|
||||
<name>talend-httputil</name>
|
||||
<version>1.0.4</version>
|
||||
<version>1.0.5</version>
|
||||
|
||||
<properties>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
@@ -20,7 +20,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.9.9</version>
|
||||
<version>2.10.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>job-audit</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>1.1</version>
|
||||
|
||||
<properties>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
@@ -50,28 +50,43 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.talend.daikon</groupId>
|
||||
<artifactId>daikon-audit</artifactId>
|
||||
<version>0.31.8</version>
|
||||
<artifactId>audit-common</artifactId>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.talend.daikon</groupId>
|
||||
<artifactId>audit-logback</artifactId>
|
||||
<version>0.31.8</version>
|
||||
<artifactId>audit-log4j1</artifactId>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.3.0-alpha4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.talend.daikon</groupId>
|
||||
<artifactId>audit-log4j2</artifactId>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -18,13 +18,30 @@ public class JobEventAuditLoggerFactory {
|
||||
final AuditConfigurationMap config = AuditConfiguration.loadFromProperties(properties);
|
||||
|
||||
AbstractBackend logger = null;
|
||||
String loggerClass = "org.talend.logging.audit.logback.LogbackBackend";
|
||||
|
||||
//load log4j2 implement firstly
|
||||
String loggerClass = "org.talend.logging.audit.log4j2.Log4j2Backend";
|
||||
try {
|
||||
final Class<?> clz = Class.forName(loggerClass);
|
||||
logger = (AbstractBackend) clz.getConstructor(AuditConfigurationMap.class).newInstance(config);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException("Unable to load backend " + loggerClass, e);
|
||||
}
|
||||
final Class<?> clz = Class.forName(loggerClass);
|
||||
logger = (AbstractBackend) clz.getConstructor(AuditConfigurationMap.class).newInstance(config);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
//load log4j1 implement if not found log4j2
|
||||
if (logger == null) {
|
||||
loggerClass = "org.talend.logging.audit.log4j1.Log4j1Backend";
|
||||
try {
|
||||
final Class<?> clz = Class.forName(loggerClass);
|
||||
logger = (AbstractBackend) clz.getConstructor(AuditConfigurationMap.class).newInstance(config);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
if(logger == null) {
|
||||
throw new RuntimeException("Unable to load backend : " + loggerClass);
|
||||
}
|
||||
|
||||
final DefaultAuditLoggerBase loggerBase = new DefaultAuditLoggerBase(logger, config);
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ public class JobAuditLoggerTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Properties props = new Properties();
|
||||
props.setProperty("root.logger", "audit");
|
||||
String root_logger_name = "audit";
|
||||
props.setProperty("root.logger", root_logger_name);
|
||||
props.setProperty("encoding", "UTF-8");
|
||||
props.setProperty("application.name", "Talend Studio");
|
||||
props.setProperty("service.name", "Talend Studio Job");
|
||||
@@ -19,6 +20,10 @@ public class JobAuditLoggerTest {
|
||||
props.setProperty("appender.file.maxsize", "52428800");
|
||||
props.setProperty("appender.file.maxbackup", "20");
|
||||
props.setProperty("host", "false");
|
||||
|
||||
org.apache.logging.log4j.core.config.Configurator.setLevel(root_logger_name, org.apache.logging.log4j.Level.DEBUG);
|
||||
//org.apache.log4j.Logger.getLogger("audit").setLevel(org.apache.log4j.Level.DEBUG);
|
||||
|
||||
final JobAuditLogger logger = JobEventAuditLoggerFactory.createJobAuditLogger(props);
|
||||
Context context = JobContextBuilder.create().jobName("fetch_from_s3_every_day").jobId("jobid_123")
|
||||
.jobVersion("0.1").connectorType("tXMLMAP").connectorId("tXMLMap_1")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>talend-mscrm</artifactId>
|
||||
<version>3.4-20190513</version>
|
||||
<version>3.4-20191012</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>talend-mscrm</name>
|
||||
@@ -109,7 +109,7 @@
|
||||
<dependency>
|
||||
<groupId>com.microsoft.azure</groupId>
|
||||
<artifactId>adal4j</artifactId>
|
||||
<version>1.1.1-patch</version>
|
||||
<version>1.1.1-20191012</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -22,7 +22,8 @@ import org.apache.axis2.transport.http.HTTPConstants;
|
||||
import org.apache.axis2.transport.http.HTTPTransportConstants;
|
||||
import org.apache.axis2.transport.http.HttpTransportProperties;
|
||||
import org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfEndpointTypestringztYlk6OT;
|
||||
import org.talend.ms.crm.sdk.OnlineAuthenticationPolicy;
|
||||
import org.talend.ms.crm.sdk.OrganizationServiceStubWrapper;
|
||||
@@ -61,7 +62,7 @@ import com.microsoft.schemas.xrm._2011.contracts.discovery.RetrieveOrganizationR
|
||||
*/
|
||||
public class MSCRMClient {
|
||||
|
||||
static Logger logger = Logger.getLogger(MSCRMClient.class.getName());
|
||||
static Logger logger = LoggerFactory.getLogger(MSCRMClient.class.getName());
|
||||
|
||||
/**
|
||||
* Microsoft account (e.g. youremail@live.com) or Microsoft Office 365 (Org ID e.g.
|
||||
|
||||
@@ -38,7 +38,8 @@ import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.params.BasicHttpParams;
|
||||
import org.apache.http.params.CoreConnectionPNames;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
@@ -53,7 +54,7 @@ public final class DeviceIdManager {
|
||||
/**
|
||||
* Logger
|
||||
*/
|
||||
static final Logger Log = Logger.getLogger(DeviceIdManager.class.getName());
|
||||
static final Logger Log = LoggerFactory.getLogger(DeviceIdManager.class.getName());
|
||||
|
||||
private static final Random RandomInstance = new Random();
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ import javax.wsdl.WSDLException;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -25,7 +26,7 @@ import org.xml.sax.SAXException;
|
||||
*/
|
||||
public final class OnlineAuthenticationPolicy {
|
||||
|
||||
static Logger logger = Logger.getLogger(OnlineAuthenticationPolicy.class.getName());
|
||||
static Logger logger = LoggerFactory.getLogger(OnlineAuthenticationPolicy.class.getName());
|
||||
|
||||
/**
|
||||
* Construct an Instance of the OnlineAuthenticationPolicy class.
|
||||
|
||||
@@ -44,7 +44,8 @@ import org.apache.http.params.BasicHttpParams;
|
||||
import org.apache.http.params.CoreConnectionPNames;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -55,7 +56,7 @@ import org.xml.sax.SAXException;
|
||||
*/
|
||||
public final class WsdlTokenManager {
|
||||
|
||||
static Logger logger = Logger.getLogger(WsdlTokenManager.class.getName());
|
||||
static Logger logger = LoggerFactory.getLogger(WsdlTokenManager.class.getName());
|
||||
|
||||
private final String DeviceTokenTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + " <s:Envelope "
|
||||
+ " xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\""
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
<artifactId>talend-ws</artifactId>
|
||||
<version>1.0.1-20190204</version>
|
||||
<version>1.0.1-20191112</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<cxf.version>3.1.1</cxf.version>
|
||||
<cxf.version>3.3.4</cxf.version>
|
||||
<odata.version>4.3.0</odata.version>
|
||||
<slf4j.version>1.7.12</slf4j.version>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
@@ -90,42 +90,42 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-core</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-simple</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-tools-common</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-wsdl</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-bindings-soap</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-databinding-jaxb</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http-jetty</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
<version>3.2.6</version>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.libraries</groupId>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
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>talendMsgMailUtil-1.1-20170419</artifactId>
|
||||
<artifactId>talendMsgMailUtil-1.1-20191012</artifactId>
|
||||
<name>talendMsgMailUtil</name>
|
||||
<version>6.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
@@ -37,6 +37,11 @@
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
|
||||
@@ -12,8 +12,8 @@ import org.apache.poi.hsmf.datatypes.MAPIProperty;
|
||||
import org.apache.poi.hsmf.datatypes.StringChunk;
|
||||
import org.apache.poi.hsmf.datatypes.Types;
|
||||
import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Level;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MsgMailUtil {
|
||||
|
||||
@@ -24,6 +24,15 @@ public class MsgMailUtil {
|
||||
|
||||
public MsgMailUtil() {
|
||||
}
|
||||
|
||||
private enum Level {
|
||||
DEBUG,
|
||||
INFO,
|
||||
TRACE,
|
||||
FATAL,
|
||||
WARN,
|
||||
ERROR
|
||||
}
|
||||
|
||||
public MsgMailUtil(String fileName, String outAttachmentPath)
|
||||
throws IOException {
|
||||
@@ -31,8 +40,8 @@ public class MsgMailUtil {
|
||||
this.outAttachmentPath = outAttachmentPath;
|
||||
}
|
||||
|
||||
public void activeLog(Logger log, String position) {
|
||||
this.log = log;
|
||||
public void activeLog(String logger_name, String position) {
|
||||
this.log = LoggerFactory.getLogger(logger_name);
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
@@ -113,23 +122,20 @@ public class MsgMailUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public void processLog(Level level, String message) {
|
||||
private void processLog(Level level, String message) {
|
||||
message = position + " - " + message;
|
||||
if (this.log != null) {
|
||||
switch (level.toInt()) {
|
||||
case Level.TRACE_INT:
|
||||
switch (level) {
|
||||
case TRACE:
|
||||
log.trace(message);
|
||||
break;
|
||||
case Level.ERROR_INT:
|
||||
case ERROR:
|
||||
log.error(message);
|
||||
break;
|
||||
case Level.FATAL_INT:
|
||||
log.fatal(message);
|
||||
break;
|
||||
case Level.INFO_INT:
|
||||
case INFO:
|
||||
log.info(message);
|
||||
break;
|
||||
case Level.WARN_INT:
|
||||
case WARN:
|
||||
log.warn(message);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
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>talend_DB_mssqlUtil-1.3-20190523</artifactId>
|
||||
<version>6.0.0</version>
|
||||
<groupId>org.talend.components.lib</groupId>
|
||||
<artifactId>talend_DB_mssqlUtil</artifactId>
|
||||
<version>1.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>talend_DB_mssqlUtil</name>
|
||||
|
||||
@@ -16,6 +16,8 @@ import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
@@ -117,10 +119,15 @@ public class MSSqlGenerateTimestampUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
{
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
}
|
||||
|
||||
/**
|
||||
* parse datetimeoffset string to date.
|
||||
* datetimeoffset string show as YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm
|
||||
* and no enough infomation for the DST decision,so no DST consider[not sure if 100% support for DST].
|
||||
*
|
||||
* @param datetimeOffsetString
|
||||
* @return
|
||||
@@ -131,13 +138,17 @@ public class MSSqlGenerateTimestampUtil {
|
||||
String offsetString = datetimeOffsetString.substring(idx + 1);
|
||||
int offset = TimeZone.getTimeZone("GMT" + offsetString).getRawOffset();
|
||||
|
||||
// get local timezone, also consider the DST
|
||||
TimeZone local = TimeZone.getDefault();
|
||||
int localOffset = local.getOffset(new java.util.Date().getTime());
|
||||
|
||||
long milliseconds = java.sql.Timestamp.valueOf(datetimeString).getTime();
|
||||
long millisecondsToGMT1970_01_01 = milliseconds - offset + localOffset;
|
||||
return new java.util.Date(millisecondsToGMT1970_01_01);
|
||||
long millisecondsWithOffset = 0l;
|
||||
try {
|
||||
millisecondsWithOffset = sdf.parse(datetimeString).getTime();
|
||||
} catch(ParseException e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
//get GMT's millisecond number since GMT 1970_01_01
|
||||
long milliseconds4GMT_to_GMT_1970_01_01 = millisecondsWithOffset - offset;
|
||||
|
||||
return new java.util.Date(milliseconds4GMT_to_GMT_1970_01_01);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<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>
|
||||
<groupId>org.talend.components.lib</groupId>
|
||||
<artifactId>talendsap</artifactId>
|
||||
<name>talendsap</name>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.2</version>
|
||||
|
||||
<properties>
|
||||
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
|
||||
|
||||
@@ -90,6 +90,7 @@ public class DocumentExtractor {
|
||||
List<Element> tablesAndChangingElements = new ArrayList<Element>(3);
|
||||
tablesAndChangingElements.add(functionElement.element("TABLES"));
|
||||
tablesAndChangingElements.add(functionElement.element("CHANGING"));
|
||||
tablesAndChangingElements.add(functionElement.element("OUTPUT"));
|
||||
|
||||
for(Element tablesOrChangingElement : tablesAndChangingElements) {
|
||||
if (tablesOrChangingElement == null) {
|
||||
@@ -121,6 +122,10 @@ public class DocumentExtractor {
|
||||
}
|
||||
result.add(row);
|
||||
}
|
||||
|
||||
if(!result.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -49,11 +49,11 @@ public class DocumentHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public void addSingleParameter(String name, String value, boolean isChanging) {
|
||||
public void addSingleParameter(String name, String value, SAPParameterType parameter_type) {
|
||||
if(value == null) {
|
||||
value = "";
|
||||
}
|
||||
if (isChanging) {
|
||||
if (parameter_type == SAPParameterType.CHANGING) {
|
||||
correctChanging();
|
||||
changing.addElement(name).setText(value);
|
||||
} else {
|
||||
@@ -62,8 +62,8 @@ public class DocumentHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public void addStructParameter(String name, boolean isChanging) {
|
||||
if (isChanging) {
|
||||
public void addStructParameter(String name, SAPParameterType parameter_type) {
|
||||
if (parameter_type == SAPParameterType.CHANGING) {
|
||||
correctChanging();
|
||||
currentStruct = changing.addElement(name);
|
||||
} else {
|
||||
@@ -79,13 +79,16 @@ public class DocumentHelper {
|
||||
currentStruct.addElement(name).setText(value);
|
||||
}
|
||||
|
||||
public void addTableParameter(String name, boolean isChanging) {
|
||||
if (isChanging) {
|
||||
public void addTableParameter(String name, SAPParameterType parameter_type) {
|
||||
if (parameter_type == SAPParameterType.CHANGING) {
|
||||
correctChanging();
|
||||
currentTable = changing.addElement(name);
|
||||
} else {
|
||||
} else if(parameter_type == SAPParameterType.TABLES) {
|
||||
correctTables();
|
||||
currentTable = tables.addElement(name);
|
||||
} else {
|
||||
correctInput();
|
||||
currentTable = input.addElement(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,18 +111,18 @@ public class DocumentHelper {
|
||||
DocumentHelper helper = new DocumentHelper();
|
||||
helper.setFunctionName("READ_TABLE_FUNCTION");
|
||||
|
||||
helper.addSingleParameter("ID", "1", true);
|
||||
helper.addSingleParameter("NAME", "gaoyan", false);
|
||||
helper.addSingleParameter("ID", "1", SAPParameterType.CHANGING);
|
||||
helper.addSingleParameter("NAME", "gaoyan", SAPParameterType.IMPORT);
|
||||
|
||||
helper.addStructParameter("INFO", true);
|
||||
helper.addStructParameter("INFO", SAPParameterType.CHANGING);
|
||||
helper.addStructChildParameter("ID", "2");
|
||||
helper.addStructChildParameter("NAME", "wangwei");
|
||||
|
||||
helper.addStructParameter("INFO1", false);
|
||||
helper.addStructParameter("INFO1", SAPParameterType.IMPORT);
|
||||
helper.addStructChildParameter("ID1", "4");
|
||||
helper.addStructChildParameter("NAME1", "momo");
|
||||
|
||||
helper.addTableParameter("TABLE1", false);
|
||||
helper.addTableParameter("TABLE1", SAPParameterType.TABLES);
|
||||
for (int i = 0; i < 200000; i++) {
|
||||
helper.addTableRow();
|
||||
helper.addTableRowChildParameter("c1", i + "");
|
||||
@@ -132,7 +135,7 @@ public class DocumentHelper {
|
||||
helper.addTableRowChildParameter("c8", "wangwei" + i);
|
||||
}
|
||||
|
||||
helper.addTableParameter("TABLE2", false);
|
||||
helper.addTableParameter("TABLE2", SAPParameterType.TABLES);
|
||||
for (int i = 0; i < 2; i++) {
|
||||
helper.addTableRow();
|
||||
helper.addTableRowChildParameter("ID4", i + "");
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.talend.sap;
|
||||
|
||||
public enum SAPParameterType {
|
||||
IMPORT,
|
||||
CHANGING,
|
||||
TABLES,
|
||||
EXPORT
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
<?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="talendssl.jar" />
|
||||
<property name="component.name" value="tLDAPInput" />
|
||||
<property name="author.name" value="wliu" />
|
||||
|
||||
<!-- 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>
|
||||
@@ -149,6 +149,8 @@
|
||||
<IMPORT NAME="Driver-V5R3_V6R1" MODULE="jt400_V5R3.jar" MVN="mvn:org.talend.libraries/jt400_V5R3/6.0.0" REQUIRED_IF="DB_VERSION == 'jt400_V5R3.jar'" />
|
||||
<IMPORT NAME="Driver-V6R1_V7R2" MODULE="jt400_V6R1.jar" MVN="mvn:org.talend.libraries/jt400_V6R1/6.0.0" REQUIRED_IF="DB_VERSION == 'jt400_V6R1.jar'" />
|
||||
<IMPORT NAME="Driver-V7R1_V7R3" MODULE="jt400-9.8.jar" MVN="mvn:net.sf.jt400/jt400/9.8" REQUIRED_IF="DB_VERSION == 'jt400-9.8.jar'" />
|
||||
<IMPORT NAME="slf4j-api-1.7.25.jar" MODULE="slf4j-api-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-api/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
<IMPORT NAME="slf4j-log4j12-1.7.25.jar" MODULE="slf4j-log4j12-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -301,6 +301,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().addingToBatch(dbLog.var("nb_line"), dbLog.str(dataAction));%>
|
||||
batchSizeCounter_<%=cid%>++;
|
||||
<%
|
||||
@@ -308,6 +309,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
} catch(java.sql.SQLException e) {
|
||||
@@ -431,6 +433,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().addingToBatch(dbLog.var("nb_line"), dbLog.str(dataAction));%>
|
||||
batchSizeCounter_<%=cid%>++;
|
||||
<%
|
||||
@@ -438,6 +441,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
} catch(java.sql.SQLException e) {
|
||||
@@ -584,6 +588,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmtUpdate_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
@@ -659,6 +664,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
@@ -833,11 +839,13 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
}else{
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
}
|
||||
} catch(java.sql.SQLException e) {
|
||||
@@ -914,12 +922,14 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().addingToBatch(dbLog.var("nb_line"), dbLog.str(dataAction));%>
|
||||
batchSizeCounter_<%=cid%>++;
|
||||
<%
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
deletedCount_<%=cid%> = deletedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().deleting(dbLog.var("nb_line"));%>
|
||||
|
||||
@@ -58,7 +58,7 @@ USER.NAME=Username
|
||||
USE_COMMIT_CONTROL.NAME=Use commit control
|
||||
USE_EXISTING_CONNECTION.NAME=Using existing connection
|
||||
USE_FIELD_OPTIONS.NAME=Use field options
|
||||
ENABLE_DEBUG_MODE.NAME=Enable debug mode
|
||||
ENABLE_DEBUG_MODE.NAME=Debug query mode
|
||||
DB_VERSION.NAME=DB Version
|
||||
DB_VERSION.ITEM.V5R2_V5R4=V5R2 to V5R4 (Deprecated)
|
||||
DB_VERSION.ITEM.V5R3_V6R1=V5R3 to V6R1 (Deprecated)
|
||||
|
||||
@@ -123,6 +123,9 @@
|
||||
|
||||
<IMPORT NAME="common2.6" 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="common-logging1.1.3" MODULE="commons-logging-1.1.3.jar" MVN="mvn:commons-logging/commons-logging/1.1.3" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-logging-1.1.3.jar" REQUIRED="true"/>
|
||||
|
||||
<IMPORT NAME="slf4j-api-1.7.25.jar" MODULE="slf4j-api-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-api/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
<IMPORT NAME="slf4j-log4j12-1.7.25.jar" MODULE="slf4j-log4j12-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
@@ -228,6 +229,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
@@ -345,6 +347,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmtUpdate_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
@@ -406,6 +409,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
try{
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
@@ -501,6 +505,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updateFlag_<%=cid%>=pstmtUpdate_<%=cid %>.executeUpdate();
|
||||
if(updateFlag_<%=cid%> != 0) {
|
||||
nb_line_<%=cid%>++;
|
||||
@@ -567,6 +572,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
@@ -645,6 +651,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
deletedCount_<%=cid%> = deletedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().deleting(dbLog.var("nb_line"));%>
|
||||
|
||||
@@ -52,7 +52,7 @@ FIELD_OPTIONS.ITEM.UPDATE_KEY=Key in update
|
||||
FIELD_OPTIONS.ITEM.DELETE_KEY=Key in delete
|
||||
FIELD_OPTIONS.ITEM.UPDATABLE=Updatable
|
||||
FIELD_OPTIONS.ITEM.INSERTABLE=Insertable
|
||||
ENABLE_DEBUG_MODE.NAME=Enable debug mode
|
||||
ENABLE_DEBUG_MODE.NAME=Debug query mode
|
||||
|
||||
NB_LINE.NAME=Number of line
|
||||
NB_LINE_UPDATED.NAME= NB Line Updated
|
||||
|
||||
Binary file not shown.
@@ -1,240 +0,0 @@
|
||||
MaxMind GeoIP License version 1.6, March 23rd, 2007
|
||||
|
||||
MAXMIND END-USER LICENSE AGREEMENT
|
||||
|
||||
By clicking on the words "I Agree" below, you agree that your use of the
|
||||
MaxMind GeoIP database products and services is subject to the terms and
|
||||
conditions set forth in this MaxMind End User License Agreement (this
|
||||
"Agreement").
|
||||
|
||||
MaxMind, Inc. ("MaxMind") provides a line of database services and products
|
||||
that provide the geographic information and other data associated with
|
||||
specific Internet protocol addresses. These database services and products
|
||||
are referred to in this Agreement individually as the "GeoIP Database" and
|
||||
collectively as the "GeoIP Databases". The data available through the GeoIP
|
||||
Databases is referred to in this Agreement as the "GeoIP Data". Some
|
||||
products in the MaxMind GeoIP Line may include MaxMind's proprietary computer
|
||||
programs used to query the GeoIP Databases (the "GeoIP Programs").
|
||||
|
||||
ADDITIONAL POLICIES.
|
||||
|
||||
The following policies are incorporated into this End User Agreement by
|
||||
reference and provide additional terms and conditions related to specific
|
||||
services and products provided by MaxMind:
|
||||
|
||||
minFraud Service Terms of Use
|
||||
|
||||
Each of these policies may be amended at any time and such amendments
|
||||
shall be binding and effective as indicated below in the section on
|
||||
Changes To The Agreement.
|
||||
|
||||
LIMITED GRANT OF RIGHTS.
|
||||
|
||||
In accordance with the terms of this Agreement, MaxMind hereby grants you a
|
||||
non-exclusive, non-transferable limited license to access and use the GeoIP
|
||||
Databases and GeoIP Data for your own internal Restricted Business
|
||||
purposes. Restricted Business purposes are limited to customizing website
|
||||
content, fraud prevention, geographic reporting, and similar business
|
||||
purposes. You agree to use the GeoIP Data and GeoIP Databases only in a
|
||||
manner that is consistent with applicable laws.
|
||||
|
||||
RESTRICTIONS ON USE.
|
||||
|
||||
Except as expressly permitted in this Agreement, you may not, nor may you
|
||||
permit others to:
|
||||
|
||||
(a) copy any portion of the GeoIP Databases except as reasonably required
|
||||
for using the GeoIP Database as permitted hereunder,
|
||||
|
||||
(b) allow anyone other than yourself or your employees to access the GeoIP
|
||||
Databases, or any portion thereof, without MaxMind's express written
|
||||
permission,
|
||||
|
||||
(c) use the GeoIP Databases to develop a database, infobase, online or
|
||||
similar database service, or other information resource in any media (print,
|
||||
electronic or otherwise, now existing or developed in the future) for sale
|
||||
to, distribution to, display to or use by others,
|
||||
|
||||
(d) create compilations or derivative works of the GeoIP Databases,
|
||||
|
||||
(e) use the GeoIP Databases in any fashion that may infringe any copyright,
|
||||
intellectual property right, contractual right, or proprietary or property
|
||||
right or interest held by MaxMind,
|
||||
|
||||
(f) store in a retrieval system accessible to the public, transfer,
|
||||
publish, distribute, display to others, broadcast, sell, or sublicense the
|
||||
GeoIP Databases, or any portion thereof,
|
||||
|
||||
(g) remove or obscure any copyright notice or other notice or terms of use
|
||||
contained in the GeoIP Databases,
|
||||
|
||||
(h) use the GeoIP Data to create or otherwise support the transmission of
|
||||
unsolicited, commercial email,
|
||||
|
||||
(i) remove, disable, avoid, circumvent, or defeat any functionality in the
|
||||
GeoIP Databases or GeoIP Programs designed to limit or control access to or
|
||||
use of the GeoIP Databases or GeoIP Data,
|
||||
|
||||
(j) use, copy or otherwise access any portion of the GeoIP Data for which
|
||||
you have not made payment to MaxMind. If for any reason, you access such
|
||||
GeoIP Data, these terms and conditions apply to your use of such data and
|
||||
you agree to pay all applicable charges, or
|
||||
|
||||
(k) copy, reverse engineer, decompile, disassemble, derive source code,
|
||||
modify or prepare derivative works of the GeoIP Programs.
|
||||
|
||||
OWNERSHIP AND INTELLECTUAL PROPERTY RIGHTS.
|
||||
|
||||
(a) Trade Secrets and Confidential Information. You acknowledge and agree
|
||||
that any and all confidential information and materials from which MaxMind
|
||||
derives actual or potential economic value constitutes MaxMind's
|
||||
confidential and proprietary trade secrets (collectively, "Trade Secrets").
|
||||
You further acknowledge and agree that MaxMind's Trade Secrets include, but
|
||||
are not limited to, the GeoIP Data contained in the GeoIP Databases and the
|
||||
technology used in the GeoIP Programs. You shall maintain any information
|
||||
learned about MaxMind's Trade Secrets as confidential and shall not disclose
|
||||
such information or permit such information to be disclosed to any person or
|
||||
entity. With respect to all such information, you shall exercise the same
|
||||
degree of care to protect MaxMind's Trade Secrets that you exercise with
|
||||
respect to protecting your own confidential information, and in no event
|
||||
less than reasonable care.
|
||||
|
||||
(b) Ownership. All intellectual property rights including copyrights, moral
|
||||
rights, trademarks, trade secrets, proprietary rights to the GeoIP
|
||||
Databases, GeoIP Data and GeoIP Programs are exclusively owned by MaxMind.
|
||||
You acknowledge and agree that you obtain no right, title or interest
|
||||
therein. You hereby assign to MaxMind all copyrights, intellectual property
|
||||
rights, and any other proprietary or property rights or interests in and to
|
||||
any work created in violation of this Agreement.
|
||||
|
||||
FEES.
|
||||
|
||||
MaxMind's current fee schedule for using the GeoIP Databases and related
|
||||
services is posted on the MaxMind website (url: http://www.maxmind.com).
|
||||
You are responsible for paying all fees associated with the use of the GEOIP
|
||||
Databases.
|
||||
|
||||
CHANGES TO THE AGREEMENT.
|
||||
|
||||
MaxMind may amend this Agreement at any time. Any such amendment(s) shall
|
||||
be binding and effective upon the earlier of (i) the date that is thirty
|
||||
(30) days after posting of the amended Agreement on MaxMind's web site, or
|
||||
(ii) the date that MaxMind provides notice to you of the amended Agreement
|
||||
pursuant to the notice provisions in this Agreement; except that changes to
|
||||
charges and payment terms may be made only upon 30 days' prior written
|
||||
notice to you. You may immediately terminate this Agreement upon notice to
|
||||
MaxMind if a change is unacceptable to you. Your continued use of the GeoIP
|
||||
Data, GeoIP Databases or GeoIP Programs following notice to you of a change
|
||||
shall constitute your acceptance of the change.
|
||||
|
||||
LIMITATION ON LIABILITY.
|
||||
|
||||
MAXMIND'S MAXIMUM TOTAL LIABILITY FOR ALL OCCURRENCES (IF ANY), TAKING PLACE
|
||||
DURING ANY TWELVE-MONTH PERIOD (OR A PORTION THEREOF, IF THIS AGREEMENT IS NOT
|
||||
IN EFFECT FOR TWELVE MONTHS), ARISING OUT OF OR IN ANY WAY RELATED TO THE
|
||||
AUTHORIZED OR UNAUTHORIZED ACTS OF MAXMIND'S EMPLOYEES OR MAXMIND'S PERFORMANCE
|
||||
OR NONPERFORMANCE OF THE SERVICES PROVIDED HEREIN, INCLUDING (BUT NOT LIMITED
|
||||
TO) ERRORS OF DESIGN OR ERRORS WHICH ARE DUE SOLELY TO MALFUNCTION OF
|
||||
MAXMIND-CONTROLLED MACHINES OR FAILURES OF MAXMIND OPERATORS, MAXMIND
|
||||
PROGRAMMERS OR MAXMIND-DEVELOPED PROGRAMS, SHALL BE LIMITED TO GENERAL MONEY
|
||||
DAMAGES IN AN AMOUNT NOT TO EXCEED THE TOTAL AMOUNT PAID BY YOU FOR SERVICES
|
||||
PROVIDED BY MAXMIND UNDER THIS AGREEMENT DURING SAID TWELVE-MONTH PERIOD (OR
|
||||
DURING SUCH SHORTER PERIOD THAT THIS AGREEMENT IS IN EFFECT). YOU AGREE THAT THE
|
||||
FOREGOING SHALL CONSTITUTE YOUR EXCLUSIVE REMEDY. YOU HEREBY RELEASE MAXMIND,
|
||||
ITS OFFICERS, EMPLOYEES AND AFFILIATES FROM ANY AND ALL OBLIGATIONS, LIABILITIES
|
||||
AND CLAIMS IN EXCESS OF THIS LIMITATION.
|
||||
|
||||
NO CONSEQUENTIAL DAMAGES.
|
||||
|
||||
UNDER NO CIRCUMSTANCES INCLUDING NEGLIGENCE SHALL MAXMIND OR ANY RELATED PARTY OR SUPPLIER BE
|
||||
LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES;
|
||||
OR FOR LOSS OF PROFITS, REVENUE, OR DATA; THAT ARE DIRECTLY OR INDIRECTLY
|
||||
RELATED TO THE USE OF, OR THE INABILITY TO USE THE SITE OR SERVICES, WHETHER
|
||||
IN AN ACTION IN CONTRACT, TORT, PRODUCT LIABILITY, STRICT LIABILITY, STATUTE
|
||||
OR OTHERWISE EVEN IF MAXMIND HAS BEEN ADVISED OF THE POSSIBILITY OF THOSE
|
||||
DAMAGES.
|
||||
|
||||
NO WARRANTIES.
|
||||
|
||||
THE GEOIP DATABASES, GEOIP DATA AND GEOIP PROGRAMS ARE FURNISHED ON AN "AS
|
||||
IS", AS-AVAILABLE BASIS. MAXMIND MAKES NO WARRANTY, EXPRESS OR IMPLIED,
|
||||
WITH RESPECT TO THE CAPABILITY OF THE GEOIP DATABASES, GEOIP DATA AND GEOIP
|
||||
PROGRAMS OR THE ACCURACY OR THE COMPLETENESS OF THE GEOIP DATA. ALL
|
||||
WARRANTIES OF ANY TYPE, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF
|
||||
THIRD PARTY RIGHTS ARE EXPRESSLY DISCLAIMED. MAXMIND DOES NOT WARRANT THAT
|
||||
THE SERVICES WILL MEET ANY PARTICULAR CRITERIA OF PERFORMANCE OR QUALITY, OR
|
||||
THAT THE SITE IS FREE OF OTHER HARMFUL COMPONENTS. NEVERTHELESS, MAXMIND
|
||||
SHALL MAKE COMMERCIALLY REASONABLE EFFORTS TO MAINTAIN THE SITE FREE OF
|
||||
VIRUSES AND MALICIOUS CODE.
|
||||
|
||||
GOVERNING LAW.
|
||||
|
||||
This Agreement shall be governed and interpreted pursuant to the laws of the
|
||||
Commonwealth of Massachusetts, applicable to contracts made and to be
|
||||
performed wholly in Massachusetts, without regard to principles of conflicts
|
||||
of laws.
|
||||
You specifically consent to personal jurisdiction in Massachusetts in connection
|
||||
with any dispute between you and MaxMind arising out of this Agreement or
|
||||
pertaining to the subject matter hereof. You agree that the exclusive venue for
|
||||
any dispute hereunder shall be in the state and federal courts in Boston,
|
||||
Massachusetts.
|
||||
|
||||
NOTICES
|
||||
|
||||
Notices given under this Agreement shall be in writing and sent by
|
||||
facsimile, e-mail, or by first class mail or equivalent. MaxMind shall
|
||||
direct notice to you at the facsimile number, e-mail address, or physical
|
||||
mailing address (collectively, "Address") you provided in the registration
|
||||
process. You shall direct notice to MaxMind at the following address:
|
||||
|
||||
MaxMind, Inc.
|
||||
PO Box 230074
|
||||
Boston MA 02123-0074
|
||||
Email: legal@maxmind.com
|
||||
Fax: (815) 301-8737
|
||||
|
||||
Either party may change its Address for notice at anytime by giving notice
|
||||
of the new Address as provided in this section.
|
||||
|
||||
COMPLETE AGREEMENT.
|
||||
|
||||
This Agreement represents
|
||||
the entire agreement between you and MaxMind with respect to the subject
|
||||
matter hereof and supersedes all previous representations, understandings or
|
||||
agreements, oral or written, between the parties regarding the subject
|
||||
matter hereof.
|
||||
|
||||
APPLICABLE LAWS.
|
||||
|
||||
You agree to use the GeoIP Data and GeoIP Databases only in a
|
||||
manner that is consistent with applicable laws.
|
||||
|
||||
ASSIGNMENT.
|
||||
|
||||
You may not assign your rights in this Agreement without MaxMind's prior
|
||||
written consent.
|
||||
|
||||
SEVERABILITY.
|
||||
|
||||
Should any provision of this Agreement be held void, invalid or inoperative,
|
||||
such decision shall not affect any other provision hereof, and the remainder
|
||||
of this Agreement shall be effective as though such void, invalid or
|
||||
inoperative provision had not been contained herein.
|
||||
|
||||
FAILURE TO ENFORCE.
|
||||
|
||||
The failure of MaxMind to enforce any provision of these terms and
|
||||
conditions shall not constitute or be construed as a waiver of such
|
||||
provision or of the right to enforce it at a later time.
|
||||
|
||||
FACSIMILES.
|
||||
|
||||
If you submit a document which includes your facsimile signature, MaxMind
|
||||
may treat the facsimile signature as an original of your signature.
|
||||
|
||||
CAPTIONS.
|
||||
|
||||
The section headings used herein, are for convenience only and shall have no
|
||||
force or effect upon the construction or interpretation of any provision
|
||||
hereof.
|
||||
@@ -211,10 +211,8 @@
|
||||
|
||||
<CODEGENERATION>
|
||||
<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="true" 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="true" BundleID="" />
|
||||
<IMPORT NAME="Java_DOM4J_2.1.1" MODULE="dom4j-2.1.1.jar" MVN="mvn:org.dom4j/dom4j/2.1.1" REQUIRED="true" BundleID="" />
|
||||
<IMPORT NAME="Java_JAXEN_1.1.6" MODULE="jaxen-1.1.6.jar" MVN="mvn:jaxen/jaxen/1.1.6" REQUIRED="true" BundleID="" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
Binary file not shown.
@@ -215,6 +215,8 @@
|
||||
</TEMPLATES>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-MysqlConnector" MODULE="mysql-connector-java-5.1.30-bin.jar" MVN="mvn:org.talend.libraries/mysql-connector-java-5.1.30-bin/6.0.0" />
|
||||
<IMPORT NAME="slf4j-api-1.7.25.jar" MODULE="slf4j-api-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-api/1.7.25" REQUIRED_IF="(USE_SHARED_CONNECTION == 'true' AND SPECIFY_DATASOURCE_ALIAS=='false')" />
|
||||
<IMPORT NAME="slf4j-log4j12-1.7.25.jar" MODULE="slf4j-log4j12-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.25" REQUIRED_IF="(USE_SHARED_CONNECTION == 'true' AND SPECIFY_DATASOURCE_ALIAS=='false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
<RETURNS/>
|
||||
|
||||
@@ -73,7 +73,7 @@ FIELD_OPTIONS.ITEM.DELETE_KEY=Key in delete
|
||||
FIELD_OPTIONS.ITEM.UPDATABLE=Updatable
|
||||
FIELD_OPTIONS.ITEM.INSERTABLE=Insertable
|
||||
PROPERTIES.NAME=Additional JDBC Parameters
|
||||
ENABLE_DEBUG_MODE.NAME=Enable debug mode
|
||||
ENABLE_DEBUG_MODE.NAME=Debug query mode
|
||||
|
||||
NB_LINE_UPDATED.NAME=Number Of Updated Lines
|
||||
NB_LINE_INSERTED.NAME=Number Of Inserted Lines
|
||||
|
||||
@@ -121,14 +121,14 @@
|
||||
<IMPORT NAME="aws-java-sdk-1.11.406.jar" MODULE="aws-java-sdk-1.11.406.jar"
|
||||
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.406"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9"
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-databind-2.9.9.jar" MODULE="jackson-databind-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.9.9"
|
||||
<IMPORT NAME="jackson-databind-2.10.1.jar" MODULE="jackson-databind-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-annotations-2.9.0.jar" MODULE="jackson-annotations-2.9.0.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0"
|
||||
<IMPORT NAME="jackson-annotations-2.10.1.jar" MODULE="jackson-annotations-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar"
|
||||
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9"
|
||||
|
||||
@@ -5,7 +5,7 @@ if(!use_customize_version){
|
||||
%>String[] applications_<%=cid%> = <%
|
||||
String application = ElementParameterParser.getValue(node, "__APPLICATION__");
|
||||
if("ALL_APPLICATIONS".equals(application)) {
|
||||
if("\"emr-4.6.0\",\"emr-4.9.2\",\"emr-5.11.0\"".contains(cluster_version)) {
|
||||
if("\"emr-4.6.0\",\"emr-4.9.2\",\"emr-5.11.0\",\"emr-5.15.0\"".contains(cluster_version)) {
|
||||
%>
|
||||
{}
|
||||
<%
|
||||
@@ -13,21 +13,9 @@ if(!use_customize_version){
|
||||
%>
|
||||
{"Ganglia","Hadoop","Hive","Hue","Mahout","Pig","Spark"}
|
||||
<%
|
||||
} else if("\"emr-4.2.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Ganglia","Hadoop","Hive","Hue","Mahout","Pig","Spark"}
|
||||
<%
|
||||
} else if("\"emr-4.1.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Hive","Hue","Mahout","Pig","Spark"}
|
||||
<%
|
||||
} else if("\"emr-4.0.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Hive","Mahout","Pig","Spark"}
|
||||
<%
|
||||
}
|
||||
} else if("CORE_HADOOP".equals(application)) {
|
||||
if("\"emr-5.11.0\"".equals(cluster_version)){%>
|
||||
if("\"emr-5.11.0\"".equals(cluster_version) || "\"emr-5.15.0\"".equals(cluster_version)){%>
|
||||
{"Ganglia","Hadoop","Hive","Hue","Mahout","Pig","Tez"}
|
||||
<%
|
||||
}else if("\"emr-4.6.0\"".equals(cluster_version) || "\"emr-4.9.2\"".equals(cluster_version)) {
|
||||
@@ -38,18 +26,6 @@ if(!use_customize_version){
|
||||
%>
|
||||
{"Ganglia","Hadoop","Hive","Pig"}
|
||||
<%
|
||||
} else if("\"emr-4.2.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Ganglia","Hadoop","Hive","Pig"}
|
||||
<%
|
||||
} else if("\"emr-4.1.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Hive","Pig"}
|
||||
<%
|
||||
} else if("\"emr-4.0.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Hive","Pig"}
|
||||
<%
|
||||
}
|
||||
} else if("PRESTO_SANDBOX".equals(application)) {
|
||||
if("\"emr-4.6.0\"".equals(cluster_version) || "\"emr-4.9.2\"".equals(cluster_version)) {
|
||||
@@ -60,17 +36,9 @@ if(!use_customize_version){
|
||||
%>
|
||||
{"Hadoop","Hive","Presto-Sandbox"}
|
||||
<%
|
||||
} else if("\"emr-4.2.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Hive","Presto-Sandbox"}
|
||||
<%
|
||||
} else if("\"emr-4.1.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Hive","Presto-Sandbox"}
|
||||
<%
|
||||
}
|
||||
} else if("PRESTO".equals(application)) {
|
||||
if("\"emr-5.11.0\"".equals(cluster_version)){%>
|
||||
if("\"emr-5.11.0\"".equals(cluster_version) || "\"emr-5.15.0\"".equals(cluster_version)){%>
|
||||
{"Hadoop","Hive","Presto"}
|
||||
<% } else { %>
|
||||
if(true) {
|
||||
@@ -79,7 +47,7 @@ if(!use_customize_version){
|
||||
<%
|
||||
}
|
||||
} else if("SPARK".equals(application)) {
|
||||
if("\"emr-5.11.0\"".equals(cluster_version)){%>
|
||||
if("\"emr-5.11.0\"".equals(cluster_version) || "\"emr-5.15.0\"".equals(cluster_version)){%>
|
||||
{"Ganglia","Hadoop","Spark","Zeppelin"}
|
||||
<%
|
||||
} else if("\"emr-4.6.0\"".equals(cluster_version) || "\"emr-4.9.2\"".equals(cluster_version)) {
|
||||
@@ -90,21 +58,9 @@ if(!use_customize_version){
|
||||
%>
|
||||
{"Ganglia","Hadoop","Spark"}
|
||||
<%
|
||||
} else if("\"emr-4.2.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Ganglia","Hadoop","Spark"}
|
||||
<%
|
||||
} else if("\"emr-4.1.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Spark"}
|
||||
<%
|
||||
} else if("\"emr-4.0.0\"".equals(cluster_version)) {
|
||||
%>
|
||||
{"Hadoop","Spark"}
|
||||
<%
|
||||
}
|
||||
} else if("HBASE".equals(application)) {
|
||||
if("\"emr-5.11.0\"".equals(cluster_version) || "\"emr-4.9.2\"".equals(cluster_version)){%>
|
||||
if("\"emr-5.11.0\"".equals(cluster_version) || "\"emr-4.9.2\"".equals(cluster_version) || "\"emr-5.15.0\"".equals(cluster_version)){%>
|
||||
{"HBase","Ganglia","Hadoop","Hive","Hue","Phoenix","ZooKeeper"}
|
||||
<%
|
||||
} else if("\"emr-4.6.0\"".equals(cluster_version)) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -97,14 +97,12 @@
|
||||
|
||||
<PARAMETER NAME="CLUSTER_VERSION" FIELD="OPENED_LIST"
|
||||
NUM_ROW="32" SHOW_IF="(ACTION=='START') AND (USE_CUSTOMIZE_VERSION == 'false')" GROUP="CONFIGURATION">
|
||||
<ITEMS DEFAULT="EMR5_11_0">
|
||||
<ITEMS DEFAULT="EMR5_15_0">
|
||||
<ITEM NAME="EMR5_15_0" VALUE=""emr-5.15.0"" />
|
||||
<ITEM NAME="EMR5_11_0" VALUE=""emr-5.11.0"" />
|
||||
<ITEM NAME="EMR4_9_2" VALUE=""emr-4.9.2"" />
|
||||
<ITEM NAME="EMR4_6_0" VALUE=""emr-4.6.0"" />
|
||||
<ITEM NAME="EMR4_5_0" VALUE=""emr-4.5.0"" />
|
||||
<ITEM NAME="EMR4_2_0" VALUE=""emr-4.2.0"" />
|
||||
<ITEM NAME="EMR4_1_0" VALUE=""emr-4.1.0"" />
|
||||
<ITEM NAME="EMR4_0_0" VALUE=""emr-4.0.0"" />
|
||||
<ITEM NAME="AMI3_10_0" VALUE=""3.10.0"" />
|
||||
<ITEM NAME="AMI3_9_0" VALUE=""3.9.0"" />
|
||||
<ITEM NAME="AMI3_8_0" VALUE=""3.8.0"" />
|
||||
@@ -114,14 +112,14 @@
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="APPLICATION" FIELD="CLOSED_LIST" NUM_ROW="32"
|
||||
SHOW_IF="(ACTION=='START') AND (USE_CUSTOMIZE_VERSION == 'false') AND ((CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR4_9_2') OR (CLUSTER_VERSION=='EMR4_6_0') OR (CLUSTER_VERSION=='EMR4_5_0') OR (CLUSTER_VERSION=='EMR4_2_0') OR (CLUSTER_VERSION=='EMR4_1_0') OR (CLUSTER_VERSION=='EMR4_0_0'))" GROUP="CONFIGURATION">
|
||||
SHOW_IF="(ACTION=='START') AND (USE_CUSTOMIZE_VERSION == 'false') AND ((CLUSTER_VERSION=='EMR5_15_0') OR (CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR4_9_2') OR (CLUSTER_VERSION=='EMR4_6_0') OR (CLUSTER_VERSION=='EMR4_5_0'))" GROUP="CONFIGURATION">
|
||||
|
||||
<ITEMS DEFAULT="CORE_HADOOP">
|
||||
<ITEM NAME="ALL_APPLICATIONS" VALUE="ALL_APPLICATIONS" NOT_SHOW_IF="(CLUSTER_VERSION=='EMR4_6_0') OR (CLUSTER_VERSION=='EMR4_9_2') OR (CLUSTER_VERSION=='EMR5_11_0')"/>
|
||||
<ITEM NAME="ALL_APPLICATIONS" VALUE="ALL_APPLICATIONS" NOT_SHOW_IF="(CLUSTER_VERSION=='EMR4_6_0') OR (CLUSTER_VERSION=='EMR4_9_2') OR (CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR5_15_0')"/>
|
||||
<ITEM NAME="CORE_HADOOP" VALUE="CORE_HADOOP" />
|
||||
<ITEM NAME="HBASE" VALUE="HBASE" SHOW_IF="(CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR4_9_2') OR (CLUSTER_VERSION=='EMR4_6_0')"/>
|
||||
<ITEM NAME="PRESTO_SANDBOX" VALUE="PRESTO_SANDBOX" NOT_SHOW_IF="(CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR4_0_0')"/>
|
||||
<ITEM NAME="PRESTO" VALUE="PRESTO" SHOW_IF="(CLUSTER_VERSION=='EMR5_11_0')"/>
|
||||
<ITEM NAME="HBASE" VALUE="HBASE" SHOW_IF="(CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR4_9_2') OR (CLUSTER_VERSION=='EMR4_6_0') OR (CLUSTER_VERSION=='EMR5_15_0')"/>
|
||||
<ITEM NAME="PRESTO_SANDBOX" VALUE="PRESTO_SANDBOX" NOT_SHOW_IF="(CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR5_15_0')"/>
|
||||
<ITEM NAME="PRESTO" VALUE="PRESTO" SHOW_IF="(CLUSTER_VERSION=='EMR5_11_0') OR (CLUSTER_VERSION=='EMR5_15_0')"/>
|
||||
<ITEM NAME="SPARK" VALUE="SPARK" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
@@ -298,7 +296,7 @@
|
||||
|
||||
<PARAMETER NAME="CUSTOMIZE_VERSION" FIELD="TEXT"
|
||||
NUM_ROW="12" SHOW_IF="(ACTION=='START') AND (USE_CUSTOMIZE_VERSION =='true')" GROUP="CUSTOMIZE_APPLICATION_GROUP">
|
||||
<DEFAULT>"emr-5.11.0"</DEFAULT>
|
||||
<DEFAULT>"emr-5.15.0"</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="CUSTOMIZE_APPLICATION_TABLE" FIELD="TABLE" NUM_ROW="13" NB_LINES="5" GROUP="CUSTOMIZE_APPLICATION_GROUP"
|
||||
@@ -427,14 +425,14 @@
|
||||
<IMPORT NAME="aws-java-sdk-1.11.406.jar" MODULE="aws-java-sdk-1.11.406.jar"
|
||||
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.406"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9"
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-databind-2.9.9.jar" MODULE="jackson-databind-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.9.9"
|
||||
<IMPORT NAME="jackson-databind-2.10.1.jar" MODULE="jackson-databind-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-annotations-2.9.0.jar" MODULE="jackson-annotations-2.9.0.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0"
|
||||
<IMPORT NAME="jackson-annotations-2.10.1.jar" MODULE="jackson-annotations-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar"
|
||||
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9"
|
||||
|
||||
@@ -29,13 +29,11 @@ REGION.ITEM.SA_EAST_1=South America (Sao Paulo)
|
||||
CLUSTER_NAME.NAME=Cluster name
|
||||
|
||||
CLUSTER_VERSION.NAME=Cluster version
|
||||
CLUSTER_VERSION.ITEM.EMR5_15_0=EMR 5.15.0
|
||||
CLUSTER_VERSION.ITEM.EMR5_11_0=EMR 5.11.0
|
||||
CLUSTER_VERSION.ITEM.EMR4_9_2=EMR 4.9.2
|
||||
CLUSTER_VERSION.ITEM.EMR4_6_0=EMR 4.6.0
|
||||
CLUSTER_VERSION.ITEM.EMR4_5_0=EMR 4.5.0
|
||||
CLUSTER_VERSION.ITEM.EMR4_2_0=EMR 4.2.0
|
||||
CLUSTER_VERSION.ITEM.EMR4_1_0=EMR 4.1.0
|
||||
CLUSTER_VERSION.ITEM.EMR4_0_0=EMR 4.0.0
|
||||
CLUSTER_VERSION.ITEM.AMI3_10_0=AMI 3.10.0
|
||||
CLUSTER_VERSION.ITEM.AMI3_9_0=AMI 3.9.0
|
||||
CLUSTER_VERSION.ITEM.AMI3_8_0=AMI 3.8.0
|
||||
|
||||
@@ -178,14 +178,14 @@
|
||||
<IMPORT NAME="aws-java-sdk-1.11.406.jar" MODULE="aws-java-sdk-1.11.406.jar"
|
||||
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.406"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9"
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-databind-2.9.9.jar" MODULE="jackson-databind-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.9.9"
|
||||
<IMPORT NAME="jackson-databind-2.10.1.jar" MODULE="jackson-databind-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-annotations-2.9.0.jar" MODULE="jackson-annotations-2.9.0.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0"
|
||||
<IMPORT NAME="jackson-annotations-2.10.1.jar" MODULE="jackson-annotations-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar"
|
||||
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9"
|
||||
|
||||
@@ -164,6 +164,8 @@
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-MysqlConnector" MODULE="mysql-connector-java-5.1.30-bin.jar" MVN="mvn:org.talend.libraries/mysql-connector-java-5.1.30-bin/6.0.0" REQUIRED_IF="DB_VERSION == 'MYSQL_5'" />
|
||||
<IMPORT NAME="Driver-MysqlConnector_Old" MODULE="mysql-connector-java-5.1.0-bin.jar" MVN="mvn:org.talend.libraries/mysql-connector-java-5.1.0-bin/6.0.0" REQUIRED="false" />
|
||||
<IMPORT NAME="slf4j-api-1.7.25.jar" MODULE="slf4j-api-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-api/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
<IMPORT NAME="slf4j-log4j12-1.7.25.jar" MODULE="slf4j-log4j12-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
<RETURNS/>
|
||||
|
||||
@@ -763,6 +763,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().addingToBatch(dbLog.var("nb_line"), dbLog.str(dataAction));%>
|
||||
<%
|
||||
if (!("").equals(numPerInsert ) && !("0").equals(numPerInsert )) {
|
||||
@@ -776,6 +777,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -853,6 +855,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -979,6 +982,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().addingToBatch(dbLog.var("nb_line"), dbLog.str(dataAction));%>
|
||||
batchSizeCounter_<%=cid%>++;
|
||||
<%
|
||||
@@ -986,6 +990,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -1137,6 +1142,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmtUpdate_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
@@ -1212,6 +1218,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
@@ -1389,11 +1396,13 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
}else{
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
}
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -1472,12 +1481,14 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().addingToBatch(dbLog.var("nb_line"), dbLog.str(dataAction));%>
|
||||
batchSizeCounter_<%=cid%>++;
|
||||
<%
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
deletedCount_<%=cid%> = deletedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().deleting(dbLog.var("nb_line"));%>
|
||||
@@ -1625,6 +1636,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
int count_on_duplicate_key_<%=cid%> = 0;
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
count_on_duplicate_key_<%=cid%> = pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().insertingOnDuplicateKeyUpdating(null);%>
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -1690,6 +1702,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().insertingOnDuplicateKeyUpdating(dbLog.var("nb_line"));%>
|
||||
} catch(java.lang.Exception e) {
|
||||
|
||||
@@ -82,7 +82,7 @@ FIELD_OPTIONS.ITEM.DELETE_KEY=Key in delete
|
||||
FIELD_OPTIONS.ITEM.UPDATABLE=Updatable
|
||||
FIELD_OPTIONS.ITEM.INSERTABLE=Insertable
|
||||
PROPERTIES.NAME=Additional JDBC Parameters
|
||||
ENABLE_DEBUG_MODE.NAME=Enable debug mode
|
||||
ENABLE_DEBUG_MODE.NAME=Debug query mode
|
||||
|
||||
NB_LINE_UPDATED.NAME=Number Of Updated Lines
|
||||
NB_LINE_INSERTED.NAME=Number Of Inserted Lines
|
||||
|
||||
@@ -56,7 +56,7 @@ imports="
|
||||
if(isLog4jEnabled){
|
||||
shareDBClass = "SharedDBConnectionLog4j";
|
||||
%>
|
||||
SharedDBConnectionLog4j.initLogger(log,"<%=cid%>");
|
||||
SharedDBConnectionLog4j.initLogger(log.getName(),"<%=cid%>");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -243,6 +243,8 @@
|
||||
<IMPORT NAME="Driver-Ojdbc8" MODULE="ojdbc8-12.2.0.1.jar" MVN="mvn:com.oracle.jdbc/ojdbc8/12.2.0.1" REQUIRED_IF="(DB_VERSION == 'ORACLE_18')" />
|
||||
<IMPORT NAME="Driver-Ojdbc7" MODULE="ojdbc7.jar" MVN="mvn:org.talend.libraries/ojdbc7/6.0.0" REQUIRED_IF="(DB_VERSION == 'ORACLE_12')" />
|
||||
<IMPORT NAME="Driver-Ojdbc6" MODULE="ojdbc6.jar" MVN="mvn:org.talend.libraries/ojdbc6/6.0.0" REQUIRED_IF="(DB_VERSION == 'ORACLE_11')" />
|
||||
<IMPORT NAME="slf4j-api-1.7.25.jar" MODULE="slf4j-api-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-api/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
<IMPORT NAME="slf4j-log4j12-1.7.25.jar" MODULE="slf4j-log4j12-1.7.25.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.25" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ String batchSize=ElementParameterParser.getValue(node,"__BATCH_SIZE__");
|
||||
|
||||
boolean useExistingConnection = "true".equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
boolean useAlternateSchema = "true".equals(ElementParameterParser.getValue(node, "__USE_ALTERNATE_SCHEMA__"));
|
||||
|
||||
String alternateSchema = ElementParameterParser.getValue(node, "__ALTERNATE_SCHEMA__");
|
||||
|
||||
String rejectConnName = null;
|
||||
List<? extends IConnection> rejectConns = node.getOutgoingConnections("REJECT");
|
||||
if(rejectConns != null && rejectConns.size() > 0) {
|
||||
@@ -198,8 +202,16 @@ if(useExistingConnection) {
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "conn_" + connection;
|
||||
String schema = "dbschema_" + connection;
|
||||
if(useAlternateSchema) {
|
||||
%>
|
||||
dbschema_<%=cid%> = <%=alternateSchema%>;
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
dbschema_<%=cid%> = (String)globalMap.get("<%=schema%>");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
dbschema_<%=cid%> = (String)globalMap.get("<%=schema%>");
|
||||
conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
|
||||
<%dbLog.conn().useExistConn("conn_"+cid+".getMetaData().getURL()", "conn_"+cid+".getMetaData().getUserName()");%>
|
||||
<%
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
NUM_ROW="50"
|
||||
REPOSITORY_VALUE="SCHEMA"
|
||||
REQUIRED="false"
|
||||
SHOW_IF="((USE_EXISTING_CONNECTION == 'false') "
|
||||
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
@@ -266,7 +266,6 @@
|
||||
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') and (CONNECTION_TYPE != 'ORACLE_WALLET')">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="NOTE"
|
||||
FIELD="LABEL"
|
||||
@@ -274,6 +273,26 @@
|
||||
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') and (CONNECTION_TYPE != 'ORACLE_WALLET')">
|
||||
<DEFAULT>*Note: Example for Additional JDBC Parameters: "parameterName1=value1&&parameterName2=value2"</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_ALTERNATE_SCHEMA"
|
||||
FIELD="CHECK"
|
||||
NUM_ROW="15"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="ALTERNATE_SCHEMA"
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="20"
|
||||
REQUIRED="false"
|
||||
SHOW_IF="(USE_EXISTING_CONNECTION == 'true') and (USE_ALTERNATE_SCHEMA == 'true')"
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="ENCODING"
|
||||
FIELD="ENCODING_TYPE"
|
||||
|
||||
@@ -453,6 +453,7 @@ IMetadataColumn talendDynCol = null;
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -594,6 +595,7 @@ IMetadataColumn talendDynCol = null;
|
||||
%>
|
||||
try {
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -758,6 +760,7 @@ IMetadataColumn talendDynCol = null;
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmtUpdate_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
@@ -838,6 +841,7 @@ IMetadataColumn talendDynCol = null;
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
@@ -1023,11 +1027,13 @@ IMetadataColumn talendDynCol = null;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmtInsert_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().inserting(dbLog.var("nb_line"));%>
|
||||
}else{
|
||||
nb_line_<%=cid%>++;
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
<%dbLog.data().updating(dbLog.var("nb_line"));%>
|
||||
}
|
||||
} catch(java.lang.Exception e) {
|
||||
@@ -1116,6 +1122,7 @@ IMetadataColumn talendDynCol = null;
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
<%if(isEnableDebug){dbLog.data().sqlDebugPrint("globalMap.get(\""+cid+"_QUERY\")");}%>
|
||||
deletedCount_<%=cid%> = deletedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
<%dbLog.data().deleting(dbLog.var("nb_line"));%>
|
||||
|
||||
@@ -77,7 +77,7 @@ FIELD_OPTIONS.ITEM.UPDATABLE=Updatable
|
||||
FIELD_OPTIONS.ITEM.INSERTABLE=Insertable
|
||||
LOCAL_SERVICE_NAME.NAME=Local Service Name
|
||||
CONVERT_COLUMN_TABLE_TO_UPPERCASE.NAME=Convert columns and table to uppercase
|
||||
ENABLE_DEBUG_MODE.NAME=Enable debug mode
|
||||
ENABLE_DEBUG_MODE.NAME=Debug query mode
|
||||
DB_VERSION.NAME=DB Version
|
||||
DB_VERSION.ITEM.ORACLE_18=Oracle 18
|
||||
DB_VERSION.ITEM.ORACLE_12=Oracle 12-7
|
||||
@@ -118,3 +118,5 @@ SUPPORT_NULL_WHERE.NAME=Support null in "SQL WHERE" statement
|
||||
|
||||
USE_TIMESTAMP_FOR_DATE_TYPE.NAME = Use Timestamp for Date type
|
||||
NB_LINE_REJECTED.NAME=Number Of Rejected Lines
|
||||
USE_ALTERNATE_SCHEMA.NAME=Use alternate schema
|
||||
ALTERNATE_SCHEMA.NAME=Schema
|
||||
@@ -234,14 +234,14 @@
|
||||
<IMPORT NAME="aws-java-sdk-1.11.406.jar" MODULE="aws-java-sdk-1.11.406.jar"
|
||||
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.406"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9"
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-databind-2.9.9.jar" MODULE="jackson-databind-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.9.9"
|
||||
<IMPORT NAME="jackson-databind-2.10.1.jar" MODULE="jackson-databind-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-annotations-2.9.0.jar" MODULE="jackson-annotations-2.9.0.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0"
|
||||
<IMPORT NAME="jackson-annotations-2.10.1.jar" MODULE="jackson-annotations-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.10.1"
|
||||
REQUIRED="true" />
|
||||
<IMPORT NAME="httpcore-4.4.9.jar" MODULE="httpcore-4.4.9.jar"
|
||||
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.9"
|
||||
|
||||
Binary file not shown.
@@ -5,6 +5,7 @@
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.process.IConnection
|
||||
java.util.List
|
||||
"
|
||||
%>
|
||||
@@ -36,6 +37,18 @@
|
||||
|
||||
String passwordFieldName = "";
|
||||
|
||||
IConnection incomingConnection = null;
|
||||
if(node.getUniqueName().startsWith("tBigQueryOutput_")) {
|
||||
List< ? extends IConnection> conns = node.getIncomingConnections();
|
||||
IConnection virtConnection = null;
|
||||
if(conns!=null && conns.size()>0){
|
||||
virtConnection = node.getIncomingConnections().get(0);
|
||||
}
|
||||
if(virtConnection != null && virtConnection.getSource() != null && virtConnection.getSource().getIncomingConnections() != null && virtConnection.getSource().getIncomingConnections().size() > 0) {
|
||||
incomingConnection = virtConnection.getSource().getIncomingConnections().get(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (authMode.equals("OAUTH")) {
|
||||
%>
|
||||
/* ----START-CREATING-CLIENT (OAuth 2.0)---- */
|
||||
@@ -247,6 +260,11 @@
|
||||
%>
|
||||
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
int currIndex_<%=cid%> = 0;
|
||||
<%
|
||||
}
|
||||
if (authMode.equals("OAUTH")) {
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
@@ -309,41 +327,82 @@
|
||||
if (metadata != null) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int nbColumns = columns.size();
|
||||
int dynamicColumnSize = 0;
|
||||
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 = (!column.isNullable()) ? "REQUIRED" : "NULLABLE";
|
||||
if(!"id_Dynamic".equals(column.getTalendType())) {
|
||||
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 = (!column.isNullable()) ? "REQUIRED" : "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[" + currIndex_<%=cid%> + "] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\",\"mode\":\"<%=modeType%>\"}");
|
||||
currIndex_<%=cid%>++;
|
||||
<%
|
||||
}
|
||||
} else if(incomingConnection != null) {
|
||||
%>
|
||||
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%>\"}");
|
||||
routines.system.Dynamic column_<%=cid%> = (routines.system.Dynamic)<%=incomingConnection.getName()%>.<%=column.getLabel()%>;
|
||||
for (int i = 0; i < column_<%=cid%>.getColumnCount(); i++) {
|
||||
routines.system.DynamicMetadata metadata = column_<%=cid%>.getColumnMetadata(i);
|
||||
String dataType = routines.system.MetadataTalendType.getDefaultSelectedDbType("bigquery_id", metadata.getType(), -1, -1);
|
||||
String orignalDBType = metadata.getDbType();
|
||||
java.util.List<String> outputDBTypelist = routines.system.MetadataTalendType.getTalendToDBList("bigquery_id", metadata.getType());
|
||||
if (outputDBTypelist != null && outputDBTypelist.size() > 0) {
|
||||
for (String dbType : outputDBTypelist) {
|
||||
if (orignalDBType.equalsIgnoreCase(dbType)) {
|
||||
dataType = dbType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dataType == null || ("").equals(dataType)) {
|
||||
dataType = orignalDBType;
|
||||
} else if(dataType.equalsIgnoreCase("RECORD") || dataType.equalsIgnoreCase("STRUCT")) {
|
||||
dataType = "STRING";
|
||||
}
|
||||
String modeType = (!metadata.isNullable()) ? "REQUIRED" : "NULLABLE";
|
||||
com.google.api.services.bigquery.model.TableFieldSchema <%=columnName%>_<%=cid%> = new com.google.api.services.bigquery.model.TableFieldSchema();
|
||||
<%=columnName%>_<%=cid%>.setName(metadata.getName());
|
||||
<%=columnName%>_<%=cid%>.setType(dataType);
|
||||
<%=columnName%>_<%=cid%>.setMode(modeType);
|
||||
fields_<%=cid%>.add(<%=columnName%>_<%=cid%>);
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.debug("<%=cid%> - Field index[" + currIndex_<%=cid%> + "] {\"name\":\"" + metadata.getName() + "\",\"type\":\"" + dataType + "\",\"mode\":\"" + modeType + "\"}");
|
||||
currIndex_<%=cid%>++;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -529,38 +588,117 @@
|
||||
for (int i = 0; i < nbColumns; i++ ) {
|
||||
IMetadataColumn column = columns.get(i);
|
||||
String columnName = column.getLabel();
|
||||
String typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.STRING";
|
||||
if("id_String".equals(column.getTalendType()) || "id_Character".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.STRING";
|
||||
} else if ("id_Float".equals(column.getTalendType()) || "id_Double".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.FLOAT";
|
||||
} else if ("id_Short".equals(column.getTalendType()) || "id_Integer".equals(column.getTalendType()) || "id_Long".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.INTEGER";
|
||||
} else if ("id_BigDecimal".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.NUMERIC";
|
||||
} else if ("id_Boolean".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.BOOLEAN";
|
||||
} else if ("id_Date".equals(column.getTalendType())) {
|
||||
String pattern = column.getPattern();
|
||||
if(pattern.length() == 12 || pattern.isEmpty() || "\"\"".equals(pattern)) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.DATE";
|
||||
}else if(pattern.length() > 12){
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.TIMESTAMP";
|
||||
}else{
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.STRING";
|
||||
}
|
||||
}
|
||||
String modeType = (!column.isNullable()) ? "REQUIRED" : "NULLABLE";
|
||||
%>
|
||||
|
||||
com.google.cloud.bigquery.Field field_<%=i%> = com.google.cloud.bigquery.Field.newBuilder("<%=columnName%>", <%=typeToGenerate%>)
|
||||
.setMode(com.google.cloud.bigquery.Field.Mode.valueOf("<%=modeType%>"))
|
||||
.build();
|
||||
fields_<%=cid%>.add(field_<%=i%>);
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
if(!"id_Dynamic".equals(column.getTalendType())) {
|
||||
String typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.STRING";
|
||||
if("id_String".equals(column.getTalendType()) || "id_Character".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.STRING";
|
||||
} else if ("id_Float".equals(column.getTalendType()) || "id_Double".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.FLOAT";
|
||||
} else if ("id_Short".equals(column.getTalendType()) || "id_Integer".equals(column.getTalendType()) || "id_Long".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.INTEGER";
|
||||
} else if ("id_BigDecimal".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.NUMERIC";
|
||||
} else if ("id_Boolean".equals(column.getTalendType())) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.BOOLEAN";
|
||||
} else if ("id_Date".equals(column.getTalendType())) {
|
||||
String pattern = column.getPattern();
|
||||
if(pattern.length() == 12 || pattern.isEmpty() || "\"\"".equals(pattern)) {
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.DATE";
|
||||
}else if(pattern.length() > 12){
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.TIMESTAMP";
|
||||
}else{
|
||||
typeToGenerate = "com.google.cloud.bigquery.LegacySQLTypeName.STRING";
|
||||
}
|
||||
}
|
||||
String modeType = (!column.isNullable()) ? "REQUIRED" : "NULLABLE";
|
||||
%>
|
||||
log.debug("<%=cid%> - Field index[<%=i%>] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\"}");
|
||||
|
||||
com.google.cloud.bigquery.Field field_<%=i%> = com.google.cloud.bigquery.Field.newBuilder("<%=columnName%>", <%=typeToGenerate%>)
|
||||
.setMode(com.google.cloud.bigquery.Field.Mode.valueOf("<%=modeType%>"))
|
||||
.build();
|
||||
fields_<%=cid%>.add(field_<%=i%>);
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.debug("<%=cid%> - Field index[" + currIndex_<%=cid%> + "] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\"}");
|
||||
currIndex_<%=cid%>++;
|
||||
<%
|
||||
}
|
||||
} else if(incomingConnection != null) {
|
||||
%>
|
||||
routines.system.Dynamic column_<%=cid%> = (routines.system.Dynamic)<%=incomingConnection.getName()%>.<%=column.getLabel()%>;
|
||||
for (int i = 0; i < column_<%=cid%>.getColumnCount(); i++) {
|
||||
com.google.cloud.bigquery.LegacySQLTypeName typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.STRING;
|
||||
routines.system.DynamicMetadata metadata = column_<%=cid%>.getColumnMetadata(i);
|
||||
String dataType = routines.system.MetadataTalendType.getDefaultSelectedDbType("bigquery_id", metadata.getType(), -1, -1);
|
||||
String orignalDBType = metadata.getDbType();
|
||||
java.util.List<String> outputDBTypelist = routines.system.MetadataTalendType.getTalendToDBList("bigquery_id", metadata.getType());
|
||||
if (outputDBTypelist != null && outputDBTypelist.size() > 0) {
|
||||
for (String dbType : outputDBTypelist) {
|
||||
if (orignalDBType.equalsIgnoreCase(dbType)) {
|
||||
dataType = dbType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dataType == null || ("").equals(dataType)) {
|
||||
dataType = orignalDBType;
|
||||
}
|
||||
String modeType = (!metadata.isNullable()) ? "REQUIRED" : "NULLABLE";
|
||||
switch(dataType) {
|
||||
case "BOOL":
|
||||
case "BOOLEAN":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.BOOLEAN;
|
||||
break;
|
||||
case "INT64":
|
||||
case "INTEGER":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.INTEGER;
|
||||
break;
|
||||
case "FLOAT64":
|
||||
case "FLOAT":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.FLOAT;
|
||||
break;
|
||||
case "STRING":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.STRING;
|
||||
break;
|
||||
case "BYTES":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.BYTES;
|
||||
break;
|
||||
case "TIMESTAMP":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.TIMESTAMP;
|
||||
break;
|
||||
case "DATE":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.DATE;
|
||||
break;
|
||||
case "TIME":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.TIME;
|
||||
break;
|
||||
case "DATETIME":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.DATETIME;
|
||||
break;
|
||||
case "NUMERIC":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.NUMERIC;
|
||||
break;
|
||||
case "GEOGRAPHY":
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.valueOf("GEOGRAPHY");
|
||||
break;
|
||||
default:
|
||||
typeToGenerate = com.google.cloud.bigquery.LegacySQLTypeName.STRING;
|
||||
break;
|
||||
}
|
||||
com.google.cloud.bigquery.Field field_<%=i%> = com.google.cloud.bigquery.Field.newBuilder(metadata.getName(), typeToGenerate)
|
||||
.setMode(com.google.cloud.bigquery.Field.Mode.valueOf(modeType))
|
||||
.build();
|
||||
fields_<%=cid%>.add(field_<%=i%>);
|
||||
<%
|
||||
if(isLog4jEnabled){
|
||||
%>
|
||||
log.debug("<%=cid%> - Field index[" + currIndex_<%=cid%> + "] {\"name\":\"" + metadata.getName() + "\",\"type\":\"" + typeToGenerate + "\",\"mode\":\"" + modeType + "\"}");
|
||||
currIndex_<%=cid%>++;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@
|
||||
</ADVANCED_PARAMETERS>
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="google-api-client-1.19.0.jar" MODULE="google-api-client-1.19.0.jar" MVN="mvn:org.talend.libraries/google-api-client-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-client-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-oauth2-v2-rev78-1.19.0.jar" MODULE="google-api-services-oauth2-v2-rev78-1.19.0.jar" MVN="mvn:org.talend.libraries/google-api-services-oauth2-v2-rev78-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-services-oauth2-v2-rev78-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-bigquery-v2-rev391-1.21.0.jar" MODULE="google-api-services-bigquery-v2-rev391-1.21.0.jar" MVN="mvn:org.talend.libraries/google-api-services-bigquery-v2-rev391-1.21.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-services-bigquery-v2-rev391-1.21.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-1.19.0.jar" MODULE="google-http-client-1.19.0.jar" MVN="mvn:org.talend.libraries/google-http-client-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-http-client-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-oauth-client-1.19.0.jar" MODULE="google-oauth-client-1.19.0.jar" MVN="mvn:org.talend.libraries/google-oauth-client-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-oauth-client-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-jackson2-1.19.0.jar" MODULE="google-http-client-jackson2-1.19.0.jar" MVN="mvn:org.talend.libraries/google-http-client-jackson2-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-http-client-jackson2-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-client-1.25.0.jar" MODULE="google-api-client-1.25.0.jar" MVN="mvn:com.google.api-client/google-api-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-oauth2-v2-rev151-1.25.0.jar" MODULE="google-api-services-oauth2-v2-rev151-1.25.0.jar" MVN="mvn:com.google.apis/google-api-services-oauth2/v2-rev151-1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-bigquery-v2-rev454-1.25.0.jar" MODULE="google-api-services-bigquery-v2-rev454-1.25.0.jar" MVN="mvn:com.google.apis/google-api-services-bigquery/v2-rev454-1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-1.25.0.jar" MODULE="google-http-client-1.25.0.jar" MVN="mvn:com.google.http-client/google-http-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-oauth-client-1.25.0.jar" MODULE="google-oauth-client-1.25.0.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-jackson2-1.25.0.jar" MODULE="google-http-client-jackson2-1.25.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson2/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="guava-jdk5-13.0.jar" MODULE="guava-jdk5-13.0.jar" MVN="mvn:org.talend.libraries/guava-jdk5-13.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.guava/lib/guava-jdk5-13.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9" REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1" REQUIRED="true" />
|
||||
<!-- REQUIRED FOR GOOGLE STORAGE -->
|
||||
<IMPORT NAME="jets3t-0.9.1" MODULE="jets3t-0.9.1.jar" MVN="mvn:org.talend.libraries/jets3t-0.9.1/6.0.0" REQUIRED="true" />
|
||||
<IMPORT NAME="commons-logging-1.1.1" 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" />
|
||||
|
||||
@@ -32,12 +32,37 @@
|
||||
String basePackage = "";
|
||||
boolean isCustomTemporaryName = ElementParameterParser.getBooleanValue(node,"__USE_CUSTOM_TEMPORARY_DATASET__");
|
||||
String tempDataset = ElementParameterParser.getValue(node,"__TEMPORARY_DATASET_NAME__");
|
||||
|
||||
String encoding = ElementParameterParser.getValue(node,"__ENCODING__");
|
||||
String advancedSeparatorStr = ElementParameterParser.getValue(node, "__ADVANCED_SEPARATOR__");
|
||||
boolean advancedSeparator = (advancedSeparatorStr!=null&&!("").equals(advancedSeparatorStr))?("true").equals(advancedSeparatorStr):false;
|
||||
String thousandsSeparator = ElementParameterParser.getValueWithJavaType(node, "__THOUSANDS_SEPARATOR__", JavaTypesManager.CHARACTER);
|
||||
String decimalSeparator = ElementParameterParser.getValueWithJavaType(node, "__DECIMAL_SEPARATOR__", JavaTypesManager.CHARACTER);
|
||||
|
||||
query = query.replaceAll("\n"," ");
|
||||
query = query.replaceAll("\r"," ");
|
||||
|
||||
String tokenFile = ElementParameterParser.getValue(node,"__TOKEN_NAME__");
|
||||
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
|
||||
|
||||
//Dynamic start
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
int sizeListColumns = 0;
|
||||
List<IMetadataColumn> columnList = null;
|
||||
boolean isDynamic = false;
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
isDynamic = metadata.isDynamicSchema();
|
||||
if (metadata!=null) {
|
||||
columnList = metadata.getListColumns();
|
||||
sizeListColumns = columnList.size();
|
||||
}
|
||||
}
|
||||
int dynamic_index=-1;
|
||||
|
||||
//Dynamic end
|
||||
|
||||
|
||||
if (authMode.equals("OAUTH")) {
|
||||
%>
|
||||
final String CLIENT_ID_<%=cid %> = <%=clientId %>;
|
||||
@@ -214,6 +239,43 @@
|
||||
}
|
||||
%>
|
||||
String pageToken_<%=cid%> = null;
|
||||
//Dynamic start
|
||||
|
||||
<%
|
||||
|
||||
if(isDynamic){
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/Input/BigQuery/BigQueryHelper_Oauth.javajet"%>
|
||||
BigQueryHelper_<%=cid%> helper_<%=cid%> = new BigQueryHelper_<%=cid%>();
|
||||
com.google.api.services.bigquery.model.TableSchema schema_<%=cid%> = bigqueryclient_<%=cid%>
|
||||
.jobs().getQueryResults(PROJECT_ID_<%=cid%>, insert_<%=cid%>.getJobReference().getJobId()).execute().getSchema();
|
||||
routines.system.Dynamic dcg_<%=cid%> = new routines.system.Dynamic();
|
||||
|
||||
<%
|
||||
|
||||
for(int i=0; i< columnList.size(); i++) {
|
||||
if(columnList.get(i).getTalendType().equals("id_Dynamic")){
|
||||
dynamic_index = i+1;
|
||||
}
|
||||
}
|
||||
%>
|
||||
//
|
||||
int colsLen_<%=cid %> = schema_<%=cid%>.getFields().size();
|
||||
for (int i = <%=dynamic_index-1%>; i < colsLen_<%=cid %>-<%=columnList.size()-dynamic_index%>; i++) {
|
||||
routines.system.DynamicMetadata dynamicMetadata_<%=cid%> = new routines.system.DynamicMetadata();
|
||||
dynamicMetadata_<%=cid%>.setName(schema_<%=cid%>.getFields().get(i).getName());
|
||||
dynamicMetadata_<%=cid%>.setDbName(dynamicMetadata_<%=cid%>.getName());
|
||||
dynamicMetadata_<%=cid%>.setType(routines.system.Dynamic.getTalendTypeFromDBType("bigquery_id", schema_<%=cid%>.getFields().get(i).getType(), 0, 0));
|
||||
dynamicMetadata_<%=cid%>.setDbType(schema_<%=cid%>.getFields().get(i).getType());
|
||||
dynamicMetadata_<%=cid%>.setNullable("NULLABLE".equals(schema_<%=cid%>.getFields().get(i).getMode()));
|
||||
dynamicMetadata_<%=cid%>.setColumnPosition(i);
|
||||
dcg_<%=cid%>.metadatas.add(dynamicMetadata_<%=cid%>);
|
||||
}
|
||||
<%
|
||||
|
||||
}
|
||||
%>
|
||||
//Dynamic end
|
||||
<%
|
||||
} else if (authMode.equals("SERVICEACCOUNT")) {
|
||||
%>
|
||||
@@ -310,6 +372,44 @@
|
||||
log.info("<%=cid%> - Job " + jobId_<%=cid%> + " finished successfully.");
|
||||
<% } %>
|
||||
com.google.cloud.bigquery.TableResult result_<%=cid%> = job_<%=cid%>.getQueryResults();
|
||||
//Dynamic start
|
||||
|
||||
<%
|
||||
|
||||
if(isDynamic){
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/Input/BigQuery/BigQueryHelper_ServiceAccount.javajet"%>
|
||||
BigQueryHelper_<%=cid%> helper_<%=cid%> = new BigQueryHelper_<%=cid%>();
|
||||
com.google.cloud.bigquery.Schema schema_<%=cid%> = result_<%=cid%>.getSchema();
|
||||
routines.system.Dynamic dcg_<%=cid%> = new routines.system.Dynamic();
|
||||
|
||||
<%
|
||||
|
||||
for(int i=0; i< columnList.size(); i++) {
|
||||
if(columnList.get(i).getTalendType().equals("id_Dynamic")){
|
||||
dynamic_index = i+1;
|
||||
}
|
||||
}
|
||||
%>
|
||||
//
|
||||
int colsLen_<%=cid %> = schema_<%=cid%>.getFields().size();
|
||||
for (int i = <%=dynamic_index-1%>; i < colsLen_<%=cid %>-<%=columnList.size()-dynamic_index%>; i++) {
|
||||
routines.system.DynamicMetadata dynamicMetadata_<%=cid%> = new routines.system.DynamicMetadata();
|
||||
dynamicMetadata_<%=cid%>.setName(schema_<%=cid%>.getFields().get(i).getName());
|
||||
dynamicMetadata_<%=cid%>.setDbName(dynamicMetadata_<%=cid%>.getName());
|
||||
com.google.cloud.bigquery.StandardSQLTypeName typeName_<%=cid%> = schema_<%=cid%>.getFields().get(i).getType().getStandardType();
|
||||
String typeNameString_<%=cid%> = (typeName_<%=cid%> != null) ? typeName_<%=cid%>.name() : schema_<%=cid%>.getFields().get(i).getType().name();
|
||||
dynamicMetadata_<%=cid%>.setType(routines.system.Dynamic.getTalendTypeFromDBType("bigquery_id", typeNameString_<%=cid%>, 0, 0));
|
||||
dynamicMetadata_<%=cid%>.setDbType(typeNameString_<%=cid%>);
|
||||
dynamicMetadata_<%=cid%>.setNullable(schema_<%=cid%>.getFields().get(i).getMode() == com.google.cloud.bigquery.Field.Mode.NULLABLE);
|
||||
dynamicMetadata_<%=cid%>.setColumnPosition(i);
|
||||
dcg_<%=cid%>.metadatas.add(dynamicMetadata_<%=cid%>);
|
||||
}
|
||||
<%
|
||||
|
||||
}
|
||||
%>
|
||||
//Dynamic end
|
||||
long nb_line_<%=cid%> = 0;
|
||||
<%
|
||||
} else {
|
||||
@@ -349,21 +449,23 @@
|
||||
} else {
|
||||
throw new IllegalArgumentException("authentication mode should be either \"SERVICEACCOUNT\" or \"OAUTH\", but it is " + authMode);
|
||||
}
|
||||
%>
|
||||
int fieldsCount_<%=cid %> = field_<%=cid %>.size();
|
||||
int column_index_<%=cid%> =0;
|
||||
<%if(isDynamic){%>
|
||||
int fixedColumnCount_<%=cid%> = <%=dynamic_index-1%>;
|
||||
<%}
|
||||
List< ? extends IConnection> conns = node.getOutgoingSortedConnections();
|
||||
if (conns != null){
|
||||
if (conns.size()>0){
|
||||
IConnection conn =conns.get(0);
|
||||
String connName = conn.getName();
|
||||
if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
|
||||
|
||||
if ((metadatas!=null) && (metadatas.size() > 0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata != null) {
|
||||
String encoding = ElementParameterParser.getValue(node,"__ENCODING__");
|
||||
String advancedSeparatorStr = ElementParameterParser.getValue(node, "__ADVANCED_SEPARATOR__");
|
||||
boolean advancedSeparator = (advancedSeparatorStr!=null&&!("").equals(advancedSeparatorStr))?("true").equals(advancedSeparatorStr):false;
|
||||
String thousandsSeparator = ElementParameterParser.getValueWithJavaType(node, "__THOUSANDS_SEPARATOR__", JavaTypesManager.CHARACTER);
|
||||
String decimalSeparator = ElementParameterParser.getValueWithJavaType(node, "__DECIMAL_SEPARATOR__", JavaTypesManager.CHARACTER);
|
||||
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int nbColumns = columns.size();
|
||||
@@ -373,14 +475,33 @@
|
||||
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable());
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
|
||||
String defVal = JavaTypesManager.getDefaultValueFromJavaType(typeToGenerate);
|
||||
if(isDynamic && !("Dynamic").equals(typeToGenerate) && dynamic_index - 1 < i) {
|
||||
%>
|
||||
column_index_<%=cid%> = <%=i-1%> + dcg_<%=cid%>.getColumnCount();
|
||||
<%}else{%>
|
||||
column_index_<%=cid%> = <%=i%>;
|
||||
<%
|
||||
}
|
||||
String patternValue = column.getPattern() == null || column.getPattern().trim().length() == 0 ? null : column.getPattern();
|
||||
if(("Dynamic").equals(typeToGenerate)) {
|
||||
%>
|
||||
<%=connName%>.<%=columnName%> = dcg_<%=cid%>;
|
||||
helper_<%=cid%>.readColumnsFromBigQuery(<%=connName%>.<%=columnName%>, field_<%=cid %>, fixedColumnCount_<%=cid%>, true);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
if(fieldsCount_<%=cid %> <= column_index_<%=cid%>) {
|
||||
<%=connName%>.<%=column.getLabel()%> = <%=defVal%>;
|
||||
} else {
|
||||
<%
|
||||
if (authMode.equals("OAUTH")) {
|
||||
%>
|
||||
value_<%=cid%> = field_<%=cid %>.get(<%=i%>).getV();
|
||||
value_<%=cid%> = field_<%=cid %>.get(column_index_<%=cid%>).getV();
|
||||
<%
|
||||
} else if (authMode.equals("SERVICEACCOUNT")) {
|
||||
%>
|
||||
value_<%=cid%> = field_<%=cid %>.get(<%=i%>).getValue();
|
||||
value_<%=cid%> = field_<%=cid %>.get(column_index_<%=cid%>).getValue();
|
||||
<%
|
||||
} else {
|
||||
throw new IllegalArgumentException("authentication mode should be either \"SERVICEACCOUNT\" or \"OAUTH\", but it is " + authMode);
|
||||
@@ -426,7 +547,9 @@
|
||||
}else{
|
||||
<%=connName%>.<%=columnName%> = <%=JavaTypesManager.getDefaultValueFromJavaType(typeToGenerate, column.getDefault())%>;
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
log4jFileUtil.debugRetriveData(node);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,14 @@
|
||||
<CONNECTOR CTYPE="RUN_IF"/>
|
||||
</CONNECTORS>
|
||||
<PARAMETERS>
|
||||
<PARAMETER
|
||||
NAME="MAPPING"
|
||||
FIELD="MAPPING_TYPE"
|
||||
NUM_ROW="120"
|
||||
SHOW="false"
|
||||
>
|
||||
<DEFAULT>bigquery_id</DEFAULT>
|
||||
</PARAMETER>
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
@@ -171,14 +179,14 @@
|
||||
</ADVANCED_PARAMETERS>
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="google-api-client-1.19.0.jar" MODULE="google-api-client-1.19.0.jar" MVN="mvn:org.talend.libraries/google-api-client-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-client-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-oauth2-v2-rev78-1.19.0.jar" MODULE="google-api-services-oauth2-v2-rev78-1.19.0.jar" MVN="mvn:org.talend.libraries/google-api-services-oauth2-v2-rev78-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-services-oauth2-v2-rev78-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-bigquery-v2-rev391-1.21.0.jar" MODULE="google-api-services-bigquery-v2-rev391-1.21.0.jar" MVN="mvn:org.talend.libraries/google-api-services-bigquery-v2-rev391-1.21.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-services-bigquery-v2-rev391-1.21.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-1.19.0.jar" MODULE="google-http-client-1.19.0.jar" MVN="mvn:org.talend.libraries/google-http-client-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-http-client-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-oauth-client-1.19.0.jar" MODULE="google-oauth-client-1.19.0.jar" MVN="mvn:org.talend.libraries/google-oauth-client-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-oauth-client-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-jackson2-1.19.0.jar" MODULE="google-http-client-jackson2-1.19.0.jar" MVN="mvn:org.talend.libraries/google-http-client-jackson2-1.19.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-http-client-jackson2-1.19.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-client-1.25.0.jar" MODULE="google-api-client-1.25.0.jar" MVN="mvn:com.google.api-client/google-api-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-oauth2-v2-rev151-1.25.0.jar" MODULE="google-api-services-oauth2-v2-rev151-1.25.0.jar" MVN="mvn:com.google.apis/google-api-services-oauth2/v2-rev151-1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-bigquery-v2-rev454-1.25.0.jar" MODULE="google-api-services-bigquery-v2-rev454-1.25.0.jar" MVN="mvn:com.google.apis/google-api-services-bigquery/v2-rev454-1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-1.25.0.jar" MODULE="google-http-client-1.25.0.jar" MVN="mvn:com.google.http-client/google-http-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-oauth-client-1.25.0.jar" MODULE="google-oauth-client-1.25.0.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-jackson2-1.25.0.jar" MODULE="google-http-client-jackson2-1.25.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson2/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="guava-jdk5-13.0.jar" MODULE="guava-jdk5-13.0.jar" MVN="mvn:org.talend.libraries/guava-jdk5-13.0/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.guava/lib/guava-jdk5-13.0.jar" REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9" REQUIRED="true" />
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1" REQUIRED="true" />
|
||||
<IMPORT NAME="google-cloud-bigquery-1.32.0.jar" MODULE="google-cloud-bigquery-1.32.0.jar" MVN="mvn:com.google.cloud/google-cloud-bigquery/1.32.0" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
|
||||
<IMPORT NAME="google-http-client-jackson-1.23.0.jar" MODULE="google-http-client-jackson-1.23.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson/1.23.0" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
|
||||
<IMPORT NAME="threetenbp-1.3.3.jar" MODULE="threetenbp-1.3.3.jar" MVN="mvn:org.threeten/threetenbp/1.3.3" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
</CONNECTORS>
|
||||
|
||||
<PARAMETERS>
|
||||
<PARAMETER
|
||||
NAME="MAPPING"
|
||||
FIELD="MAPPING_TYPE"
|
||||
NUM_ROW="120"
|
||||
SHOW="false"
|
||||
>
|
||||
<DEFAULT>bigquery_id</DEFAULT>
|
||||
</PARAMETER>
|
||||
<PARAMETER NAME="PROPERTY" FIELD="PROPERTY_TYPE" SHOW="true" NUM_ROW="10" REPOSITORY_VALUE="DELIMITED" />
|
||||
|
||||
<PARAMETER NAME="FILENAME" FIELD="FILE" NUM_ROW="11" REQUIRED="true" REPOSITORY_VALUE="FILE_PATH">
|
||||
|
||||
@@ -16,6 +16,63 @@ imports="
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata!=null) {
|
||||
|
||||
String encoding = ElementParameterParser.getValue(node,"__ENCODING__");
|
||||
|
||||
if(metadata.isDynamicSchema()) {
|
||||
%>
|
||||
class BigQueryOutputHelper_<%=cid%> {
|
||||
public void writeData(routines.system.Dynamic column, String[] row, int offset) {
|
||||
for (int i = 0; i < column.getColumnCount(); i++) {
|
||||
if (column.getColumnValue(i) != null) {
|
||||
routines.system.DynamicMetadata metadata = column.getColumnMetadata(i);
|
||||
String dataType = routines.system.MetadataTalendType.getDefaultSelectedDbType("bigquery_id", metadata.getType(), -1, -1);
|
||||
String orignalDBType = metadata.getDbType();
|
||||
java.util.List<String> outputDBTypelist = routines.system.MetadataTalendType.getTalendToDBList("bigquery_id", metadata.getType());
|
||||
if (outputDBTypelist != null && outputDBTypelist.size() > 0) {
|
||||
for (String dbType : outputDBTypelist) {
|
||||
if (orignalDBType.equalsIgnoreCase(dbType)) {
|
||||
dataType = dbType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dataType == null || ("").equals(dataType)) {
|
||||
dataType = orignalDBType;
|
||||
}
|
||||
if ("id_Date".equals(metadata.getType())) {
|
||||
String pattern = getPattern(dataType);
|
||||
row[offset + i] = routines.system.DynamicUtils.formatDate(column.getColumnValue(i), pattern);
|
||||
} else if ("id_byte[]".equals(metadata.getType())) {
|
||||
row[offset + i] = java.nio.charset.Charset.forName(<%=encoding %>).decode(java.nio.ByteBuffer.wrap((byte[])column.getColumnValue(i))).toString();
|
||||
} else {
|
||||
row[offset + i] = String.valueOf(column.getColumnValue(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getPattern(String typeName) {
|
||||
if(typeName == null) {
|
||||
return "yyyy-MM-dd hh:mm:ss.SSS";
|
||||
}
|
||||
switch(typeName.toUpperCase()) {
|
||||
case "TIMESTAMP":
|
||||
return "yyyy-MM-dd hh:mm:ss.SSSXXX";
|
||||
case "DATE":
|
||||
return "yyyy-MM-dd";
|
||||
case "TIME":
|
||||
return "hh:mm:ss.SSS";
|
||||
case "DATETIME":
|
||||
return "yyyy-MM-dd hh:mm:ss.SSS";
|
||||
default:
|
||||
return "yyyy-MM-dd hh:mm:ss.SSS";
|
||||
}
|
||||
}
|
||||
}
|
||||
BigQueryOutputHelper_<%=cid%> bigQueryHelper_<%=cid%> = new BigQueryOutputHelper_<%=cid%>();
|
||||
<%
|
||||
}
|
||||
|
||||
String filename = ElementParameterParser.getValue(node,"__FILENAME__");
|
||||
|
||||
String rowSeparator = ElementParameterParser.getValue(node,"__ROWSEPARATOR__");
|
||||
@@ -26,8 +83,6 @@ imports="
|
||||
|
||||
String textEnclosure = ElementParameterParser.getValue(node, "__TEXT_ENCLOSURE__");
|
||||
|
||||
String encoding = ElementParameterParser.getValue(node,"__ENCODING__");
|
||||
|
||||
boolean checkDiskSpace = ("true").equals(ElementParameterParser.getValue(node,"__CHECK_DISK_SPACE__"));
|
||||
|
||||
boolean isAppend = ("true").equals(ElementParameterParser.getValue(node,"__APPEND__"));
|
||||
|
||||
@@ -21,7 +21,12 @@
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata!=null) {
|
||||
|
||||
boolean hasDynamic = metadata.isDynamicSchema();
|
||||
if(hasDynamic) {
|
||||
%>
|
||||
int dynamic_column_count_<%=cid%> = 1;
|
||||
<%
|
||||
}
|
||||
boolean checkDiskSpace = ("true").equals(ElementParameterParser.getValue(node,"__CHECK_DISK_SPACE__"));
|
||||
boolean flushOnRow = ("true").equals(ElementParameterParser.getValue(node, "__FLUSHONROW__"));
|
||||
String flushMod = ElementParameterParser.getValue(node, "__FLUSHONROW_NUM__");
|
||||
@@ -35,72 +40,81 @@
|
||||
if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int sizeColumns = columns.size();
|
||||
%>
|
||||
String[] row_<%=cid%>=new String[]{<%for(int j=0;j<sizeColumns;j++){%>"\\N",<%}%>}; //empty value must be NULL('\N' in bulk file)
|
||||
IMetadataColumn dynamicCol = metadata.getDynamicColumn();
|
||||
%>
|
||||
String[] row_<%=cid%>=new String[<%=sizeColumns%><%=hasDynamic?"+"+conn.getName()+".":"" %><%=dynamicCol==null?"":dynamicCol.getLabel()+".getColumnCount()-1" %>];
|
||||
java.util.Arrays.fill(row_<%=cid%>, "\\N");
|
||||
<%
|
||||
int dynamicColIndex = -1;
|
||||
%>
|
||||
int curColumnIndex_<%=cid%> = 0;
|
||||
<%
|
||||
for (int i = 0; i < sizeColumns; i++) {
|
||||
IMetadataColumn column = columns.get(i);
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
|
||||
String pattern = column.getPattern() == null || column.getPattern().trim().length() == 0 ? null : column.getPattern();
|
||||
if(JavaTypesManager.isJavaPrimitiveType( column.getTalendType(), column.isNullable())){
|
||||
if(dynamicColIndex != -1 && i > dynamicColIndex) {
|
||||
%>
|
||||
curColumnIndex_<%=cid%> = <%=i-1%> + dynamic_column_count_<%=cid%>;
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
curColumnIndex_<%=cid%> = <%=i%>;
|
||||
<%
|
||||
}
|
||||
if(("id_Dynamic").equals(column.getTalendType())) {
|
||||
dynamicColIndex = i;
|
||||
%>
|
||||
dynamic_column_count_<%=cid%> = <%=conn.getName()%>.<%=column.getLabel()%>.getColumnCount();
|
||||
if (<%=conn.getName()%>.<%=column.getLabel()%> != null) {
|
||||
bigQueryHelper_<%=cid%>.writeData(<%=conn.getName()%>.<%=column.getLabel()%>, row_<%=cid%>, <%=dynamicColIndex%>);
|
||||
}
|
||||
<%
|
||||
} else if(JavaTypesManager.isJavaPrimitiveType( column.getTalendType(), column.isNullable())){
|
||||
|
||||
if(javaType == JavaTypesManager.BOOLEAN ){
|
||||
if(javaType == JavaTypesManager.BOOLEAN ){
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = String.valueOf(
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = String.valueOf(
|
||||
true == <%=conn.getName() %>.<%=column.getLabel() %> ?"1":"0"
|
||||
);
|
||||
<%
|
||||
} else {
|
||||
} else {
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = String.valueOf(<%=conn.getName() %>.<%=column.getLabel() %>);
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = String.valueOf(<%=conn.getName() %>.<%=column.getLabel() %>);
|
||||
<%
|
||||
}
|
||||
|
||||
}else {
|
||||
} else {
|
||||
%>
|
||||
if(<%=conn.getName() %>.<%=column.getLabel() %> != null){
|
||||
<%
|
||||
if(javaType == JavaTypesManager.STRING ){
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = <%=conn.getName() %>.<%=column.getLabel() %>;
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = <%=conn.getName() %>.<%=column.getLabel() %>;
|
||||
<%
|
||||
}else if(javaType == JavaTypesManager.DATE && pattern == null){
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = FormatterUtils.format_Date(<%=conn.getName() %>.<%=column.getLabel() %>, "yyyy-MM-dd");
|
||||
<%
|
||||
}else if(javaType == JavaTypesManager.DATE && pattern != null){
|
||||
if(pattern.length() > 12){
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = FormatterUtils.format_Date(<%=conn.getName() %>.<%=column.getLabel() %>, "yyyy-MM-dd HH:mm:ss");
|
||||
<%
|
||||
}else if(pattern.length() == 12 || "\"\"".equals(pattern)) {
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = FormatterUtils.format_Date(<%=conn.getName() %>.<%=column.getLabel() %>, "yyyy-MM-dd");
|
||||
<%
|
||||
}else {
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = FormatterUtils.format_Date(<%=conn.getName() %>.<%=column.getLabel() %>, <%=pattern%>);
|
||||
<%
|
||||
}
|
||||
}else if(javaType == JavaTypesManager.DATE){
|
||||
%>
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = FormatterUtils.format_Date(<%=conn.getName() %>.<%=column.getLabel() %>, <%=(pattern != null && !("\"\"").equals(pattern)) ? pattern : "\"yyyy-MM-dd\""%>);
|
||||
<%
|
||||
}else if(javaType == JavaTypesManager.BYTE_ARRAY){
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = java.nio.charset.Charset.forName(<%=encoding %>).decode(java.nio.ByteBuffer.wrap(<%=conn.getName() %>.<%=column.getLabel() %>)).toString();
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = java.nio.charset.Charset.forName(<%=encoding %>).decode(java.nio.ByteBuffer.wrap(<%=conn.getName() %>.<%=column.getLabel() %>)).toString();
|
||||
<%
|
||||
}else if(javaType == JavaTypesManager.BOOLEAN ){
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = String.valueOf(
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = String.valueOf(
|
||||
true == <%=conn.getName() %>.<%=column.getLabel() %> ?"1":"0"
|
||||
);
|
||||
<%
|
||||
}
|
||||
else{
|
||||
%>
|
||||
row_<%=cid%>[<%=i%>] = String.valueOf(<%=conn.getName() %>.<%=column.getLabel() %>);
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = String.valueOf(<%=conn.getName() %>.<%=column.getLabel() %>);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
} else {
|
||||
row_<%=cid%>[<%=i%>] = "\\N";
|
||||
row_<%=cid%>[curColumnIndex_<%=cid%>] = "\\N";
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -166,37 +166,17 @@
|
||||
</ADVANCED_PARAMETERS>
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="google-api-client-1.19.0.jar" MODULE="google-api-client-1.19.0.jar"
|
||||
MVN="mvn:org.talend.libraries/google-api-client-1.19.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-client-1.19.0.jar"
|
||||
REQUIRED="true"/>
|
||||
<IMPORT NAME="google-api-services-oauth2-v2-rev78-1.19.0.jar"
|
||||
MODULE="google-api-services-oauth2-v2-rev78-1.19.0.jar"
|
||||
MVN="mvn:org.talend.libraries/google-api-services-oauth2-v2-rev78-1.19.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-services-oauth2-v2-rev78-1.19.0.jar"
|
||||
REQUIRED="true"/>
|
||||
<IMPORT NAME="google-api-services-bigquery-v2-rev391-1.21.0.jar"
|
||||
MODULE="google-api-services-bigquery-v2-rev391-1.21.0.jar"
|
||||
MVN="mvn:org.talend.libraries/google-api-services-bigquery-v2-rev391-1.21.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-api-services-bigquery-v2-rev391-1.21.0.jar"
|
||||
REQUIRED="true"/>
|
||||
<IMPORT NAME="google-http-client-1.19.0.jar" MODULE="google-http-client-1.19.0.jar"
|
||||
MVN="mvn:org.talend.libraries/google-http-client-1.19.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-http-client-1.19.0.jar"
|
||||
REQUIRED="true"/>
|
||||
<IMPORT NAME="google-oauth-client-1.19.0.jar" MODULE="google-oauth-client-1.19.0.jar"
|
||||
MVN="mvn:org.talend.libraries/google-oauth-client-1.19.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-oauth-client-1.19.0.jar"
|
||||
REQUIRED="true"/>
|
||||
<IMPORT NAME="google-http-client-jackson2-1.19.0.jar" MODULE="google-http-client-jackson2-1.19.0.jar"
|
||||
MVN="mvn:org.talend.libraries/google-http-client-jackson2-1.19.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.google/lib/google-http-client-jackson2-1.19.0.jar"
|
||||
REQUIRED="true"/>
|
||||
<IMPORT NAME="google-api-client-1.25.0.jar" MODULE="google-api-client-1.25.0.jar" MVN="mvn:com.google.api-client/google-api-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-oauth2-v2-rev151-1.25.0.jar" MODULE="google-api-services-oauth2-v2-rev151-1.25.0.jar" MVN="mvn:com.google.apis/google-api-services-oauth2/v2-rev151-1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-api-services-bigquery-v2-rev454-1.25.0.jar" MODULE="google-api-services-bigquery-v2-rev454-1.25.0.jar" MVN="mvn:com.google.apis/google-api-services-bigquery/v2-rev454-1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-1.25.0.jar" MODULE="google-http-client-1.25.0.jar" MVN="mvn:com.google.http-client/google-http-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-oauth-client-1.25.0.jar" MODULE="google-oauth-client-1.25.0.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="google-http-client-jackson2-1.25.0.jar" MODULE="google-http-client-jackson2-1.25.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson2/1.25.0" REQUIRED="true" />
|
||||
<IMPORT NAME="guava-jdk5-13.0.jar" MODULE="guava-jdk5-13.0.jar"
|
||||
MVN="mvn:org.talend.libraries/guava-jdk5-13.0/6.0.0"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.guava/lib/guava-jdk5-13.0.jar" REQUIRED="true"/>
|
||||
<IMPORT NAME="jackson-core-2.9.9.jar" MODULE="jackson-core-2.9.9.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.9.9" REQUIRED="true"/>
|
||||
<IMPORT NAME="jackson-core-2.10.1.jar" MODULE="jackson-core-2.10.1.jar"
|
||||
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.10.1" REQUIRED="true"/>
|
||||
<IMPORT NAME="google-cloud-bigquery-1.32.0.jar" MODULE="google-cloud-bigquery-1.32.0.jar"
|
||||
MVN="mvn:com.google.cloud/google-cloud-bigquery/1.32.0"
|
||||
REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user