Compare commits

...

130 Commits

Author SHA1 Message Date
Jenkins Continuous Build server
06a690bbe6 Set version to 7.3.1 M2 2019-09-24 14:08:02 +02:00
hcyi
8dd9933294 fix(TUP-23558):TaCoKit not delete child datasets if delete datastore. (#3805)
* fix(TUP-23558):TaCoKit not delete child datasets if delete datastore.

* fix(TUP-23558):improve for TaCoKit not delete child datasets if delete
datastore.

* fix(TUP-23558):improve for TaCoKit not delete child datasets if delete
datastore.

* fix(TUP-23558):TaCoKit not delete child datasets if delete datastore.

* fix(TUP-23558):TaCoKit not delete child datasets if delete datastore.

* fix(TUP-23558):improve taCoKit not delete child datasets if delete
datastore.

* fix(TUP-23558):improve for TaCoKit not delete child datasets if delete
2019-09-24 09:52:12 +08:00
jiezhang-tlnd
09fd6c52ff Jzhang/feat/tup 24444 add choice between log4j and log4j2 in project settings (#3925)
* feat(TUP-24444)Add choice between log4j and log4j2 in project settings
https://jira.talendforge.org/browse/TUP-24444

* feat(TUP-24444)Add choice between log4j and log4j2 in project settings
https://jira.talendforge.org/browse/TUP-24444

* feat(TUP-24444)Add choice between log4j and log4j2 in project settings
https://jira.talendforge.org/browse/TUP-24444

* feat(TUP-24444)format code and delete log4j.xml

* feat(TUP-24444)add junits
https://jira.talendforge.org/browse/TUP-24444

* feat(TUP-24444)Add choice between log4j and log4j2 in project settings

* feat(TUP-24444)after run job then change logj4, the pom file isn't
update.
2019-09-23 18:38:08 +08:00
wang wei
0399e751f5 fix(TDI-42187): Fix Double Checked Locking in GlobalResource (#3917)
* fix(TDI-42187): Fix Double Checked Locking in GlobalResource

* fix(TDI-42187): use more readable method

* fix(TDI-42187): use more readable method

* fix(TDI-42187): adjust the java compiler level in pom file to make the
java 8 style code works and now master use java 8, not promise java 7,
so it is ok
2019-09-23 17:42:37 +08:00
jiezhang-tlnd
9ca8fa0663 fix(TUP-22677)import a existing project from Login dialog, the temp folder is not deleted (#3895)
* fix(TUP-22677)import a existing project from Login dialog, the temp
folder is not deleted
https://jira.talendforge.org/browse/TUP-22677

* fix(TUP-22677)Close zip file.
https://jira.talendforge.org/browse/TUP-22677

* fix(TUP-22677)Close zip file
https://jira.talendforge.org/browse/TUP-22677

* fix(TUP-22677)import a existing project from Login dialog, the temp
folder is not deleted
https://jira.talendforge.org/browse/TUP-22677

* fix(TUP-22677)import a existing project from Login dialog, the temp
folder is not deleted
https://jira.talendforge.org/browse/TUP-22677
2019-09-23 15:50:13 +08:00
hwang-talend
43cb82c389 Revert "bugfix(TUP-24029):[FTP] Connection wizard add timeout property (#3864)" (#3959)
Revert "bugfix(TUP-24029):[FTP] Connection wizard add timeout property (#3864)" 
This reverts commit c4c49001a2.
2019-09-23 14:46:25 +08:00
yyin-talend
f3bfc9ca6b Feat TDQ-17348 Retrieve records "rejected" by the tDataUnmasking (#3942)
* Feat     TDQ-17348 Retrieve records "rejected" by the tDataUnmasking
component DI

-change the migration task

* TDQ-17348 change name
2019-09-23 14:38:01 +08:00
Mike Yan
8a3ef23853 fix(TESB-27030): Avoid to add activemq-all lib in OSGi bundle (#3955) 2019-09-23 12:45:45 +08:00
hcyi
d2e9b874c1 fix(TUP-24084):Change the display of the new Couchbase component names. (#3934) 2019-09-23 12:35:48 +08:00
hwang-talend
e7e9908678 bugfix(TUP-24631):There is error when open job with tRunJob in TOS (#3954)
bugfix(TUP-24631):There is error when open job with tRunJob in TOS
2019-09-23 10:54:04 +08:00
Redwene
da0a057872 Redwene/tbd 9137 (#3951)
fix(TBD-9137) : Handle location for temp dataset with large Big Query results
2019-09-20 11:49:27 +02:00
hwang-talend
9052eb3e99 Hwang/tup 24326 patch (#3939)
* bugfix(TUP-24326):keyword "__TABLE__" not working for tJDBCxxxx
components
2019-09-19 15:12:07 +08:00
chmyga
b88c6e3fbc fix(TDI-42549): tFileInputMail multipart body (#3919)
* Fix multivalue body mail part processing
2019-09-18 13:42:11 +03:00
chmyga
457bd0fc40 fix(TDI-42061): fix zip-slip attacks vulnerability (#3845)
* fix(TDI-42061): fix zip-slip attacks vulnerability

* Update libraries versions

* Add code to fix zip-slip for commons-compress

* fix(TDI-42061): fix zip-slip attacks vulnerability

* update commons-compress version
2019-09-18 13:15:13 +03:00
hwang-talend
c4c49001a2 bugfix(TUP-24029):[FTP] Connection wizard add timeout property (#3864)
bugfix(TUP-24029):[FTP] Connection wizard add timeout property
2019-09-18 17:00:03 +08:00
jiezhang-tlnd
c21f8e7551 fix(TUP-22646)Path in Textbox of "To archive file" is incomplete when building job (#3931)
* fix(TUP-22646)Path in Textbox of "To archive file" is incomplete when
building job
https://jira.talendforge.org/browse/TUP-22646

* fix(TUP-22646)Path in Textbox of "To archive file" is incomplete when
building job
https://jira.talendforge.org/browse/TUP-22646
2019-09-17 17:26:19 +08:00
hcyi
cda47b2324 fix(TUP-23217):Install a wrong car will make all the car file installed (#3928)
can not work.
2019-09-17 10:51:54 +08:00
hwang-talend
cab755152c bugfix(TUP-24355):Default Context environment appended after migrating (#3926)
* bugfix(TUP-24355):Default Context environment appended after migrating
to 7.2.1
2019-09-17 10:24:55 +08:00
hwang-talend
14ed765ab8 bugfix(TUP-24311):jvm arguments not reflected on build job (#3872)
bugfix(TUP-24311):jvm arguments not reflected on build job
2019-09-17 10:12:59 +08:00
hwang-talend
1844d76b67 bugfix(TUP-24495):columns' order is incorrect if I use 'Used Column' (#3913)
bugfix(TUP-24495):columns' order is incorrect if I use 'Used Column'
2019-09-16 10:36:06 +08:00
hzhao-talendbj
b3f4d37498 feat(TUP-24028)Add Azure datacenter part of the studio connection (#3923) 2019-09-12 14:41:37 +08:00
Zhiwei Xue
1c786fb4f2 fix(TUP-24310):routines is duplicated in the reactor (#3909) 2019-09-12 10:33:51 +08:00
hcyi
d54077e7dc fix(TUP-23158):Some layouts for Tacokit component isn't correct. (#3918) 2019-09-11 17:25:28 +08:00
hzhao-talendbj
9d8ffa6d37 feat(TUP-24028)Add Azure datacenter part of the studio connection (#3868)
* feat(TUP-24028)Add Azure datacenter part of the studio connection

* feat(TUP-24028)Add Azure datacenter part of the studio connection

* feat(TUP-24028)Add Azure datacenter part of the studio connection
2019-09-11 17:13:02 +08:00
yyin-talend
e5b9def018 Feat TDQ-17176 Retrieve records "rejected" by the tDataMasking DI (#3892)
* Feat     TDQ-17176 Retrieve records "rejected" by the tDataMasking DI
component

* TDQ-17176 add Copyright
2019-09-11 14:59:39 +08:00
wang wei
08fb15d12b fix(TDI-34818): tEXAOutput doesn't work when use a shared DB connection (#3897) 2019-09-11 14:58:27 +08:00
hwang-talend
83d684ce0c bugfix(TUP-24326):keyword "__TABLE__" not working for tJDBCxxxx (#3903)
bugfix(TUP-24326):keyword "__TABLE__" not working for tJDBCxxxx components
2019-09-11 10:08:07 +08:00
Redwene
2aa3688f12 fix(TBD-9137) : tBigQueryInput does not support backtick in query in (#3866) 2019-09-10 13:30:28 +02:00
Liu Xinquan
229c1f8d95 feat(TDQ-17246) update the migration to update spark job (#3889) 2019-09-10 13:35:43 +08:00
hwang-talend
c8325d6799 bugfix(TUP-23100):Add warning in the tRunjob for recursive jobs (#3916)
bugfix(TUP-23100):Add warning in the tRunjob for recursive jobs
2019-09-10 10:59:21 +08:00
vyu-talend
7139c9bb7f Fix(TDI-42855):Support IAM roles in tRedshiftBulkExec. (#3894)
* Fix(TDI-42855):Support IAM roles in tRedshiftBulkExec.

* Fix(TDI-42855)

* Fix(TDI-42855)
2019-09-10 10:15:38 +08:00
Denis Sergent
e73b0715dc TESB-26772 Adds a way to externalise osgi-exclude.properties file (#3860)
This dev adds the opportunity to externalise osgi-exclude.properties
resource file from org.talend.repository bundle better than using the
one included in org.talend.repository budle jar file.
2019-09-09 18:22:47 +02:00
mbasiuk-talend
ad56747c35 feat(TDI-40462): tJDBCSCDELT add custom end date value (#3821)
* feat(TDI-40462): add common changes

* feat(TDI-40462): update db2 template with custom end date

* feat(TDI-40462): update mysql template with custom end date

* feat(TDI-40462): update postgres template with custom end date

* feat(TDI-40462): update sap hana template with custom end date

* feat(TDI-40462): update sybase template with custom end date

* feat(TDI-40462): update teradata template with custom end date

* feat(TDI-40462): update vertica template with custom end date

* feat(TDI-40462): update property name and i18n message

* feat(TDI-40462): fix wrapping parameter name

* feat(TDI-40462): fix teradata quote close

* feat(TDI-40462): fix oracle template parameter name

* feat(TDI-40462): remove extra whitespace, add where it is needed
2019-09-09 07:18:38 +03:00
hcyi
8faeb6dd45 fix(TUP-20949):Property change event is not triggered when user (#3896)
adds/removes column in Table widget.
2019-09-09 11:03:46 +08:00
hcyi
706b61e22d fix(TUP-22459):TaCoKit component runtime doesn't work until initialize (#3908)
all hidden enums.
2019-09-09 10:57:41 +08:00
clesaec
fd891e2419 feat(TDI-40560) : specify ACL when putting file or create bucket
* TDI-40560 : specify ACL when putting file or create bucket

* TDI-40560 : correction from qiyan liu comments

* feat(TDI-40560) : fix Canonical ID in context and move to advanced

* feat(TDI-40560) : support ACL on email

* feat(TDI-40560) : keep the same ACL order as in amazon

* feat(TDI-40560) : Add logs on ACL
2019-09-06 09:26:02 +02:00
hwang-talend
8599590f33 Hwang/tup 23100 (#3827)
* bugfix(TUP-23100):Add warning in the tRunjob for recursive jobs
2019-09-06 10:34:32 +08:00
hwang-talend
7c5a32acb1 bugfix(TUP-24249):Added the column but not reflected to json metadata (#3901)
bugfix(TUP-24249):Added the column but not reflected to json metadata
2019-09-06 10:17:04 +08:00
clesaec
600b37d142 TDI-42493 : Ajout types date & timestamp (#3898) 2019-09-05 10:20:29 +02:00
msjian
c4900e7ad2 feat(TDQ-17372): update migration to support batch/streaming job (#3888) 2019-09-04 11:08:18 +08:00
Zhiwei Xue
6d8adab44d fix(TUP-24323):_tdm folder is missing after build thmap job (#3874) 2019-09-03 10:18:05 +08:00
Roman
751c6d7813 fix(TDI-42560): add jaxb dependency to support java 11 (#3884) 2019-09-02 17:23:19 +03:00
jiezhang-tlnd
22792ee2a3 fix(TUP-24411)Error message: unable to update task config if the Context (#3883)
parameters have same values but different case
https://jira.talendforge.org/browse/TUP-24411
2019-09-02 11:28:07 +08:00
vizotenko-talend
34b7458303 bug(TDI-42686): update snowflake JDBC driver in tCreateTable (#3830) 2019-08-30 13:16:34 +03:00
hwang-talend
2f7a4e930d bugfix(TUP-24248):when edit the metadata, the display content is (#3878)
* bugfix(TUP-24248):when edit the metadata, the display content is
different as when created
2019-08-30 17:25:04 +08:00
hcyi
b3ea83c580 fix(TUP-23435):Studio path contain a space can't install car file in (#3882)
local patches file.
2019-08-30 14:49:45 +08:00
hzhao-talendbj
5920f991b0 fix(TUP-23077)left border of text of component tFileCopy does not show (#3881)
* fix(TUP-23077)left border of text of component tFileCopy does not show

* fix(TUP-23077)left border of text of component tFileCopy does not show
2019-08-30 14:47:16 +08:00
hcyi
1c40d8b173 Revert "fix(TUP-20936):No properties validation for tcomp components in compile time. (#3822)" (#3887)
This reverts commit 9db887667a.
2019-08-30 14:20:34 +08:00
chmyga
4b56340f46 fix(TDI-37801): tWriteJSONField null values (#3865)
* fix(TDI-37801): tWriteJSONField null values

* fix(TDI-37801): Handle nulls and empty strings correctly in json-lib

* fix(TDI-37801): Update json-lib version in components

* fix(TDI-37801): tWriteJSONField null values

* fix(TDI-37801): Fix import name
2019-08-29 08:33:51 +03:00
jiezhang-tlnd
926bc55d86 fix(TUP-24392)JDBCInput component not working as expected when values as provided using context (#3875)
* fix(TUP-24392)JDBCInput component not working as expected when values as
provided using context
https://jira.talendforge.org/browse/TUP-24392

* fix(TUP-24392)JDBCInput component not working as expected when values as
provided using context
https://jira.talendforge.org/browse/TUP-24392
2019-08-29 10:51:25 +08:00
clesaec
e27ab0d505 TDI-42493 : add DBType in mapping (#3861)
* TDI-42493 : add DBType in mapping, controle existance du java.sql.Types and specific code for timestamp with tz
2019-08-28 09:01:30 +02:00
hcyi
4b1dd0a0c5 fix(TUP-21759):BuiltInSuggestable table should remove value, when (#3869)
corresponding schema column was removed.
2019-08-28 14:34:52 +08:00
hcyi
8ed935fc5f fix(TUP-20950):When Configuration/Datastore class is empty it is displayed in Studio as a Text field. (#3858)
* fix(TUP-20950):When Configuration/Datastore class is empty it is
displayed in Studio as a Text field.

* fix(TUP-20950): add junits.
2019-08-28 11:59:33 +08:00
SunChaoqun
18b2039453 TESB-26824:Fail to deploy cMap route and tHmap job to runtime (#3871) 2019-08-27 18:28:06 +08:00
SunChaoqun
31d5836c01 TESB-26609:Building a route microservice docker with wrong host details (#3867)
doesn't throw any error.
2019-08-27 11:39:32 +08:00
hwang-talend
6e88f43352 bugfix(TUP-24249):Added the column but not reflected to json metadata (#3852) 2019-08-27 10:38:52 +08:00
jiezhang-tlnd
efd512cc4f fix(TUP-22646)Path in Textbox of "To archive file" is incomplete when (#3857)
building job
https://jira.talendforge.org/browse/TUP-22646
2019-08-23 15:57:26 +08:00
Roman
5632263a99 feat(TDI-42819): correct behavior whe use log file (#3862) 2019-08-23 09:27:40 +03:00
ypiel
b8d0a79ae6 fix(TDI-42689) : Double precision within mongo
* fix(TDI-42689) : prefer BigDecimal for float&double

* fix(TDI-42689) : double precision is usually enough

* fix(TDI-42689) : Upgrade all to json-lib-2.4.2-talend
2019-08-22 14:15:31 +02:00
kjwang
1a1d07909f Fix TUP-24170 Set crypto-utils as bundle to make the master compile with (#3820)
daikon 0.31.10-SNAPSHOT
https://jira.talendforge.org/browse/TUP-24170
2019-08-22 15:39:59 +08:00
slushatel
c9c865871b feat(TDI-42473): change janet-java version to 1.2 (#3829)
* feat(TDI-42473): change janet-java version to 1.2

* feat(TDI-42473): change janet-java version to 1.2
2019-08-21 13:36:00 +03:00
Jane Ding
4eb95ff314 fix(TUP-24129)Security vulnerabilities in Job building and contexts (#3824)
scripts in 7.1.1.
https://jira.talendforge.org/browse/TUP-24129
2019-08-21 10:47:57 +08:00
Roman
9058e5f0cf fix(TDI-42034): update Redshift jar to 1.2.32.1056 (#3828) 2019-08-20 09:26:06 +03:00
hcyi
9db887667a fix(TUP-20936):No properties validation for tcomp components in compile time. (#3822)
* fix(TUP-20936):No properties validation for tcomp components in compile
time.

* fix(TUP-20936):No properties validation for tcomp components in compile
time.
2019-08-20 14:22:21 +08:00
wang wei
115ff04f57 fix(TDI-42443): tRunJob component - Enabling custom JVM params for independent child jobs (#3749)
* fix(TDI-42443): tRunJob component - Enabling custom JVM params for
independent child jobs

* fix(TDI-42443): make the generated code shorter

* fix(TDI-42443): rename var to make more easy to understand

* fix(TDI-42443): adjust something

* fix(TDI-42443): tRunJob component - Enabling custom JVM params for
independent child jobs

* fix(TDI-42443): refix the tRunJob by the new api

* Revert "fix(TDI-42443): refix the tRunJob by the new api"

This reverts commit 94792b0faa.

* fix(TDI-42443): 	need to allow user to overwrite the child job vm
parameter which is not set by user, but by Talend, for example :
"-Dfile.encoding=UTF-8" is set by Talend for encoding issue, not set by
user in the Run page. If user check "overwrite jvm parameters" in
trunjob and set "-Dfile.encoding=GBK" in the vm parameters table in
trunjob, will only add "-Dfile.encoding=GBK" to vm parameters, mean
overwrite the one set by Talend

* fix(TDI-42443): use the foreach
2019-08-20 14:16:07 +08:00
wang wei
12181f8a75 fix(TDI-42862): fix the ftps for java 11 (#3832)
* fix(TDI-42862): fix ftps for java 11

* fix(TDI-42862): remove the unnecessary urlpath
2019-08-20 13:37:59 +08:00
Jane Ding
ccdad6daa8 fix(TUP-24109)unable to test Expression Builder of tMap (#3839)
https://jira.talendforge.org/browse/TUP-24109
2019-08-20 11:44:44 +08:00
Jane Ding
62dc6af821 fix(TUP-24109)unable to test Expression Builder of tMap (#3799)
* fix(TUP-24109)unable to test Expression Builder of tMap
https://jira.talendforge.org/browse/TUP-24109

* fix(TUP-24109)unable to test Expression Builder of tMap
https://jira.talendforge.org/browse/TUP-24109
2019-08-20 11:06:47 +08:00
jiezhang-tlnd
739ca0b32c fix(TUP-24159)XML metadata wizard showing inconsistent view on V711 (#3835)
comparing with V6 Studio
https://jira.talendforge.org/browse/TUP-24159
2019-08-20 10:25:56 +08:00
hwang-talend
534feea221 bugfix(TUP-23583):Unable to see all tables in AS400 Connection (#3757)
bugfix(TUP-23583):Unable to see all tables in AS400 Connection
2019-08-19 15:20:13 +08:00
jiezhang-tlnd
f4a45b3659 fix(TUP-23160)Error popup during build father job after modified sun job (#3826)
and do not open father job
https://jira.talendforge.org/browse/TUP-23160
2019-08-19 11:42:35 +08:00
vyu-talend
e3a55d8b63 Vyu/tdi 32477 always lowercase column's name of postgres when create table (#3737)
* Fix(TDI-32477):Always lowercase column's name of postgres when create
table

* Fix(TDI-32477):Always lowercase column's name and table in Postgresql

* Fix(TDI-32477):Enable when the type is Dynamic

* Fix(TDI-32477):Dynamic column includes the part of columns

* Fix(TDI-32477)

* Fix(TDI-32477):fix the two bugs in comment
2019-08-19 10:11:14 +08:00
Emmanuel GALLOIS
80fbfd17a8 feat(TDI-40339): add Snowflake to tSQLTemplate family (#3767)
* feat(TDI-40339): add Snowflake to tSQLTemplate family
* feat(TDI-40339): add Snowflake to Managers
- update db_output_bulk
* feat(TDI-40339): add Snowflake (tcompv0) connection handling in javajets
* feat(TDI-40339): correct style
* feat(TDI-40339): remove duplicated inherited methods
2019-08-16 11:23:42 +02:00
pyzhou
0652420c79 fix(TDI-41375):HTTPS proxy server with user authentication (#3762)
* fix(TDI-41375):HTTPS proxy server with user authentication

* fix(TDI-41368):add a check box

* feat(TDI-41368):add checkbox in advance setting
2019-08-16 14:18:09 +08:00
wang wei
23e645e8e6 fix(TDI-42522): avoid 65535 issue (#3636) 2019-08-16 11:59:52 +08:00
Dmytro Sylaiev
2dcba4cddb chore(TDI-42791): Refactor creation connection ftp (#3796)
* chore(TDI-42791): Refactor creation connection ftp

* chore(TDI-42791): Fix compile error after refactoring
2019-08-15 18:26:12 +03:00
vyu-talend
9e7e4c0971 Fix(TDI-42374):"None Proxy Hosts" rename to "No Proxy for" (#3816) 2019-08-15 16:09:25 +08:00
vyu-talend
d5f863477d Fix(TDI-40237):Fix the omitted components in tRedShiftXXX (#3815)
* Fix(TDI-40237):Fix the omitted components in tRedShiftXXX

* Fix(TDI-40237):add China (Ningxia)
2019-08-14 14:59:22 +08:00
Dmytro Sylaiev
b802bb6a72 fix(TDI-42836): Add milis elaboration to properties labels (#3819) 2019-08-13 16:50:04 +03:00
AlixMetivier
21b8a407de new migration task to change tMapROjaiOutput component dbVersion to corresponding one in 7.1.0+ (#3811) 2019-08-13 14:12:54 +02:00
dmytroshekera
0352e0556c feat(TDI-38420):Add support for AND/OR filter in tServiceNowInput (#3818) 2019-08-13 14:36:37 +03:00
pyzhou
9ce74b5a90 fix(TDI-42725):change the groupID for Exa jar (#3817) 2019-08-13 17:42:37 +08:00
Zhiwei Xue
b9c4102074 fix(TUP-23637):7.x missing local_project for big data spark batch job (#3671) 2019-08-13 11:42:04 +08:00
dmytroshekera
2733478a43 feat(TDI-38420):Add support for AND/OR filter in tServiceNowInput (#3813)
Ivan mention that I should use another type of component,
2019-08-12 17:03:37 +03:00
dmytroshekera
9b2180562c Dshekera/tdi 38420 service now input support and or condition (#3795)
* feat(TDI-38420):Add support for AND/OR filter in tServiceNowInput
2019-08-12 12:27:25 +03:00
Stéphane Bouchet
bec10957e5 TESB-26300: disable message dialog when checking build errors (#3654)
* TESB-23600 : do not open dialog anymore when checking errors

* TESB-23600 : refactor/cleanup
2019-08-09 14:23:28 +02:00
jzhao
d0a5929ad6 fix(TDI-42812):tRedshifBulkExec should hide access key and secret key when datasource is not S3(#3809) 2019-08-09 14:09:45 +08:00
vyu-talend
cc999c45b5 Vyu/tdi 40237 add eu (paris) region to t s3 connection (#3806)
* Fix(TDI-40237):Add new regions to tS3Connection

* Fix(TDI-40237):Add new regions

* Fix(TDI-40237):Further modifications

* Fix(TDI-40237)

* Fix(TDI-40237)

* Fix(TDI-40237)

* Fix(TDI-40237):tS3XXX
2019-08-09 11:16:05 +08:00
zshen-talend
5defbea32b feat(TDQ-17177): support "RAW" output flow for tPatternMasking component (#3790)
* feat(TDQ-17177): support "RAW" output flow for tPatternMasking component

* feat(TDQ-17177): added new output flow "FLOW_OUTPUT" to support

propagate scheam change
2019-08-09 11:06:49 +08:00
qiongli
2583507d00 feat(TDQ-17366)Remove migration for tRuleSurvivorship (#3794) 2019-08-09 10:59:22 +08:00
jiezhang-tlnd
48b0e2ecbd fix(TUP-24159)XML metadata wizard showing inconsistent view on V711 (#3807)
comparing with V6 Studio
https://jira.talendforge.org/browse/TUP-24159
2019-08-09 10:54:31 +08:00
hzhao-talendbj
f1b204b226 fix(TUP-24034)tETLoutput schema getting changed to Built-in from (#3802)
repository when changes are made in the map
2019-08-08 19:59:45 +08:00
hcyi
7f5e8bfa11 fix(TUP-20933):tStatCatcher Statistics property is not shown in Advanced (#3798)
tab of Tacokit components
2019-08-08 19:26:26 +08:00
wang wei
063f1daeec fix(TDI-42737): [java 11] FTPS protocol for FTP components don`t work with linux and java 11 (#3764) 2019-08-08 10:08:09 +08:00
wang wei
d2621d049e fix(TDI-42747): fix the issue for tjdbcinput with dynamic column and inside talend object type like for database type blob(#3783) 2019-08-08 09:12:43 +08:00
vizotenko-talend
364d240804 fix(TDI-42495): unexpected behaviour of tArchive (#3801) 2019-08-07 14:04:36 +03:00
SunChaoqun
7398c13e69 TESB-26174:Error on Job with multiple tRunJob calling Call another Child (#3701)
job with tESBConsumer component
2019-08-07 12:10:31 +08:00
hcyi
ea4ae4c735 fix(TUP-21027):Suggestable widgets not save edited values (if not use (#3793)
custom value).
2019-08-06 10:54:05 +08:00
jiezhang-tlnd
5eb3f438ea fix(TUP-20372)Use Project Settings is not checked as default for job (#3787)
https://jira.talendforge.org/browse/TUP-20372
2019-08-06 10:49:28 +08:00
wang wei
dc1c743d48 fix(TDI-42687): Enable AWS ECS role for S3 component (#3770) 2019-08-06 10:07:18 +08:00
vyu-talend
b885667b38 Fix(TDI-40237):Add new regions to tS3Connection (#3750)
* Fix(TDI-40237):Add new regions to tS3Connection

* Fix(TDI-40237):Add new regions

* Fix(TDI-40237):Further modifications

* Fix(TDI-40237)

* Fix(TDI-40237)

* Fix(TDI-40237)

* Fix(TDI-40237):tS3XXX

* Fix(TDI-40237):Remove new region China (Ningxia)
2019-08-05 15:40:25 +08:00
Chao MENG
4019138048 fix(TUP-20951): Validation parameters need to be removed from (#3786)
serialization
https://jira.talendforge.org/browse/TUP-20951
2019-08-05 11:24:38 +08:00
hcyi
eb00028926 fix(TUP-23513):NPE shows in errorlog view when clicking [...] button (#3785)
next to SQL Query.
2019-08-05 11:02:05 +08:00
hcyi
f439623eab fix(TUP-23515):tacokit dataset won't pop up after clicking OK on "Edit (#3791)
parameters using repository".
2019-08-05 10:50:43 +08:00
Romain Manni-Bucau
8e65ae765f chore(monitoring/TUP-23824): Ensure monitoring feature can rely on system properties to configure the audit logger and does not hardcode a local file name+location+maxsize (#3699)
* Ensure monitoring feature can rely on system properties to configure the audit logger and does not hardcode a local file name+location+maxsize

* support system property monitoring even when no arg is passed to the main
2019-08-02 10:09:35 +02:00
Emmanuel GALLOIS
84edd12af5 fix TalendExcel imports (#3788) 2019-08-01 16:06:49 +02:00
Emmanuel GALLOIS
cb8308df05 feat(TDI-41662): Password protected Excel files management (#3743)
* feat(TDI-41662): add PASSWORD property
* feat(TDI-41662): set PASSWORD property visible only for Excel 2007++
* feat(TDI-41662): add password decryption in Talend ExcelReader wrapper
- warning this is an external lib
* feat(TDI-41662): bump simpleexcel lib release to latest updates
- not sure that MANIFEST.MF should be updated but once build there was
no changes to it, so in case of...
* feat(TDI-41662): implement decryption in javajet
* feat(TDI-41662): add properties to tFileOutputExcel
* fix(TDI-41662): correct gav
* fix(TDI-41662): bump simpleexcel version
* fix(TDI-41662): add password protection on writing excel file
* fix(TDI-41662): bump talendExcel version
* fix(TDI-41662): add password protection on writing excel file (javajet)
* feat(TDI-41662): close workbook when not protected
* feat(TDI-41662): fix some stuff about tFileOutputExcel
* feat(TDI-41662): remove old parse methods to ExcelReader
* feat(TDI-41662): close workbook in any cases
* feat(TDI-41662): use agile encryption mode only in TalendExcel
* feat(TDI-41662): use agile encryption mode only in javajet comp
* feat(TDI-41662): merge master and bump TalendExcel version
* feat(TDI-41662): fix classpath version for TalendExcel
- not sure that's necessary but...
2019-08-01 11:04:13 +02:00
hzhao-talendbj
62fe9a0f38 fix(TUP-22893)Icon becomes old version after openning SQL builder (#3775)
* fix(TUP-22893)Icon becomes old version after openning SQL builder

* fix(TUP-22893)Icon becomes old version after openning SQL builder
2019-08-01 16:29:24 +08:00
Chao MENG
ac80911050 fix(TUP-23514): NPE shows in errorlog view when Selecting Repository in (#3772)
Basic settings
https://jira.talendforge.org/browse/TUP-23514
2019-08-01 16:17:58 +08:00
hcyi
7c682778ec fix(TUP-23626):tacokit problem with drag and drop variables from (#3773)
Outline.
2019-08-01 16:15:10 +08:00
SunChaoqun
4159e31ef1 TESB-24597:Docker Support for Microservice - CI Part (#3782) 2019-07-31 18:38:00 +08:00
Chao MENG
b7ed047c91 fix(TUP-20943): Code generates with an error when Pattern check fails if (#3774)
contain back slash
https://jira.talendforge.org/browse/TUP-20943
2019-07-31 17:39:33 +08:00
hwang-talend
be5a9a7dba bugfix(TUP-23894):Fix all failed junit for both java 8 and 11 (#3779)
bugfix(TUP-23894):Fix all failed junit for both java 8 and 11
2019-07-31 16:59:27 +08:00
apoltavtsev
0f0ead31aa TESB-24900 Undeploying a Data Service causes "Exception in opening zip file" error 2019-07-31 09:33:09 +03:00
SunChaoqun
70f45909b9 TESB-24597:Docker Support for Microservice - CI Part (#3776) 2019-07-31 11:09:37 +08:00
hwang-talend
3e0d0538bb bugfix(TUP-23967):Studio can't run jobs when path has spaces, Windows 10 (#3768)
bugfix(TUP-23967):Studio can't run jobs when path has spaces, Windows 10
2019-07-31 10:08:14 +08:00
Chao MENG
40d9315e48 Cmeng/bugfix/tup 23914 json wizard encoding (#3771)
* fix(TUP-23914): JSON with accented characters is not being recognized
when creating a new JSON file in Metadata.
https://jira.talendforge.org/browse/TUP-23914
2019-07-31 10:05:19 +08:00
wang wei
0946243005 fix(TDI-42705): tSAPBwInput component gives compilation error (#3739) 2019-07-31 09:52:27 +08:00
Roman
d544cfbbd8 feat(TDI-36668): Add possibility to write xlsm files (#3766) 2019-07-29 16:58:22 +03:00
hwang-talend
38d73d1c3b bugfix(TUP-23894):Fix all failed junit for both java 8 and 11 (#3761)
* bugfix(TUP-23894):Fix all failed junit for both java 8 and 11
2019-07-29 18:05:07 +08:00
Dmytro Sylaiev
a257812d17 Dsylaiev/tdi 37257 timeout sftp (#3756)
* feat(TDI-37257): Add connection timeout for SFTP

* feat(TDI-37257): Implement timeout feature for FTP and FTPS
2019-07-29 12:56:03 +03:00
Jane Ding
4224c49747 fix(TUP-22943)checkbox with empty item name display on window Save (#3755)
Resources
https://jira.talendforge.org/browse/TUP-22943
2019-07-29 15:12:01 +08:00
Jane Ding
2a48cfd3c5 fix(TUP-22880)Resources: Job cannot use resources from reference (#3759)
project;
https://jira.talendforge.org/browse/TUP-22880
2019-07-29 15:07:34 +08:00
hcyi
c4adf887db fix(TUP-21687):Table value is not visible after filling component properties from metadata. (#3747)
* fix(TUP-21687):Table value is not visible after filling component
properties from metadata.

* fix(TUP-21687):add/update junits for Table value is not visible after
filling component properties from metadata.

* fix(TUP-21687):add/update junits for Table value is not visible after
filling component properties from metadata.
2019-07-29 15:02:34 +08:00
hcyi
18422df2a4 fix(TUP-20928):Suggestable doesn't work for TextArea in Studio (#3765) 2019-07-29 14:56:00 +08:00
SunChaoqun
0985646d21 TESB-24597:Docker Support for Microservice - CI Part (#3730)
* TESB-24597:Docker Support for Microservice - CI Part

* TESB-24597:Docker Support for Microservice - CI Part

* TESB-24597:Docker Support for Microservice - CI Part
2019-07-26 10:39:40 +08:00
slushatel
481edbbc18 fix(TDI-42634): create output directory if not exists (#3760) 2019-07-25 16:15:55 +03:00
Hanna Liashchuk
02df23ffeb (feature(TBD-8945): added drop table checkbox to OAuth authentication mode (#3713) 2019-07-25 13:45:47 +03:00
Jane Ding
957704c0a4 fix(TUP-23789)Pom files are not generated sometimes for the jobs in (#3738)
* fix(TUP-23789)Pom files are not generated sometimes for the jobs in
7.1.1
https://jira.talendforge.org/browse/TUP-23789

* fix(TUP-23789)Pom files are not generated sometimes for the jobs in
7.1.1
https://jira.talendforge.org/browse/TUP-23789
Add a junit.
2019-07-24 16:18:59 +08:00
Roman
cb85a154f8 fix(TDI-42457): correct Postgre supported DB version (#3733) 2019-07-24 10:11:57 +03:00
468 changed files with 7315 additions and 3630 deletions

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.abstractmap.nl</artifactId> <artifactId>org.talend.designer.abstractmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.alfrescooutput.nl</artifactId> <artifactId>org.talend.designer.alfrescooutput.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.business.diagram.nl</artifactId> <artifactId>org.talend.designer.business.diagram.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.codegen.nl</artifactId> <artifactId>org.talend.designer.codegen.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.exchange.nl</artifactId> <artifactId>org.talend.designer.components.exchange.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.core.nl</artifactId> <artifactId>org.talend.designer.core.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.dbmap.nl</artifactId> <artifactId>org.talend.designer.dbmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.documentation.nl</artifactId> <artifactId>org.talend.designer.documentation.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.fileoutputxml.nl</artifactId> <artifactId>org.talend.designer.fileoutputxml.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.gefabstractmap.nl</artifactId> <artifactId>org.talend.designer.gefabstractmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.mapper.nl</artifactId> <artifactId>org.talend.designer.mapper.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.maven.job.nl</artifactId> <artifactId>org.talend.designer.maven.job.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.rowgenerator.nl</artifactId> <artifactId>org.talend.designer.rowgenerator.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.runprocess.nl</artifactId> <artifactId>org.talend.designer.runprocess.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.scd.nl</artifactId> <artifactId>org.talend.designer.scd.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.webservice.nl</artifactId> <artifactId>org.talend.designer.webservice.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.xmlmap.nl</artifactId> <artifactId>org.talend.designer.xmlmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.expressionbuilder.nl</artifactId> <artifactId>org.talend.expressionbuilder.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.presentation.onboarding.resource.nl</artifactId> <artifactId>org.talend.presentation.onboarding.resource.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.presentation.onboarding.resource.tos.nl</artifactId> <artifactId>org.talend.presentation.onboarding.resource.tos.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.ftp.nl</artifactId> <artifactId>org.talend.repository.ftp.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.json.nl</artifactId> <artifactId>org.talend.repository.json.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.nl</artifactId> <artifactId>org.talend.repository.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.view.di.nl</artifactId> <artifactId>org.talend.repository.view.di.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.sbi.engines.client.nl</artifactId> <artifactId>org.talend.sbi.engines.client.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.spagic.engines.client.nl</artifactId> <artifactId>org.talend.spagic.engines.client.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.sqlbuilder.nl</artifactId> <artifactId>org.talend.sqlbuilder.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.business.feature</artifactId> <artifactId>org.talend.designer.business.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.feature</artifactId> <artifactId>org.talend.designer.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.fragment.jars.di.feature</artifactId> <artifactId>org.talend.fragment.jars.di.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.rcp.branding.tos.feature</artifactId> <artifactId>org.talend.rcp.branding.tos.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.rcp.branding.tos.test.feature</artifactId> <artifactId>org.talend.rcp.branding.tos.test.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.feature</artifactId> <artifactId>org.talend.repository.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.sbi.feature</artifactId> <artifactId>org.talend.sbi.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.spagic.feature</artifactId> <artifactId>org.talend.spagic.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.components.feature</artifactId> <artifactId>org.talend.tos.components.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.core.feature</artifactId> <artifactId>org.talend.tos.core.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.feature</artifactId> <artifactId>org.talend.tos.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.libraries.feature</artifactId> <artifactId>org.talend.tos.libraries.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.abstractmap</artifactId> <artifactId>org.talend.designer.abstractmap</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.alfrescooutput</artifactId> <artifactId>org.talend.designer.alfrescooutput</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.business.diagram</artifactId> <artifactId>org.talend.designer.business.diagram</artifactId>

View File

@@ -22,6 +22,7 @@ Require-Bundle: org.talend.core.repository,
org.apache.log4j, org.apache.log4j,
org.talend.components.api, org.talend.components.api,
org.talend.daikon, org.talend.daikon,
org.talend.daikon.crypto.utils,
org.talend.designer.core.generic org.talend.designer.core.generic
Eclipse-LazyStart: true Eclipse-LazyStart: true
Bundle-ClassPath: . Bundle-ClassPath: .

View File

@@ -59,88 +59,76 @@ if((codePart.equals(ECodePart.END))&&(stat || logstashCurrent)){
List<String> needToEndConnNames = new ArrayList<String>(); List<String> needToEndConnNames = new ArrayList<String>();
INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget(); INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget();
NodeUtil.fillConnectionsForStat(needToEndConnNames, nextNode); NodeUtil.fillConnectionsForStat(needToEndConnNames, nextNode);
%> if(!needToEndConnNames.isEmpty()) {
if(stat && logstashCurrent) {
<%if(stat) {%>
if(execStat){
<%
for(String connName : needToEndConnNames){
%> %>
runStat.updateStatOnConnection("<%=connName%>"+iterateId,2, 0); runStat.updateStatAndLog(execStat,enableLogStash,iterateId,2,0<%for(String connName : needToEndConnNames){%>,"<%=connName%>"<%}%>);
<% <%
} else {
if(stat) {%>
if(execStat){
runStat.updateStatOnConnection(iterateId,2,0<%for(String connName : needToEndConnNames){%>,"<%=connName%>"<%}%>);
}
<%}%>
<%if(logstashCurrent) {//now only finish the log, not send, TODO%>
if(enableLogStash){
runStat.log(iterateId,2,0<%for(String connName : needToEndConnNames){%>,"<%=connName%>"<%}%>);
}
<%
}
} }
%>
} }
<%}%>
<%if(logstashCurrent) {//now only finish the log, not send, TODO%>
if(enableLogStash){
<%
for(String connName : needToEndConnNames){
%>
runStat.logStatOnConnection("<%=connName%>"+iterateId,2, 0);
<%
}
%>
}
<%
}
%>
<%
} }
if(connSet.size()>0){
for(IConnection con:connSet){ if(connSet.size()>0) {
INode source = con.getSource(); if(stat && logstashCurrent && (connSet.size()==1)) {//the most common case, write this ugly logic for 65535 issue
String sourceNodeId = source.getUniqueName(); for(IConnection con:connSet){
String sourceNodeComponent = source.getComponent().getName(); INode source = con.getSource();
%> String sourceNodeId = source.getUniqueName();
<%if(stat) {%> String sourceNodeComponent = source.getComponent().getName();
if(execStat){ for (INode jobStructureCatcher : jobCatcherNodes) {
if(resourceMap.get("inIterateVComp") == null || !((Boolean)resourceMap.get("inIterateVComp"))){ %>
runStat.updateStatOnConnection("<%=con.getUniqueName()%>"+iterateId,2, 0); if(runStat.updateStatAndLog(execStat,enableLogStash,resourceMap,iterateId,"<%=con.getUniqueName()%>",2,0,
} <%=jobStructureCatcher.getUniqueName()%>,"<%=sourceNodeId%>","<%=sourceNodeComponent%>","<%=node.getUniqueName()%>","<%=node.getComponent().getName()%>","<%="REJECT".equals(con.getConnectorName()) ? "reject" : "output"%>")) {
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
}
<%
break;
}
}
} else {
if(stat){
%>
if(execStat){
runStat.updateStat(resourceMap,iterateId,2,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
}
<%
} }
<%}%>
<%if(logstashCurrent) {%> if(logstashCurrent){
if(enableLogStash){ %>
if(resourceMap.get("inIterateVComp") == null || !((Boolean)resourceMap.get("inIterateVComp"))){ if(enableLogStash) {
<% <%
for(IConnection con:connSet){
INode source = con.getSource();
String sourceNodeId = source.getUniqueName();
String sourceNodeComponent = source.getComponent().getName();
for (INode jobStructureCatcher : jobCatcherNodes) { for (INode jobStructureCatcher : jobCatcherNodes) {
%> %>
RunStat.StatBean talend_statebean = runStat.logStatOnConnection("<%=con.getUniqueName()%>"+iterateId,2, 0); if(runStat.log(resourceMap,iterateId,"<%=con.getUniqueName()%>",2,0,
<%=jobStructureCatcher.getUniqueName()%>,"<%=sourceNodeId%>","<%=sourceNodeComponent%>","<%=node.getUniqueName()%>","<%=node.getComponent().getName()%>","<%="REJECT".equals(con.getConnectorName()) ? "reject" : "output"%>")) {
<%=jobStructureCatcher.getUniqueName() %>.addConnectionMessage( <%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
"<%=sourceNodeId%>", }
"<%=sourceNodeComponent%>",
false,
"<%="REJECT".equals(con.getConnectorName()) ? "reject" : "output"%>",
"<%=con.getUniqueName()%>",
talend_statebean.getNbLine(),
talend_statebean.getStartTime(),
talend_statebean.getEndTime()
);
<%=jobStructureCatcher.getUniqueName() %>.addConnectionMessage(
"<%=node.getUniqueName()%>",
"<%=node.getComponent().getName()%>",
true,
"input",
"<%=con.getUniqueName()%>",
talend_statebean.getNbLine(),
talend_statebean.getStartTime(),
talend_statebean.getEndTime()
);
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
<% <%
break; break;
} }
%> }
} %>
}
<%
} }
<%}%> }
<%
}
} }
} }
%> %>

View File

@@ -146,83 +146,82 @@
boolean logstashCurrent = !cid.startsWith("tJobStructureCatcher") && !cid.startsWith("talend") && enableLogStash; boolean logstashCurrent = !cid.startsWith("tJobStructureCatcher") && !cid.startsWith("talend") && enableLogStash;
if ((codePart.equals(ECodePart.BEGIN))&&(stat || logstashCurrent)&&connSet.size()>0) { if ((codePart.equals(ECodePart.BEGIN))&&(stat || logstashCurrent)&&connSet.size()>0) {
for(IConnection con:connSet){ if(containsTPartitioner) {
%> %>
if (<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>) { if(<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>) {
if(resourceMap.get("inIterateVComp") == null){ runStat.updateStatOnConnectionAndLog(resourceMap,globalMap,iterateLoop,iterateId,<%if(stat){%>execStat<%} else {%>false<%}%>,enableLogStash,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
<%if(containsTPartitioner){%> }
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=con.getUniqueName() %> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap"); <%
concurrentHashMap_<%=con.getUniqueName() %>.putIfAbsent("<%=con.getUniqueName() %>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0)); } else {
java.util.concurrent.atomic.AtomicInteger stats_<%=con.getUniqueName() %> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=con.getUniqueName() %>.get("<%=con.getUniqueName() %>" + iterateLoop); if(stat && logstashCurrent) {
int step_<%=con.getUniqueName() %> = stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1; %>
<%if(stat) {%> runStat.updateStatAndLog(execStat,enableLogStash,resourceMap,iterateId,0,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
if(execStat) { <%
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId, step_<%=con.getUniqueName()%>, 0); } else {
} if(stat) {
<%}%> %>
if(execStat) {
<%if(logstashCurrent) {%> runStat.updateStatOnConnection(resourceMap,iterateId,0,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
if(enableLogStash) { }
runStat.logStatOnConnection("<%=con.getUniqueName()%>"+iterateId, step_<%=con.getUniqueName()%>, 0); <%
}
<%}%>
<%}else{%>
<%if(stat) {%>
if(execStat) {
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId, 0, 0);
}
<%}%>
<%if(logstashCurrent) {%>
if(enableLogStash) {
runStat.logStatOnConnection("<%=con.getUniqueName()%>"+iterateId, 0, 0);
}
<%}%>
<%}%>
} }
}
if(logstashCurrent) {
<% %>
if(enableLogStash) {
runStat.log(resourceMap,iterateId,0,0<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
}
<%
}
}
} }
} }
if((codePart.equals(ECodePart.MAIN))&&(stat || logstashCurrent)&&connSet.size()>0){ if((codePart.equals(ECodePart.MAIN))&&(stat || logstashCurrent)&&connSet.size()>0){
for(IConnection con:connSet){ if(!node.getComponent().useMerge()) {
%> if(stat && logstashCurrent) {
//<%=con.getUniqueName()%>
//<%=(String)codeGenArgument.getIncomingName()%>
<%if (!node.getComponent().useMerge()) {%>
<%if(stat) {%>
if(execStat){
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
}
<%}%>
<%if(logstashCurrent) {%>
if(enableLogStash) {
runStat.logStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
}
<%}%>
<%
} else if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){
%> %>
<%if(stat) {%> runStat.updateStatAndLog(execStat,enableLogStash,iterateId,1,1<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
if(execStat){ <%
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1); } else {
if(stat) {
%>
if(execStat){
runStat.updateStatOnConnection(iterateId,1,1<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
}
<%
} }
<%}%>
<%if(logstashCurrent) {%> if(logstashCurrent) {
if(enableLogStash) { %>
runStat.logStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1); if(enableLogStash) {
runStat.log(iterateId,1,1<%for(IConnection con : connSet){%>,"<%=con.getUniqueName()%>"<%}%>);
}
<%
} }
<%}%> }
<%}%> } else {
for(IConnection connection:connSet){
<% if(connection.getUniqueName().equals((String)codeGenArgument.getIncomingName())){
if(stat && logstashCurrent) {
%>
runStat.updateStatAndLog(execStat,enableLogStash,iterateId,1,1<%for(IConnection con : connSet){if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){%>,"<%=con.getUniqueName()%>"<%}}%>);
<%
} else {
if(stat) {%>
if(execStat){
runStat.updateStatOnConnection(iterateId,1,1<%for(IConnection con : connSet){if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){%>,"<%=con.getUniqueName()%>"<%}}%>);
}
<%}
if(logstashCurrent) {%>
if(enableLogStash) {
runStat.log(iterateId,1,1<%for(IConnection con : connSet){if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){%>,"<%=con.getUniqueName()%>"<%}}%>);
}
<%}
}
}
}
} }
} }
@@ -251,7 +250,7 @@
for (INode jobStructureCatcher : jobCatcherNodes) { for (INode jobStructureCatcher : jobCatcherNodes) {
%> %>
if(enableLogStash) { if(enableLogStash) {
<%=jobStructureCatcher.getUniqueName() %>.addComponentMessage("<%=node.getUniqueName()%>", "<%=node.getComponent().getName()%>"); <%=jobStructureCatcher.getUniqueName() %>.addCM("<%=node.getUniqueName()%>", "<%=node.getComponent().getName()%>");
<%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); <%=jobStructureCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
} }
<% <%
@@ -266,46 +265,37 @@
List<String> needToStartConnNames = new ArrayList<String>(); List<String> needToStartConnNames = new ArrayList<String>();
INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget(); INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget();
NodeUtil.fillConnectionsForStat(needToStartConnNames, nextNode); NodeUtil.fillConnectionsForStat(needToStartConnNames, nextNode);
if(needToStartConnNames.isEmpty()) {
//do nothing
} else if(containsTPartitioner){
%> %>
if(<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>){ if(<%if(stat){%>execStat<%}%><%if(stat && logstashCurrent){%> || <%}%><%if(logstashCurrent){%>enableLogStash<%}%>){
<% runStat.updateStatOnConnectionAndLog(globalMap,iterateLoop,iterateId,<%if(stat){%>execStat<%} else {%>false<%}%>,enableLogStash,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
for(String connName : needToStartConnNames){ }
%> <%
<%if(containsTPartitioner){%> } else {
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=connName%> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap"); if(stat && logstashCurrent) {
concurrentHashMap_<%=connName%>.putIfAbsent("<%=connName%>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0)); %>
java.util.concurrent.atomic.AtomicInteger stats_<%=connName%> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=connName%>.get("<%=connName%>" + iterateLoop); runStat.updateStatAndLog(execStat,enableLogStash,iterateId,0,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
<%
int step_<%=connName %> = stats_<%=connName%>.incrementAndGet()<=1?0:1; } else {
<%if(stat) {%> if(stat){
if(execStat) { %>
runStat.updateStatOnConnection("<%=connName%>"+iterateId, step_<%=connName%>, 0); if(execStat){
} runStat.updateStatOnConnection(iterateId,0,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
<%}%> }
<%
<%if(logstashCurrent) {%> }
if(enableLogStash) { %>
runStat.logStatOnConnection("<%=connName%>"+iterateId, step_<%=connName%>, 0);
} <%if(logstashCurrent) {%>
<%}%> if(enableLogStash){
<%}else{%> runStat.log(iterateId,0,0<%for(String connName : needToStartConnNames){%>,"<%=connName%>"<%}%>);
<%if(stat) {%> }
if(execStat) { <%
runStat.updateStatOnConnection("<%=connName%>"+iterateId, 0, 0); }
} }
<%}%>
<%if(logstashCurrent) {%>
if(enableLogStash) {
runStat.logStatOnConnection("<%=connName%>"+iterateId, 0, 0);
}
<%}%>
<%}%>
<%
}
%>
} }
<%
}else if(codePart.equals(ECodePart.MAIN)){ }else if(codePart.equals(ECodePart.MAIN)){
%> %>
resourceMap.put("inIterateVComp", true); resourceMap.put("inIterateVComp", true);

View File

@@ -445,6 +445,7 @@
lastStr = ""; lastStr = "";
} }
} }
enableLogStash = "true".equalsIgnoreCase(System.getProperty("monitoring"));
<%if(isLog4jEnabled){%> <%if(isLog4jEnabled){%>
if(!"".equals(log4jLevel)){ if(!"".equals(log4jLevel)){
@@ -493,7 +494,11 @@
properties_<%=jobCatcherNode.getUniqueName()%>.setProperty("appender.file.maxsize", "52428800"); properties_<%=jobCatcherNode.getUniqueName()%>.setProperty("appender.file.maxsize", "52428800");
properties_<%=jobCatcherNode.getUniqueName()%>.setProperty("appender.file.maxbackup", "20"); properties_<%=jobCatcherNode.getUniqueName()%>.setProperty("appender.file.maxbackup", "20");
properties_<%=jobCatcherNode.getUniqueName()%>.setProperty("host", "false"); properties_<%=jobCatcherNode.getUniqueName()%>.setProperty("host", "false");
System.getProperties().stringPropertyNames().stream()
.filter(it -> it.startsWith("monitoring.audit.logger.properties."))
.forEach(key -> properties_<%=jobCatcherNode.getUniqueName()%>.setProperty(key.substring("monitoring.audit.logger.properties.".length()), System.getProperty(key)));
auditLogger_<%=jobCatcherNode.getUniqueName()%> = org.talend.job.audit.JobEventAuditLoggerFactory.createJobAuditLogger(properties_<%=jobCatcherNode.getUniqueName()%>); auditLogger_<%=jobCatcherNode.getUniqueName()%> = org.talend.job.audit.JobEventAuditLoggerFactory.createJobAuditLogger(properties_<%=jobCatcherNode.getUniqueName()%>);
} }
<% <%
@@ -1509,12 +1514,10 @@ if (execStat) {
} }
} else if (arg.startsWith("--log4jLevel=")) { } else if (arg.startsWith("--log4jLevel=")) {
log4jLevel = arg.substring(13); log4jLevel = arg.substring(13);
} else if (arg.startsWith("--monitoring=")) {//for trunjob call } else if (arg.startsWith("--monitoring") && arg.contains("=")) {//for trunjob call
enableLogStash = "true".equalsIgnoreCase(arg.substring(13)); final int equal = arg.indexOf('=');
} final String key = arg.substring("--".length(), equal);
System.setProperty(key, arg.substring(equal + 1));
if(!enableLogStash) {
enableLogStash = "true".equalsIgnoreCase(System.getProperty("monitoring"));
} }
} }

View File

@@ -139,7 +139,7 @@ for (INode node : process.getNodesOfType("tRESTClient")) {
} }
boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty(); boolean talendEsbJobFactory = actAsProvider || !process.getNodesOfType("tRouteInput").isEmpty();
boolean talendEsbJob = talendEsbJobFactory || actAsConsumer || ProcessorUtilities.isEsbJob(process.getId(), process.getVersion()); 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__"));

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.codegen</artifactId> <artifactId>org.talend.designer.codegen</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.exchange</artifactId> <artifactId>org.talend.designer.components.exchange</artifactId>

View File

@@ -1,7 +1,7 @@
<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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.libraries</groupId>
<artifactId>checkArchive-1.1-20181130</artifactId> <artifactId>checkArchive-1.1-20190917</artifactId>
<version>6.0.0</version> <version>6.0.0</version>
<name>checkArchive</name> <name>checkArchive</name>
<description>Dependence for tFileArchive and tFileUnAchive</description> <description>Dependence for tFileArchive and tFileUnAchive</description>
@@ -41,7 +41,7 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId> <artifactId>commons-compress</artifactId>
<version>1.10</version> <version>1.19</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -1,9 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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"> 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> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.components.lib</groupId>
<artifactId>commons-net-ftps-proxy</artifactId> <artifactId>commons-net-ftps-proxy</artifactId>
<version>3.6.1-talend-20190128</version> <version>3.6.1-talend-20190819</version>
<name>commons-net-talend</name> <name>commons-net-talend</name>

View File

@@ -3,6 +3,7 @@ package org.talend.ftp;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.Socket; import java.net.Socket;
import java.net.InetAddress;
import java.util.Locale; import java.util.Locale;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
@@ -29,11 +30,13 @@ public class SSLSessionReuseFTPSClient extends FTPSClient {
final Object cache = sessionHostPortCache.get(context); final Object cache = sessionHostPortCache.get(context);
final Method putMethod = cache.getClass().getDeclaredMethod("put", Object.class, Object.class); final Method putMethod = cache.getClass().getDeclaredMethod("put", Object.class, Object.class);
putMethod.setAccessible(true); putMethod.setAccessible(true);
final Method getHostMethod = socket.getClass().getDeclaredMethod("getHost"); InetAddress address = socket.getInetAddress();
getHostMethod.setAccessible(true); int port = socket.getPort();
Object host = getHostMethod.invoke(socket);
final String key = String key = String.format("%s:%s", address.getHostName(), String.valueOf(port)).toLowerCase(Locale.ROOT);
String.format("%s:%s", host, String.valueOf(socket.getPort())).toLowerCase(Locale.ROOT); putMethod.invoke(cache, key, session);
key = String.format("%s:%s", address.getHostAddress(), String.valueOf(port)).toLowerCase(Locale.ROOT);
putMethod.invoke(cache, key, session); putMethod.invoke(cache, key, session);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -7,7 +7,7 @@
<groupId>net.sf.json-lib</groupId> <groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId> <artifactId>json-lib</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>2.4.1-talend</version> <version>2.4.3-talend</version>
<name>json-lib</name> <name>json-lib</name>
<properties> <properties>

View File

@@ -15,6 +15,7 @@
*/ */
package net.sf.json.util; package net.sf.json.util;
import java.math.BigDecimal;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONException; import net.sf.json.JSONException;
import net.sf.json.JSONNull; import net.sf.json.JSONNull;
@@ -414,7 +415,7 @@ public class JSONTokener {
} }
try{ try{
return NumberUtils.createNumber(s); return createNumber(s);
}catch( Exception e ){ }catch( Exception e ){
return s; return s;
} }
@@ -435,6 +436,26 @@ public class JSONTokener {
return s; return s;
} }
/**
* This method has been added to fix https://jira.talendforge.org/browse/TDI-42689
*
* @param s The String representation of the number
* @return The Number instance
*/
private Number createNumber(String s){
boolean isDecimal = s.indexOf('.') != -1;
if(isDecimal){
Double d = Double.valueOf(s);
if(Double.POSITIVE_INFINITY == Math.abs(d)){
return new BigDecimal(s);
}
return d;
}
return NumberUtils.createNumber(s);
}
/** /**
* Look at the next character in the source string. * Look at the next character in the source string.
* *

View File

@@ -184,14 +184,12 @@ public final class JSONUtils {
return Integer.class; return Integer.class;
}else if( isLong( n ) ){ }else if( isLong( n ) ){
return Long.class; return Long.class;
}else if( isFloat( n ) ){
return Float.class;
}else if( isBigInteger( n ) ){ }else if( isBigInteger( n ) ){
return BigInteger.class; return BigInteger.class;
}else if( isBigDecimal( n ) ){
return BigDecimal.class;
}else if( isDouble( n ) ){ }else if( isDouble( n ) ){
return Double.class; return Double.class;
}else if( isBigDecimal( n ) ){
return BigDecimal.class;
}else{ }else{
throw new JSONException( "Unsupported type" ); throw new JSONException( "Unsupported type" );
} }

View File

@@ -163,6 +163,11 @@ public class XMLSerializer {
*/ */
private boolean useLongDecimals; private boolean useLongDecimals;
/**
* flag for if parse empty elements as empty strings
*/
private boolean useEmptyStrings;
/** /**
* Creates a new XMLSerializer with default options.<br> * Creates a new XMLSerializer with default options.<br>
* <ul> * <ul>
@@ -803,6 +808,8 @@ public class XMLSerializer {
clazz = JSONTypes.OBJECT; clazz = JSONTypes.OBJECT;
}else if( JSONTypes.ARRAY.compareToIgnoreCase( clazzText ) == 0 ){ }else if( JSONTypes.ARRAY.compareToIgnoreCase( clazzText ) == 0 ){
clazz = JSONTypes.ARRAY; clazz = JSONTypes.ARRAY;
} else if(JSONTypes.STRING.equalsIgnoreCase(clazzText)) {
clazz = JSONTypes.STRING;
} }
} }
return clazz; return clazz;
@@ -1414,6 +1421,8 @@ public class XMLSerializer {
String text = element.getValue(); String text = element.getValue();
params = StringUtils.split( paramsAttribute.getValue(), "," ); params = StringUtils.split( paramsAttribute.getValue(), "," );
setOrAccumulate( jsonObject, key, new JSONFunction( params, text ) ); setOrAccumulate( jsonObject, key, new JSONFunction( params, text ) );
} else if( useEmptyStrings && clazz != null && clazz.equalsIgnoreCase(JSONTypes.STRING) ) {
setTextValue(jsonObject, key, element);
}else{ }else{
if( isArray( element, false ) ){ if( isArray( element, false ) ){
setOrAccumulate( jsonObject, key, processArrayElement( element, defaultType ) ); setOrAccumulate( jsonObject, key, processArrayElement( element, defaultType ) );
@@ -1421,19 +1430,23 @@ public class XMLSerializer {
setOrAccumulate( jsonObject, key, simplifyValue( jsonObject, setOrAccumulate( jsonObject, key, simplifyValue( jsonObject,
processObjectElement( element, defaultType ) ) ); processObjectElement( element, defaultType ) ) );
}else{ }else{
String value; setTextValue(jsonObject, key, element);
if( isKeepCData && isCData( element ) ){
value = "<![CDATA[" + element.getValue() + "]]>";
}else{
value = element.getValue();
}
setOrAccumulate( jsonObject, key, trimSpaceFromValue( value ) );
} }
} }
} }
} }
} }
private void setTextValue(final JSONObject jsonObject, final String key, final Element element) {
String value;
if( isKeepCData && isCData( element ) ){
value = "<![CDATA[" + element.getValue() + "]]>";
}else{
value = element.getValue();
}
setOrAccumulate( jsonObject, key, trimSpaceFromValue( value ) );
}
private boolean isCData( Element element ) { private boolean isCData( Element element ) {
if( element.getChildCount() == 1 ){ if( element.getChildCount() == 1 ){
final Node child = element.getChild( 0 ); final Node child = element.getChild( 0 );
@@ -1493,6 +1506,14 @@ public class XMLSerializer {
return str; return str;
} }
public void setUseEmptyStrings(boolean useEmptyStrings) {
this.useEmptyStrings = useEmptyStrings;
}
public boolean isUseEmptyStrings() {
return this.useEmptyStrings;
}
private static class CustomElement extends Element { private static class CustomElement extends Element {
private static String getName( String name ) { private static String getName( String name ) {
int colon = name.indexOf( ':' ); int colon = name.indexOf( ':' );

View File

@@ -27,6 +27,7 @@ import net.sf.json.processors.PropertyNameProcessor;
import net.sf.json.sample.BeanA; import net.sf.json.sample.BeanA;
import net.sf.json.sample.BeanB; import net.sf.json.sample.BeanB;
import net.sf.json.sample.BeanC; import net.sf.json.sample.BeanC;
import net.sf.json.sample.BeanD;
import net.sf.json.sample.BeanFoo; import net.sf.json.sample.BeanFoo;
import net.sf.json.sample.BeanWithFunc; import net.sf.json.sample.BeanWithFunc;
import net.sf.json.sample.ChildBean; import net.sf.json.sample.ChildBean;
@@ -1042,6 +1043,17 @@ public class TestJSONObject extends TestCase {
JSONArray.toArray( jsonObject.getJSONArray( "intarray" ) ) ); JSONArray.toArray( jsonObject.getJSONArray( "intarray" ) ) );
} }
public void testToBean_BeanD() {
String json = "{bool:true,integer:1,string:\"json\",doublearray:[4.2424245783E7, 123456789.2424245783E7, 6.0]}";
JSONObject jsonObject = JSONObject.fromObject( json );
BeanD bean = (BeanD) JSONObject.toBean( jsonObject, BeanD.class );
assertEquals( jsonObject.get( "bool" ), Boolean.valueOf( bean.isBool() ) );
assertEquals( jsonObject.get( "integer" ), new Integer( bean.getInteger() ) );
assertEquals( jsonObject.get( "string" ), bean.getString() );
Assertions.assertEquals( bean.getDoublearray(),
JSONArray.toArray( jsonObject.getJSONArray( "doublearray" ) ) );
}
public void testToBean_ClassBean() { public void testToBean_ClassBean() {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.element( "klass", "java.lang.Object" ); json.element( "klass", "java.lang.Object" );
@@ -1050,9 +1062,29 @@ public class TestJSONObject extends TestCase {
assertEquals( Object.class, bean.getKlass() ); assertEquals( Object.class, bean.getKlass() );
} }
public void testToBean_DynaBean__BigInteger_BigDecimal() { public void testToBean_DynaBean__BigInteger_Double() {
BigInteger l = new BigDecimal( "1.7976931348623157E308" ).toBigInteger(); BigInteger l = new BigDecimal( "1.7976931348623157E308" ).toBigInteger();
BigDecimal m = new BigDecimal( "1.7976931348623157E307" ).add( new BigDecimal( "0.0001" ) ); BigDecimal m = new BigDecimal( "1.7976931348623157E307" ).add( new BigDecimal( "0.0001" ) );
JSONObject json = new JSONObject().element( "i", BigInteger.ZERO )
.element( "d", MorphUtils.BIGDECIMAL_ONE )
.element( "bi", l )
.element( "bd", m );
Object bean = JSONObject.toBean( json );
Object i = ((MorphDynaBean) bean).get( "i" );
Object d = ((MorphDynaBean) bean).get( "d" );
assertTrue( i instanceof Integer );
assertTrue( d instanceof Integer );
Object bi = ((MorphDynaBean) bean).get( "bi" );
Object bd = ((MorphDynaBean) bean).get( "bd" );
assertTrue( bi instanceof BigInteger );
assertTrue( bd instanceof Double );
}
public void testToBean_DynaBean__BigInteger_BigDecimal() {
BigInteger l = new BigDecimal( "1.7976931348623157E308" ).toBigInteger();
BigDecimal m = new BigDecimal( "-1.7976931348623157E309" ).add( new BigDecimal( "0.0001" ) );
JSONObject json = new JSONObject().element( "i", BigInteger.ZERO ) JSONObject json = new JSONObject().element( "i", BigInteger.ZERO )
.element( "d", MorphUtils.BIGDECIMAL_ONE ) .element( "d", MorphUtils.BIGDECIMAL_ONE )
.element( "bi", l ) .element( "bi", l )

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sf.json.sample;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* @author Andres Almiray <aalmiray@users.sourceforge.net>
*/
public class BeanD extends BeanA {
private Double[] doublearray = new Double[3];
public Double[] getDoublearray() {
return doublearray;
}
public void setDoublearray(Double[] doublearray) {
this.doublearray = doublearray;
}
public String toString() {
return ToStringBuilder.reflectionToString( this, ToStringStyle.MULTI_LINE_STYLE );
}
}

View File

@@ -17,6 +17,7 @@
package net.sf.json.util; package net.sf.json.util;
import java.io.StringWriter; import java.io.StringWriter;
import java.math.BigDecimal;
import junit.framework.TestCase; import junit.framework.TestCase;
import net.sf.json.JSONFunction; import net.sf.json.JSONFunction;
@@ -93,7 +94,7 @@ public class TestJSONBuilder extends TestCase {
.endObject(); .endObject();
JSONObject jsonObj = JSONObject.fromObject( w.toString() ); JSONObject jsonObj = JSONObject.fromObject( w.toString() );
assertEquals( Boolean.TRUE, jsonObj.get( "bool" ) ); assertEquals( Boolean.TRUE, jsonObj.get( "bool" ) );
assertEquals( new Double( 1.1d ), jsonObj.get( "numDouble" ) ); assertEquals( Double.valueOf( "1.1" ), jsonObj.get( "numDouble" ) );
assertEquals( new Long( 2 ).longValue(), ((Number) jsonObj.get( "numInt" )).longValue() ); assertEquals( new Long( 2 ).longValue(), ((Number) jsonObj.get( "numInt" )).longValue() );
assertEquals( "text", jsonObj.get( "text" ) ); assertEquals( "text", jsonObj.get( "text" ) );
assertTrue( JSONUtils.isFunction( jsonObj.get( "func" ) ) ); assertTrue( JSONUtils.isFunction( jsonObj.get( "func" ) ) );

View File

@@ -20,6 +20,8 @@ import junit.framework.TestCase;
import net.sf.json.JSONFunction; import net.sf.json.JSONFunction;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import java.math.BigDecimal;
/** /**
* @author Andres Almiray <aalmiray@users.sourceforge.net> * @author Andres Almiray <aalmiray@users.sourceforge.net>
*/ */
@@ -85,7 +87,7 @@ public class TestJSONStringer extends TestCase {
.endObject(); .endObject();
JSONObject jsonObj = JSONObject.fromObject( b.toString() ); JSONObject jsonObj = JSONObject.fromObject( b.toString() );
assertEquals( Boolean.TRUE, jsonObj.get( "bool" ) ); assertEquals( Boolean.TRUE, jsonObj.get( "bool" ) );
assertEquals( new Double( 1.1d ), jsonObj.get( "numDouble" ) ); assertEquals( Double.valueOf( "1.1" ), jsonObj.get( "numDouble" ) );
assertEquals( new Long( 2 ).longValue(), ((Number) jsonObj.get( "numInt" )).longValue() ); assertEquals( new Long( 2 ).longValue(), ((Number) jsonObj.get( "numInt" )).longValue() );
assertEquals( "text", jsonObj.get( "text" ) ); assertEquals( "text", jsonObj.get( "text" ) );
assertTrue( JSONUtils.isFunction( jsonObj.get( "func" ) ) ); assertTrue( JSONUtils.isFunction( jsonObj.get( "func" ) ) );

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.libraries</groupId>
<artifactId>simpleexcel-2.1-20190507</artifactId> <artifactId>simpleexcel-2.2-20190722</artifactId>
<version>6.0.0</version> <version>6.0.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@@ -12,17 +12,21 @@
// ============================================================================ // ============================================================================
package com.talend.excel.xssf.event; package com.talend.excel.xssf.event;
import org.apache.poi.ooxml.util.PackageHelper;
import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.poifs.crypt.Decryptor;
import org.apache.poi.poifs.crypt.EncryptionInfo;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable; import org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable;
import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.eventusermodel.XSSFReader;
import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.model.StylesTable;
import org.apache.poi.ooxml.util.PackageHelper;
import org.xml.sax.ContentHandler; import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.xml.sax.XMLReader; import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory; import org.xml.sax.helpers.XMLReaderFactory;
import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@@ -32,7 +36,6 @@ import java.util.concurrent.FutureTask;
/** /**
* created by wwang on 2012-9-27 Detailled comment * created by wwang on 2012-9-27 Detailled comment
*
*/ */
public class ExcelReader implements Callable { public class ExcelReader implements Callable {
@@ -46,6 +49,8 @@ public class ExcelReader implements Callable {
private String charset = "UTF-8"; private String charset = "UTF-8";
private String password = null;
private java.io.InputStream is; private java.io.InputStream is;
private List<String> sheetNames = new ArrayList<String>(); private List<String> sheetNames = new ArrayList<String>();
@@ -64,15 +69,17 @@ public class ExcelReader implements Callable {
task = new Thread(futureTask); task = new Thread(futureTask);
} }
public void parse(String fileURL, String charset) { public void parse(String fileURL, String charset, String password) {
this.fileURL = fileURL; this.fileURL = fileURL;
this.charset = charset; this.charset = charset;
this.password = password;
task.start(); task.start();
} }
public void parse(java.io.InputStream is, String charset) { public void parse(java.io.InputStream is, String charset, String password) {
this.is = is; this.is = is;
this.charset = charset; this.charset = charset;
this.password = password;
task.start(); task.start();
} }
@@ -120,11 +127,25 @@ public class ExcelReader implements Callable {
public Object call() throws Exception { public Object call() throws Exception {
OPCPackage pkg = null; OPCPackage pkg = null;
POIFSFileSystem fs = null;
try { try {
if (fileURL != null) { if (password != null) {
pkg = OPCPackage.open(fileURL); if (fileURL != null) {
fs = new POIFSFileSystem(new File(fileURL));
} else {
fs = new POIFSFileSystem(is);
}
Decryptor d = Decryptor.getInstance(new EncryptionInfo(fs));
if (!d.verifyPassword(password)) {
throw new RuntimeException("Error: Cannot decrypt Excel file. Invalid password.");
}
pkg = OPCPackage.open(d.getDataStream(fs));
} else { } else {
pkg = PackageHelper.open(is); if (fileURL != null) {
pkg = OPCPackage.open(fileURL);
} else {
pkg = PackageHelper.open(is);
}
} }
XSSFReader r = new XSSFReader(pkg); XSSFReader r = new XSSFReader(pkg);
@@ -204,6 +225,9 @@ public class ExcelReader implements Callable {
if (pkg != null) { if (pkg != null) {
pkg.revert(); pkg.revert();
} }
if (fs != null) {
fs.close();
}
cache.notifyErrorOccurred(); cache.notifyErrorOccurred();
} }
return null; return null;

View File

@@ -7,7 +7,7 @@
<groupId>org.talend.libraries</groupId> <groupId>org.talend.libraries</groupId>
<artifactId>talend-codegen-utils</artifactId> <artifactId>talend-codegen-utils</artifactId>
<!-- release for revert version of library --> <!-- release for revert version of library -->
<version>0.25.4</version> <version>0.28.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

View File

@@ -51,6 +51,8 @@ public final class TypeConverter {
public static final String LIST = "id_List"; public static final String LIST = "id_List";
public static final String OBJECT = "id_Object";
private TypeConverter() { private TypeConverter() {
// Class provides static utility methods and shouldn't be instantiated // Class provides static utility methods and shouldn't be instantiated
} }
@@ -167,6 +169,8 @@ public final class TypeConverter {
return SHORT; return SHORT;
case "java.util.Date": case "java.util.Date":
return DATE; return DATE;
case "java.lang.Object":
return OBJECT;
default: default:
throw new UnsupportedOperationException("Unrecognized java class " + javaClass); throw new UnsupportedOperationException("Unrecognized java class " + javaClass);
} }

View File

@@ -5,9 +5,9 @@
> >
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.components.lib</groupId>
<artifactId>talend-db-exasol</artifactId> <artifactId>talend-db-exasol</artifactId>
<version>2.1.3</version> <version>2.1.4</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>talend-db-exasol</name> <name>talend-db-exasol</name>

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.libraries</groupId>
<artifactId>talendExcel-1.4-20190531</artifactId> <artifactId>talendExcel-1.5-20190731</artifactId>
<version>6.0.0</version> <version>6.0.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@@ -3,6 +3,7 @@ package org.talend;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Date; import java.util.Date;
@@ -10,17 +11,23 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.poifs.crypt.EncryptionInfo;
import org.apache.poi.poifs.crypt.EncryptionMode;
import org.apache.poi.poifs.crypt.Encryptor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.ss.usermodel.FormulaEvaluator; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbookType;
public class ExcelTool { public class ExcelTool {
@@ -70,6 +77,8 @@ public class ExcelTool {
private boolean isTrackAllColumns = false; private boolean isTrackAllColumns = false;
private String password = null;
public ExcelTool() { public ExcelTool() {
cellStylesMapping = new HashMap<>(); cellStylesMapping = new HashMap<>();
} }
@@ -110,21 +119,7 @@ public class ExcelTool {
initPreXlsx(fileName); initPreXlsx(fileName);
} }
if (appendWorkbook) { if (appendWorkbook) {
InputStream inp = new FileInputStream(fileName); appendActionForFile(fileName);
wb = WorkbookFactory.create(inp);
sheet = wb.getSheet(sheetName);
if (sheet != null) {
if (appendSheet) {
if (sheet.getLastRowNum() != 0 || sheet.getRow(0) != null) {
curY = sheet.getLastRowNum() + 1;
}
} else {
wb.removeSheetAt(wb.getSheetIndex(sheetName));
sheet = wb.createSheet(sheetName);
}
} else {
sheet = wb.createSheet(sheetName);
}
} else { } else {
xlsxFile.delete(); xlsxFile.delete();
wb = new SXSSFWorkbook(rowAccessWindowSize); wb = new SXSSFWorkbook(rowAccessWindowSize);
@@ -140,6 +135,47 @@ public class ExcelTool {
} }
} }
public void prepareXlsmFile(String fileName) throws Exception {
File xlsmFile = new File(fileName);
if (xlsmFile.exists()) {
if (isAbsY && keepCellFormat) {
initPreXlsx(fileName);
}
if (appendWorkbook) {
appendActionForFile(fileName);
} else {
xlsmFile.delete();
wb = new SXSSFWorkbook(new XSSFWorkbook(XSSFWorkbookType.XLSM), rowAccessWindowSize);
sheet = wb.createSheet(sheetName);
}
} else {
wb = new SXSSFWorkbook(new XSSFWorkbook(XSSFWorkbookType.XLSM), rowAccessWindowSize);
sheet = wb.createSheet(sheetName);
}
if (isAbsY) {
startX = absX;
curY = absY;
}
}
private void appendActionForFile(String fileName) throws IOException {
InputStream inp = new FileInputStream(fileName);
wb = WorkbookFactory.create(inp);
sheet = wb.getSheet(sheetName);
if (sheet != null) {
if (appendSheet) {
if (sheet.getLastRowNum() != 0 || sheet.getRow(0) != null) {
curY = sheet.getLastRowNum() + 1;
}
} else {
wb.removeSheetAt(wb.getSheetIndex(sheetName));
sheet = wb.createSheet(sheetName);
}
} else {
sheet = wb.createSheet(sheetName);
}
}
/** /**
* *
* @return start insert row index. * @return start insert row index.
@@ -302,13 +338,14 @@ public class ExcelTool {
} }
public void writeExcel(OutputStream outputStream) throws Exception { public void writeExcel(OutputStream outputStream) throws Exception {
try { try {
wb.write(outputStream); wb.write(outputStream);
} finally { wb.close();
if(outputStream != null) { } finally {
outputStream.close(); if (outputStream != null) {
} outputStream.close();
} }
}
} }
public void writeExcel(String fileName, boolean createDir) throws Exception { public void writeExcel(String fileName, boolean createDir) throws Exception {
@@ -319,14 +356,29 @@ public class ExcelTool {
pFile.mkdirs(); pFile.mkdirs();
} }
} }
FileOutputStream fileOutput = new FileOutputStream(fileName);
if (appendWorkbook && appendSheet && recalculateFormula) { if (appendWorkbook && appendSheet && recalculateFormula) {
evaluateFormulaCell(); evaluateFormulaCell();
} }
FileOutputStream fileOutput = new FileOutputStream(fileName);
POIFSFileSystem fs = null;
try { try {
wb.write(fileOutput); if (password == null) {
wb.write(fileOutput);
} else {
fs = new POIFSFileSystem();
Encryptor encryptor = new EncryptionInfo(EncryptionMode.agile).getEncryptor();
encryptor.confirmPassword(password);
OutputStream encryptedDataStream = encryptor.getDataStream(fs);
wb.write(encryptedDataStream);
encryptedDataStream.close(); // this is mandatory to do that at that point
fs.writeFilesystem(fileOutput);
}
} finally { } finally {
fileOutput.close(); wb.close();
fileOutput.close();
if (fs != null) {
fs.close();
}
} }
} }
@@ -349,4 +401,9 @@ public class ExcelTool {
((SXSSFSheet) sheet).flushRows(); ((SXSSFSheet) sheet).flushRows();
} }
} }
public void setPasswordProtection(String password) {
this.password = password;
}
} }

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.libraries</groupId>
<artifactId>talendzip</artifactId> <artifactId>talendzip</artifactId>
<version>1.0-20190527</version> <version>1.0-20190917</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
@@ -40,18 +40,18 @@
<dependency> <dependency>
<groupId>net.lingala.zip4j</groupId> <groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId> <artifactId>zip4j</artifactId>
<version>1.3.1</version> <version>1.3.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId> <artifactId>commons-compress</artifactId>
<version>1.10</version> <version>1.19</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.libraries</groupId>
<artifactId>checkArchive-1.1-20181130</artifactId> <artifactId>checkArchive-1.1-20190917</artifactId>
<version>6.0.0</version> <version>6.0.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -1,5 +1,7 @@
package com.talend.compress.zip; package com.talend.compress.zip;
import java.io.IOException;
public class Util { public class Util {
public java.util.List<UnzippedFile> unzippedFiles = new java.util.ArrayList<UnzippedFile>(); public java.util.List<UnzippedFile> unzippedFiles = new java.util.ArrayList<UnzippedFile>();
@@ -53,6 +55,10 @@ public class Util {
f = new java.io.File(path, shortName); f = new java.io.File(path, shortName);
} }
if(!f.getCanonicalPath().startsWith(new java.io.File(path).getCanonicalPath())) {
throw new IOException("expanding " + f.getName()
+ " would create file outside of " + path);
}
checkDir(f); checkDir(f);
f.getParentFile().mkdirs(); f.getParentFile().mkdirs();
@@ -89,6 +95,10 @@ public class Util {
f = new java.io.File(path, shortName); f = new java.io.File(path, shortName);
} }
if(!f.getCanonicalPath().startsWith(new java.io.File(path).getCanonicalPath())) {
throw new IOException("expanding " + f.getName()
+ " would create file outside of " + path);
}
if (isDirectory) { if (isDirectory) {
if (!f.exists()) { if (!f.exists()) {
f.mkdirs(); f.mkdirs();

View File

@@ -5,9 +5,9 @@
> >
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId> <groupId>org.talend.components.lib</groupId>
<artifactId>thashfile</artifactId> <artifactId>thashfile</artifactId>
<version>3.0-20170711</version> <version>3.1-20190910</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>thashfile</name> <name>thashfile</name>
@@ -45,8 +45,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>3.5.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.8</source>
<target>1.7</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>

View File

@@ -9,45 +9,44 @@ import java.util.concurrent.ConcurrentHashMap;
import org.talend.designer.components.hashfile.memory.AdvancedMemoryHashFile; import org.talend.designer.components.hashfile.memory.AdvancedMemoryHashFile;
public class MapHashFile { public class MapHashFile {
//use this map instead of globalMap // use this map instead of globalMap
private Map<String, AdvancedMemoryHashFile> resourceMap = new ConcurrentHashMap<>(); private Map<String, AdvancedMemoryHashFile> resourceMap = new ConcurrentHashMap<>();
//keep the present key of AdvancedMemoryHashFile as key and the previous key as value // keep the present key of AdvancedMemoryHashFile as key and the previous key as
// value
private Map<String, String> keyMap = new ConcurrentHashMap<>(); private Map<String, String> keyMap = new ConcurrentHashMap<>();
//singleton // singleton
private static final MapHashFile mhf = new MapHashFile(); private static final MapHashFile mhf = new MapHashFile();
public static TalendMultiThreadLockMap resourceLockMap = new TalendMultiThreadLockMap(); public static TalendMultiThreadLockMap resourceLockMap = new TalendMultiThreadLockMap();
public static class TalendMultiThreadLockMap { public static class TalendMultiThreadLockMap {
private Map<Object, Object> tMultiTheadLockMap = new HashMap<Object, Object>(); private Map<Object, Object> tMultiTheadLockMap = new ConcurrentHashMap<>();
public Object get(Object key) {
return tMultiTheadLockMap.computeIfAbsent(key, k -> new Object());
}
public void remove(Object key) {
tMultiTheadLockMap.remove(key);
}
}
public synchronized Object get(Object key) {
if (tMultiTheadLockMap.get(key) == null) {
tMultiTheadLockMap.put(key, new Object());
}
return tMultiTheadLockMap.get(key);
}
public synchronized void remove(Object key){
tMultiTheadLockMap.remove(key);
}
}
private MapHashFile() { private MapHashFile() {
} }
public static MapHashFile getMapHashFile() { public static MapHashFile getMapHashFile() {
return mhf; return mhf;
} }
//get the linked AdvancedMemoryHashFile // get the linked AdvancedMemoryHashFile
public AdvancedMemoryHashFile getAdvancedMemoryHashFile(String key) { public AdvancedMemoryHashFile getAdvancedMemoryHashFile(String key) {
AdvancedMemoryHashFile amhf = resourceMap.get(key); AdvancedMemoryHashFile amhf = resourceMap.get(key);
String prekey = keyMap.get(key); String prekey = keyMap.get(key);
//if present AdvancedMemoryHashFile is null get the AdvancedMemoryHashFile before present. // if present AdvancedMemoryHashFile is null get the AdvancedMemoryHashFile
// before present.
int size = keyMap.size(); int size = keyMap.size();
while(amhf==null && (size--)>0){ while (amhf == null && (size--) > 0) {
amhf = resourceMap.get(prekey); amhf = resourceMap.get(prekey);
prekey = keyMap.get(prekey); prekey = keyMap.get(prekey);
} }
@@ -61,16 +60,18 @@ public class MapHashFile {
public Map<String, String> getKeyMap() { public Map<String, String> getKeyMap() {
return keyMap; return keyMap;
} }
public void clearCache(String key){
public void clearCache(String key) {
clearChildCache(getRootCache(key)); clearChildCache(getRootCache(key));
} }
public void clearChildCache(String root){
public void clearChildCache(String root) {
Set<String> set = keyMap.keySet(); Set<String> set = keyMap.keySet();
synchronized(keyMap) { synchronized (keyMap) {
Iterator<String> it = set.iterator(); Iterator<String> it = set.iterator();
while(it.hasNext()){ while (it.hasNext()) {
String key = it.next(); String key = it.next();
if(root.equals(keyMap.get(key))){ if (root.equals(keyMap.get(key))) {
this.resourceMap.remove(key); this.resourceMap.remove(key);
this.keyMap.remove(key); this.keyMap.remove(key);
clearChildCache(key); clearChildCache(key);
@@ -79,11 +80,11 @@ public class MapHashFile {
} }
this.resourceMap.remove(root); this.resourceMap.remove(root);
} }
public String getRootCache(String cache){ public String getRootCache(String cache) {
String root; String root;
while((root = keyMap.get(cache))!=null){ while ((root = keyMap.get(cache)) != null) {
cache=root; cache = root;
} }
return cache; return cache;
} }

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>7.3.1-SNAPSHOT</version> <version>7.3.1-M2</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.libs</artifactId> <artifactId>org.talend.designer.components.libs</artifactId>

View File

@@ -32,6 +32,7 @@
String gsFileHeader = ElementParameterParser.getValue(node, "__GS_FILE_HEADER__"); String gsFileHeader = ElementParameterParser.getValue(node, "__GS_FILE_HEADER__");
String tokenFile = ElementParameterParser.getValue(node,"__TOKEN_NAME__"); String tokenFile = ElementParameterParser.getValue(node,"__TOKEN_NAME__");
boolean isLog4jEnabled = ElementParameterParser.getBooleanValue(node.getProcess(), "__LOG4J_ACTIVATE__"); boolean isLog4jEnabled = ElementParameterParser.getBooleanValue(node.getProcess(), "__LOG4J_ACTIVATE__");
boolean dropTable = ElementParameterParser.getBooleanValue(node, "__DROP__");
String passwordFieldName = ""; String passwordFieldName = "";
@@ -260,77 +261,117 @@
com.google.api.services.bigquery.model.JobConfiguration config_<%=cid%> = new com.google.api.services.bigquery.model.JobConfiguration(); com.google.api.services.bigquery.model.JobConfiguration config_<%=cid%> = new com.google.api.services.bigquery.model.JobConfiguration();
com.google.api.services.bigquery.model.JobConfigurationLoad queryLoad_<%=cid%> = new com.google.api.services.bigquery.model.JobConfigurationLoad(); com.google.api.services.bigquery.model.JobConfigurationLoad queryLoad_<%=cid%> = new com.google.api.services.bigquery.model.JobConfigurationLoad();
<%if (createTableIfNotExist) { %> <%if (dropTable) {%>
com.google.api.services.bigquery.model.TableSchema schema_<%=cid%> = new com.google.api.services.bigquery.model.TableSchema(); try {
bigqueryclient_<%=cid%>.tables().delete(PROJECT_ID_<%=cid%>, <%=dataset%>, <%=table%>).execute();
<% } catch (com.google.api.client.googleapis.json.GoogleJsonResponseException e_<%=cid%>) {
if(isLog4jEnabled){ if (e_<%=cid%>.getDetails().getCode() != 404) {
%> <%
log.info("<%=cid%> - Table field schema:"); if(dieOnError) {
<% %>
} throw e_<%=cid%>;
%> <%
java.util.List<com.google.api.services.bigquery.model.TableFieldSchema> fields_<%=cid%> = new java.util.ArrayList<com.google.api.services.bigquery.model.TableFieldSchema>(); } else {
<%
List<IMetadataTable> metadatas = node.getMetadataList();
if ((metadatas!=null) && (metadatas.size() > 0)) {
IMetadataTable metadata = metadatas.get(0);
if (metadata != null) {
List<IMetadataColumn> columns = metadata.getListColumns();
int nbColumns = columns.size();
for (int i = 0; i < nbColumns; i++ ) {
IMetadataColumn column = columns.get(i);
String columnName = column.getLabel();
String typeToGenerate = "string";
if("id_Float".equals(column.getTalendType()) || "id_Double".equals(column.getTalendType())) {
typeToGenerate = "float";
}else if("id_Integer".equals(column.getTalendType()) || "id_Long".equals(column.getTalendType()) || "id_Short".equals(column.getTalendType())) {
typeToGenerate = "integer";
} else if("id_Character".equals(column.getTalendType())) {
typeToGenerate = "string";
} else if("id_BigDecimal".equals(column.getTalendType())) {
typeToGenerate = "numeric";
} else if("id_Boolean".equals(column.getTalendType())) {
typeToGenerate = "boolean";
} else if("id_Date".equals(column.getTalendType())) {
String pattern = column.getPattern();
if(pattern.length() == 12 || pattern.isEmpty() || "\"\"".equals(pattern)) {
typeToGenerate = "date";
}else if(pattern.length() > 12){
typeToGenerate = "timestamp";
}else{
typeToGenerate = "string";
}
}
String modeType = (!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){ if(isLog4jEnabled){
%> %>
log.debug("<%=cid%> - Field index[<%=i%>] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\",\"mode\":\"<%=modeType%>\"}"); log.error("<%=cid%> - "+ e_<%=cid%>.getDetails().getMessage());
<% <%
} }
%>
System.err.println(e_<%=cid%>.getDetails().getMessage());
<%
} }
%>
} }
} }
%> <%}%>
<%if (createTableIfNotExist) { %>
try {
schema_<%=cid%>.setFields(fields_<%=cid%>); com.google.api.services.bigquery.model.Table getTable = bigqueryclient_<%=cid%>.tables().get(PROJECT_ID_<%=cid%>, <%=dataset%>, <%=table%>).execute();
queryLoad_<%=cid%>.setCreateDisposition("CREATE_NEVER");
queryLoad_<%=cid%>.setSchema(schema_<%=cid%>); } catch (com.google.api.client.googleapis.json.GoogleJsonResponseException e_<%=cid%>){
if (e_<%=cid%>.getDetails().getCode() == 404) {
com.google.api.services.bigquery.model.TableSchema schema_<%=cid%> = new com.google.api.services.bigquery.model.TableSchema();
<% <%
} if(isLog4jEnabled){
if(createTableIfNotExist) { %>
%> log.info("<%=cid%> - Table field schema:");
queryLoad_<%=cid%>.setCreateDisposition("CREATE_IF_NEEDED"); <%
}
%>
java.util.List<com.google.api.services.bigquery.model.TableFieldSchema> fields_<%=cid%> = new java.util.ArrayList<com.google.api.services.bigquery.model.TableFieldSchema>();
<%
List<IMetadataTable> metadatas = node.getMetadataList();
if ((metadatas!=null) && (metadatas.size() > 0)) {
IMetadataTable metadata = metadatas.get(0);
if (metadata != null) {
List<IMetadataColumn> columns = metadata.getListColumns();
int nbColumns = columns.size();
for (int i = 0; i < nbColumns; i++ ) {
IMetadataColumn column = columns.get(i);
String columnName = column.getLabel();
String typeToGenerate = "string";
if("id_Float".equals(column.getTalendType()) || "id_Double".equals(column.getTalendType())) {
typeToGenerate = "float";
}else if("id_Integer".equals(column.getTalendType()) || "id_Long".equals(column.getTalendType()) || "id_Short".equals(column.getTalendType())) {
typeToGenerate = "integer";
} else if("id_Character".equals(column.getTalendType())) {
typeToGenerate = "string";
} else if("id_BigDecimal".equals(column.getTalendType())) {
typeToGenerate = "numeric";
} else if("id_Boolean".equals(column.getTalendType())) {
typeToGenerate = "boolean";
} else if("id_Date".equals(column.getTalendType())) {
String pattern = column.getPattern();
if(pattern.length() == 12 || pattern.isEmpty() || "\"\"".equals(pattern)) {
typeToGenerate = "date";
}else if(pattern.length() > 12){
typeToGenerate = "timestamp";
}else{
typeToGenerate = "string";
}
}
String modeType = (!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[<%=i%>] {\"name\":\"<%=columnName%>\",\"type\":\"<%=typeToGenerate%>\",\"mode\":\"<%=modeType%>\"}");
<%
}
}
}
}
%>
schema_<%=cid%>.setFields(fields_<%=cid%>);
queryLoad_<%=cid%>.setSchema(schema_<%=cid%>);
queryLoad_<%=cid%>.setCreateDisposition("CREATE_IF_NEEDED");
} else {
<%
if(dieOnError) {
%>
throw e_<%=cid%>;
<%
} else {
if(isLog4jEnabled){
%>
log.error("<%=cid%> - "+ e_<%=cid%>.getDetails().getMessage());
<%
}
%>
System.err.println(e_<%=cid%>.getDetails().getMessage());
<%
}
%>
}
}
<% <%
} else { } else {
%> %>
@@ -456,12 +497,11 @@
%> %>
/* ----START-CREATING-JOB (Cloud API)---- */ /* ----START-CREATING-JOB (Cloud API)---- */
com.google.cloud.bigquery.TableId tableId_<%=cid%> = com.google.cloud.bigquery.TableId.of(<%=projectId%>, <%=dataset%>, <%=table%>); com.google.cloud.bigquery.TableId tableId_<%=cid%> = com.google.cloud.bigquery.TableId.of(<%=projectId%>, <%=dataset%>, <%=table%>);
com.google.cloud.bigquery.Table table_<%=cid%> = bigquery_<%=cid%>.getTable(tableId_<%=cid%>);
com.google.cloud.bigquery.LoadJobConfiguration.Builder loadJobBuilder_<%=cid%> = com.google.cloud.bigquery.LoadJobConfiguration.newBuilder(tableId_<%=cid%>, <%=gsFile%>); com.google.cloud.bigquery.LoadJobConfiguration.Builder loadJobBuilder_<%=cid%> = com.google.cloud.bigquery.LoadJobConfiguration.newBuilder(tableId_<%=cid%>, <%=gsFile%>);
boolean dropTable_<%=cid%> = <%=ElementParameterParser.getBooleanValue(node, "__DROP__")%>; boolean dropTable_<%=cid%> = <%=dropTable%>;
if ( dropTable_<%=cid%> && table_<%=cid%> != null) { if (dropTable_<%=cid%> && bigquery_<%=cid%>.getTable(tableId_<%=cid%>) != null) {
boolean deleted = bigquery_<%=cid%>.delete(tableId_<%=cid%>); boolean deleted = bigquery_<%=cid%>.delete(tableId_<%=cid%>);
if (deleted) { if (deleted) {
<% <%
@@ -475,8 +515,9 @@
throw new RuntimeException("Unable to delete table " + tableId_<%=cid%>); throw new RuntimeException("Unable to delete table " + tableId_<%=cid%>);
} }
} }
<%if(createTableIfNotExist){%> <%if(createTableIfNotExist){%>
if(table_<%=cid%> == null){ if(bigquery_<%=cid%>.getTable(tableId_<%=cid%>) == null){
java.util.List<com.google.cloud.bigquery.Field> fields_<%=cid%> = new java.util.ArrayList<>(); java.util.List<com.google.cloud.bigquery.Field> fields_<%=cid%> = new java.util.ArrayList<>();
<% <%
List<IMetadataTable> metadatas = node.getMetadataList(); List<IMetadataTable> metadatas = node.getMetadataList();
@@ -529,22 +570,17 @@
com.google.cloud.bigquery.Schema schema_<%=cid%> = com.google.cloud.bigquery.Schema.of(fields_<%=cid%>); com.google.cloud.bigquery.Schema schema_<%=cid%> = com.google.cloud.bigquery.Schema.of(fields_<%=cid%>);
com.google.cloud.bigquery.TableInfo tableInfo_<%=cid%> = com.google.cloud.bigquery.TableInfo.newBuilder(tableId_<%=cid%>, com.google.cloud.bigquery.StandardTableDefinition.of(schema_<%=cid%>)).build(); com.google.cloud.bigquery.TableInfo tableInfo_<%=cid%> = com.google.cloud.bigquery.TableInfo.newBuilder(tableId_<%=cid%>, com.google.cloud.bigquery.StandardTableDefinition.of(schema_<%=cid%>)).build();
table_<%=cid%> = bigquery_<%=cid%>.create(tableInfo_<%=cid%>); com.google.cloud.bigquery.Table table_<%=cid%> = bigquery_<%=cid%>.create(tableInfo_<%=cid%>);
loadJobBuilder_<%=cid%>.setSchema(schema_<%=cid%>); loadJobBuilder_<%=cid%>.setSchema(schema_<%=cid%>);
}
<%}
if(createTableIfNotExist) {
%>
loadJobBuilder_<%=cid%>.setCreateDisposition(com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_IF_NEEDED); loadJobBuilder_<%=cid%>.setCreateDisposition(com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_IF_NEEDED);
<%
} else { } else {
%>
loadJobBuilder_<%=cid%>.setCreateDisposition(com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_NEVER); loadJobBuilder_<%=cid%>.setCreateDisposition(com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_NEVER);
<%
} }
%> <%} else {%>
loadJobBuilder_<%=cid%>.setCreateDisposition(com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_NEVER);
<%}%>
loadJobBuilder_<%=cid%>.setWriteDisposition(com.google.cloud.bigquery.JobInfo.WriteDisposition.WRITE_<%=actionOnData%>); loadJobBuilder_<%=cid%>.setWriteDisposition(com.google.cloud.bigquery.JobInfo.WriteDisposition.WRITE_<%=actionOnData%>);
loadJobBuilder_<%=cid%>.setDestinationTable(tableId_<%=cid%>); loadJobBuilder_<%=cid%>.setDestinationTable(tableId_<%=cid%>);
com.google.cloud.bigquery.CsvOptions.Builder csvOptions_<%=cid%> = com.google.cloud.bigquery.CsvOptions.newBuilder(); com.google.cloud.bigquery.CsvOptions.Builder csvOptions_<%=cid%> = com.google.cloud.bigquery.CsvOptions.newBuilder();

View File

@@ -173,7 +173,7 @@
SHOW_IF="(SET_FIELD_DELIMITER == 'true')"> SHOW_IF="(SET_FIELD_DELIMITER == 'true')">
<DEFAULT>","</DEFAULT> <DEFAULT>","</DEFAULT>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="DROP" FIELD="CHECK" REQUIRED="true" NUM_ROW="25" SHOW_IF="AUTH_MODE == 'SERVICEACCOUNT'"> <PARAMETER NAME="DROP" FIELD="CHECK" REQUIRED="true" NUM_ROW="25">
<DEFAULT>false</DEFAULT> <DEFAULT>false</DEFAULT>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ENCODING" FIELD="ENCODING_TYPE" NUM_ROW="30" <PARAMETER NAME="ENCODING" FIELD="ENCODING_TYPE" NUM_ROW="30"

View File

@@ -221,10 +221,9 @@
} }
String query_<%=cid%> = <%=query%>; String query_<%=cid%> = <%=query%>;
String dataset = query_<%=cid%>.substring(query_<%=cid%>.indexOf("from") + 4, query_<%=cid%>.indexOf(".")).trim(); <% if(isLog4jEnabled) { %>
String temp_table = "temp_" + dataset + java.util.UUID.randomUUID().toString().replaceAll("-", "") log.info("<%=cid%> - query " + <%=query%>);
+ "<%=cid%>".toLowerCase().replaceAll("[^a-z0-9]", "0").replaceAll("^[^a-z]", "a") <% } %>
+ Integer.toHexString(java.util.concurrent.ThreadLocalRandom.current().nextInt());
com.google.cloud.bigquery.BigQuery bigquery_<%=cid%> = com.google.cloud.bigquery.BigQueryOptions.newBuilder() com.google.cloud.bigquery.BigQuery bigquery_<%=cid%> = com.google.cloud.bigquery.BigQueryOptions.newBuilder()
.setCredentials(credentials_<%=cid%>) .setCredentials(credentials_<%=cid%>)
@@ -233,25 +232,55 @@
.getService(); .getService();
com.google.cloud.bigquery.QueryJobConfiguration.Builder queryConfiguration_<%=cid%> = com.google.cloud.bigquery.QueryJobConfiguration.newBuilder(<%=query%>).setUseLegacySql(<%=useLegacySql%>); com.google.cloud.bigquery.QueryJobConfiguration.Builder queryConfiguration_<%=cid%> = com.google.cloud.bigquery.QueryJobConfiguration.newBuilder(<%=query%>).setUseLegacySql(<%=useLegacySql%>);
<%
if (resultSizeType.equals("LARGE") || resultSizeType.equals("AUTO")) {
%>
queryConfiguration_<%=cid%>.setDestinationTable(com.google.cloud.bigquery.TableId.of(dataset, temp_table)).setAllowLargeResults(true);
<%
}
%>
com.google.cloud.bigquery.JobId jobId_<%=cid%> = com.google.cloud.bigquery.JobId.of(java.util.UUID.randomUUID().toString());
com.google.cloud.bigquery.Job job_<%=cid%> = bigquery_<%=cid%>.create(com.google.cloud.bigquery.JobInfo.newBuilder(queryConfiguration_<%=cid%>.build()).setJobId(jobId_<%=cid%>).build());
<% <%if (resultSizeType.equals("LARGE") || resultSizeType.equals("AUTO")) {%>
if(isLog4jEnabled){
%> com.google.cloud.bigquery.QueryJobConfiguration jobConfDryRun_<%=cid%> = queryConfiguration_<%=cid%> .setDryRun(true).build();
com.google.cloud.bigquery.Job jobDryRun_<%=cid%> = bigquery_<%=cid%>.create(com.google.cloud.bigquery.JobInfo.of(jobConfDryRun_<%=cid%>));
String queryLocation_<%=cid%> =jobDryRun_<%=cid%>.getJobId().getLocation();
String location_<%=cid%> = queryLocation_<%=cid%> == null ? "US" : queryLocation_<%=cid%>;
String tempDataset_<%=cid%> = java.util.UUID.randomUUID().toString().replaceAll("-", "")
+ Integer.toHexString(java.util.concurrent.ThreadLocalRandom.current().nextInt())
+ Integer.toHexString(java.util.concurrent.ThreadLocalRandom.current().nextInt());
String tempTable_<%=cid%> = java.util.UUID.randomUUID().toString().replaceAll("-", "")
+ Integer.toHexString(java.util.concurrent.ThreadLocalRandom.current().nextInt())
+ Integer.toHexString(java.util.concurrent.ThreadLocalRandom.current().nextInt());
<% if(isLog4jEnabled){ %>
log.info("<%=cid%> - query location :" + queryLocation_<%=cid%>);
log.info("<%=cid%> - temporary dataset location :" + location_<%=cid%>);
log.info("<%=cid%> - temporary Dataset name : " + tempDataset_<%=cid%>);
log.info("<%=cid%> - temporary table name : " + tempTable_<%=cid%>);
<% } %>
com.google.cloud.bigquery.DatasetInfo datasetInfo_<%=cid%> = com.google.cloud.bigquery.DatasetInfo.newBuilder(tempDataset_<%=cid%>).setLocation(location_<%=cid%>).build();
com.google.cloud.bigquery.Dataset dataset_<%=cid%> = bigquery_<%=cid%> .create(datasetInfo_<%=cid%>);
queryConfiguration_<%=cid%>
.setDryRun(false)
.setAllowLargeResults(true)
.setDestinationTable(com.google.cloud.bigquery.TableId.of(tempDataset_<%=cid%>, tempTable_<%=cid%>));
com.google.cloud.bigquery.JobId jobId_<%=cid%> = com.google.cloud.bigquery.JobId
.newBuilder().setProject(<%=projectId%>)
.setJob(java.util.UUID.randomUUID().toString())
.setLocation(location_<%=cid%>)
.build();
<% if(isLog4jEnabled){ %>
log.info("<%=cid%> - job location : " + jobId_<%=cid%>.getLocation());
<% } %>
<% } else { %>
com.google.cloud.bigquery.JobId jobId_<%=cid%> = com.google.cloud.bigquery.JobId.of(<%=projectId%>,java.util.UUID.randomUUID().toString());
<% } %>
com.google.cloud.bigquery.Job job_<%=cid%> = bigquery_<%=cid%>.create(com.google.cloud.bigquery.JobInfo.newBuilder(queryConfiguration_<%=cid%>.build()).setJobId(jobId_<%=cid%>).build());
<% if(isLog4jEnabled) { %>
log.info("<%=cid%> - Sending job " + jobId_<%=cid%> + " with query: " + <%=query%>); log.info("<%=cid%> - Sending job " + jobId_<%=cid%> + " with query: " + <%=query%>);
<% <% } %>
}
%>
job_<%=cid%> = job_<%=cid%>.waitFor(); job_<%=cid%> = job_<%=cid%>.waitFor();
if (job_<%=cid%> == null) { if (job_<%=cid%> == null) {
@@ -260,13 +289,9 @@
throw new RuntimeException(job_<%=cid%>.getStatus().getError().toString()); throw new RuntimeException(job_<%=cid%>.getStatus().getError().toString());
} }
<% <% if(isLog4jEnabled) { %>
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Job " + jobId_<%=cid%> + " finished successfully."); log.info("<%=cid%> - Job " + jobId_<%=cid%> + " finished successfully.");
<% <% } %>
}
%>
com.google.cloud.bigquery.TableResult result_<%=cid%> = job_<%=cid%>.getQueryResults(); com.google.cloud.bigquery.TableResult result_<%=cid%> = job_<%=cid%>.getQueryResults();
long nb_line_<%=cid%> = 0; long nb_line_<%=cid%> = 0;
<% <%

View File

@@ -10,7 +10,10 @@ imports="
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument(); INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName(); String cid = node.getUniqueName();
String authMode = ElementParameterParser.getValue(node,"__AUTH_MODE__"); String authMode = ElementParameterParser.getValue(node,"__AUTH_MODE__");
String projectId = ElementParameterParser.getValue(node,"__PROJECT_ID__");
String resultSizeType = ElementParameterParser.getValue(node,"__RESULT_SIZE__");
if (authMode.equals("OAUTH")) { if (authMode.equals("OAUTH")) {
%> %>
} }
@@ -24,7 +27,10 @@ imports="
} else if (authMode.equals("SERVICEACCOUNT")) { } else if (authMode.equals("SERVICEACCOUNT")) {
%> %>
} }
bigquery_<%=cid%>.delete(com.google.cloud.bigquery.TableId.of(dataset, temp_table)); <% if (resultSizeType.equals("LARGE") || resultSizeType.equals("AUTO")) { %>
com.google.cloud.bigquery.DatasetId datasetId_<%=cid%> = com.google.cloud.bigquery.DatasetId.of(<%=projectId%>, tempDataset_<%=cid%>);
bigquery_<%=cid%>.delete(datasetId_<%=cid%>, com.google.cloud.bigquery.BigQuery.DatasetDeleteOption.deleteContents());
<% }%>
<% <%
} else { } else {
throw new IllegalArgumentException("authentication mode should be either \"SERVICEACCOUNT\" or \"OAUTH\", but it is " + authMode); throw new IllegalArgumentException("authentication mode should be either \"SERVICEACCOUNT\" or \"OAUTH\", but it is " + authMode);

View File

@@ -188,6 +188,7 @@ COMPATIBILITY="ALL"
<IMPORT NAME="sshj-0_8_1" MODULE="sshj-0.8.1.jar" MVN="mvn:org.talend.libraries/sshj-0.8.1/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/> <IMPORT NAME="sshj-0_8_1" MODULE="sshj-0.8.1.jar" MVN="mvn:org.talend.libraries/sshj-0.8.1/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/>
<IMPORT NAME="sts-2.0.2" MODULE="sts-2.0.2.jar" MVN="mvn:org.talend.libraries/sts-2.0.2/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/> <IMPORT NAME="sts-2.0.2" MODULE="sts-2.0.2.jar" MVN="mvn:org.talend.libraries/sts-2.0.2/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/>
<IMPORT NAME="jaxb-api-2.3.1" MODULE="jaxb-api-2.3.1.jar" MVN="mvn:javax.xml.bind/jaxb-api/2.3.1" REQUIRED="true"/>
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -97,6 +97,7 @@ COMPATIBILITY="ALL"
<IMPORT NAME="sshj-0_8_1" MODULE="sshj-0.8.1.jar" MVN="mvn:org.talend.libraries/sshj-0.8.1/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/> <IMPORT NAME="sshj-0_8_1" MODULE="sshj-0.8.1.jar" MVN="mvn:org.talend.libraries/sshj-0.8.1/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/>
<IMPORT NAME="sts-2.0.2" MODULE="sts-2.0.2.jar" MVN="mvn:org.talend.libraries/sts-2.0.2/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/> <IMPORT NAME="sts-2.0.2" MODULE="sts-2.0.2.jar" MVN="mvn:org.talend.libraries/sts-2.0.2/6.0.0" REQUIRED_IF="PROVIDER=='AWS_EC2'"/>
<IMPORT NAME="jaxb-api-2.3.1" MODULE="jaxb-api-2.3.1.jar" MVN="mvn:javax.xml.bind/jaxb-api/2.3.1" REQUIRED="true"/>
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -898,8 +898,8 @@
<IMPORT NAME="Driver-VERTICA_7.0.1" MODULE="vertica-jdbc-7.0.1-0.jar" MVN="mvn:org.talend.libraries/vertica-jdbc-7.0.1-0/6.0.0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_7_0_X')" /> <IMPORT NAME="Driver-VERTICA_7.0.1" MODULE="vertica-jdbc-7.0.1-0.jar" MVN="mvn:org.talend.libraries/vertica-jdbc-7.0.1-0/6.0.0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_7_0_X')" />
<IMPORT NAME="Driver-VERTICA_7.1.2" MODULE="vertica-jdbc-7.1.2-0.jar" MVN="mvn:org.talend.libraries/vertica-jdbc-7.1.2-0/6.0.0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_7_1_X')" /> <IMPORT NAME="Driver-VERTICA_7.1.2" MODULE="vertica-jdbc-7.1.2-0.jar" MVN="mvn:org.talend.libraries/vertica-jdbc-7.1.2-0/6.0.0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_7_1_X')" />
<IMPORT NAME="Driver-EXASolution" MODULE="exajdbc-6.0.9302.jar" MVN="mvn:org.talend.libraries/exajdbc-6.0.9302/6.3.0" REQUIRED_IF="(DBTYPE=='EXASOL') and (USE_EXISTING_CONNECTION == 'false')" /> <IMPORT NAME="Driver-EXASolution" MODULE="exajdbc-6.0.9302.jar" MVN="mvn:org.talend.libraries/exajdbc-6.0.9302/6.3.0" REQUIRED_IF="(DBTYPE=='EXASOL') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.20.1043.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.20.1043" REQUIRED_IF="(DBTYPE=='REDSHIFT') and (USE_EXISTING_CONNECTION == 'false')" /> <IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.32.1056.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.32.1056" REQUIRED_IF="(DBTYPE=='REDSHIFT') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-Snowflake" MODULE="snowflake-jdbc-3.5.3.jar" MVN="mvn:net.snowflake/snowflake-jdbc/3.5.3" REQUIRED_IF="(DBTYPE=='SNOWFLAKE') and (USE_EXISTING_CONNECTION == 'false')" /> <IMPORT NAME="Driver-Snowflake" MODULE="snowflake-jdbc-3.9.0.jar" MVN="mvn:net.snowflake/snowflake-jdbc/3.9.0" REQUIRED_IF="(DBTYPE=='SNOWFLAKE') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-VERTICA_9.0" MODULE="vertica-jdbc-9.0.0-0.jar" MVN="mvn:org.talend.libraries/vertica-jdbc-9.0.0-0/6.0.0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_9_0')"/> <IMPORT NAME="Driver-VERTICA_9.0" MODULE="vertica-jdbc-9.0.0-0.jar" MVN="mvn:org.talend.libraries/vertica-jdbc-9.0.0-0/6.0.0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_9_0')"/>
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -118,7 +118,7 @@ DB_VERTICA_VERSION.ITEM.VERTICA_7_1_X=Vertica 7.1.X
DB_VERTICA_VERSION.ITEM.VERTICA_9_0=Vertica 9 DB_VERTICA_VERSION.ITEM.VERTICA_9_0=Vertica 9
DB_POSTGRE_VERSION.NAME=DB Version DB_POSTGRE_VERSION.NAME=DB Version
DB_POSTGRE_VERSION.ITEM.PRIOR_TO_V9=Prior to v9 DB_POSTGRE_VERSION.ITEM.PRIOR_TO_V9=v7.2 to v8.X
DB_POSTGRE_VERSION.ITEM.V9_X=v9 and later DB_POSTGRE_VERSION.ITEM.V9_X=v9 and later
QUERY.NAME=Query QUERY.NAME=Query

View File

@@ -40,8 +40,8 @@
</ADVANCED_PARAMETERS> </ADVANCED_PARAMETERS>
<CODEGENERATION> <CODEGENERATION>
<IMPORTS> <IMPORTS>
<IMPORT MODULE="janet-java-1.1.jar" MVN="mvn:org.talend.libraries/janet-java-1.1/6.0.0" NAME="janet-java-1.1" <IMPORT MODULE="janet-java-1.2.jar" MVN="mvn:org.talend.libraries/janet-java-1.2/6.0.0" NAME="janet-java-1.2"
REQUIRED="true" /> REQUIRED="true" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>
<RETURNS> <RETURNS>

View File

@@ -94,7 +94,7 @@
</ADVANCED_PARAMETERS> </ADVANCED_PARAMETERS>
<CODEGENERATION> <CODEGENERATION>
<IMPORTS> <IMPORTS>
<IMPORT MODULE="janet-java-1.1.jar" MVN="mvn:org.talend.libraries/janet-java-1.1/6.0.0" NAME="janet-java-1.1" <IMPORT MODULE="janet-java-1.2.jar" MVN="mvn:org.talend.libraries/janet-java-1.2/6.0.0" NAME="janet-java-1.2"
REQUIRED="true" /> REQUIRED="true" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -104,7 +104,6 @@ skeleton="@{org.talend.designer.components.localprovider}/components/templates/d
int deletedCount_<%=cid%> = 0; int deletedCount_<%=cid%> = 0;
int insertedCount_<%=cid%> = 0; int insertedCount_<%=cid%> = 0;
// schema is mandatory
String dbschema_<%=cid%> = null; String dbschema_<%=cid%> = null;
<% if (useExistingConnection) { %> <% if (useExistingConnection) { %>
@@ -112,8 +111,12 @@ String dbschema_<%=cid%> = null;
<% } else { %> <% } else { %>
dbschema_<%=cid%> = <%=dbschema%>; dbschema_<%=cid%> = <%=dbschema%>;
<% } %> <% } %>
String tableName_<%=cid%> = null;
String tableName_<%=cid%> = dbschema_<%=cid%> + "." + <%=table%>; if(dbschema_<%=cid%> == null || dbschema_<%=cid%>.trim().length() == 0) {
tableName_<%=cid%> = <%=table%>;
} else {
tableName_<%=cid%> = dbschema_<%=cid%> + "." + <%=table%>;
}
java.sql.Connection conn_<%=cid%> = null; java.sql.Connection conn_<%=cid%> = null;
<% if (useExistingConnection) { %> <% if (useExistingConnection) { %>
conn_<%=cid%> = (java.sql.Connection) globalMap.get("conn_<%=connection%>"); conn_<%=cid%> = (java.sql.Connection) globalMap.get("conn_<%=connection%>");

View File

@@ -650,8 +650,8 @@
<CODEGENERATION> <CODEGENERATION>
<IMPORTS> <IMPORTS>
<IMPORT NAME="Driver-EXASolution" MODULE="exajdbc-6.0.9302.jar" MVN="mvn:org.talend.libraries/exajdbc-6.0.9302/6.3.0" REQUIRED="true" /> <IMPORT NAME="Driver-EXASolution" MODULE="exajdbc-6.0.9302.jar" MVN="mvn:org.talend.libraries/exajdbc-6.0.9302/6.3.0" REQUIRED="true" />
<IMPORT NAME="Talend-DB-Exasol-Util" MODULE="talend-db-exasol-2.1.3.jar" MVN="mvn:org.talend.libraries/talend-db-exasol/2.1.3" <IMPORT NAME="Talend-DB-Exasol-Util" MODULE="talend-db-exasol-2.1.4.jar" MVN="mvn:org.talend.components.lib/talend-db-exasol/2.1.4"
UrlPath="platform:/plugin/org.talend.libraries.jdbc.exasol/lib/talend-db-exasol-2.1.3.jar" REQUIRED="true" /> UrlPath="platform:/plugin/org.talend.libraries.jdbc.exasol/lib/talend-db-exasol-2.1.4.jar" REQUIRED="true" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -105,8 +105,12 @@ if(("true").equals(useExistingConn)) {
<% <%
} }
%> %>
// schema is mandatory String tableName_<%=cid%> = null;
String tableName_<%=cid%> = dbschema_<%=cid%> + "." + <%=table%>; if(dbschema_<%=cid%> == null || dbschema_<%=cid%>.trim().length() == 0) {
tableName_<%=cid%> = <%=table%>;
} else {
tableName_<%=cid%> = dbschema_<%=cid%> + "." + <%=table%>;
}
<% <%
if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || ("UPDATE_OR_INSERT").equals(dataAction)) { if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || ("UPDATE_OR_INSERT").equals(dataAction)) {
int updateKeyCount = 0; int updateKeyCount = 0;

View File

@@ -178,7 +178,7 @@
<IMPORTS> <IMPORTS>
<IMPORT NAME="Java_DOM4J1.6" MODULE="dom4j-1.6.1.jar" MVN="mvn:dom4j/dom4j/1.6.1" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/dom4j-1.6.1.jar" REQUIRED_IF="READ_BY == 'XPATH'" BundleID="" /> <IMPORT NAME="Java_DOM4J1.6" MODULE="dom4j-1.6.1.jar" MVN="mvn:dom4j/dom4j/1.6.1" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/dom4j-1.6.1.jar" REQUIRED_IF="READ_BY == 'XPATH'" BundleID="" />
<IMPORT NAME="Java_JAXEN1.1" MODULE="jaxen-1.1.1.jar" MVN="mvn:org.talend.libraries/jaxen-1.1.1/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/jaxen-1.1.1.jar" REQUIRED_IF="READ_BY == 'XPATH'" BundleID="" /> <IMPORT NAME="Java_JAXEN1.1" MODULE="jaxen-1.1.1.jar" MVN="mvn:org.talend.libraries/jaxen-1.1.1/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/jaxen-1.1.1.jar" REQUIRED_IF="READ_BY == 'XPATH'" BundleID="" />
<IMPORT NAME="json-lib" MODULE="json-lib-2.4.1-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.1-talend" REQUIRED_IF="READ_BY == 'XPATH'" /> <IMPORT NAME="json-lib" MODULE="json-lib-2.4.3-talend.jar" MVN="mvn:net.sf.json-lib/json-lib/2.4.3-talend" REQUIRED_IF="READ_BY == 'XPATH'" />
<IMPORT NAME="commons_lang" MODULE="commons-lang-2.6.jar" MVN="mvn:commons-lang/commons-lang/2.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.6.jar" REQUIRED_IF="READ_BY == 'XPATH'" /> <IMPORT NAME="commons_lang" MODULE="commons-lang-2.6.jar" MVN="mvn:commons-lang/commons-lang/2.6" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.6.jar" REQUIRED_IF="READ_BY == 'XPATH'" />
<IMPORT NAME="commons_logging" MODULE="commons-logging-1.1.1.jar" MVN="mvn:org.talend.libraries/commons-logging-1.1.1/6.0.0" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar" REQUIRED_IF="READ_BY == 'XPATH'" /> <IMPORT NAME="commons_logging" MODULE="commons-logging-1.1.1.jar" MVN="mvn:org.talend.libraries/commons-logging-1.1.1/6.0.0" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar" REQUIRED_IF="READ_BY == 'XPATH'" />
<IMPORT NAME="ezmorph" MODULE="ezmorph-1.0.6.jar" MVN="mvn:org.talend.libraries/ezmorph-1.0.6/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.jackson/lib/ezmorph-1.0.6.jar" REQUIRED_IF="READ_BY == 'XPATH'" /> <IMPORT NAME="ezmorph" MODULE="ezmorph-1.0.6.jar" MVN="mvn:org.talend.libraries/ezmorph-1.0.6/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.jackson/lib/ezmorph-1.0.6.jar" REQUIRED_IF="READ_BY == 'XPATH'" />

View File

@@ -1,88 +0,0 @@
<%@ jet
%>
boolean retry_<%=cid%> = false;
int retry_count_<%=cid%> = 0;
int retry_max_<%=cid%> = 5;
com.jcraft.jsch.Session session_<%=cid%> = null;
com.jcraft.jsch.Channel channel_<%=cid%> = null;
do {
retry_<%=cid%> = false;
com.jcraft.jsch.JSch jsch_<%=cid%> = new com.jcraft.jsch.JSch();
<%if (("PUBLICKEY").equals(authMethod)){%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - SFTP authentication using a public key.");
log.debug("<%=cid%> - Private key: '" + <%=privateKey%> + "'.");
<%}%>
jsch_<%=cid%>.addIdentity(<%=privateKey %>, defaultUserInfo_<%=cid%>.getPassphrase());
<%}%>
session_<%=cid%> = jsch_<%=cid%>.getSession(<%=user%>, <%=host%>, <%=port%>);
session_<%=cid%>.setConfig("PreferredAuthentications", "publickey,password,keyboard-interactive,gssapi-with-mic");
<%if (("PASSWORD").equals(authMethod)) {%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - SFTP authentication using a password.");
<%}%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
session_<%=cid%>.setPassword(decryptedPassword_<%=cid%>);
<%}%>
session_<%=cid%>.setUserInfo(defaultUserInfo_<%=cid%>);
<%if (!useProxy) {%>
if(("true").equals(System.getProperty("http.proxySet")) ){
com.jcraft.jsch.ProxyHTTP proxy_<%=cid%> = new com.jcraft.jsch.ProxyHTTP(System.getProperty("http.proxyHost"),Integer.parseInt(System.getProperty("http.proxyPort")));
if(!"".equals(System.getProperty("http.proxyUser"))){
proxy_<%=cid%>.setUserPasswd(System.getProperty("http.proxyUser"),System.getProperty("http.proxyPassword"));
}
session_<%=cid%>.setProxy(proxy_<%=cid%>);
}
<%}%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" + <%=user%> + "'.");
<%}%>
channel_<%=cid%> = null;
try {
session_<%=cid%>.connect();
channel_<%=cid%> = session_<%=cid%>.openChannel("sftp");
channel_<%=cid%>.connect();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
} catch (com.jcraft.jsch.JSchException e_<%=cid%>) {
try {
if(channel_<%=cid%>!=null) {
channel_<%=cid%>.disconnect();
}
if(session_<%=cid%>!=null) {
session_<%=cid%>.disconnect();
}
} catch(java.lang.Exception ce_<%=cid%>) {
<%if(isLog4jEnabled){%>
log.warn("<%=cid%> - close sftp connection failed : " + ce_<%=cid%>.getClass() + " : " + ce_<%=cid%>.getMessage());
<%}%>
}
String message_<%=cid%> = new TalendException(null, null, null).getExceptionCauseMessage(e_<%=cid%>);
if(message_<%=cid%>.contains("Signature length not correct") || message_<%=cid%>.contains("connection is closed by foreign host")) {
retry_<%=cid%> = true;
retry_count_<%=cid%>++;
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - connect: Signature length not correct or connection is closed by foreign host, so retry, retry time : " + retry_count_<%=cid%>);
<%}%>
} else {
throw e_<%=cid%>;
}
}
} while(retry_<%=cid%> && (retry_count_<%=cid%> < retry_max_<%=cid%>));
com.jcraft.jsch.ChannelSftp c_<%=cid%> = (com.jcraft.jsch.ChannelSftp)channel_<%=cid%>;

View File

@@ -28,10 +28,11 @@ String authMethod = ElementParameterParser.getValue(node, "__AUTH_METHOD__");
String privateKey = ElementParameterParser.getValue(node, "__PRIVATEKEY__"); String privateKey = ElementParameterParser.getValue(node, "__PRIVATEKEY__");
boolean ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__")); boolean ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__"));
String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__"); String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__");
String sEncoding = ElementParameterParser.getValue(node, "__ENCODING__"); String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__"); String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__"); String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__");
String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__"); String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__");
String timeoutValue = ElementParameterParser.getValue(node, "__CONNECTION_TIMEOUT__");
boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__")); boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__"));
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
String passwordFieldName = ""; String passwordFieldName = "";
@@ -60,37 +61,18 @@ if (ElementParameterParser.canEncrypt(node, passwordFieldName)) {
}); });
<% <%
} }
%>
int connectionTimeout_<%=cid %> = Integer.valueOf(<%=timeoutValue %>);
<%
if (!sftp && !ftps) { // *** ftp *** // if (!sftp && !ftps) { // *** ftp *** //
if(isLog4jEnabled){%> %>
log.debug("<%=cid%> - " + <%=(("ACTIVE").equals(connectMode))?"\"Using the active mode.\"":"\"Using the passive mode.\""%>); com.enterprisedt.net.ftp.FTPClient ftp_<%=cid %> = null;
<%}%> <%
com.enterprisedt.net.ftp.FTPClient ftp_<%=cid %> = new com.enterprisedt.net.ftp.FTPClient(); passwordFieldName = "__PASS__";
ftp_<%=cid %>.setRemoteHost(<%=host %>); %>
ftp_<%=cid %>.setRemotePort(<%=port %>); <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftp_connect.javajet"%>
<%if (("ACTIVE").equals(connectMode)) {%> globalMap.put("conn_<%=cid%>",ftp_<%=cid %>);
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.ACTIVE);
<%} else {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=sEncoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" +<%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASS__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
globalMap.put("conn_<%=cid%>",ftp_<%=cid %>);
<% <%
} else if (!ftps) { // *** sftp *** // } else if (!ftps) { // *** sftp *** //
%> %>
@@ -138,99 +120,20 @@ if (!sftp && !ftps) { // *** ftp *** //
passwordFieldName = "__PASS__"; passwordFieldName = "__PASS__";
%> %>
<%@ include file="sftp_connect.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/sftp_connect.javajet"%>
<%if(use_encoding) {%> <%if(use_encoding) {%>
c_<%=cid%>.setFilenameEncoding(<%=sEncoding%>); c_<%=cid%>.setFilenameEncoding(<%=encoding%>);
<%}%> <%}%>
globalMap.put("conn_<%=cid%>", c_<%=cid%>); globalMap.put("conn_<%=cid%>", c_<%=cid%>);
<% <%
} else { // *** ftps *** // } else { // *** ftps *** //
%> %>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = null;
<%@ include file="../templates/FTP/ftpsTrust.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftps_connect.javajet"%>
javax.net.ssl.SSLContext sslContext_<%=cid %> = null; globalMap.put("conn_<%=cid%>", ftp_<%=cid %>);
javax.net.ssl.TrustManager[] trustManager_<%=cid %> = null;
javax.net.ssl.SSLSocketFactory sslSocketFactory_<%=cid %> = null;
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = null;
MyTrust_<%=cid%> myTrust_<%=cid%> = null;
try {
sslContext_<%=cid %> = javax.net.ssl.SSLContext.getInstance("SSL");
myTrust_<%=cid%> = new MyTrust_<%=cid%>();
trustManager_<%=cid %> = myTrust_<%=cid%>.getTrustManagers();
sslContext_<%=cid %>.init(null, trustManager_<%=cid %>, new java.security.SecureRandom());
sslSocketFactory_<%=cid %> = sslContext_<%=cid %>.getSocketFactory();
boolean isHTTPProxyUsed = "true".equals(System.getProperty("http.proxySet"));
if (isHTTPProxyUsed) {
String httpProxyHost = System.getProperty("http.proxyHost");
int httpProxyPort = Integer.getInteger("http.proxyPort");
String httpProxyUser = System.getProperty("http.proxyUser");
String httpProxyPass = System.getProperty("http.proxyPassword");
ftp_<%=cid %> = new org.talend.ftp.HTTPProxyFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>, httpProxyHost, httpProxyPort, httpProxyUser, httpProxyPass);
} else {
ftp_<%=cid %> = new org.talend.ftp.SSLSessionReuseFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>);
}
ftp_<%=cid %>.setControlEncoding(<%=sEncoding %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> -FTPS security Mode is <%=securityMode%>.");
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" + <%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect(<%=host %>,<%=ftpsPort%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
ftp_<%=cid %>.setRemoteVerificationEnabled(<%=useRemoteVerification %>);
<%
passwordFieldName = "__PASS__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
boolean isLoginSuccessful_<%=cid %> = ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
if (!isLoginSuccessful_<%=cid %>) {
throw new RuntimeException("Login failed");
}
ftp_<%=cid %>.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE);
<%
if (protectionBufferSize != null && !protectionBufferSize.isEmpty() ) {
%>
ftp_<%=cid %>.execPBSZ(<%=protectionBufferSize %>);
<%
}
if (protectionLevel != null && !protectionLevel.isEmpty()) {
%>
ftp_<%=cid %>.execPROT(<%=protectionLevel %>);
<%
}
%>
} catch (Exception e) {
<%if(isLog4jEnabled){%>
log.error("<%=cid%> - Can't create connection: " + e.getMessage());
<%}%>
throw e;
}
<%
if ("PASSIVE".equals(connectMode)) {
%>
ftp_<%=cid %>.enterLocalPassiveMode();
<%
if (isLog4jEnabled) {
%>
log.debug("<%=cid%> - Using the passive mode.");
<%
}
}
%>
globalMap.put("conn_<%=cid%>", ftp_<%=cid %>);
<% <%
} }
%> %>

View File

@@ -232,6 +232,11 @@
NUM_ROW="95" SHOW_IF="(FTPS=='true')" REPOSITORY_VALUE="REMOTE_VERIFICATION"> NUM_ROW="95" SHOW_IF="(FTPS=='true')" REPOSITORY_VALUE="REMOTE_VERIFICATION">
<DEFAULT>true</DEFAULT> <DEFAULT>true</DEFAULT>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="CONNECTION_TIMEOUT" FIELD="TEXT"
NUM_ROW="96" REPOSITORY_VALUE="CONNECTION_TIMEOUT">
<DEFAULT>0</DEFAULT>
</PARAMETER>
</ADVANCED_PARAMETERS> </ADVANCED_PARAMETERS>
<CODEGENERATION> <CODEGENERATION>
@@ -239,7 +244,7 @@
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false')"/> <IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false')"/>
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true')"/> <IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true')"/>
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true')" /> <IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true')" />
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar" MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" REQUIRED_IF="(FTPS == 'true')" /> <IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar" MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819" REQUIRED_IF="(FTPS == 'true')" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -40,4 +40,5 @@ SECURITY_MODE.NAME=Security Mode
SECURITY_MODE.ITEM.IMPLICIT=Implicit SECURITY_MODE.ITEM.IMPLICIT=Implicit
SECURITY_MODE.ITEM.EXPLICIT=Explicit SECURITY_MODE.ITEM.EXPLICIT=Explicit
USE_ENCODING.NAME=Filename encoding USE_ENCODING.NAME=Filename encoding
CONNECTION_TIMEOUT.NAME=Connection timeout (milliseconds)

View File

@@ -43,6 +43,7 @@ boolean sftp = false;
boolean ftps = false; boolean ftps = false;
String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__"); String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__");
String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__"); String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__");
String timeoutValue = ElementParameterParser.getValue(node, "__CONNECTION_TIMEOUT__");
boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__")); boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__"));
if (("true").equals(useExistingConn)) { if (("true").equals(useExistingConn)) {
List<? extends INode> nodeList = node.getProcess().getGeneratingNodes(); List<? extends INode> nodeList = node.getProcess().getGeneratingNodes();
@@ -55,6 +56,9 @@ if (("true").equals(useExistingConn)) {
} else { } else {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__")); sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__")); ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__"));
%>
int connectionTimeout_<%=cid %> = Integer.valueOf(<%=timeoutValue %>);
<%
} }
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
@@ -129,7 +133,7 @@ int nb_file_<%=cid%> = 0;
passwordFieldName = "__PASSWORD__"; passwordFieldName = "__PASSWORD__";
%> %>
<%@ include file="../tFTPConnection/sftp_connect.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/sftp_connect.javajet"%>
<%if(use_encoding) {%> <%if(use_encoding) {%>
c_<%=cid%>.setFilenameEncoding(<%=encoding%>); c_<%=cid%>.setFilenameEncoding(<%=encoding%>);
@@ -167,101 +171,18 @@ int nb_file_<%=cid%> = 0;
<% <%
} else if (ftps) { // *** ftps *** // } else if (ftps) { // *** ftps *** //
%>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = null;
<%
if (("false").equals(useExistingConn)) { if (("false").equals(useExistingConn)) {
String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__"); String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__"); String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
%> %>
<%@ include file="../templates/FTP/ftpsTrust.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftps_connect.javajet"%>
javax.net.ssl.SSLContext sslContext_<%=cid %> = null;
javax.net.ssl.TrustManager[] trustManager_<%=cid %> = null;
javax.net.ssl.SSLSocketFactory sslSocketFactory_<%=cid %> = null;
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> =null;
MyTrust_<%=cid %> myTrust_<%=cid%> = null;
try {
sslContext_<%=cid %> = javax.net.ssl.SSLContext.getInstance("SSL");
myTrust_<%=cid%> = new MyTrust_<%=cid%>();
trustManager_<%=cid %> = myTrust_<%=cid%>.getTrustManagers();
sslContext_<%=cid %>.init(null, trustManager_<%=cid %>, new java.security.SecureRandom());
sslSocketFactory_<%=cid %> = sslContext_<%=cid %>.getSocketFactory();
boolean isHTTPProxyUsed = "true".equals(System.getProperty("http.proxySet"));
if (isHTTPProxyUsed) {
String httpProxyHost = System.getProperty("http.proxyHost");
int httpProxyPort = Integer.getInteger("http.proxyPort");
String httpProxyUser = System.getProperty("http.proxyUser");
String httpProxyPass = System.getProperty("http.proxyPassword");
ftp_<%=cid %> = new org.talend.ftp.HTTPProxyFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>, httpProxyHost, httpProxyPort, httpProxyUser, httpProxyPass);
} else {
ftp_<%=cid %> = new org.talend.ftp.SSLSessionReuseFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>);
}
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> -FTPS security Mode is <%=securityMode%>.");
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" + <%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect(<%=host %>,<%=ftpsPort %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
ftp_<%=cid %>.setRemoteVerificationEnabled(<%=useRemoteVerification %>);
<% <%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
boolean isLoginSuccessful_<%=cid %> = ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
if (!isLoginSuccessful_<%=cid %>) {
throw new RuntimeException("Login failed");
}
<%
if (protectionBufferSize != null && !protectionBufferSize.isEmpty() ) {
%>
ftp_<%=cid %>.execPBSZ(<%=protectionBufferSize %>);
<%
}
if (protectionLevel != null && !protectionLevel.isEmpty()) {
%>
ftp_<%=cid %>.execPROT(<%=protectionLevel %>);
<%
}
%>
} catch (Exception e) {
<%if(isLog4jEnabled){%>
log.error("<%=cid%> - Can't create connection: " + e.getMessage());
<%}%>
<%
if (dieOnError) {
%>
throw e;
<%
} else {
%>
e.printStackTrace();
<%
}
%>
}
<%
if ("PASSIVE".equals(connectMode)) {
%>
ftp_<%=cid %>.enterLocalPassiveMode();
<%
if (isLog4jEnabled) {
%>
log.debug("<%=cid%> - Using the passive mode.");
<%
}
}
} else { } else {
%> %>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>"); ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>");
<% <%
if (moveToCurrentDir) { if (moveToCurrentDir) {
%> %>
@@ -303,36 +224,12 @@ int nb_file_<%=cid%> = 0;
<%if(!moveToCurrentDir){%> <%if(!moveToCurrentDir){%>
String rootDir_<%=cid %> = ftp_<%=cid %>.pwd(); String rootDir_<%=cid %> = ftp_<%=cid %>.pwd();
<%}%> <%}%>
<%} else {%> <%} else {
ftp_<%=cid %> = new com.enterprisedt.net.ftp.FTPClient(); passwordFieldName = "__PASSWORD__";
ftp_<%=cid %>.setRemoteHost(<%=host %>); %>
ftp_<%=cid %>.setRemotePort(<%=port %>); <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftp_connect.javajet"%>
<%if(isLog4jEnabled){%> <%}%>
log.debug("<%=cid%> - " + <%=(("ACTIVE").equals(connectMode))?"\"Using the active mode.\"":"\"Using the passive mode.\""%>); java.util.List<java.util.Map<String,String>> list<%=cid %> = new java.util.ArrayList<java.util.Map<String,String>>();
<%}%>
<%if (("ACTIVE").equals(connectMode)) {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.ACTIVE);
<%} else {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username: '" +<%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
<%}%>
java.util.List<java.util.Map<String,String>> list<%=cid %> = new java.util.ArrayList<java.util.Map<String,String>>();
<%for (int i = 0; i < files.size(); i++) { <%for (int i = 0; i < files.size(); i++) {
Map<String, String> line = files.get(i); Map<String, String> line = files.get(i);

View File

@@ -288,6 +288,11 @@
NUM_ROW="95" SHOW_IF="(FTPS=='true') AND (USE_EXISTING_CONNECTION == 'false')" REPOSITORY_VALUE="REMOTE_VERIFICATION"> NUM_ROW="95" SHOW_IF="(FTPS=='true') AND (USE_EXISTING_CONNECTION == 'false')" REPOSITORY_VALUE="REMOTE_VERIFICATION">
<DEFAULT>true</DEFAULT> <DEFAULT>true</DEFAULT>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="CONNECTION_TIMEOUT" FIELD="TEXT"
NUM_ROW="96" SHOW_IF="USE_EXISTING_CONNECTION == 'false'" REPOSITORY_VALUE="CONNECTION_TIMEOUT">
<DEFAULT>0</DEFAULT>
</PARAMETER>
</ADVANCED_PARAMETERS> </ADVANCED_PARAMETERS>
<CODEGENERATION> <CODEGENERATION>
@@ -296,8 +301,8 @@
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/> <IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="jakarta-oro" MODULE="jakarta-oro-2.0.8.jar" MVN="mvn:org.talend.libraries/jakarta-oro-2.0.8/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/jakarta-oro-2.0.8.jar" REQUIRED="true" /> <IMPORT NAME="jakarta-oro" MODULE="jakarta-oro-2.0.8.jar" MVN="mvn:org.talend.libraries/jakarta-oro-2.0.8/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/jakarta-oro-2.0.8.jar" REQUIRED="true" />
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" /> <IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar" <IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar" MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" /> REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -56,4 +56,5 @@ IGNORE_FAILURE_AT_QUIT.NAME=Ignore Failure At Quit
PERL5_REGEX.NAME=Use Perl5 Regex Expressions as Filemask (Unchecked means Glob Expressions) PERL5_REGEX.NAME=Use Perl5 Regex Expressions as Filemask (Unchecked means Glob Expressions)
MOVE_TO_THE_CURRENT_DIRECTORY.NAME=Move to the current directory MOVE_TO_THE_CURRENT_DIRECTORY.NAME=Move to the current directory
USE_ENCODING.NAME=Filename encoding USE_ENCODING.NAME=Filename encoding
CONNECTION_TIMEOUT.NAME=Connection timeout (milliseconds)

View File

@@ -42,6 +42,7 @@ boolean ftps = false;
String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__"); String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__");
String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__"); String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__");
String timeoutValue = ElementParameterParser.getValue(node, "__CONNECTION_TIMEOUT__");
boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__")); boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__"));
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
@@ -57,6 +58,9 @@ if (("true").equals(useExistingConn)) {
} else { } else {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__")); sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__")); ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__"));
%>
int connectionTimeout_<%=cid %> = Integer.valueOf(<%=timeoutValue %>);
<%
} }
String passwordFieldName = ""; String passwordFieldName = "";
@@ -134,7 +138,7 @@ if (sftp) { // *** sftp *** //
passwordFieldName = "__PASSWORD__"; passwordFieldName = "__PASSWORD__";
%> %>
<%@ include file="../tFTPConnection/sftp_connect.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/sftp_connect.javajet"%>
<%if(use_encoding) {%> <%if(use_encoding) {%>
c_<%=cid%>.setFilenameEncoding(<%=encoding%>); c_<%=cid%>.setFilenameEncoding(<%=encoding%>);
@@ -154,90 +158,18 @@ if (sftp) { // *** sftp *** //
<% <%
} }
} else if (ftps) { // *** ftps *** // } else if (ftps) { // *** ftps *** //
%>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = null;
<%
if (("false").equals(useExistingConn)) { if (("false").equals(useExistingConn)) {
String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__"); String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__"); String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
%> %>
<%@ include file="../templates/FTP/ftpsTrust.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftps_connect.javajet"%>
javax.net.ssl.SSLContext sslContext_<%=cid %> = null;
javax.net.ssl.TrustManager[] trustManager_<%=cid %> = null;
javax.net.ssl.SSLSocketFactory sslSocketFactory_<%=cid %> = null;
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> =null;
MyTrust_<%=cid %> myTrust_<%=cid%> = null;
try {
sslContext_<%=cid %> = javax.net.ssl.SSLContext.getInstance("SSL");
myTrust_<%=cid%> = new MyTrust_<%=cid%>();
trustManager_<%=cid %> = myTrust_<%=cid%>.getTrustManagers();
sslContext_<%=cid %>.init(null, trustManager_<%=cid %>, new java.security.SecureRandom());
sslSocketFactory_<%=cid %> = sslContext_<%=cid %>.getSocketFactory();
boolean isHTTPProxyUsed = "true".equals(System.getProperty("http.proxySet"));
if (isHTTPProxyUsed) {
String httpProxyHost = System.getProperty("http.proxyHost");
int httpProxyPort = Integer.getInteger("http.proxyPort");
String httpProxyUser = System.getProperty("http.proxyUser");
String httpProxyPass = System.getProperty("http.proxyPassword");
ftp_<%=cid %> = new org.talend.ftp.HTTPProxyFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>, httpProxyHost, httpProxyPort, httpProxyUser, httpProxyPass);
} else {
ftp_<%=cid %> = new org.talend.ftp.SSLSessionReuseFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>);
}
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> -FTPS security Mode is <%=securityMode%>.");
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" + <%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect(<%=host %>,<%=ftpsPort %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
ftp_<%=cid %>.setRemoteVerificationEnabled(<%=useRemoteVerification %>);
<% <%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
boolean isLoginSuccessful_<%=cid %> = ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
if (!isLoginSuccessful_<%=cid %>) {
throw new RuntimeException("Login failed");
}
<%
if (protectionBufferSize != null && !protectionBufferSize.isEmpty() ) {
%>
ftp_<%=cid %>.execPBSZ(<%=protectionBufferSize %>);
<%
}
if (protectionLevel != null && !protectionLevel.isEmpty()) {
%>
ftp_<%=cid %>.execPROT(<%=protectionLevel %>);
<%
}
%>
} catch (Exception e) {
<%if(isLog4jEnabled){%>
log.error("<%=cid%> - Can't create connection: " + e.getMessage());
<%}%>
throw e;
}
<%
if ("PASSIVE".equals(connectMode)) {
%>
ftp_<%=cid %>.enterLocalPassiveMode();
<%
if (isLog4jEnabled) {
%>
log.debug("<%=cid%> - Using the passive mode.");
<%
}
}
} else { } else {
%> %>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>"); ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>");
<% <%
} }
} else { // *** ftp *** // } else { // *** ftp *** //
@@ -251,36 +183,10 @@ if (sftp) { // *** sftp *** //
log.info("<%=cid%> - Use an existing connection. Connection hostname: " + ftp_<%=cid %>.getRemoteHost() + ", Connection port: " + ftp_<%=cid %>.getRemotePort() + "."); log.info("<%=cid%> - Use an existing connection. Connection hostname: " + ftp_<%=cid %>.getRemoteHost() + ", Connection port: " + ftp_<%=cid %>.getRemotePort() + ".");
} }
<%}%> <%}%>
<%} else {%> <%} else {
ftp_<%=cid %> = new com.enterprisedt.net.ftp.FTPClient(); passwordFieldName = "__PASSWORD__";
ftp_<%=cid %>.setRemoteHost(<%=host %>); %>
ftp_<%=cid %>.setRemotePort(<%=port %>); <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftp_connect.javajet"%>
<%
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - " + <%=(("ACTIVE").equals(connectMode))?"\"Using the active mode.\"":"\"Using the passive mode.\""%>);
<%}%>
<%if (("ACTIVE").equals(connectMode)) {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.ACTIVE);
<%} else {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username: '" +<%=username %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=username %>, decryptedPassword_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host%> + "' has succeeded.");
<%}%>
<%
} }
}%> }%>

View File

@@ -276,6 +276,11 @@ COMPATIBILITY="ALL"
NUM_ROW="95" SHOW_IF="(FTPS=='true') AND (USE_EXISTING_CONNECTION == 'false')" REPOSITORY_VALUE="REMOTE_VERIFICATION"> NUM_ROW="95" SHOW_IF="(FTPS=='true') AND (USE_EXISTING_CONNECTION == 'false')" REPOSITORY_VALUE="REMOTE_VERIFICATION">
<DEFAULT>true</DEFAULT> <DEFAULT>true</DEFAULT>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="CONNECTION_TIMEOUT" FIELD="TEXT"
NUM_ROW="96" SHOW_IF="USE_EXISTING_CONNECTION == 'false'" REPOSITORY_VALUE="CONNECTION_TIMEOUT">
<DEFAULT>0</DEFAULT>
</PARAMETER>
</ADVANCED_PARAMETERS> </ADVANCED_PARAMETERS>
<CODEGENERATION> <CODEGENERATION>
@@ -283,8 +288,8 @@ COMPATIBILITY="ALL"
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/> <IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" UrlPath="platform:/plugin/org.talend.libraries.ftp/lib/edtftpj-2.5.0.jar" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/> <IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" /> <IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar" <IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar" MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" /> REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -56,4 +56,5 @@ CONNECT_MODE.ITEM.PASSIVE=Passive
IGNORE_FAILURE_AT_QUIT.NAME=Ignore Failure At Quit IGNORE_FAILURE_AT_QUIT.NAME=Ignore Failure At Quit
USE_ENCODING.NAME=Filename encoding USE_ENCODING.NAME=Filename encoding
CONNECTION_TIMEOUT.NAME=Connection timeout (milliseconds)

View File

@@ -42,6 +42,7 @@ boolean sftp = false;
boolean ftps = false; boolean ftps = false;
String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__"); String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__");
String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__"); String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__");
String timeoutValue = ElementParameterParser.getValue(node, "__CONNECTION_TIMEOUT__");
boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__")); boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__"));
if (("true").equals(useExistingConn)) { if (("true").equals(useExistingConn)) {
@@ -56,6 +57,9 @@ if (("true").equals(useExistingConn)) {
} else { } else {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__")); sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__")); ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__"));
%>
int connectionTimeout_<%=cid %> = Integer.valueOf(<%=timeoutValue %>);
<%
} }
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
String passwordFieldName = ""; String passwordFieldName = "";
@@ -151,7 +155,7 @@ if (sftp) {// *** sftp *** //
passwordFieldName = "__PASSWORD__"; passwordFieldName = "__PASSWORD__";
%> %>
<%@ include file="../tFTPConnection/sftp_connect.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/sftp_connect.javajet"%>
<%if(use_encoding) {%> <%if(use_encoding) {%>
c_<%=cid%>.setFilenameEncoding(<%=encoding%>); c_<%=cid%>.setFilenameEncoding(<%=encoding%>);
@@ -233,93 +237,18 @@ if (sftp) {// *** sftp *** //
nb_file_<%=cid%>++; nb_file_<%=cid%>++;
<% <%
} else if (ftps) { // *** ftps *** // } else if (ftps) { // *** ftps *** //
%>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = null;
<%
if (("false").equals(useExistingConn)) { if (("false").equals(useExistingConn)) {
String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__"); String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__"); String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
%> %>
<%@ include file="../templates/FTP/ftpsTrust.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftps_connect.javajet"%>
javax.net.ssl.SSLContext sslContext_<%=cid %> = null;
javax.net.ssl.TrustManager[] trustManager_<%=cid %> = null;
javax.net.ssl.SSLSocketFactory sslSocketFactory_<%=cid %> = null;
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> =null;
MyTrust_<%=cid %> myTrust_<%=cid%> = null;
try {
sslContext_<%=cid %> = javax.net.ssl.SSLContext.getInstance("SSL");
myTrust_<%=cid%> = new MyTrust_<%=cid%>();
trustManager_<%=cid %> = myTrust_<%=cid%>.getTrustManagers();
sslContext_<%=cid %>.init(null, trustManager_<%=cid %>, new java.security.SecureRandom());
sslSocketFactory_<%=cid %> = sslContext_<%=cid %>.getSocketFactory();
boolean isHTTPProxyUsed = "true".equals(System.getProperty("http.proxySet"));
if (isHTTPProxyUsed) {
String httpProxyHost = System.getProperty("http.proxyHost");
int httpProxyPort = Integer.getInteger("http.proxyPort");
String httpProxyUser = System.getProperty("http.proxyUser");
String httpProxyPass = System.getProperty("http.proxyPassword");
ftp_<%=cid %> = new org.talend.ftp.HTTPProxyFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>, httpProxyHost, httpProxyPort, httpProxyUser, httpProxyPass);
} else {
ftp_<%=cid %> = new org.talend.ftp.SSLSessionReuseFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>);
}
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> -FTPS security Mode is <%=securityMode%>.");
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" + <%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect(<%=host %>,<%=ftpsPort %>);
<% <%
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%
}
passwordFieldName = "__PASSWORD__";
%>
ftp_<%=cid %>.setRemoteVerificationEnabled(<%=useRemoteVerification %>);
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
boolean isLoginSuccessful_<%=cid %> = ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
if (!isLoginSuccessful_<%=cid %>) {
throw new RuntimeException("Login failed");
}
<%
if (protectionBufferSize != null && !protectionBufferSize.isEmpty() ) {
%>
ftp_<%=cid %>.execPBSZ(<%=protectionBufferSize %>);
<%
}
if (protectionLevel != null && !protectionLevel.isEmpty()) {
%>
ftp_<%=cid %>.execPROT(<%=protectionLevel %>);
<%
}
%>
} catch (Exception e) {
<%if(isLog4jEnabled){%>
log.error("<%=cid%> - Can't create connection: " + e.getMessage());
<%}%>
throw e;
}
<%
if ("PASSIVE".equals(connectMode)) {
%>
ftp_<%=cid %>.enterLocalPassiveMode();
<%
if (isLog4jEnabled) {
%>
log.debug("<%=cid%> - Using the passive mode.");
<%
}
}
} else { } else {
%> %>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>"); ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>");
String rootDir_<%=cid %> = ftp_<%=cid %>.printWorkingDirectory(); String rootDir_<%=cid %> = ftp_<%=cid %>.printWorkingDirectory();
<% <%
} }
@@ -401,35 +330,10 @@ if (sftp) {// *** sftp *** //
<%if(!moveToCurrentDir){%> <%if(!moveToCurrentDir){%>
String rootDir_<%=cid %> = ftp_<%=cid %>.pwd(); String rootDir_<%=cid %> = ftp_<%=cid %>.pwd();
<%}%> <%}%>
<%} else {%> <%} else {
ftp_<%=cid %> = new com.enterprisedt.net.ftp.FTPClient(); passwordFieldName = "__PASSWORD__";
ftp_<%=cid %>.setRemoteHost(<%=host %>); %>
ftp_<%=cid %>.setRemotePort(<%=port %>); <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftp_connect.javajet"%>
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - " + <%=(("ACTIVE").equals(connectMode))?"\"Using the active mode.\"":"\"Using the passive mode.\""%>);
<%}%>
<%if (("ACTIVE").equals(connectMode)) {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.ACTIVE);
<%} else {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);
<%}%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" +<%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
<%}%> <%}%>
String remotedir_<%=cid %> = (<%=remotedir%>).replaceAll("\\\\","/"); String remotedir_<%=cid %> = (<%=remotedir%>).replaceAll("\\\\","/");
ftp_<%=cid %>.chdir(remotedir_<%=cid %>); ftp_<%=cid %>.chdir(remotedir_<%=cid %>);

View File

@@ -254,6 +254,11 @@
NUM_ROW="95" SHOW_IF="(FTPS=='true') AND (USE_EXISTING_CONNECTION == 'false')" REPOSITORY_VALUE="REMOTE_VERIFICATION"> NUM_ROW="95" SHOW_IF="(FTPS=='true') AND (USE_EXISTING_CONNECTION == 'false')" REPOSITORY_VALUE="REMOTE_VERIFICATION">
<DEFAULT>true</DEFAULT> <DEFAULT>true</DEFAULT>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="CONNECTION_TIMEOUT" FIELD="TEXT"
NUM_ROW="96" SHOW_IF="USE_EXISTING_CONNECTION == 'false'" REPOSITORY_VALUE="CONNECTION_TIMEOUT">
<DEFAULT>0</DEFAULT>
</PARAMETER>
</ADVANCED_PARAMETERS> </ADVANCED_PARAMETERS>
<CODEGENERATION> <CODEGENERATION>
@@ -261,8 +266,8 @@
<IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/> <IMPORT NAME="Java-FTP" MODULE="edtftpj-2.5.0.jar" MVN="mvn:com.enterprisedt/edtftpj/2.5.0" REQUIRED_IF="(SFTP == 'false') AND (FTPS == 'false') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/> <IMPORT NAME="Java-SFTP" MODULE="jsch-0.1.55.jar" MVN="mvn:com.jcraft/jsch/0.1.55" REQUIRED_IF="(SFTP == 'true') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" /> <IMPORT NAME="Java-FTPS" MODULE="commons-net-3.6.jar" MVN="mvn:commons-net/commons-net/3.6" REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190128.jar" <IMPORT NAME="Java-FTPS-talend" MODULE="commons-net-ftps-proxy-3.6.1-talend-20190819.jar"
MVN="mvn:org.talend.libraries/commons-net-ftps-proxy/3.6.1-talend-20190128" UrlPath="platform:/plugin/org.talend.designer.components.localprovider/components/tFTPConnection/commons-net-ftps-proxy-3.6.1-talend-20190128.jar" MVN="mvn:org.talend.components.lib/commons-net-ftps-proxy/3.6.1-talend-20190819"
REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" /> REQUIRED_IF="(FTPS == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS> </IMPORTS>
</CODEGENERATION> </CODEGENERATION>

View File

@@ -51,4 +51,5 @@ FILES.NAME=Files
FILES.ITEM.FILEMASK=Filemask FILES.ITEM.FILEMASK=Filemask
MOVE_TO_THE_CURRENT_DIRECTORY.NAME=Move to the current directory MOVE_TO_THE_CURRENT_DIRECTORY.NAME=Move to the current directory
USE_ENCODING.NAME=Filename encoding USE_ENCODING.NAME=Filename encoding
CONNECTION_TIMEOUT.NAME=Connection timeout (milliseconds)

View File

@@ -46,6 +46,7 @@ boolean ftps = false;
String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__"); String protectionLevel = ElementParameterParser.getValue(node, "__FTPS_PROT__");
String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__"); String protectionBufferSize = ElementParameterParser.getValue(node, "__FTPS_PROTECTION_BUFF_SIZE__");
String timeoutValue = ElementParameterParser.getValue(node, "__CONNECTION_TIMEOUT__");
boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__")); boolean useRemoteVerification = ("true").equals(ElementParameterParser.getValue(node, "__REMOTE_VERIFICATION__"));
log4jFileUtil.componentStartInfo(node); log4jFileUtil.componentStartInfo(node);
@@ -62,6 +63,9 @@ if (("true").equals(useExistingConn)) {
} else { } else {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__")); sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__")); ftps = ("true").equals(ElementParameterParser.getValue(node, "__FTPS__"));
%>
int connectionTimeout_<%=cid %> = Integer.valueOf(<%=timeoutValue %>);
<%
} }
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
@@ -153,9 +157,9 @@ if (sftp) { // *** sftp *** //
<% <%
passwordFieldName = "__PASSWORD__"; passwordFieldName = "__PASSWORD__";
%> %>
<%@ include file="../tFTPConnection/sftp_connect.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/sftp_connect.javajet"%>
<%if(use_encoding) {%> <%if(use_encoding) {%>
c_<%=cid%>.setFilenameEncoding(<%=encoding%>); c_<%=cid%>.setFilenameEncoding(<%=encoding%>);
<%}%> <%}%>
@@ -203,90 +207,18 @@ if (sftp) { // *** sftp *** //
} }
<% <%
} else if (ftps) { // *** ftps *** // } else if (ftps) { // *** ftps *** //
%>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = null;
<%
if (("false").equals(useExistingConn)) { if (("false").equals(useExistingConn)) {
String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__"); String keystoreFile = ElementParameterParser.getValue(node, "__KEYSTORE_FILE__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__"); String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
%> %>
<%@ include file="../templates/FTP/ftpsTrust.javajet"%> <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftps_connect.javajet"%>
javax.net.ssl.SSLContext sslContext_<%=cid %> = null;
javax.net.ssl.TrustManager[] trustManager_<%=cid %> = null;
javax.net.ssl.SSLSocketFactory sslSocketFactory_<%=cid %> = null;
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> =null;
MyTrust_<%=cid %> myTrust_<%=cid%> = null;
try {
sslContext_<%=cid %> = javax.net.ssl.SSLContext.getInstance("SSL");
myTrust_<%=cid%> = new MyTrust_<%=cid%>();
trustManager_<%=cid %> = myTrust_<%=cid%>.getTrustManagers();
sslContext_<%=cid %>.init(null, trustManager_<%=cid %>, new java.security.SecureRandom());
sslSocketFactory_<%=cid %> = sslContext_<%=cid %>.getSocketFactory();
boolean isHTTPProxyUsed = "true".equals(System.getProperty("http.proxySet"));
if (isHTTPProxyUsed) {
String httpProxyHost = System.getProperty("http.proxyHost");
int httpProxyPort = Integer.getInteger("http.proxyPort");
String httpProxyUser = System.getProperty("http.proxyUser");
String httpProxyPass = System.getProperty("http.proxyPassword");
ftp_<%=cid %> = new org.talend.ftp.HTTPProxyFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>, httpProxyHost, httpProxyPort, httpProxyUser, httpProxyPass);
} else {
ftp_<%=cid %> = new org.talend.ftp.SSLSessionReuseFTPSClient(<%="IMPLICIT".equals(securityMode)%>, sslContext_<%=cid %>);
}
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> -FTPS security Mode is <%=securityMode%>.");
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" + <%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect(<%=host %>,<%=ftpsPort %>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
ftp_<%=cid %>.setRemoteVerificationEnabled(<%=useRemoteVerification %>);
<% <%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
boolean isLoginSuccessful_<%=cid %> = ftp_<%=cid %>.login(<%=user %>, decryptedPassword_<%=cid%>);
if (!isLoginSuccessful_<%=cid %>) {
throw new RuntimeException("Login failed");
}
ftp_<%=cid %>.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE); //to calculate md5 for binary files correctly
<%
if (protectionBufferSize != null && !protectionBufferSize.isEmpty() ) {
%>
ftp_<%=cid %>.execPBSZ(<%=protectionBufferSize %>);
<%
}
if (protectionLevel != null && !protectionLevel.isEmpty()) {
%>
ftp_<%=cid %>.execPROT(<%=protectionLevel %>);
<%
}
%>
} catch (Exception e) {
<%if(isLog4jEnabled){%>
log.error("<%=cid%> - Can't create connection: " + e.getMessage());
<%}%>
throw e;
}
<%
if ("PASSIVE".equals(connectMode)) {
%>
ftp_<%=cid %>.enterLocalPassiveMode();
<%
if (isLog4jEnabled) {
%>
log.debug("<%=cid%> - Using the passive mode.");
<%
}
}
} else { } else {
%> %>
org.apache.commons.net.ftp.FTPSClient ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>"); ftp_<%=cid %> = (org.apache.commons.net.ftp.FTPSClient) globalMap.get("<%=conn %>");
<% <%
} }
%> %>
@@ -341,36 +273,11 @@ if (sftp) { // *** sftp *** //
log.info("<%=cid%> - Use an existing connection. Connection hostname: " + ftp_<%=cid %>.getRemoteHost() + ", Connection port: " + ftp_<%=cid %>.getRemotePort() + "."); log.info("<%=cid%> - Use an existing connection. Connection hostname: " + ftp_<%=cid %>.getRemoteHost() + ", Connection port: " + ftp_<%=cid %>.getRemotePort() + ".");
} }
<%}%> <%}%>
<%} else {%> <%} else {
ftp_<%=cid %> = new com.enterprisedt.net.ftp.FTPClient(); passwordFieldName = "__PASSWORD__";
ftp_<%=cid %>.setRemoteHost(<%=host %>); %>
ftp_<%=cid %>.setRemotePort(<%=port %>); <%@ include file="@{org.talend.designer.components.localprovider}/components/templates/FTP/ftp_connect.javajet"%>
<%}%>
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - " + <%=(("ACTIVE").equals(connectMode))?"\"Using the active mode.\"":"\"Using the passive mode.\""%>);
<%}%>
<%if (("ACTIVE").equals(connectMode)) {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.ACTIVE);
<%} else {%>
ftp_<%=cid %>.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);
<%}%>
ftp_<%=cid %>.setControlEncoding(<%=encoding%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Attempt to connect to '" + <%=host %> + "' with username '" +<%=user %>+ "'.");
<%}%>
ftp_<%=cid %>.connect();
<%
passwordFieldName = "__PASSWORD__";
%>
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
ftp_<%=cid %>.login(<%=username %>, decryptedPassword_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connect to '" + <%=host %> + "' has succeeded.");
<%}%>
<%}%>
<% <%
//add feature 19709,add the "Transfer mode" option, //add feature 19709,add the "Transfer mode" option,
//the default transfer mode is ASCII,we don't change the mode when ascii is choosed. //the default transfer mode is ASCII,we don't change the mode when ascii is choosed.

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