Compare commits

...

133 Commits

Author SHA1 Message Date
Dmytro Sylaiev
1dfe60285a Dsylaiev/tdi 48434 backport to 73 (#8067)
* fix(TDI-48434): Avoid NPE for the old xlsx format (#7920)

* fix(TDI-48434): Avoid NPE for the old xlsx format

* fix(TDI-48434): Fix the studio build

* fix(TDI-48434): Fix cherry-pick merge issue
2022-09-30 22:55:15 +03:00
wang wei
7bae6b958c fix(TDI-48473): Job using tLDAPInput with Protocol=LDAPS fails in MDM (#7955) 2022-09-29 18:43:17 +08:00
zshen-talend
4b6155564b fix(TDQ-20725): The default project dir path support reference project (#7999) (#8046) 2022-09-29 09:44:03 +08:00
zyuan-talend
71e0c0da5f fix(TUP-36626):tAmazonMysqlInput gets only tAmazonMysqlConnection and (#8018)
remove the version compatible tMysqlConnection from valid list.
2022-09-28 17:12:46 +08:00
wang wei
fefd0c1b47 fix(TDI-48550): tMysqlSCD component does not change date(time) fields to NULL (#8002) 2022-09-28 15:03:56 +08:00
Dmytro Grygorenko
cbc822c3a8 fix(TDI-47532): bump XercesImpl library to 2.12.2 (#7321) 2022-09-27 15:18:51 +08:00
dicarcab
b7210746e3 NPE exception while opening BigData Streaming Job (#8009) 2022-09-26 15:00:14 +02:00
pyzhou
c489fd8da7 fix(TDI-48576): update Apache Ant for tFileUnarchive. 2022-09-21 11:42:22 +08:00
Liu Xinquan
901963c1fc Revert "fix(TDQ-20610) org.apache.lucene:lucene-core (#7945)" (#7984)
This reverts commit 6b7fde47d0.
2022-09-13 17:48:09 +08:00
Liu Xinquan
6b7fde47d0 fix(TDQ-20610) org.apache.lucene:lucene-core (#7945) 2022-09-06 17:20:16 +08:00
hzhao
9642d20f56 fix(TUP-36593): Nexus proxy password is stored in clear text in project (#7954) 2022-09-06 09:31:02 +08:00
ypiel
d2c1b3d9ee fix(TPS-5340): mscrm oauth2 backport to 7.3.1 (#7925)
* fix(TPS-5340): mscrm oauth2 backport to 7.3.1

* fix(TPS-5340):  CLIENT_CREDENTIAL as PASSWORD.

* Revert "fix(TPS-5340):  CLIENT_CREDENTIAL as PASSWORD."

This reverts commit 9f0b633e44.

Co-authored-by: jzhao-talend <jzhao@talend.com>
2022-09-05 17:41:59 +08:00
hzhao
1c56a4d797 fix(TUP-36593): Nexus proxy password is stored in clear text in project (#7938)
* fix(TUP-36593): Nexus proxy password is stored in clear text in project
setting preference

* fix(TUP-36593): Nexus proxy password is stored in clear text in project
2022-09-02 16:53:50 +08:00
pyzhou
75664ab5b6 fix(TDI-48456):tPOP java8 compatibility (#7927) 2022-09-01 11:20:44 +08:00
wang wei
83f862a29f fix(TDI-48333): [CVE]: replace or remove xalan dependency for tfileinputxml and twebservicexxx components (#7889) 2022-09-01 10:42:47 +08:00
pyzhou
a9227785c4 Added extra fields, dependencies + token fetch logic. (#7918)
Co-authored-by: Balázs Gunics <bgunics@talend.com>
2022-08-31 18:01:33 +08:00
Xilai Dai
a61f2c6797 fix(APPINT-34973) exclude saaj-impl from OSGi build (#7911) 2022-08-31 16:09:36 +08:00
pyzhou
d5df42537d fix(TDI-48443):backport TDI-47447 (#7917)
* fix(TDI-48443):backport TDI-47447

* correct name
2022-08-31 02:17:45 +08:00
pyzhou
cd6b711595 fix(TDI-48322):align javax.mail version (#7847)
# Conflicts:
#	main/plugins/org.talend.designer.components.localprovider/components/tMicrosoftCrmInput/tMicrosoftCrmInput_java.xml
#	main/plugins/org.talend.designer.components.localprovider/components/tMicrosoftCrmOutput/tMicrosoftCrmOutput_java.xml
2022-08-31 01:44:30 +08:00
hcyi
4502ff4ae3 fix(TUP-36483):Code generation fails with xmlmap. (#7907) 2022-08-30 17:57:29 +08:00
jzhao
625aeaebf9 fix(TDI-48426):CVE: org.postgresql:postgresql:42.2.25 (#7904) 2022-08-30 15:57:50 +08:00
pyzhou
838d016f41 feat(TDI-47369): tSendMail Oauth2 (#7784)
* fix(TDI-47369): tSendMail Oauth2

* fix migration

* feat(TDI-47447):tPOP OAuth2.0

* rename

* fix show if

* tSendMile MVN path

* tPOP mvn path

* correct migration description.
# Conflicts:
#	main/plugins/org.talend.designer.components.localprovider/components/tPOP/tPOP_messages.properties
#	main/plugins/org.talend.designer.components.localprovider/components/tSendMail/tSendMail_messages.properties
#	main/plugins/org.talend.repository/plugin.xml
2022-08-30 01:13:33 +08:00
sbliu
d2a1041993 chore(TUP-36502) upgrade org.postgresql:postgresql:42.2.25 to 42.2.26 (#7900) 2022-08-29 16:37:30 +08:00
Xilai Dai
cfbec28162 fix(APPINT-34738) add MsmqTalend into osgi-exclude.properties (#7897) 2022-08-17 16:22:14 +08:00
Abdulhamid Rashankar
38c60c194f APPINT-34738:Integrate Talend-customized Microsoft MQ driver jar with improved native library loading (#7860)
Co-authored-by: arashankar <abdulhamid0606@gmail.com>
2022-08-09 09:34:21 +02:00
Liu Xinquan
02d660edd5 fix(TDQ-20362): Update and save analysis when rename jdbc connection (#7818) 2022-08-08 09:48:49 +08:00
msjian
e7cf31a2a1 fix(TDQ-20638): fix a replacement error for DQ item (#7842) 2022-08-02 17:15:03 +08:00
Laurent BOURGEOIS
6204d78546 fix(TBD-14061):CVE: commons-collections:commons-collections:3.2.1 2022-08-01 16:29:03 +02:00
vyu-talend
f5d40d7898 fix(TDI-48082):add additional parameters to all greenplum. (#7794) (#7829) 2022-08-01 17:51:39 +08:00
pyzhou
5c3b8f54cb fix(TDI-48107):gson CVE (#7668)
* fix(TDI-48107):gson CVE

# Conflicts:
#	main/plugins/org.talend.designer.components.libs/libs_src/adal4j/pom.xml

* Revert "fix(TDI-48107):gson CVE"

This reverts commit 7f54d53b3b.

* fix(TDI-48107):gson CVE

# Conflicts:
#	main/plugins/org.talend.designer.components.libs/libs_src/adal4j/pom.xml

* fix(TDI-48107):gson CVE

* back to 2.8.9

* tcloud

* cloud upgrade

* fix(TDI-48107):don't need to update gson for talend-mscrm on 7.3

Co-authored-by: jzhao-talend <jzhao@talend.com>
2022-07-28 09:32:24 +08:00
Dmytro Grygorenko
3943cfb8d1 fix(TDI-48259): Fix MSCRM regression for 731 (#7807)
* fix(TDI-48259): backporting original "talend-mscrm-3.10-20211021" library.

* fix(TDI-48259): new "talend-mscrm" version to fix CVE.

* fix(TDI-48259): formatting, some version changed.

* fix(TDI-48259): missing changes restored.

* fix(TDI-48259): slf4j version.

* fix(TDI-48259): formatting again.

* fix(TDI-48259): Jackson bump.
2022-07-27 15:26:07 +03:00
wang wei
87679ad3b1 fix(TDI-48203): [CVE]: routines.system.JSONObject(Object bean) use reflect to call method invoke, that's dangerous for evil script inject(#7721) 2022-07-27 09:37:18 +08:00
Oleksandr Zhelezniak
a3b64152be chore(TDI-48177): bump google oauth (#7765)
* 1.31.0 -> 1.33.3
2022-07-26 11:07:21 +03:00
sbliu
2e8c6f3188 fix(TUP-36128) fix problem when parse where condition string which contains global string for tELTmap. (#7804)
* fix(TUP-36128) fix problem when parse where condition string which contains global string for tELTmap.

* fix(TUP-36128) add junit .
2022-07-26 11:06:52 +08:00
Zhiwei Xue
38e20f74fa fix(TUP-18979):Migration tasks including mapping files (#7754) 2022-07-22 16:52:05 +08:00
Oleksandr Zhelezniak
93c6383ef7 chore(TDI-48081): bump xmlsec 2.3.1 (#7769)
* MCRMInput\Output 2.1.2 -> 2.3.1
2022-07-22 09:52:14 +03:00
kjwang
4af633af53 TUP-36157 Error when install Bigtable in studio: Illegal character in (#7763)
TUP-36157 Error when install Bigtable in studio: Illegal character in query
https://jira.talendforge.org/browse/TUP-36157
2022-07-22 09:38:18 +08:00
zshen-talend
e8bdf16525 fix(TDQ-20577): replace project name with lowercase mode in TDQItems when export job (#7768) 2022-07-20 10:44:19 +08:00
Dmytro Sylaiev
a0d3dc47fb fix(TDI-47908): Commit stats in case of Error (#7703) 2022-07-19 10:08:35 +03:00
pyzhou
2d24b5d5fd fix(TDI-48024): ResumeUtil performance issue. (#7771) 2022-07-19 12:02:52 +08:00
vyu-talend
946402c192 fix(TDI-47976):fix some potencial npe. (#7757) (#7788) 2022-07-19 10:21:22 +08:00
wang wei
0e0749cfdf fix(TDI-48221): tDBBulkExec (MYSQL) Failing with error (#7739) 2022-07-18 10:16:26 +08:00
zshen-talend
6265144309 fix(TDQ-20754): revert code to keep project is lowercase (#7745) 2022-07-08 17:46:01 +08:00
Dmytro Grygorenko
f15a3e3e7c chore(TDI-48185): backport leftovers for "nimbus-jose" update. (#7719) 2022-07-04 11:48:36 +03:00
Dmytro Grygorenko
7d46024e9d chore(TDI-48134): backport "nimbus-jose" lib update. (#7688) 2022-07-04 11:13:35 +03:00
Abdulhamid Rashankar
4543d6a129 APPINT-34489 : profile added for prometheus dependencies (#7700) 2022-06-29 13:56:08 +02:00
zshen-talend
a61882573f fix(TDQ-19623): fix junit about BuildJobHandlerTest.testBuildJobWithTDM (#7692) (#7697) 2022-06-29 13:04:31 +08:00
kjwang
748e0d218f Kjwang/fix tup 35887 npe 73 (#7691)
"build job" working in 7.2.1 fails in 8.0.1: Failed to generate code :
NPE org.talend.designer.dbmap.language.oracle.OracleGenerationManager.addQuoteForSpecialChar
https://jira.talendforge.org/browse/TUP-35887
2022-06-29 11:38:02 +08:00
bhe-talendbj
0752bfd4fa fix(TUP-35942): update relevant job only after renaming joblet (#7678) 2022-06-29 11:20:29 +08:00
Jill Yan
503e187f96 APPINT-34694 build routlet module (#7674)
Co-authored-by: jillyan <yan955599@gmail.com>
2022-06-29 10:48:36 +08:00
zshen-talend
09bdc7e42d fix(TDQ-19623): make sure project name never force lowercase (#7659) 2022-06-17 10:13:47 +08:00
zshen-talend
885fe944f5 fix(TDQ-19623): make sure build job action work for reference project (#7653) 2022-06-15 18:17:34 +08:00
apoltavtsev
2087cdfe68 fix(APPINT-34416) Migrate to CXF 3.4.7 (#7626) 2022-06-07 15:42:14 +02:00
Oleksandr Zhelezniak
81345dd1b0 fix(TDI-47895): oracle input float length (#7545)
* force to use 38 as length for NUMBER (FLOAT) in oracle when getPrecision returns value bigger than 38
* getPrecision for Float Oracle returns 126.
* It's expected binary precision for FLOAT Oracle type. The decimal precision for it is 38.
2022-06-07 09:43:50 +03:00
sbieliaievl
d2982b93e7 bugfix(APPINT-33830) - migration for demos (#7600)
* Added rename timeout parameters for tRESTClient migration

* Added rename timeout parameters for tRESTClient migration

* Comment changes for RenameTimeoutParameterstRESTClient

* Code refactoring in RenameTimeoutParameterstRESTClient
2022-06-06 09:54:00 +03:00
wang wei
b2ce9e2ee2 fix(TDI-48037): CVE: org.postgresql:postgresql:42.2.14 (#7574) 2022-06-02 16:37:38 +08:00
Jill Yan
25d0a3c978 jill/fix-m73/APPINT-34618 add mssql driver to import-package for child job (#7606)
* APPINT-34618 add mssql driver to import-package for child job

* APPINT-34618 remove mssql-jdbc in build lib

Co-authored-by: jillyan <yan955599@gmail.com>
2022-06-02 14:36:39 +08:00
sbliu
1d4e07ebd0 chore(TUP-35245) upgrade cxf to 3.4.7 (#7475) 2022-06-02 09:30:45 +08:00
wang wei
2a591f79ce fix(TDI-47803): Compile error after applying Patch_20220107_R2022-01_v1-7.3.1 (#7474) 2022-06-01 11:29:36 +08:00
sbliu
30d42547e5 chore(TUP-35684) upgrade xmlbeans. (#7590) 2022-05-31 16:12:28 +08:00
bhe-talendbj
fe468cbf15 chore(TUP-35685): upgrade database driver (#7575) 2022-05-31 11:39:04 +08:00
vyu-talend
ce2b399fe4 chore(TDI-47796):upgrade cxf to 3.4.7 (#7570)
* fix(TDI-47796):backport talend-ws from master to 7.3 to align

* chore(TDI-47796):bump cxf version to 3.4.7

* chore(TDI-47796):upgrade talend-ws version for twebservice comps
2022-05-30 15:51:59 +08:00
Chao MENG
55aba706f6 Cmeng/fix/tup 35608 db version 7 (#7572)
* fix(TUP-35608): Stat and Logs screen - Database connection dropdown
incorrect
https://jira.talendforge.org/browse/TUP-35608

* fix(TUP-35608): Stat and Logs screen - Database connection dropdown
incorrect
https://jira.talendforge.org/browse/TUP-35608
2022-05-26 19:45:11 +08:00
Zhiwei Xue
4ee53f979e fix(TUP-31233):Routine pom is not updated after installed the required (#7547)
* fix(TUP-31233):Routine pom is not updated after installed the required
jar of user routine

* fix(TUP-31233):Routine pom is not updated after installed the required
jar of user routine

* fix(TUP-31233):Routine pom is not updated after installed the required
jar of user routine
2022-05-25 18:04:51 +08:00
Dmytro Sylaiev
51142f7983 fix(TDI-47452): Fix codegen for not valid xpath expression (#7175) 2022-05-16 12:50:26 +03:00
jiezhang-tlnd
e2697a8226 fix(TUP-33047)Help links in Studio (#7472) 2022-05-09 10:38:41 +08:00
sponomarova
86eb6ab2fe fix(TBD-13798): CVE: Replace log4j1.x by reload4j for org.talend.libraries.hadoop.mapr.5.0.0 (#7450) 2022-05-05 16:56:39 +03:00
Emmanuel GALLOIS
1690847460 fix(TCOMP-2045): master backport (#7495) 2022-05-05 09:33:02 +02:00
wang wei
461258adc9 fix(TDI-47819): tJDBCInput component results in error with Dynamic schema inTalend latest versions. (#7426) 2022-05-05 13:44:11 +08:00
Emmanuel GALLOIS
3e4d33ab73 feat(TDI-47764): bump component-runtime to 1.38.6 (#7384)
* feat(TDI-47764): Bump component-runtime to 1.38.6

* feat(TDI-47764): Bump component-runtime to 1.38.6

* remove snapshot

Co-authored-by: jzhao-talend <jzhao@talend.com>
2022-05-05 10:19:29 +08:00
Oleksandr Zhelezniak
962e6b754b chore(TDI-47688): bump jackson (#7385)
* jackson: 2.11.3 -> 2.13.2
* jackson-databind: 2.11.3 -> 2.13.2.2
2022-04-29 15:24:30 +03:00
Emmanuel GALLOIS
302b9a4921 feat(TCOMP-2045): Pass meta information about columns (#7100) 2022-04-29 12:56:31 +02:00
pyzhou
02f5d99a23 Pyzhou/tdi 43829 zip4j2 tfile archive 7.3 (#7478)
* feat(TDI-43829): Add support for zip4j 2.x libraries to tFileArchive/unArchive components

# Conflicts:
#	main/plugins/org.talend.designer.components.libs/libs_src/talendzip/pom.xml

# Conflicts:
#	main/plugins/org.talend.designer.components.localprovider/components/tFileUnarchive/tFileUnarchive_java.xml

* fix(TDI-43829): move IntegrityUtil.java

# Conflicts:
#	main/plugins/org.talend.designer.components.libs/libs_src/checkArchive/pom.xml
2022-04-28 16:45:02 +08:00
hcyi
a34a1fb6dc fix(TUP-35078):tJDBCSCDELT does not work correctly on Snowflake. (#7397)
* fix(TUP-35078):tJDBCSCDELT does not work correctly on Snowflake.

* fix(TUP-35078):tJDBCSCDELT does not work correctly on Snowflake.

* fix(TUP-35078):add junits
2022-04-25 17:18:57 +08:00
Dmytro Sylaiev
5c2049fb1b fix(TDI-47802): Fix short strings as Clobs (#7425)
* Add warning for long strings as varchar
2022-04-20 20:43:13 +03:00
vyu-talend
ddafd9607d fix(TDI-46584):modify limit label. (#7458) 2022-04-20 18:11:00 +08:00
Chao MENG
12339ad3ab chore: fix swtbot issue (#7448) 2022-04-19 11:12:53 +08:00
Jane Ding
76c8733bad fix(TUP-35238):Drag and drop Redshift metadata to list components lost (#7418)
some components
https://jira.talendforge.org/browse/TUP-35238
2022-04-15 15:47:19 +08:00
pyzhou
50a9456491 feat(TDI-47687):tScp reuse session (#7417)
* feat(TDI-47687):tScp reuse session

* feat(TDI-47687): tSCPFileList

* feat(TDI-47687): tSCPFileList compile error
2022-04-12 11:44:53 +08:00
wang wei
bbb82ade0d fix(TDI-46584): tServiceNowInput Limit disable option in Advanced settings not working (#6717)
* fix(TDI-46584): tServiceNowInput Limit disable option in Advanced
settings not working

* fix something

* fix more

* fix(TDI-46584):fix the job won't stop issue.

* fix(TDI-46584):fix always reading-all-records issue.

Co-authored-by: vyu <vyu@talend.com>
2022-04-11 14:25:29 +08:00
Chao MENG
b5e8c7d605 fix(TUP-35034): CI - stop the build if custom component is missing
https://jira.talendforge.org/browse/TUP-35034
2022-04-07 20:13:35 +08:00
Chao MENG
97bc429216 fix(TUP-35034): CI - stop the build if custom component is missing (#7402)
https://jira.talendforge.org/browse/TUP-35034
2022-04-07 16:34:48 +08:00
clesaec
0d0d0bc9db TDI-47287 : change ftpput (#7352) 2022-04-04 07:37:58 +02:00
Chao MENG
ecd65bd27d fix(TUP-35034): CI - stop the build if custom component is missing
https://jira.talendforge.org/browse/TUP-35034
2022-04-01 19:07:51 +08:00
wwang-talend
95614a456c fix(TDI-47536): CVE : logback 2022-03-31 08:31:33 +08:00
wang wei
45fd8866a1 fix(TDI-47633): CVE: Replace log4j1.x by reload4j or upgrade to log4j2 (#7332) 2022-03-30 18:25:40 +08:00
jiezhang-tlnd
662cb3ce5d fix(TUP-34954)CVE: Replace log4j1.x by reload4j (#7331)
* fix(TUP-34954)CVE: Replace log4j1.x by reload4j

* update junits

* exclude log4j from slf4j-log4j12
2022-03-30 17:36:25 +08:00
Chao MENG
15d8e5966f Cmeng/fix/tup 35034 err on component missing m73 (#7328)
* fix(TUP-34378): Job could build out successfully if contains component which cannot be loaded (#7286)

* fix(TUP-34378): Job could build out successfully if contains component
which cannot be loaded
https://jira.talendforge.org/browse/TUP-34378

* fix(TUP-35034): CI - stop the build if custom component is missing
https://jira.talendforge.org/browse/TUP-35034

* fix(TUP-35034): CI - stop the build if custom component is missing
https://jira.talendforge.org/browse/TUP-35034

* fix(TUP-35034): CI - stop the build if custom component is missing
https://jira.talendforge.org/browse/TUP-35034

* fix(TUP-35034): CI - stop the build if custom component is missing
https://jira.talendforge.org/browse/TUP-35034
2022-03-30 16:10:45 +08:00
bhe-talendbj
092cd497a7 feat(TUP-33809): check modulelist (#7209) (#7285)
* feat(TUP-33809): check modulelist

* feat(TUP-33809): get all sub jobs
2022-03-30 11:40:39 +08:00
Dmytro Grygorenko
b8adbf0321 fix(TDI-47670): fix Xpath "count" function for unformatted XML file. (#7355) 2022-03-29 16:33:43 +03:00
wang wei
2510f3ad4f fix(TDI-47589): "Write Excel 2007 format" leads to tFileOutputExcel poor performance(#7261) 2022-03-28 14:43:23 +08:00
Xilai Dai
00c50f158a fix(APPINT-34443) add missing import packages for tRESTClient (#7334) 2022-03-28 13:35:23 +08:00
Oleksandr Zhelezniak
f2d9ef95dc fix(TDI-47651): bump Redshift driver to 1.2.55.1083 (#7315) 2022-03-24 11:02:47 +02:00
jzhao
1a627ac736 fix(TDI-47373):update IBM MQ client lib to 9.2.4.0 (#7281) 2022-03-16 15:12:14 +08:00
pyzhou
cd0646d89c Pyzhou/tdi 47528 CVE mina sshd 7.3 (#7279)
* fix(TDI-47528):CVE mina-sshd

* upgrade talend-scp-helper version

* compile error

* compile error

* compile error

* timeout
2022-03-11 11:28:40 +08:00
Chao MENG
544eecb22d fix(TUP-30599): tMap drag and drop does not work seamlessly in Linux GUI (#7267)
as it does in Windows
https://jira.talendforge.org/browse/TUP-30599
2022-03-04 16:13:11 +08:00
wang wei
d2717e757e fix(TDI-47230): close thread pool for spring boot case (#7272) 2022-03-03 17:08:47 +08:00
pyzhou
e2ef1e4028 Revert "Revert "fix(TDI-47385): tMap error when tenary operator is used (#7188)""
This reverts commit b7bea1900e.
2022-02-28 21:18:02 +08:00
Laurent BOURGEOIS
074579381d chore(TBD-13325):CVE on protobuf-java-2.5.0 (#7179) 2022-02-28 10:29:59 +01:00
pyzhou
b7bea1900e Revert "fix(TDI-47385): tMap error when tenary operator is used (#7188)"
This reverts commit cbe2bb000d.
2022-02-28 16:09:46 +08:00
Dmytro Ochkas
3859b1e957 fix(TDI-47385): tMap error when tenary operator is used (#7188)
Add parentheses so that user don't add them manually
2022-02-28 15:59:52 +08:00
Liu Xinquan
74d2a8410e fix(TBD-13419) Class not found happen in spark job calling a standard… (#7163) (#7237) 2022-02-28 14:53:03 +08:00
sbliu
1f7a4875ef fix(TUP-34769) add junit (#7253) 2022-02-28 14:25:29 +08:00
wwang-talend
637aa45e61 fix(TDI-47230): use fixedthreadpool for TDM 2022-02-28 10:45:00 +08:00
hcyi
75be28c5b1 fix(TUP-34593):Cannot connect to Salesforce with password starting with double-quotes (#7244)
* fix(TUP-34593):Cannot connect to Salesforce with password starting with
double-quotes

* fix(TUP-34593):Cannot connect to Salesforce with password starting with
double-quotes

* fix(TUP-34593):add junits
2022-02-25 17:52:24 +08:00
jiezhang-tlnd
00cc76bb3c fix(TUP-34609)Cannot retrieve Module Name in tSalesforceInput with (#7246)
* fix(TUP-34609)Cannot retrieve Module Name in tSalesforceInput with
password starting with double-quotes

* change condition
2022-02-25 17:48:05 +08:00
wang wei
35d710ca54 fix(TDI-47230): avoid create thread for every task for
twritexmlfield/twritejsonfield in loop
2022-02-24 14:55:43 +08:00
sbliu
c78507196c fix(TUP-34769) Error fields for Rejects get dropped from tSalesforceOutput after Sync Columns. (#7232)
fix bug TUP-33497
2022-02-23 17:56:24 +08:00
Dmytro Grygorenko
7a60d7fdbb fix(TDI-47524): replace non-dynamic column for PosgresqlOutput with dynamic schema. (#7224) 2022-02-21 10:22:28 +02:00
kjwang
e05ae031de TUP-34156 UI is broken for TCK Table structures in 8.0.1 + nighty (#7205)
TUP-34156 UI is broken for TCK Table structures in 8.0.1 + nighty
https://jira.talendforge.org/browse/TUP-34156
2022-02-17 11:47:41 +08:00
Dmytro Ochkas
3028e357b1 fix(TDI-47435): tPostgreSqlOutput 'Debug query mode' and 'Upsert' (#7167)
* Modified some DB templates so they initialize unresolved variable when dataAction is 'Upsert'
2022-02-16 19:14:13 +02:00
Dmytro Grygorenko
7dab8ce963 fix(TDI-47437): check for replaced column for Postgres Upsert action. (#7206) 2022-02-16 16:24:22 +02:00
Dmytro Ochkas
35b20bb39e fix(TDI-47436): tPostgreSqlOutput upsert and dynamic column (#7172)
* ON CONFLICT clause now contains not only dynamic columns but not dynamic ones as well
2022-02-16 16:05:20 +02:00
pyzhou
25d58e1fd2 fix(TDI-47396):tSCPGet doesn't always close session (#7134) 2022-02-14 17:53:39 +08:00
pyzhou
ea023892f0 fix(TDI-47336):Align snowflake driver (#7155) 2022-01-27 13:12:29 +08:00
wang wei
d6fd1cbe18 fix(TDI-47395): tPostgresqlOutput cannot select Insert as Action on Data when disable the Log4j(#7136) 2022-01-26 16:49:52 +08:00
bhe-talendbj
ce1fd92c74 fix(TUP-34535): disable log4j for dataproc (#7154)
* fix(TUP-34535): disable log4j for dataproc

* fix(TUP-34535): add log4j2 check

* fix(TUP-34535): disable log4j2 only
2022-01-24 18:00:52 +08:00
Wei Hua
bc4b7a489a APPINT-33765 [7.3.1 patch] ClassNotFoundException in runtime when DB connection (SQLServer) in joblet without using alias (#7089) 2022-01-21 10:30:28 +08:00
Jill Yan
e51292ea35 APPINT-31044 (#7097)
Co-authored-by: jillyan <yan955599@gmail.com>
2022-01-19 17:04:29 +08:00
jzhao
c2b7b58302 fix(TDI-46871):tFTPXXX component host can't use expression without "()" (#6742) 2022-01-14 15:07:15 +08:00
kjwang
893b214fcf TUP-34282 CVE: log4j-core(1.2-api)-[2-2.16.0) (Fix junit) (#7096)
https://jira.talendforge.org/browse/TUP-34282
2022-01-10 10:54:05 +08:00
kjwang
c0d3e099dd TUP-34282 CVE: log4j-core(1.2-api)-[2-2.16.0) (#7082)
* TUP-34282 CVE: log4j-core(1.2-api)-[2-2.16.0)
https://jira.talendforge.org/browse/TUP-34282
2022-01-07 10:02:18 +08:00
Oleksandr Zhelezniak
3970eb25af fix(TDI-46410): update namespace in xml element (#7018) 2022-01-04 14:40:17 +02:00
wang wei
79361417eb fix(TDI-47212): CVE: jackson-mapper(core)-asl-1.9.15-TALEND (#7073) 2021-12-31 17:07:03 +08:00
pyzhou
1240c228c1 fix(TDI-47234):tXSLT regression (#7066)
* fix(TDI-47234):tXSLT regression

* correct migration result

* Revert "correct migration result"

This reverts commit 677ff8525e.
2021-12-31 11:01:49 +08:00
Zhiwei Xue
47953ea772 workitem(TUP-34111):slow studio build time for remote execution (#7040) 2021-12-30 16:05:14 +08:00
jiezhang-tlnd
8bf40999cb fix(TUP-33863)Update of Metadata Hadoop Cluster does not change spark (#6945)
* fix(TUP-33863)Update of Metadata Hadoop Cluster does not change spark
version when propagated
https://jira.talendforge.org/browse/TUP-33863

* fix(TUP-33863)Update of Metadata Hadoop Cluster does not change spark
version when propagated

* add common judgment

* add common fix

* Update of Metadata Hadoop Cluster does not change spark version when
propagated
2021-12-30 11:18:09 +08:00
Wei Hua
d8824c7d80 APPINT-34077 RuntimeException: java.lang.NoClassDefFoundError: org/apache/cxf/databinding/DataBinding (#7061) 2021-12-29 14:49:10 +08:00
Emmanuel GALLOIS
c89e5a35db fix(TDI-47213): correct migration issue w/ context + function call (#6999)
* fix(TDI-47213): correct migration issue w/ context + function call

* fix(TCOMP-2053): correct migration issue w/ context + function call
2021-12-29 11:25:23 +08:00
ypiel
22b2899392 chore: bump tck/1.38.5 (#7052) 2021-12-29 11:07:48 +08:00
Jane Ding
5c5e4a561f fix(TUP-33830):[7.3] ref project compilation error (#7054)
* fix(TUP-33830):[7.3] ref project compilation error
https://jira.talendforge.org/browse/TUP-33830

* fix(TUP-33830):[7.3] ref project compilation error
https://jira.talendforge.org/browse/TUP-33830
2021-12-29 10:23:57 +08:00
Zhiwei Xue
a972cbe1ec fix(TUP-33966):Studio/commandline fails to generate code for the job, (#6978)
throws "Invalid thread access"
2021-12-29 09:45:53 +08:00
sbliu
79599d9db9 chore(TUP-33956) remove xercesImpl from libraries needed. (#7029) 2021-12-27 15:26:21 +08:00
379 changed files with 6689 additions and 10242 deletions

View File

@@ -514,17 +514,35 @@
}
org.apache.logging.log4j.core.config.Configurator.setLevel(org.apache.logging.log4j.LogManager.getRootLogger().getName(), log.getLevel());
<%}%>
}
log.info("TalendJob: '<%=codeGenArgument.getJobName()%>' - Start.");
<%}%>
<%
INode jobCatcherNode = null;
}
log.info("TalendJob: '<%=codeGenArgument.getJobName()%>' - Start.");
<%}%>
<%
INode jobCatcherNode = null;
int threadPoolSize = 0;
boolean tRESTRequestLoopExists = false;
for (INode nodeInProcess : process.getGeneratingNodes()) {
String componentName = nodeInProcess.getComponent().getName();
if("tJobStructureCatcher".equals(componentName)) {
if(jobCatcherNode==null && "tJobStructureCatcher".equals(componentName)) {
jobCatcherNode = nodeInProcess;
break;
continue;
}
if(!nodeInProcess.isActivate()) continue;
if("tRESTRequestLoop".equals(componentName)) {
tRESTRequestLoopExists = true;
continue;
}
if("tWriteXMLFieldOut".equals(componentName)) {
IConnection nextMergeConn = NodeUtil.getNextMergeConnection(nodeInProcess);
if(nextMergeConn == null || nextMergeConn.getInputId()==1){
threadPoolSize++;
}
}
}
@@ -652,15 +670,15 @@
boolean inOSGi = routines.system.BundleUtils.inOSGi();
if (inOSGi) {
java.util.Dictionary<String, Object> jobProperties = routines.system.BundleUtils.getJobProperties(jobName);
if (jobProperties != null && jobProperties.get("context") != null) {
contextStr = (String)jobProperties.get("context");
}
}
try {
java.util.Dictionary<String, Object> jobProperties = null;
if (inOSGi) {
jobProperties = routines.system.BundleUtils.getJobProperties(jobName);
if (jobProperties != null && jobProperties.get("context") != null) {
contextStr = (String)jobProperties.get("context");
}
}
//call job/subjob with an existing context, like: --context=production. if without this parameter, there will use the default context instead.
java.io.InputStream inContext = <%=className%>.class.getClassLoader().getResourceAsStream("<%=jobClassPackageFolder%>/contexts/" + contextStr + ".properties");
if (inContext == null) {
@@ -670,8 +688,17 @@
try {
//defaultProps is in order to keep the original context value
if(context != null && context.isEmpty()) {
defaultProps.load(inContext);
context = new ContextProperties(defaultProps);
defaultProps.load(inContext);
if (inOSGi && jobProperties != null) {
java.util.Enumeration<String> keys = jobProperties.keys();
while (keys.hasMoreElements()) {
String propKey = keys.nextElement();
if (defaultProps.containsKey(propKey)) {
defaultProps.put(propKey, (String) jobProperties.get(propKey));
}
}
}
context = new ContextProperties(defaultProps);
}
} finally {
inContext.close();
@@ -857,7 +884,7 @@
}
%>
//Resume: jobStart
resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "","","","",resumeUtil.convertToJsonText(context,parametersToEncrypt));
resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "","","","",resumeUtil.convertToJsonText(context,ContextProperties.class,parametersToEncrypt));
<%
if (stats) {
@@ -1130,9 +1157,15 @@ this.globalResumeTicket = false;//to run others jobs
if (!componentName.equals("tJobStructureCatcher") && !componentName.equals("tLogCatcher") && !componentName.equals("tFlowMeterCatcher") && !componentName.equals("tAssertCatcher") && !componentName.equals("tStatCatcher") && !componentName.equals("tAsyncIn")) {
%>
<%=createCallProcess(rootNode, className, false) %>
<% }
}
}// end if(isRunInMultiThread)
<%
if (process.getNodesOfType("tStatCatcher").size() > 0) {
%>
<%=statsErrorHandlingAfterMainCall(rootNode, process.getNodesOfType("tStatCatcher"))%>
<%
}
}
}
}// end if(isRunInMultiThread)
%>
this.globalResumeTicket = true;//to run tPostJob
@@ -1190,6 +1223,26 @@ this.globalResumeTicket = true;//to run tPostJob
e.printStackTrace();
}
}
<%
}
//tRESTRequest may appear in microservice, the code may be called before call submit(task) method, so can't shutdown it here
if(!tRESTRequestLoopExists && threadPoolSize>0) {
%>
es.shutdown();
<%//shutdownNow should never be executed, only for safe%>
try {
if(!es.awaitTermination(60, java.util.concurrent.TimeUnit.SECONDS)) {
es.shutdownNow();
if(!es.awaitTermination(60, java.util.concurrent.TimeUnit.SECONDS)) {
}
}
} catch (java.lang.InterruptedException ie) {
es.shutdownNow();
} catch (java.lang.Exception e) {
}
<%
}
%>
@@ -1246,7 +1299,7 @@ if (execStat) {
returnCode = errorCode.intValue();
}
resumeUtil.addLog("JOB_ENDED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "","" + returnCode,"","","");
resumeUtil.flush();
return returnCode;
}

View File

@@ -42,10 +42,10 @@ public class CLASS
//List< ? extends IConnection> onSubJobErrorConns = rootNode.getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR);
//if(onSubJobErrorConns!=null){
// for(IConnection conn : onSubJobErrorConns) {
// for(IConnection conn : onSubJobErrorConns) {
// toReturn += createCallProcess(conn.getTarget(), className, isMultiThread);
// }
//}
//}
if(isMultiThread){
toReturn += "\n}catch (java.lang.Error e_" + rootNode.getUniqueName() + ") {\n";
toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n";
@@ -55,7 +55,20 @@ public class CLASS
toReturn += "\n}";
return toReturn;
}
public String statsErrorHandlingAfterMainCall(INode rootNode, List<? extends INode> statsNodes) {
String catchErrorReturn = "catch (Error error_" + rootNode.getUniqueName() + " ) {\n";
catchErrorReturn+="end = System.currentTimeMillis();\n";
for (INode statCatcherNode : statsNodes) {
catchErrorReturn += statCatcherNode.getUniqueName() + ".addMessage(\"failure\", (end-startTime));\n";
catchErrorReturn += "try {\n " + statCatcherNode.getDesignSubjobStartNode().getUniqueName() + "Process(globalMap);\n";
catchErrorReturn += "} catch (Exception e_" + statCatcherNode.getUniqueName() + ") {\n";
catchErrorReturn += "e_" + statCatcherNode.getUniqueName() + ".printStackTrace();\n}\n";
}
catchErrorReturn+= "throw error_" + rootNode.getUniqueName() + ";\n}\n";
return catchErrorReturn;
}
public String generate(Object argument) {
return "";
}

View File

@@ -170,16 +170,8 @@ class IndexedRecordToRowStructGenerator {
if (columnName.equals(dynamicColName)) {
%>
java.util.Map<String, Object> dynamicValue_<%=cid%> = (java.util.Map<String, Object>) <%=codeVarSchemaEnforcer%>.get(<%=i%>);
org.apache.avro.Schema dynSchema_<%=cid%> = ((org.talend.codegen.enforcer.OutgoingDynamicSchemaEnforcer) <%=codeVarSchemaEnforcer%>).getDynamicFieldsSchema();
for (org.apache.avro.Schema.Field dynamicField_<%=cid%> : dynSchema_<%=cid%>.getFields()){
String name = dynamicField_<%=cid%>.name();
if("true".equals(dynamicField_<%=cid%>.getProp("ENABLE_SPECIAL_TABLENAME"))){
dynamicValue_<%=cid%>.put(dynamicField_<%=cid%>.getProp("talend.field.dbColumnName"), dynamicValue_<%=cid%>.get(name));
dynamicValue_<%=cid%>.remove(name);
}
}
for (java.util.Map.Entry<String, Object> dynamicValueEntry_<%=cid%> : dynamicValue_<%=cid%>.entrySet()) {
<%=codeVarDynamic%>.setColumnValue(<%=codeVarDynamic%>.getIndex(dynamicValueEntry_<%=cid%>.getKey()), dynamicValueEntry_<%=cid%>.getValue());
<%=codeVarDynamic%>.addColumnValue(dynamicValueEntry_<%=cid%>.getValue());
}
<%=codeVarRowStruct%>.<%=dynamicColName%> = <%=codeVarDynamic%>;
<%

View File

@@ -385,11 +385,101 @@ public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Ch
<%
INode jobCatcherNode = null;
//one matched component or part, one thread
//why not computed by cpu or resource : please image this case :
//loop==>(input==>(twritexmlfield A)==>(twritexmlfield B)==>(twritexmlfield C)==>output), dead lock as cycle dependency and only one thead in thread pool
//maybe newCachedThreadPool is a better idea, but that have risk for creating more threads, then more memory for TDI-47230
//why not generate thread pool object in subprocess scope :
// 1: major reason : difficult to control the var scope, somewhere can't access it, then compiler issue
// 2: we may need this thread pool for bigger scope, not only for twritexmlfield/twritejsonfield in future
// 3: we don't suppose this thread pool cost big resource after all tasks done, so we can shutdown it more later,
// for example, most time, user will use less than 3 twritexmlfield in one job, then 3 threads thread pool, we can close them in job finish code part,
// not a big cost to keep that. And of course, we best to start&clean it in subprocess finish, but that's risk of 1 above.
int threadPoolSize = 0;
boolean tHMapExists = false;
boolean tHMapOutExists = false;
boolean tRESTRequestLoopExists = false;
for (INode nodeInProcess : processNodes) {
String componentName = nodeInProcess.getComponent().getName();
if("tJobStructureCatcher".equals(componentName)) {
if(jobCatcherNode==null && "tJobStructureCatcher".equals(componentName)) {
jobCatcherNode = nodeInProcess;
break;
continue;
}
if(!nodeInProcess.isActivate()) continue;
if("tHMap".equals(componentName)) {
tHMapExists = true;
continue;
}
if("tHMapOut".equals(componentName)) {
tHMapOutExists = true;
continue;
}
if("tRESTRequestLoop".equals(componentName)) {
tRESTRequestLoopExists = true;
continue;
}
if("tWriteXMLFieldOut".equals(componentName)) {
IConnection nextMergeConn = NodeUtil.getNextMergeConnection(nodeInProcess);
if(nextMergeConn == null || nextMergeConn.getInputId()==1){
threadPoolSize++;
}
}
}
if(threadPoolSize>0) {
if(tRESTRequestLoopExists) {//miscroservice
%>
private class DaemonThreadFactory implements java.util.concurrent.ThreadFactory {
java.util.concurrent.ThreadFactory factory = java.util.concurrent.Executors.defaultThreadFactory();
public java.lang.Thread newThread(java.lang.Runnable r) {
java.lang.Thread t = factory.newThread(r);
t.setDaemon(true);
return t;
}
}
<%
}
if(tHMapExists || tHMapOutExists) {
%>
private final java.util.concurrent.ExecutorService es = java.util.concurrent.Executors.newFixedThreadPool(<%=threadPoolSize%> <%if(tRESTRequestLoopExists) {%>,new DaemonThreadFactory()<%}%>);
<%
} else {
%>
private final java.util.concurrent.ExecutorService es = java.util.concurrent.Executors.newCachedThreadPool(<%if(tRESTRequestLoopExists) {%>new DaemonThreadFactory()<%}%>);
<%
}
if(tRESTRequestLoopExists) {//miscroservice
%>
{
java.lang.Runtime.getRuntime().addShutdownHook(new java.lang.Thread() {
public void run() {
es.shutdown();
try {
if(!es.awaitTermination(60, java.util.concurrent.TimeUnit.SECONDS)) {
es.shutdownNow();
if(!es.awaitTermination(60, java.util.concurrent.TimeUnit.SECONDS)) {
}
}
} catch (java.lang.InterruptedException ie) {
es.shutdownNow();
} catch (java.lang.Exception e) {
}
}
});
}
<%
}
}

View File

@@ -20,6 +20,7 @@
org.talend.core.model.process.IHashConfiguration
org.talend.core.model.process.IHashableColumn
org.talend.core.model.utils.NodeUtil
org.talend.core.model.utils.TalendTextUtils
"
class="SubProcessHeader"
skeleton="subprocess_header_java.skeleton"
@@ -183,6 +184,48 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
public <%= typeToGenerate %> get<%=column.getLabel().substring(0, 1).toUpperCase()%><%=column.getLabel().substring(1)%> () {
return this.<%=column.getLabel()%>;
}
public Boolean <%=column.getLabel()%>IsNullable(){
return <%=column.isNullable()%>;
}
public Boolean <%=column.getLabel()%>IsKey(){
return <%=column.isKey()%>;
}
public Integer <%=column.getLabel()%>Length(){
return <%=column.getLength()%>;
}
public Integer <%=column.getLabel()%>Precision(){
return <%=column.getPrecision()%>;
}
public String <%=column.getLabel()%>Default(){
<% if (column.getDefault() == null) { %>
return null;
<% } else { %>
return "<%=TalendTextUtils.escapeJavaText(TalendTextUtils.removeQuotes(column.getDefault()))%>";
<% } %>
}
public String <%=column.getLabel()%>Comment(){
<% if (column.getComment() == null) { %>
return null;
<% } else { %>
return "<%=TalendTextUtils.escapeJavaText(TalendTextUtils.removeQuotes(column.getComment()))%>";
<% } %>
}
public String <%=column.getLabel()%>Pattern(){
<% if (column.getPattern() == null) { %>
return null;
<% } else { %>
return "<%=TalendTextUtils.escapeJavaText(TalendTextUtils.removeQuotes(column.getPattern()))%>";
<% } %>
}
public String <%=column.getLabel()%>OriginalDbColumnName(){
<% if (column.getOriginalDbColumnName() == null) { %>
return null;
<% } else { %>
return "<%=TalendTextUtils.escapeJavaText(TalendTextUtils.removeQuotes(column.getOriginalDbColumnName()))%>";
<% } %>
}
<%
if((conn.getLineStyle() == EConnectionType.FLOW_REF) && conn.getTarget().getUniqueName().startsWith("tXMLMap") && "id_Document".equals(javaType.getId())) {
%>

View File

@@ -10,6 +10,7 @@ CodeGenerator.getGraphicalNode2=------process.getGeneratingNodes()------
CodeGenerator.JET.TimeOut=JET initialisation Time Out
CodeGenerator.newLine=\n\n\n\n
CodeGenerator.Node.NotFound=Node not found in current process
CodeGenerator.Components.NotFound={0}: Component is missing: {1}; use -D{2}=false in your studio or commandline to skip this check, and a warning message will be logged.
JavaRoutineSynchronizer.UnsupportedOperation.Exception1=method not implemented: org.talend.designer.codegen.JavaRoutineSynchronizer line:49
JavaRoutineSynchronizer.UnsupportedOperation.Exception2=method not implemented: org.talend.designer.codegen.JavaRoutineSynchronizer line:58
JetSkeletonManager.unableLoad=unable to load skeleton update cache file

View File

@@ -66,6 +66,7 @@ import org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory;
import org.talend.designer.codegen.model.CodeGeneratorInternalTemplatesFactoryProvider;
import org.talend.designer.codegen.proxy.JetProxy;
import org.talend.designer.core.generic.model.Component;
import org.talend.designer.core.model.components.DummyComponent;
import org.talend.designer.runprocess.ProcessorUtilities;
/**
@@ -845,6 +846,25 @@ public class CodeGenerator implements ICodeGenerator {
IComponentFileNaming componentFileNaming = ComponentsFactoryProvider.getFileNamingInstance();
IComponent component = node.getComponent();
if (component instanceof DummyComponent) {
if (((DummyComponent) component).isMissingComponent()) {
String processName = "";
try {
IProcess proc = node.getProcess();
processName = proc.getName() + " " + proc.getVersion();
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (IProcess.ERR_ON_COMPONENT_MISSING) {
throw new CodeGeneratorException(Messages.getString("CodeGenerator.Components.NotFound", processName,
component.getName(), IProcess.PROP_ERR_ON_COMPONENT_MISSING));
}
if (ECodePart.BEGIN.equals(part)) {
log.warn(Messages.getString("CodeGenerator.Components.NotFound", processName, component.getName(),
IProcess.PROP_ERR_ON_COMPONENT_MISSING));
}
}
}
// some code unification to handle all component types the same way.
String templateURI = component.getTemplateFolder() + TemplateUtil.DIR_SEP
+ componentFileNaming.getJetFileName(component.getTemplateNamePrefix(), language.getExtension(), part);

View File

@@ -100,7 +100,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>

View File

@@ -42,7 +42,18 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>

View File

@@ -1,69 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.components</groupId>
<artifactId>checkArchive</artifactId>
<version>1.2-20210901</version>
<name>checkArchive</name>
<description>Dependence for tFileArchive and tFileUnAchive</description>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
<java.source.version>1.8</java.source.version>
</properties>
<distributionManagement>
<snapshotRepository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</snapshotRepository>
<repository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</distributionManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java.source.version}</source>
<target>${java.source.version}</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -230,9 +230,9 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>

View File

@@ -11,7 +11,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>3.3.10</cxf.version>
<cxf.version>3.4.7</cxf.version>
</properties>
<build>
@@ -77,8 +77,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend</groupId>
<artifactId>talendMQRFH2</artifactId>
<version>1.0.1-20190206</version>
<version>1.1.0-20220307</version>
<packaging>jar</packaging>
<properties>
@@ -36,20 +36,10 @@
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq</artifactId>
<version>8.0.0.9</version>
</dependency>
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mqjms</artifactId>
<version>8.0.0.9</version>
</dependency>
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>8.0.0.9</version>
<version>9.2.4.0</version>
</dependency>
<dependency>
<groupId>org.talend.libraries</groupId>
@@ -67,9 +57,9 @@
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
</dependencies>

View File

@@ -6,7 +6,7 @@
<!-- #################################################### -->
<!-- modification 1: config -->
<property name="jar.name" value="MsmqTalend-1.0.0.jar" />
<property name="jar.name" value="MsmqTalend-1.0.5.jar" />
<property name="component.name" value="tMicrosoftMQInput" />
<property name="author.name" value="ytao" />

View File

@@ -113,9 +113,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<scope>test</scope>
</dependency>
<!-- JUnit -->

View File

@@ -63,9 +63,9 @@
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
</dependencies>
<build>
@@ -90,4 +90,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@@ -108,4 +108,4 @@ public class DefaultTalendSheetContentsHandler implements TalendXSSFSheetXMLHand
}
return columnIndex;
}
}
}

View File

@@ -45,9 +45,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -69,13 +69,13 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.16.0</version>
<version>2.17.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.16.0</version>
<version>2.17.1</version>
<optional>true</optional>
</dependency>
</dependencies>

View File

@@ -1,71 +1,110 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId>
<artifactId>talend-mscrm</artifactId>
<version>3.4-20191012</version>
<packaging>jar</packaging>
<name>talend-mscrm</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<odata.version>4.3.0</odata.version>
<slf4j.version>1.7.12</slf4j.version>
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
</properties>
<distributionManagement>
<snapshotRepository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</snapshotRepository>
<repository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans</artifactId>
<version>1.7.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.9</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.7.4</version>
</dependency>
<dependency>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.components</groupId>
<artifactId>talend-mscrm</artifactId>
<version>3.10.2-20220831</version>
<packaging>jar</packaging>
<description>A forked Talend-MSCRM library, developed to use in Studio 7.3.1 only. It's main intention is to contain CVE fixes.</description>
<name>talend-mscrm</name>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.talendforge.org/modules/licenses/APACHE_v2.txt</url>
<distribution>may be downloaded from the Maven repository</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
<odata.version>4.7.1</odata.version>
<slf4j.version>1.7.28</slf4j.version>
<axis2.version>1.7.9</axis2.version>
<httpclient.version>4.5.13</httpclient.version>
<httpcore.version>4.4.13</httpcore.version>
<junit.version>4.13.2</junit.version>
<adal4j.version>1.6.5-20220701</adal4j.version>
<jackson.version>2.13.2</jackson.version>
<jackson-databind.version>2.13.2.2</jackson-databind.version>
<!-- plugin's versions -->
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
</properties>
<repositories>
<repository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<distributionManagement>
<snapshotRepository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</snapshotRepository>
<repository>
<id>talend_nexus_deployment</id>
<url>${talend.nexus.url}/nexus/content/repositories/TalendOpenSourceRelease/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${httpcore.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>${axis2.version}</version>
<exclusions>
<exclusion>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.olingo</groupId>
<artifactId>odata-client-core</artifactId>
<version>${odata.version}</version>
@@ -97,53 +136,55 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.11</version>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.1.1-20191012</version>
<version>${adal4j.version}</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<outputDirectory>../../../org.talend.libraries.crm/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</build>
</project>

View File

@@ -1,8 +1,11 @@
package org.talend.ms.crm;
import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.UUID;
import javax.naming.AuthenticationException;
import javax.naming.ServiceUnavailableException;
import javax.xml.stream.XMLStreamException;
import org.apache.axiom.om.OMAbstractFactory;
@@ -19,33 +22,37 @@ import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HTTPTransportConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.apache.olingo.client.api.http.HttpClientException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfEndpointTypestringztYlk6OT;
import org.talend.ms.crm.odata.ClientConfiguration;
import org.talend.ms.crm.odata.authentication.AuthStrategyFactory;
import org.talend.ms.crm.odata.authentication.IAuthStrategy;
import org.talend.ms.crm.sdk.Instance;
import org.talend.ms.crm.sdk.OnlineAuthenticationPolicy;
import org.talend.ms.crm.sdk.OrganizationServiceStubWrapper;
import org.talend.ms.crm.sdk.RequestDateTimeData;
import org.talend.ms.crm.sdk.SecurityData;
import org.talend.ms.crm.sdk.WsdlTokenManager;
import com.microsoft.schemas.xrm._2011.contracts.DiscoveryServiceStub;
import com.microsoft.schemas.xrm._2011.contracts.IDiscoveryService_Execute_DiscoveryServiceFaultFault_FaultMessage;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.microsoft.schemas.xrm._2011.contracts.OrganizationServiceStub;
import com.microsoft.schemas.xrm._2011.contracts.discovery.EndpointType;
import com.microsoft.schemas.xrm._2011.contracts.discovery.ExecuteDocument;
import com.microsoft.schemas.xrm._2011.contracts.discovery.ExecuteDocument.Execute;
import com.microsoft.schemas.xrm._2011.contracts.discovery.ExecuteResponseDocument;
import com.microsoft.schemas.xrm._2011.contracts.discovery.ExecuteResponseDocument.ExecuteResponse;
import com.microsoft.schemas.xrm._2011.contracts.discovery.OrganizationDetail;
import com.microsoft.schemas.xrm._2011.contracts.discovery.RetrieveOrganizationRequest;
import com.microsoft.schemas.xrm._2011.contracts.discovery.RetrieveOrganizationResponse;
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -64,21 +71,15 @@ public class MSCRMClient {
static Logger logger = LoggerFactory.getLogger(MSCRMClient.class.getName());
/**
* Microsoft account (e.g. youremail@live.com) or Microsoft Office 365 (Org ID e.g.
* youremail@yourorg.onmicrosoft.com) User Name.
*/
private String username;
/**
* Microsoft account or Microsoft Office 365 (Org ID) Password.
*/
private String password;
/**
* Unique Name of the organization
*/
private String orgName;
/**
* Unique Name of the organization
*/
private ClientConfiguration clientConfiguration;
/**
* Suffix for the Flat WSDL
@@ -87,88 +88,84 @@ public class MSCRMClient {
private OrganizationServiceStub serviceStub;
private Integer timeout;
private String discoveryServiceURL = "https://globaldisco.crm.dynamics.com/api/discovery/v2.0/Instances";
/**
* This sample application registration values are available for all online instances
* This is suggested to use for development and prototyping purposes.For production use, you should create an AppId or ClientId that is specific
* to your tenant in the Azure Management portal.
*
*/
private static final String DEFAULT_CLIENT_ID = "51f81489-12ee-4a9e-aaae-a2591f45987d";
private IAuthStrategy authStrategy;
private Boolean reuseHttpClient;
public MSCRMClient(ClientConfiguration clientConfiguration, String orgName, String discoveryServiceURL) throws AuthenticationException {
this.clientConfiguration = clientConfiguration;
this.orgName = orgName;
this.discoveryServiceURL = discoveryServiceURL;
init();
private int maxConnectionRetries = 5;
}
private void init() throws AuthenticationException {
if (clientConfiguration != null && discoveryServiceURL != null && discoveryServiceURL.indexOf("/api/discovery/") > 0) {
clientConfiguration.setResource(discoveryServiceURL.substring(0, discoveryServiceURL.indexOf("/api/discovery/")));
}
if(clientConfiguration != null) {
if (discoveryServiceURL != null && discoveryServiceURL.indexOf("/api/discovery/") > 0) {
clientConfiguration.setResource(discoveryServiceURL.substring(0, discoveryServiceURL.indexOf("/api/discovery/")));
}
if (clientConfiguration.getClientId()==null || clientConfiguration.getClientId().isEmpty()) {
clientConfiguration.setClientId(DEFAULT_CLIENT_ID);
}
}
private int attemptsInterval = 1000;
public MSCRMClient(String username, String password, String orgName) {
this.username = username;
this.password = password;
this.orgName = orgName;
authStrategy = AuthStrategyFactory.createAuthStrategy(this.clientConfiguration);
authStrategy.init();
}
public void setTimeout(Integer timeout) {
this.timeout = timeout;
}
public void setReuseHttpClient(Boolean reuseHttpClient) {
this.reuseHttpClient = reuseHttpClient;
}
public void setMaxConnectionRetries(int maxConnectionRetries) {
this.maxConnectionRetries = maxConnectionRetries;
}
public void setAttemptsInterval(int attemptsInterval) {
this.attemptsInterval = attemptsInterval;
}
public OrganizationServiceStub getOnlineConnection(String discoveryServiceURL) throws Exception {
return new OrganizationServiceStubWrapper(doGetOnlineConnection(discoveryServiceURL), this, discoveryServiceURL,
maxConnectionRetries, attemptsInterval);
public OrganizationServiceStub getOnlineConnection() throws Exception {
return new OrganizationServiceStubWrapper(doGetOnlineConnection(), this, discoveryServiceURL,
clientConfiguration.getMaxRetryTimes(), clientConfiguration.getIntervalTime());
}
/**
* URL for the Discovery Service For North America Microsoft account, discovery service url is
* https://dev.crm.dynamics.com/XRMServices/2011/Discovery.svc Microsoft office 365, discovery service url is
* https://disco.crm.dynamics.com/XRMServices/2011/Discovery.svc To use appropriate discovery service url for other
* Organization information is stored in the Instance table of the Discovery Service. To see the kind of information contained in that table,
* send an HTTP GET request to the service for one of your instances.
* environments refer http://technet.microsoft.com/en-us/library/gg309401.aspx
*
* @throws Exception
*/
public OrganizationServiceStub doGetOnlineConnection(String discoveryServiceURL) throws Exception {
public OrganizationServiceStub doGetOnlineConnection() throws Exception {
try {
// Retrieve the authentication policy for the discovery service.
OnlineAuthenticationPolicy discoveryPolicy = new OnlineAuthenticationPolicy(discoveryServiceURL + FlatWSDLSuffix);
WsdlTokenManager discoeryTokenManager = new WsdlTokenManager();
// Authenticate the user using the discovery authentication policy.
SecurityData discoverySecurityData = discoeryTokenManager.authenticate(discoveryServiceURL, username, password,
discoveryPolicy.getAppliesTo(), discoveryPolicy.getPolicy(), discoveryPolicy.getIssuerUri());
// Retrieve discovery stub using organization URL with the security data.
DiscoveryServiceStub discoveryServiceStub = createDiscoveryServiceStub(discoveryServiceURL, discoverySecurityData);
// Retrieve organization service url using discovery stub.
String orgUrl = discoverOrganizationUrl(discoveryServiceStub, orgName);
// The discovery service stub cannot be reused against the organization service
// as the Issuer and AppliesTo may differ between the discovery and organization services.
// Retrieve the authentication policy for the organization service.
OnlineAuthenticationPolicy organizationPolicy = new OnlineAuthenticationPolicy(orgUrl + FlatWSDLSuffix);
WsdlTokenManager orgTokenManager = new WsdlTokenManager();
// Authenticate the user using the organization authentication policy.
SecurityData securityData = orgTokenManager.authenticate(orgUrl, username, password,
organizationPolicy.getAppliesTo(), organizationPolicy.getPolicy(), organizationPolicy.getIssuerUri());
String serviceURL = discoveryServiceURL;
if(!discoveryServiceURL.contains("(")) {
serviceURL = discoveryServiceURL+"(UniqueName='"+orgName+"')";
}
String orgUrl = getOrgURL( serviceURL);
// The discovery service stub cannot be reused against the organization service
// as the Issuer and AppliesTo may differ between the discovery and organization services.
// Retrieve the authentication policy for the organization service.
OnlineAuthenticationPolicy organizationPolicy = new OnlineAuthenticationPolicy(orgUrl + FlatWSDLSuffix);
WsdlTokenManager orgTokenManager = new WsdlTokenManager();
// Authenticate the user using the organization authentication policy.
SecurityData securityData = orgTokenManager.authenticate(orgUrl, clientConfiguration.getUserName(), clientConfiguration.getPassword(),
organizationPolicy.getAppliesTo(), organizationPolicy.getPolicy(), organizationPolicy.getIssuerUri());
// Retrieve organization stub using organization URL with the security data.
serviceStub = createOrganizationServiceStub(orgUrl, securityData);
// Retrieve organization stub using organization URL with the security data.
serviceStub = createOrganizationServiceStub(orgUrl, securityData);
Options options = serviceStub._getServiceClient().getOptions();
if (reuseHttpClient != null) {
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT, reuseHttpClient);
}
if (timeout != null) {
options.setTimeOutInMilliSeconds(Long.valueOf(timeout));
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.SO_TIMEOUT, timeout);
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CONNECTION_TIMEOUT, timeout);
}
} catch (IDiscoveryService_Execute_DiscoveryServiceFaultFault_FaultMessage e) {
throw new Exception(e.getFaultMessage().getDiscoveryServiceFault().getMessage());
}
Options options = serviceStub._getServiceClient().getOptions();
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT, clientConfiguration.isReuseHttpClient());
options.setTimeOutInMilliSeconds(Long.valueOf(clientConfiguration.getTimeout()));
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.SO_TIMEOUT, clientConfiguration.getTimeout());
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CONNECTION_TIMEOUT, clientConfiguration.getTimeout());
return serviceStub;
}
@@ -185,18 +182,6 @@ public class MSCRMClient {
}
}
private static DiscoveryServiceStub createDiscoveryServiceStub(String discoveryServiceURL, SecurityData securityData)
throws RemoteException, XMLStreamException {
try {
DiscoveryServiceStub stub = new DiscoveryServiceStub(getConfigurationContext(), discoveryServiceURL);
setServiceClientOptions(stub._getServiceClient(), securityData);
return stub;
} catch (RemoteException e) {
logger.error(e.getMessage());
throw e;
}
}
private static void setServiceClientOptions(ServiceClient sc, SecurityData securityData) throws AxisFault, XMLStreamException {
Options options = sc.getOptions();
@@ -306,45 +291,6 @@ public class MSCRMClient {
return ctx;
}
private static String discoverOrganizationUrl(DiscoveryServiceStub serviceStub, String organizationUniqueName)
throws RemoteException, IDiscoveryService_Execute_DiscoveryServiceFaultFault_FaultMessage {
try {
RetrieveOrganizationRequest request = RetrieveOrganizationRequest.Factory.newInstance();
request.setUniqueName(organizationUniqueName);
Execute exe = Execute.Factory.newInstance();
exe.setRequest(request);
ExecuteDocument exeDoc = ExecuteDocument.Factory.newInstance();
exeDoc.setExecute(exe);
ExecuteResponseDocument executeRespDoc = serviceStub.execute(exeDoc);
ExecuteResponse executeResp = executeRespDoc.getExecuteResponse();
RetrieveOrganizationResponse result = (RetrieveOrganizationResponse) executeResp.getExecuteResult();
OrganizationDetail orgDetail = result.getDetail();
KeyValuePairOfEndpointTypestringztYlk6OT[] keyValuePairs = orgDetail.getEndpoints()
.getKeyValuePairOfEndpointTypestringztYlk6OTArray();
for (KeyValuePairOfEndpointTypestringztYlk6OT keyValuePair : keyValuePairs) {
if (keyValuePair.getKey() == EndpointType.ORGANIZATION_SERVICE) {
return keyValuePair.getValue();
}
}
} catch (RemoteException e) {
logger.error(e.getMessage());
throw e;
} catch (IDiscoveryService_Execute_DiscoveryServiceFaultFault_FaultMessage e) {
logger.error(e.getMessage());
throw e;
}
return null;
}
private static HttpTransportProperties.ProxyProperties getProxyProperties() {
String proxyHost = null;
String proxyPort = null;
@@ -370,5 +316,55 @@ public class MSCRMClient {
}
return proxyProps;
}
private String getOrgURL(String discoveryServiceURL) throws ServiceUnavailableException {
try {
HttpGet request = new HttpGet(discoveryServiceURL);
// https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/discover-url-organization-web-api#authentication
authStrategy.configureRequest(request);
try (CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = httpClient.execute(request)) {
int statusCode = response.getStatusLine().getStatusCode();
if(statusCode != HttpStatus.SC_NO_CONTENT && statusCode != HttpStatus.SC_CREATED && statusCode != HttpStatus.SC_OK) {
String message = null;
if (statusCode == HttpStatus.SC_NOT_FOUND ) {
message = "The organization '"+orgName+"' does not exist.";
} else {
message = response.getStatusLine().getReasonPhrase();
}
throw new HttpClientException(message);
}
HttpEntity entity = response.getEntity();
String orgUrl = null;
if (entity != null) {
String result = EntityUtils.toString(entity);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode tree = mapper.readTree(result);
Iterator<JsonNode> iter = tree.path("value").elements();
while (iter.hasNext()){
JsonNode node = iter.next();
Instance instance = mapper.readValue(node.toString(), Instance.class);
// Should only return one instance.
if(orgName.equals(instance.getUniqueName())) {
orgUrl = instance.getApiUrl() + "/XRMServices/2011/Organization.svc";
break;
}
}
}
if(orgUrl == null) {
throw new HttpClientException("No organization available.");
}
return orgUrl;
}
} catch (Exception e) {
throw new ServiceUnavailableException(e.getMessage());
}
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -12,12 +12,14 @@
// ============================================================================
package org.talend.ms.crm.odata;
import java.util.Map;
public final class ClientConfiguration {
/*
* Implemented authentication strategies for OData/MS CRM.
*/
public static enum AuthStrategyEnum {NTLM, OAUTH};
public static enum AuthStrategyEnum {NTLM, OAUTH, OAUTH_PREMISE};
/*
* Kind of registered app on azure
@@ -69,6 +71,16 @@ public final class ClientConfiguration {
*/
private String authoryEndpoint;
/*
* The redirect URL
*/
private String redirectURL;
/*
* The service API to retrieve the resource we ask for with oauth on-premise
*/
private String serviceAPI;
private int maxRetryTimes = 5;
/*
@@ -87,6 +99,14 @@ public final class ClientConfiguration {
private AppRegisteredType appRegisteredType = AppRegisteredType.NATIVE_APP;
private WebAppPermission webAppPermission = WebAppPermission.DELEGATED;
/**
* The oauth resource is deduced from the "Service root URL" if this value is null.
*/
private String forceResource;
private Map<String, String> headers;
private boolean returnRepresentation = false;
ClientConfiguration(AuthStrategyEnum authStrategy) {
this.authStrategy = authStrategy;
@@ -217,4 +237,44 @@ public final class ClientConfiguration {
this.domain = domain;
}
}
public String getRedirectURL() {
return redirectURL;
}
public void setRedirectURL(String redirectURL) {
this.redirectURL = redirectURL;
}
public String getServiceAPI() {
return serviceAPI;
}
public void setServiceAPI(String serviceAPI) {
this.serviceAPI = serviceAPI;
}
public String getForceResource() {
return forceResource;
}
public void setForceResource(String forceResource) {
this.forceResource = forceResource;
}
public void setCustomHeaders(Map<String, String> headers){
this.headers = headers;
}
public Map<String, String> getCustomHeaders(){
return this.headers;
}
public boolean isReturnRepresentation() {
return returnRepresentation;
}
public void setReturnRepresentation(boolean returnRepresentation) {
this.returnRepresentation = returnRepresentation;
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -16,13 +16,13 @@ import org.talend.ms.crm.odata.ClientConfiguration.AuthStrategyEnum;
/**
* Generate the ClientConfiguration according to wanted authentication.
*
* <p>
* Different authentications need different information.
*/
public class ClientConfigurationFactory {
public final static ClientConfiguration buildOAuthNativeClientConfiguration(String clientId, String userName, String password,
String authoryEndpoint) {
String authoryEndpoint) {
ClientConfiguration clientConfiguration = new ClientConfiguration(AuthStrategyEnum.OAUTH);
clientConfiguration.setAppRegisteredType(ClientConfiguration.AppRegisteredType.NATIVE_APP);
clientConfiguration.setClientId(clientId);
@@ -34,7 +34,7 @@ public class ClientConfigurationFactory {
}
public final static ClientConfiguration buildOAuthWebClientConfiguration(String clientId, String clientSecret, String userName, String password,
String authoryEndpoint, ClientConfiguration.WebAppPermission permission) {
String authoryEndpoint, ClientConfiguration.WebAppPermission permission) {
ClientConfiguration clientConfiguration = new ClientConfiguration(AuthStrategyEnum.OAUTH);
clientConfiguration.setAppRegisteredType(ClientConfiguration.AppRegisteredType.WEB_APP);
clientConfiguration.setWebAppPermission(permission);
@@ -49,7 +49,7 @@ public class ClientConfigurationFactory {
}
public final static ClientConfiguration buildNtlmClientConfiguration(String userName, String password, String workstation,
String domain) {
String domain) {
ClientConfiguration clientConfiguration = new ClientConfiguration(AuthStrategyEnum.NTLM);
clientConfiguration.setUserName(userName);
clientConfiguration.setPassword(password);
@@ -59,4 +59,19 @@ public class ClientConfigurationFactory {
return clientConfiguration;
}
public final static ClientConfiguration buildOAuthPremiseClientConfiguration(String userName, String password, String authoryEndpoint,
String serviceAPI, String clientId, String clientSecret, String redirectUrl, String forcedResource) {
ClientConfiguration clientConfiguration = new ClientConfiguration(AuthStrategyEnum.OAUTH_PREMISE);
clientConfiguration.setUserName(userName);
clientConfiguration.setPassword(password);
clientConfiguration.setAuthoryEndpoint(authoryEndpoint);
clientConfiguration.setClientId(clientId);
clientConfiguration.setClientSecret(clientSecret);
clientConfiguration.setRedirectURL(redirectUrl);
clientConfiguration.setServiceAPI(serviceAPI);
clientConfiguration.setForceResource(forcedResource);
return clientConfiguration;
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -12,21 +12,9 @@
// ============================================================================
package org.talend.ms.crm.odata;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.naming.AuthenticationException;
import javax.naming.ServiceUnavailableException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
@@ -44,6 +32,7 @@ import org.apache.http.params.HttpConnectionParams;
import org.apache.http.util.EntityUtils;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.request.retrieve.EdmMetadataRequest;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetIteratorRequest;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
@@ -69,16 +58,33 @@ import org.talend.ms.crm.odata.httpclientfactory.DefaultHttpClientState;
import org.talend.ms.crm.odata.httpclientfactory.IHttpClientFactoryObserver;
import org.talend.ms.crm.odata.httpclientfactory.IHttpclientFactoryObservable;
import javax.naming.AuthenticationException;
import javax.naming.ServiceUnavailableException;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* Client for accessing Dynamics CRM Online using the Web API
*
*/
public class DynamicsCRMClient implements IHttpClientFactoryObserver {
private static final String NAMESPAVE = "Microsoft.Dynamics.CRM";
private static final String LOOKUP_NAME_PREFIX = "_";
private static final String LOOKUP_NAME_SUFFIX = "_value";
private static final int LOOKUP_NAME_MINSIZE = LOOKUP_NAME_PREFIX.length()+LOOKUP_NAME_SUFFIX.length();
private static final String LOOKUP_NAME_PREFIX = "_";
private static final String LOOKUP_NAME_SUFFIX = "_value";
private static final int LOOKUP_NAME_MINSIZE = LOOKUP_NAME_PREFIX.length() + LOOKUP_NAME_SUFFIX.length();
private ClientConfiguration clientConfiguration;
@@ -101,7 +107,7 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
/**
* A list which contains all navigation links to set to null.
*
* <p>
* A distinct delete command must be sent to set a navigation property to null. It can't be done in the same
* time that the entity update.
*/
@@ -152,10 +158,26 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
return odataClient;
}
private void addCustomHeaders(ODataEntitySetRequest<ClientEntitySet> request) {
if (this.clientConfiguration.getCustomHeaders() == null) {
return;
}
this.clientConfiguration.getCustomHeaders().entrySet().stream().forEach(e -> request.addCustomHeader(e.getKey(), e.getValue()));
}
private void addCustomHeader(HttpRequestBase request) {
if (this.clientConfiguration.getCustomHeaders() != null) {
this.clientConfiguration.getCustomHeaders().entrySet().stream().forEach(e -> request.addHeader(e.getKey(), e.getValue()));
}
if (this.clientConfiguration.isReturnRepresentation()) {
request.addHeader("Prefer", "return=representation");
}
}
/**
* Create EntitySet Iterator request
*
* @param entirySet entirySet the EntitySet name which you want to retrieve records
* @param queryOption
* @return EntitySet iterator request
*/
@@ -164,6 +186,7 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
if (queryOption.getReturnEntityProperties() != null) {
uriBuilder.select(queryOption.getReturnEntityProperties());
}
if (queryOption.getTop() > 0) {
uriBuilder.top(queryOption.getTop());
}
@@ -173,21 +196,68 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
if (!StringUtils.isEmpty(queryOption.getFilter())) {
uriBuilder.filter(queryOption.getFilter());
}
final List<String> expands = queryOption.getExpands();
if (expands.size() > 0) {
String[] expandArray = new String[expands.size()];
uriBuilder.expand(expands.toArray(expandArray));
}
ODataEntitySetRequest<ClientEntitySet> request = odataClient.getRetrieveRequestFactory()
.getEntitySetRequest(uriBuilder.build());
this.authStrategy.configureRequest(request);
if (expands.size() > 0) {
// odata-metadata=full set by olingo generates issue when expand entities
request.addCustomHeader("Accept", "application/json;odata-metadata=minimal");
}
addCustomHeaders(request);
return request;
}
public EdmMetadataRequest createMetadataRetrieveRequest() {
EdmMetadataRequest request = odataClient.getRetrieveRequestFactory()
.getMetadataRequest(serviceRootURL);
this.authStrategy.configureRequest(request);
return request;
}
public ODataEntitySetRequest<ClientEntitySet> createEntitySetRetrieveRequest() {
URIBuilder uriBuilder = odataClient.newURIBuilder(serviceRootURL).appendEntitySetSegment("EntityDefinitions").select("EntitySetName,LogicalName");
ODataEntitySetRequest<ClientEntitySet> entitySetRequest = odataClient.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
this.authStrategy.configureRequest(entitySetRequest);
addCustomHeaders(entitySetRequest);
return entitySetRequest;
}
public ODataEntitySetRequest<ClientEntitySet> createEndpointsNamesRequest() {
URIBuilder uriBuilder = odataClient.newURIBuilder(serviceRootURL);
ODataEntitySetRequest<ClientEntitySet> entitySetRequest = odataClient.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
this.authStrategy.configureRequest(entitySetRequest);
addCustomHeaders(entitySetRequest);
return entitySetRequest;
}
public ODataEntitySetRequest<ClientEntitySet> createRequest(URIBuilder uriBuilder) {
ODataEntitySetRequest<ClientEntitySet> entitySetRequest = odataClient.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
this.authStrategy.configureRequest(entitySetRequest);
addCustomHeaders(entitySetRequest);
return entitySetRequest;
}
/**
* Retrieve records from EntitySet
*
* @param entitySet the EntitySet name which you want to retrieve records
* @param queryOption
* @return the entity set iterator object
*
* @throws ServiceUnavailableException
*/
public ClientEntitySet retrieveEntities(QueryOptionConfig queryOption) throws AuthenticationException {
@@ -218,12 +288,10 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
/**
* Create entity
*
* @param entitySet entitySet the EntitySet name which you want to create record
* @param entity provided content for create
*
* @throws ServiceUnavailableException
*/
public HttpResponse insertEntity(ClientEntity entity) throws ServiceUnavailableException {
public CreateUpdateResult insertEntity(ClientEntity entity) throws ServiceUnavailableException {
URIBuilder insertURIBuilder = odataClient.newURIBuilder(serviceRootURL).appendEntitySetSegment(entitySet);
HttpEntity httpEntity = convertToHttpEntity(entity);
return createAndExecuteRequest(insertURIBuilder.build(), httpEntity, HttpMethod.POST);
@@ -233,27 +301,49 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
* Update entity with provided content.
* The PATCH method is used, so only given properties are updated.
* Navigation link properties that must be set to null are updated by another DELETE calls.
* Navigation link properties are saved during {@link #addEntityNavigationLink(ClientEntity, String, String, String, boolean, boolean)}
* method call
*
* @param entity The payload containing properties to update
* @param entity The payload containing properties to update
* @param keySegment The id of the entity to update
* @throws ServiceUnavailableException
* @deprecated use {@link #updateEntity(ClientEntity, String, List)} instead with a list of navigation links list instead;
*/
@Deprecated
public CreateUpdateResult updateEntity(ClientEntity entity, String keySegment) throws ServiceUnavailableException {
CreateUpdateResult result = updateEntity(entity, keySegment, this.navigationLinksToNull);
this.navigationLinksToNull.clear();
return result;
}
/**
* Update entity with provided content.
* The PATCH method is used, so only given properties are updated.
* Navigation link properties that must be set to null are updated by another DELETE calls.
*
* @param entity The payload containing properties to update
* @param keySegment The id of the entity to update
* @param navigationLinksToDelete list of navigation link names to delete
* @throws ServiceUnavailableException
*/
public HttpResponse updateEntity(ClientEntity entity, String keySegment) throws ServiceUnavailableException {
public CreateUpdateResult updateEntity(ClientEntity entity, String keySegment, List<String> navigationLinksToDelete) throws ServiceUnavailableException {
URIBuilder updateURIBuilder = odataClient.newURIBuilder(serviceRootURL).appendEntitySetSegment(entitySet)
.appendKeySegment(UUID.fromString(keySegment));
HttpEntity httpEntity = convertToHttpEntity(entity);
HttpResponse updateHttpResponse = createAndExecuteRequest(updateURIBuilder.build(), httpEntity, HttpMethod.PATCH);
CreateUpdateResult result = createAndExecuteRequest(updateURIBuilder.build(), httpEntity, HttpMethod.PATCH);
// No need to test the updateHttpResponse code since it is returned only if it's a success.
// The deletion of navigation links will be done only if the previous update doesn't throw an exception.
this.deleteNavigationLinksToNull(keySegment);
this.deleteNavigationLinksToNull(keySegment, navigationLinksToDelete);
return updateHttpResponse;
return result;
}
protected void deleteNavigationLinksToNull(String keySegment) throws ServiceUnavailableException {
for(String navigationLinkName : this.navigationLinksToNull){
protected void deleteNavigationLinksToNull(String keySegment, List<String> navigationLinksToNull) throws ServiceUnavailableException {
if (navigationLinksToNull == null || navigationLinksToNull.isEmpty()) {
return;
}
for (String navigationLinkName : navigationLinksToNull) {
this.deleteNavigationLink(navigationLinkName, keySegment);
}
}
@@ -261,16 +351,14 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
/**
* Deleted entity by key
*
* @param entitySet entitySet the EntitySet name which you want to delete records
* @param keySegment Entity key segment
*
* @throws ServiceUnavailableException
*/
public HttpResponse deleteEntity(String keySegment) throws ServiceUnavailableException {
URIBuilder deleteURIBuilder = odataClient.newURIBuilder(serviceRootURL).appendEntitySetSegment(entitySet)
.appendKeySegment(UUID.fromString(keySegment));
return createAndExecuteRequest(deleteURIBuilder.build(), null, HttpMethod.DELETE);
return createAndExecuteRequest(deleteURIBuilder.build(), null, HttpMethod.DELETE).getResponse();
}
@@ -279,17 +367,17 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
* Jira : TDI-39571
*
* @param navigationLinkName The navigation link name (not the _name_value generated lookup property)
* @param keySegment The keysegment(id) of the main property
* @param keySegment The keysegment(id) of the main property
* @return The Http response.
* @throws ServiceUnavailableException
*/
public HttpResponse deleteNavigationLink(String navigationLinkName, String keySegment) throws ServiceUnavailableException {
URIBuilder deleteNavLinkURIBuilder = odataClient.newURIBuilder(serviceRootURL)
.appendEntitySetSegment(entitySet)
.appendKeySegment(UUID.fromString(keySegment))
.appendNavigationSegment(navigationLinkName).appendRefSegment();
.appendEntitySetSegment(entitySet)
.appendKeySegment(UUID.fromString(keySegment))
.appendNavigationSegment(navigationLinkName).appendRefSegment();
return createAndExecuteRequest(deleteNavLinkURIBuilder.build(), null, HttpMethod.DELETE);
return createAndExecuteRequest(deleteNavLinkURIBuilder.build(), null, HttpMethod.DELETE).getResponse();
}
/**
@@ -349,24 +437,24 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
*
* @param entityType
*/
public void setEntityType(String entityType){
public void setEntityType(String entityType) {
this.entityType = entityType;
}
public void addEntityNavigationLink(ClientEntity entity, String lookupEntitySet, String lookupName,
String linkedEntityId, boolean emptyLookupIntoNull, boolean ignoreNull) {
String linkedEntityId, boolean emptyLookupIntoNull, boolean ignoreNull) {
// To help the final user since lookup names '_name_value' are available in the schema
// But it's the navigation link that can be updated.
String navigationLinkName = this.extractNavigationLinkName(lookupName);
// If value is empty and emptyLookupIntoNull, then set the value to null to unlink the navigation (set to null)
if(emptyLookupIntoNull && linkedEntityId != null && linkedEntityId.isEmpty()){
if (emptyLookupIntoNull && linkedEntityId != null && linkedEntityId.isEmpty()) {
linkedEntityId = null;
}
// If ignore null is set and the value is null, then don't update/delete this navigation link
if(ignoreNull && linkedEntityId == null){
if (ignoreNull && linkedEntityId == null) {
return;
}
@@ -377,14 +465,50 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
} catch (URISyntaxException e) {
throw new HttpClientException(e);
}
}
else{
} else {
// Retains all navigation links to delete (set to null)
navigationLinksToNull.add(navigationLinkName);
}
}
public int getNbNavigationLinkToRemove(){
/**
* Try to add navigation link to entity.
*
* @param navigationLinkName extracted navigation link(see {@link #extractNavigationLinkName(String)})
* @param entity to be updated
* @param lookupEntitySet entity set referred by navigation link
* @param linkedEntityId id of the referred entity
* @param emptyLookupIntoNull if empty lookup values should be converted to null values
* @param ignoreNull if null values should be skipped
* @return true if the link was added or skipped, false if it should be deleted with a separate call.
*/
public boolean addOrSkipEntityNavigationLink(ClientEntity entity, String lookupEntitySet, String navigationLinkName,
String linkedEntityId, boolean emptyLookupIntoNull, boolean ignoreNull) {
// If value is empty and emptyLookupIntoNull, then set the value to null to unlink the navigation (set to null)
if (emptyLookupIntoNull && linkedEntityId != null && linkedEntityId.isEmpty()) {
linkedEntityId = null;
}
// If ignore null is set and the value is null, then don't update/delete this navigation link
if (ignoreNull && linkedEntityId == null) {
return true;
}
if (linkedEntityId != null) {
try {
entity.getNavigationLinks().add(odataClient.getObjectFactory().newEntityNavigationLink(navigationLinkName,
new URI(lookupEntitySet + "(" + linkedEntityId + ")")));
} catch (URISyntaxException e) {
throw new HttpClientException(e);
}
} else {
// Retains all navigation links to delete (set to null)
return false;
}
return true;
}
public int getNbNavigationLinkToRemove() {
return navigationLinksToNull.size();
}
@@ -397,20 +521,20 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
* @param lookupName The auto-generated lookup name
* @return The extracted navigation link name or the lookup name if it can't be extracted.
*/
public String extractNavigationLinkName(String lookupName){
public String extractNavigationLinkName(String lookupName) {
final int nameSize = lookupName.length();
if(nameSize <= LOOKUP_NAME_MINSIZE){
if (nameSize <= LOOKUP_NAME_MINSIZE) {
return lookupName;
}
String pref = lookupName.substring(0, LOOKUP_NAME_PREFIX.length());
if(!pref.equals(LOOKUP_NAME_PREFIX)){
if (!pref.equals(LOOKUP_NAME_PREFIX)) {
return lookupName;
}
final int endName = nameSize - LOOKUP_NAME_SUFFIX.length();
String suff = lookupName.substring(endName, nameSize);
if(!suff.equals(LOOKUP_NAME_SUFFIX)){
if (!suff.equals(LOOKUP_NAME_SUFFIX)) {
return lookupName;
}
@@ -421,7 +545,6 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
* Convert OData entity to HttpEntity type
*
* @param entity OData entity.
*
* @return An entity that can be sent or received with an HTTP message.
* @throws
*/
@@ -446,15 +569,14 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
/**
* Created and executes a request
*
* @param uri the request URI
* @param uri the request URI
* @param httpEntity the entity to send.
* @param method HTTP method
*
* @param method HTTP method
* @return the response to the request.
* @throws ServiceUnavailableException
*/
protected HttpResponse createAndExecuteRequest(URI uri, HttpEntity httpEntity, HttpMethod method)
protected CreateUpdateResult createAndExecuteRequest(URI uri, HttpEntity httpEntity, HttpMethod method)
throws ServiceUnavailableException {
boolean hasRetried = false;
@@ -476,11 +598,31 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
if (request instanceof HttpEntityEnclosingRequestBase) {
((HttpEntityEnclosingRequestBase) request).setEntity(httpEntity);
}
addCustomHeader(request);
CreateUpdateResult result = new CreateUpdateResult();
HttpResponse response = httpClientState.getHttpClient().execute(request);
result.setResponse(response);
if (isResponseSuccess(response.getStatusLine().getStatusCode())) {
if (this.clientConfiguration.isReturnRepresentation()) {
final HttpEntity entity = response.getEntity();
if (entity != null && entity.isStreaming()) {
try(InputStream instream = entity.getContent()) {
String e = new BufferedReader(new InputStreamReader(instream))
.lines().collect(Collectors.joining("\n"));
result.setEntity(e);
if (instream != null) {
instream.close();
}
}
}
} else {
EntityUtils.consume(response.getEntity());
}
request.releaseConnection();
EntityUtils.consume(response.getEntity());
return response;
return result;
} else {
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_UNAUTHORIZED && !hasRetried) {
this.authStrategy.refreshAuth();
@@ -509,7 +651,6 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
* 201 create/update/delete entity success with return (not used in our component at present)
*
* @param statusCode HTTP status code
*
* @return success or not(true or false)
*/
public boolean isResponseSuccess(int statusCode) {
@@ -542,4 +683,30 @@ public class DynamicsCRMClient implements IHttpClientFactoryObserver {
}
public final static class CreateUpdateResult {
private HttpResponse response;
private String entity;
public HttpResponse getResponse() {
return response;
}
public void setResponse(HttpResponse response) {
this.response = response;
}
public String getEntity() {
return entity;
}
public void setEntity(String entity) {
this.entity = entity;
}
public boolean hasEntity() {
return this.entity != null;
}
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -0,0 +1,54 @@
package org.talend.ms.crm.odata;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class QueryExpandUtil {
public static List<String> getExpandConfig(List<String> fields, List<String> params) {
if (fields == null || params == null || fields.size() != params.size()) {
throw new IllegalArgumentException(
"Please make sure list of expands fields and params are not null and their size are same.");
}
if(fields.size() <= 0){
return Collections.emptyList();
}
List<String> expands = new ArrayList<>();
for(int i=0; i< fields.size(); i++){
String name = fields.get(i);
if("".equals(name.trim())){
continue;
}
name = getSanitizedName(name);
StringBuilder sb = new StringBuilder(name);
final String param = params.get(i);
if(!"".equals(param.trim())){
sb.append('(');
sb.append(param);
sb.append(')');
}
expands.add(sb.toString());
}
return expands;
}
/**
* expandable attrribute name are _entityid_value, should be transformed to entityid.
* @param name
* @return
*/
public static String getSanitizedName(final String name){
String sanitized = ('_' == name.charAt(0)) ? name.substring(1) : name;
sanitized = (sanitized.endsWith("_value")) ? sanitized.substring(0, sanitized.length() - 6): sanitized;
return sanitized;
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -12,6 +12,9 @@
// ============================================================================
package org.talend.ms.crm.odata;
import java.util.List;
import java.util.ArrayList;
public class QueryOptionConfig {
private int top = -1;
@@ -24,6 +27,9 @@ public class QueryOptionConfig {
private String filter;
private List<String> expand = new ArrayList<>();
public int getTop() {
return top;
}
@@ -64,4 +70,8 @@ public class QueryOptionConfig {
this.filter = filter;
}
public void setExpands(List<String> expand) { this.expand = expand;}
public List<String> getExpands() { return this.expand; }
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -12,13 +12,11 @@
// ============================================================================
package org.talend.ms.crm.odata.authentication;
import javax.naming.AuthenticationException;
import org.talend.ms.crm.odata.ClientConfiguration;
/**
* Factory for OData authentication strategies.
*
* <p>
* No need to use singleton pattern since no implementation/extends, static is enough.
*/
public final class AuthStrategyFactory {
@@ -26,15 +24,18 @@ public final class AuthStrategyFactory {
private AuthStrategyFactory() {
}
public final static IAuthStrategy createAuthStrategy(ClientConfiguration conf) {
public static IAuthStrategy createAuthStrategy(ClientConfiguration conf) {
IAuthStrategy authStrategy = null;
switch (conf.getAuthStrategy()) {
case OAUTH:
authStrategy = new OAuthStrategyImpl(conf);
break;
case NTLM:
authStrategy = new NTLMStrategyImpl(conf);
break;
case OAUTH:
authStrategy = new OAuthStrategyImpl(conf);
break;
case NTLM:
authStrategy = new NTLMStrategyImpl(conf);
break;
case OAUTH_PREMISE:
authStrategy = new OAuthPremiseStrategyImpl(conf);
break;
}
return authStrategy;

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -31,7 +31,7 @@ public interface IAuthStrategy {
* Called when DynamicsCRMClient is instanciated.
*
*/
public void init() throws AuthenticationException;
void init() throws AuthenticationException;
/**
* Retrieve the HttpClientFactory.
@@ -41,21 +41,21 @@ public interface IAuthStrategy {
* Called when DynamicsCRMClient is instanciated.
*
*/
public IHttpclientFactoryObservable getHttpClientFactory() throws AuthenticationException;
IHttpclientFactoryObservable getHttpClientFactory() throws AuthenticationException;
/**
* Refresh Authentication if needed.
*/
public void refreshAuth() throws AuthenticationException;
void refreshAuth() throws AuthenticationException;
/**
* Configure request generated by odataClient.getRetrieveRequestFactory().
*/
public void configureRequest(ODataRequest request);
void configureRequest(ODataRequest request);
/**
* Configure request HttpRequestBase with POST/PATCH/DELETE method.
*/
public void configureRequest(HttpRequestBase request);
void configureRequest(HttpRequestBase request);
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -0,0 +1,208 @@
package org.talend.ms.crm.odata.authentication;
import com.google.gson.Gson;
import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;
import com.google.gson.stream.JsonReader;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.olingo.client.api.communication.request.ODataRequest;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.talend.ms.crm.odata.ClientConfiguration;
import org.talend.ms.crm.odata.authentication.httpclienthelper.HttpClient;
import org.talend.ms.crm.odata.authentication.httpclienthelper.HttpResponse;
import org.talend.ms.crm.odata.authentication.httpclienthelper.RequestHttpContext;
import org.talend.ms.crm.odata.authentication.httpclienthelper.Token;
import org.talend.ms.crm.odata.httpclientfactory.IHttpclientFactoryObservable;
import org.talend.ms.crm.odata.httpclientfactory.OAuthHttpClientFactory;
import javax.naming.AuthenticationException;
import java.io.IOException;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
public class OAuthPremiseStrategyImpl implements IAuthStrategy {
private final static int MAX_REDIRECT_AUTH_CODE = 3;
private final ClientConfiguration conf;
private Token token;
private OAuthHttpClientFactory httpClientFactory;
OAuthPremiseStrategyImpl(ClientConfiguration conf) {
this.conf = conf;
}
@Override
public void init() throws AuthenticationException {
oauthFlow();
}
@Override
public IHttpclientFactoryObservable getHttpClientFactory() throws AuthenticationException {
oauthFlow();
if (httpClientFactory == null) {
httpClientFactory = new OAuthHttpClientFactory(this.conf);
}
return httpClientFactory;
}
@Override
public void refreshAuth() throws AuthenticationException {
oauthFlow();
}
@Override
public void configureRequest(ODataRequest request) {
request.addCustomHeader(HttpHeader.AUTHORIZATION, "Bearer " + token.getAccess_token());
}
@Override
public void configureRequest(HttpRequestBase request) {
request.addHeader(HttpHeader.AUTHORIZATION, "Bearer " + token.getAccess_token());
}
private void oauthFlow() throws AuthenticationException {
int retry = 0;
while (true) {
retry++;
try {
final Optional<String> code = retrieveAuthorizationCode();
if (code.isPresent()) {
final String sCode = code.get();
final Optional<Token> token = retrieveToken(sCode);
if (token.isPresent()) {
this.token = token.get();
break;
} else {
throw new IllegalArgumentException("Can't retrieve oauth token, but no exception has been raised.");
}
} else {
throw new IllegalArgumentException("Can't retrieve authorization code, but no exception has been raised.");
}
} catch (IOException | InterruptedException | IllegalArgumentException e) {
if (retry < conf.getMaxRetryTimes()) {
try {
Thread.sleep(conf.getIntervalTime());
} catch (InterruptedException e1) {
// ignore
}
continue;
}
throw new AuthenticationException("Can't retrieve ms crm oauth token after '" + retry + "' retries : " + e.getMessage());
}
}
}
private Token json2Token(String json) throws JsonIOException, JsonSyntaxException {
Gson gson = new Gson();
JsonReader jsr = new JsonReader(new StringReader(json));
return gson.fromJson(jsr, Token.class);
}
private String getResource() throws MalformedURLException {
if(conf.getForceResource() != null && !"".equals(conf.getForceResource().trim())){
return conf.getForceResource();
}
URL url = new URL(conf.getServiceAPI());
final int port = url.getPort();
StringBuilder sp = new StringBuilder();
if (port > -1) {
sp.append(":").append(port);
}
return url.getProtocol() + "://" + url.getHost() + sp.toString();
}
/**
* To compute token url, change last segment by token.
* @return
*/
private String computeTokenUrl(String url){
while(url.endsWith("/")) {
url = url.substring(0, url.length() - 1);
}
String token = url.substring(0, url.lastIndexOf('/')) + "/token";
return token;
}
private Optional<Token> retrieveToken(String code) throws IOException, InterruptedException, IllegalArgumentException {
Map<String, String> body = new HashMap<>();
body.put("grant_type", "authorization_code");
body.put("code", code);
body.put("redirect_uri", conf.getRedirectURL());
body.put("client_id", conf.getClientId());
if(conf.getClientSecret() != null && !"".equals(conf.getClientSecret().trim())){
body.put("client_secret", conf.getClientSecret());
}
RequestHttpContext queryContext = new RequestHttpContext("POST",
computeTokenUrl(conf.getAuthoryEndpoint()),
Collections.emptyMap(),
new HashMap<>(),
true,
conf.getTimeout() * 1000,
conf.getTimeout() * 1000);
queryContext.setBodyContent(body);
HttpClient client = new HttpClient(queryContext);
// Redirect are followed by the java http client
final HttpResponse call = client.call(new AtomicInteger(-1), e -> true);
Token token = null;
try {
token = json2Token(call.getBody());
}
catch (JsonIOException | JsonSyntaxException e){
throw new IllegalArgumentException("Can't parse retrieve ms crm oauth token : " + e.getMessage(), e);
}
return Optional.ofNullable(token);
}
private Optional<String> retrieveAuthorizationCode() throws IOException, InterruptedException {
Map<String, String> params = new HashMap();
params.put("resource", getResource());
params.put("response_type", "code");
params.put("state", "");
params.put("client_id", conf.getClientId());
params.put("scope", "");
params.put("redirect_uri", conf.getRedirectURL());
Map<String, String> form = new HashMap<>();
form.put("UserName", conf.getUserName());
form.put("Password", conf.getPassword());
form.put("AuthMethod", "FormsAuthentication");
RequestHttpContext queryContext = new RequestHttpContext("POST",
conf.getAuthoryEndpoint(),
params,
new HashMap<>(),
false,
conf.getTimeout() * 1000,
conf.getTimeout() * 1000);
queryContext.setBodyContent(form);
HttpClient client = new HttpClient(queryContext);
// We stop to follow redirect url once we have the code
final HttpResponse call = client.call(new AtomicInteger(MAX_REDIRECT_AUTH_CODE), e -> !e.extractCode().isPresent());
return call.extractCode();
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -0,0 +1,127 @@
package org.talend.ms.crm.odata.authentication.httpclienthelper;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
public final class HttpClient {
private final static int TEMPORARY_REDIRECT = 307;
private final static int PERMANENT_REDIRECT = 308;
private final RequestHttpContext requestHttpContext;
public HttpClient(RequestHttpContext requestHttpContext) {
this.requestHttpContext = requestHttpContext;
}
public static String encodeValue(String value) throws UnsupportedEncodingException {
return URLEncoder.encode(value, StandardCharsets.UTF_8.toString());
}
public HttpResponse call(AtomicInteger atomicInteger, Function<HttpResponse, Boolean> acceptRedirect) throws IOException, InterruptedException {
final HttpURLConnection conn = buildUrl(requestHttpContext);
if ("POST".equals(conn.getRequestMethod())) {
conn.setDoOutput(true);
try (DataOutputStream dos = new DataOutputStream(conn.getOutputStream())) {
final byte[] form = requestHttpContext.getBodyContent().getBytes(StandardCharsets.UTF_8);
dos.write(form);
dos.flush();
}
} else {
conn.connect();
}
final HttpResponse respContext = HttpResponse.fromHttpUrlConnection(conn);
return followRedirect(requestHttpContext, respContext, atomicInteger, acceptRedirect);
}
private HttpResponse followRedirect(RequestHttpContext queryContext, HttpResponse response, AtomicInteger nbRedirect, Function<HttpResponse, Boolean> acceptRedirect) throws IOException, InterruptedException {
final int nbR = nbRedirect.decrementAndGet();
final int status = response.getStatus();
boolean redirect = false;
if (status != HttpURLConnection.HTTP_OK && ((status == HttpURLConnection.HTTP_MOVED_TEMP
|| status == HttpURLConnection.HTTP_MOVED_PERM || status == HttpURLConnection.HTTP_SEE_OTHER
|| status == TEMPORARY_REDIRECT || status == PERMANENT_REDIRECT))) {
redirect = true;
}
final Optional<String> location = response.getFirstValueHeader("location");
if (!redirect || !location.isPresent() || nbR <= 0) {
return response;
}
queryContext.setBase(location.get());
queryContext.setParams(Collections.emptyMap());
final List<String> cookie = response.getAllValuesHeader("Set-Cookie").orElse(Collections.emptyList());
if (cookie.size() > 0) {
final String collect = String.join("; ", cookie); //cookie.stream().collect(Collectors.joining("; "));
queryContext.getHeaders().put("Cookie", collect);
}
Boolean continueRedirect = acceptRedirect.apply(response);
if (!continueRedirect) {
return response;
}
HttpClient manager = new HttpClient(queryContext);
final HttpResponse redirectResponseContext = manager.call(nbRedirect, acceptRedirect);
return redirectResponseContext;
}
private HttpURLConnection buildUrl(RequestHttpContext context) throws IOException {
StringBuilder sb = new StringBuilder(context.getBase());
if (context.getParams().size() > 0) {
sb.append("?");
boolean first = true;
for (Map.Entry<String, String> e : context.getParams().entrySet()) {
if (!first) {
sb.append("&");
}
first = false;
sb.append(e.getKey());
sb.append("=");
sb.append(encodeValue(e.getValue()));
}
}
URL url = new URL(sb.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
if (context.getHeaders().size() > 0) {
for (Map.Entry<String, String> e : context.getHeaders().entrySet()) {
conn.setRequestProperty(e.getKey(), e.getValue());
}
}
conn.setRequestMethod(context.getMethod());
conn.setInstanceFollowRedirects(context.isFollowRedirects());
conn.setConnectTimeout(context.getConnectionTimeout());
conn.setReadTimeout(context.getReadTimeout());
return conn;
}
public RequestHttpContext getRequestHttpContext() {
return requestHttpContext;
}
}

View File

@@ -0,0 +1,131 @@
package org.talend.ms.crm.odata.authentication.httpclienthelper;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
public final class HttpResponse {
private int status;
private Map<String, List<String>> headers;
private String body;
private Optional<String> code = null;
public static HttpResponse fromHttpUrlConnection(HttpURLConnection conn) throws IOException {
final int status = conn.getResponseCode();
final Map<String, List<String>> respHeaders = conn.getHeaderFields();
HttpResponse context = new HttpResponse(status);
context.setHeaders(respHeaders);
try(BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"))){
final String body = in.lines().collect(Collectors.joining("\n"));
context.setBody(body);
}
return context;
}
private HttpResponse(int status) {
this.status = status;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
public void setHeaders(Map<String, List<String>> headers) {
this.headers = headers;
}
private Optional<List<String>> _getAllValuesHeader(String key) {
if (this.getHeaders() == null || this.getHeaders().size() <= 0) {
return Optional.empty();
}
if (!this.getHeaders().containsKey(key)) {
return Optional.empty();
}
return Optional.ofNullable(this.getHeaders().get(key));
}
public Optional<List<String>> getAllValuesHeader(String key) {
String keyUpper = ("" + key.charAt(0)).toUpperCase() + key.substring(1);
String keyLower = ("" + key.charAt(0)).toLowerCase() + key.substring(1);
Optional<List<String>> values = _getAllValuesHeader(keyUpper);
if(!values.isPresent()){
values = _getAllValuesHeader(keyLower);
}
return values;
}
public Optional<String> getFirstValueHeader(String key) {
final Optional<List<String>> values = getAllValuesHeader(key);
if(!values.isPresent()){
return Optional.empty();
}
final List<String> ss = values.get();
if(ss.size() <= 0){
return Optional.empty();
}
return Optional.ofNullable(ss.get(0));
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
/**
* Extract 'Code' parameter from the redirect url if exist.
* @return An Optional with the code if any.
*/
private Optional<String> _extractCode(){
final Optional<String> optLocation = this.getFirstValueHeader("Location");
if (!optLocation.isPresent()) {
return Optional.empty();
}
final String optLocationValue = optLocation.get();
final String[] split = optLocationValue.split("&|\\?");
final Optional<String> optCode = Arrays.stream(split).filter(e -> e.startsWith("code=")).findFirst();
if (optCode.isPresent()) {
final String optCodeValue = optCode.get();
String code = optCodeValue.substring(5);
return Optional.ofNullable(code);
}
return Optional.empty();
}
public Optional<String> extractCode(){
if(code != null){
return code;
}
code = _extractCode();
return code;
}
}

View File

@@ -0,0 +1,106 @@
package org.talend.ms.crm.odata.authentication.httpclienthelper;
import java.io.UnsupportedEncodingException;
import java.util.Map;
public final class RequestHttpContext {
private String method;
private String base;
private Map<String, String> params;
private Map<String, String> headers;
private boolean followRedirects;
private int connectionTimeout;
private int readTimeout;
private String bodyContent = "";
public RequestHttpContext(String method, String base, Map<String, String> params, Map<String, String> headers, boolean followRedirects, int connectionTimeout, int readTimeout) {
this.method = method;
this.base = base;
this.params = params;
this.headers = headers;
this.followRedirects = followRedirects;
this.connectionTimeout = connectionTimeout;
this.readTimeout = readTimeout;
}
public String getBodyContent() {
return bodyContent;
}
public void setBodyContent(Map<String, String> form) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (Map.Entry<String, String> e : form.entrySet()) {
if(!first){
sb.append("&");
}
first = false;
sb.append(e.getKey()).append("=").append(HttpClient.encodeValue(e.getValue()));
}
this.setBodyContent(sb.toString());
}
public void setBodyContent(String bodyContent) {
this.bodyContent = bodyContent;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getBase() {
return base;
}
public void setBase(String base) {
this.base = base;
}
public Map<String, String> getParams() {
return params;
}
public void setParams(Map<String, String> params) {
this.params = params;
}
public Map<String, String> getHeaders() {
return headers;
}
public void setHeaders(Map<String, String> headers) {
this.headers = headers;
}
public boolean isFollowRedirects() {
return followRedirects;
}
public void setFollowRedirects(boolean followRedirects) {
this.followRedirects = followRedirects;
}
public int getConnectionTimeout() {
return connectionTimeout;
}
public void setConnectionTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
public int getReadTimeout() {
return readTimeout;
}
public void setReadTimeout(int readTimeout) {
this.readTimeout = readTimeout;
}
}

View File

@@ -0,0 +1,38 @@
package org.talend.ms.crm.odata.authentication.httpclienthelper;
public final class Token {
// Time to be sure to refresh the token at time
private final static int EXPIRATION_SECURITY_GAP_SECOND = 60;
private String access_token;
private String token_type;
private Long expires_in;
public Token(){
}
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getToken_type() {
return token_type;
}
public void setToken_type(String token_type) {
this.token_type = token_type;
}
public Long getExpires_in() {
return expires_in;
}
public void setExpires_in(Long expires_in) {
this.expires_in = expires_in;
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -0,0 +1,85 @@
package org.talend.ms.crm.sdk;
public class Instance {
public String id;
public String uniqueName;
public String urlName;
public String friendlyName;
public String state;
public String version;
public String url;
public String apiUrl;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUniqueName() {
return uniqueName;
}
public void setUniqueName(String uniqueName) {
this.uniqueName = uniqueName;
}
public String getUrlName() {
return urlName;
}
public void setUrlName(String urlName) {
this.urlName = urlName;
}
public String getFriendlyName() {
return friendlyName;
}
public void setFriendlyName(String friendlyName) {
this.friendlyName = friendlyName;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getApiUrl() {
return apiUrl;
}
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
}

View File

@@ -11,7 +11,7 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.activity.InvalidActivityException;
import java.security.InvalidParameterException;
import javax.wsdl.WSDLException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
@@ -107,7 +107,7 @@ public final class OnlineAuthenticationPolicy {
this.initialize(flatWsdlUrl, targetDocument);
}
private void initialize(String url, String wsdl) throws URISyntaxException, InvalidActivityException {
private void initialize(String url, String wsdl) throws URISyntaxException, InvalidParameterException {
final String PolicyNodeContentRegexPatern = "(?i)(<wsp:All.*?>)(.+?)(</wsp:All>)";
final String LiveIdentityProviderTrustRegexPatern = "(?i)(<ms-xrm:LiveTrust.*?>)(.+?)(</ms-xrm:LiveTrust>)";
final String OrgIdentityProviderTrustRegexPatern = "(?i)(<ms-xrm:OrgTrust.*?>)(.+?)(</ms-xrm:OrgTrust>)";
@@ -166,7 +166,7 @@ public final class OnlineAuthenticationPolicy {
}
}
throw new InvalidActivityException(
throw new InvalidParameterException(
String.format(Locale.getDefault(), "Unable to parse the authentication policy from the WSDL \"%s\".", url));
}

View File

@@ -100,7 +100,7 @@ public class OrganizationServiceStubWrapper extends OrganizationServiceStub {
}
private void renewToken() throws Exception {
orgStub = client.doGetOnlineConnection(discoveryServiceUrl);
orgStub = client.doGetOnlineConnection();
}
private void sleep() {

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -6,12 +6,12 @@
<groupId>org.talend.components</groupId>
<artifactId>talend-scp-helper</artifactId>
<version>1.0</version>
<version>1.1</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<ssd.version>2.5.1</ssd.version>
<ssd.version>2.8.0</ssd.version>
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
</properties>

View File

@@ -1,31 +1,32 @@
package org.talend.components.talendscp;
import org.apache.sshd.client.channel.ChannelExec;
import org.apache.sshd.scp.client.AbstractScpClient;
import org.apache.sshd.scp.client.DefaultScpClient;
import org.apache.sshd.scp.client.DefaultScpStreamResolver;
import org.apache.sshd.scp.client.ScpClient;
import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.file.FileSystemFactory;
import org.apache.sshd.common.file.util.MockFileSystem;
import org.apache.sshd.common.file.util.MockPath;
import org.apache.sshd.scp.common.ScpFileOpener;
import org.apache.sshd.scp.common.ScpHelper;
import org.apache.sshd.common.util.ValidateUtils;
import org.apache.sshd.scp.common.ScpTransferEventListener;
import org.apache.sshd.scp.common.helpers.ScpTimestampCommandDetails;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
import java.nio.file.attribute.PosixFilePermission;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import org.apache.sshd.client.channel.ChannelExec;
import org.apache.sshd.client.scp.AbstractScpClient;
import org.apache.sshd.client.scp.DefaultScpClient;
import org.apache.sshd.client.scp.DefaultScpStreamResolver;
import org.apache.sshd.client.scp.ScpClient;
import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.file.FileSystemFactory;
import org.apache.sshd.common.file.util.MockFileSystem;
import org.apache.sshd.common.file.util.MockPath;
import org.apache.sshd.common.scp.ScpFileOpener;
import org.apache.sshd.common.scp.ScpHelper;
import org.apache.sshd.common.scp.ScpTimestamp;
import org.apache.sshd.common.scp.ScpTransferEventListener;
import org.apache.sshd.common.util.ValidateUtils;
/*
What we do here is just overwrite the ScpHelper to throw Exception when scp return status 1
@@ -40,7 +41,8 @@ public class TalendScpClient extends DefaultScpClient {
}
@Override public void upload(InputStream local, String remote, long size, Collection<PosixFilePermission> perms,
ScpTimestamp time) throws IOException {
ScpTimestampCommandDetails time) throws IOException {
int namePos = ValidateUtils.checkNotNullAndNotEmpty(remote, "No remote location specified").lastIndexOf('/');
String name = (namePos < 0) ?
remote :

View File

@@ -1,11 +1,11 @@
package org.talend.components.talendscp;
import org.apache.sshd.client.scp.AbstractScpClientCreator;
import org.apache.sshd.client.scp.ScpClient;
import org.apache.sshd.client.scp.ScpClientCreator;
import org.apache.sshd.scp.client.AbstractScpClientCreator;
import org.apache.sshd.scp.client.ScpClient;
import org.apache.sshd.scp.client.ScpClientCreator;
import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.common.scp.ScpFileOpener;
import org.apache.sshd.common.scp.ScpTransferEventListener;
import org.apache.sshd.scp.common.ScpFileOpener;
import org.apache.sshd.scp.common.ScpTransferEventListener;
public class TalendScpClientCreator extends AbstractScpClientCreator implements ScpClientCreator {
public static final TalendScpClientCreator INSTANCE = new TalendScpClientCreator();

View File

@@ -6,11 +6,12 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.FileSystem;
import org.apache.sshd.common.scp.ScpException;
import org.apache.sshd.common.scp.ScpFileOpener;
import org.apache.sshd.common.scp.ScpHelper;
import org.apache.sshd.common.scp.ScpTransferEventListener;
import org.apache.sshd.scp.common.ScpException;
import org.apache.sshd.scp.common.ScpFileOpener;
import org.apache.sshd.scp.common.ScpHelper;
import org.apache.sshd.scp.common.ScpTransferEventListener;
import org.apache.sshd.common.session.Session;
import org.apache.sshd.scp.common.helpers.ScpAckInfo;
public class TalendScpHelper extends ScpHelper {
@@ -20,8 +21,9 @@ public class TalendScpHelper extends ScpHelper {
}
@Override
public int readAck(boolean canEof) throws IOException {
int c = in.read();
public ScpAckInfo readAck(boolean canEof) throws IOException {
final ScpAckInfo scpAckInfo = ScpAckInfo.readAck(this.in, this.csIn, canEof);
int c = scpAckInfo == null ? -1 : scpAckInfo.getStatusCode();
switch (c) {
case -1:
if (log.isDebugEnabled()) {
@@ -31,12 +33,12 @@ public class TalendScpHelper extends ScpHelper {
throw new EOFException("readAck - EOF before ACK");
}
break;
case OK:
case ScpAckInfo.OK:
if (log.isDebugEnabled()) {
log.debug("readAck({})[EOF={}] read OK", this, canEof);
}
break;
case WARNING: {
case ScpAckInfo.WARNING: {
if (log.isDebugEnabled()) {
log.debug("readAck({})[EOF={}] read warning message", this, canEof);
}
@@ -45,7 +47,7 @@ public class TalendScpHelper extends ScpHelper {
log.warn("readAck({})[EOF={}] - Received warning: {}", this, canEof, line);
throw new ScpException("received error: " + line, c);
}
case ERROR: {
case ScpAckInfo.ERROR: {
if (log.isDebugEnabled()) {
log.debug("readAck({})[EOF={}] read error message", this, canEof);
}
@@ -58,6 +60,6 @@ public class TalendScpHelper extends ScpHelper {
default:
break;
}
return c;
return scpAckInfo;
}
}

View File

@@ -60,9 +60,9 @@
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>

View File

@@ -2,17 +2,28 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId>
<groupId>org.talend.components</groupId>
<artifactId>talend-ws</artifactId>
<version>1.0.1-20191112</version>
<version>1.0.7-20220526</version>
<packaging>jar</packaging>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.talendforge.org/modules/licenses/APACHE_v2.txt</url>
<distribution>may be downloaded from the Maven repository</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>3.3.4</cxf.version>
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
<cxf.version>3.4.7</cxf.version>
<odata.version>4.3.0</odata.version>
<slf4j.version>1.7.12</slf4j.version>
<talend.nexus.url>https://artifacts-oss.talend.com</talend.nexus.url>
<httpclient.version>4.5.13</httpclient.version>
</properties>
<distributionManagement>
@@ -43,13 +54,19 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
<version>1.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient -->
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.woodstox/stax2-api -->
<dependency>
@@ -91,6 +108,12 @@
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.version}</version>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -101,6 +124,16 @@
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-tools-common</artifactId>
<version>${cxf.version}</version>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-xjc</artifactId>
</exclusion>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -127,6 +160,16 @@
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.6</version>
</dependency>
<dependency>
<groupId>org.talend.libraries</groupId>
<artifactId>jaxb-impl-2.2.6-modified</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.talend.libraries</groupId>
<artifactId>jaxb-xjc-2.2.6-modified</artifactId>
@@ -244,6 +287,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
@@ -251,4 +295,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@@ -48,4 +48,6 @@ please @see org\talend\ws\helper\ServiceDiscoveryHelper.java
please @see org\talend\ws\helper\ServiceInvokerHelper.java
org\talend\ws\mapper\MapperFactory.java
10.(2019-01-18 modified by dchmyga) fixed TDI-41647
10.(2019-01-18 modified by dchmyga) fixed TDI-41647
11.(2020-08-24 modified by ozhelezniak) updated commons-codec to 1.14 in scope of TDI-44145

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

View File

@@ -3,29 +3,22 @@
*/
package org.talend.webservice.helper;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
import com.ibm.wsdl.Constants;
import com.ibm.wsdl.extensions.schema.SchemaConstants;
import com.ibm.wsdl.util.xml.DOMUtils;
import com.ibm.wsdl.util.xml.QNameUtils;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.talend.webservice.helper.conf.ServiceHelperConfiguration;
import org.talend.webservice.helper.conf.WSDLLocatorImpl;
import org.w3c.dom.Element;
import javax.wsdl.Definition;
import javax.wsdl.Import;
import javax.wsdl.Types;
import javax.wsdl.WSDLException;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.UnknownExtensibilityElement;
import javax.wsdl.extensions.schema.Schema;
import javax.wsdl.extensions.schema.SchemaImport;
import javax.wsdl.extensions.schema.SchemaReference;
@@ -37,16 +30,15 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.talend.webservice.helper.conf.ServiceHelperConfiguration;
import org.talend.webservice.helper.conf.WSDLLocatorImpl;
import org.w3c.dom.Element;
import com.ibm.wsdl.Constants;
import com.ibm.wsdl.extensions.schema.SchemaConstants;
import com.ibm.wsdl.util.xml.DOMUtils;
import com.ibm.wsdl.util.xml.QNameUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
/**
* This helper allow easy discovery of services and types
@@ -70,26 +62,36 @@ public class ServiceDiscoveryHelper {
private Set<String> namespaces;
private final String LOCAL_WSDL_NAME = "mainWSDL.wsdl";
private boolean createTempFiles = true;
public ServiceDiscoveryHelper(String wsdlUri) throws WSDLException, IOException, TransformerException, URISyntaxException {
this(wsdlUri, null, null);
this(wsdlUri, null, null, true);
}
public ServiceDiscoveryHelper(String wsdlUri, String tempPath) throws WSDLException, IOException, TransformerException,
URISyntaxException {
this(wsdlUri, null, tempPath);
this(wsdlUri, null, tempPath, true);
}
public ServiceDiscoveryHelper(String wsdlUri, ServiceHelperConfiguration configuration) throws WSDLException, IOException,
TransformerException, URISyntaxException {
this(wsdlUri, configuration, null);
this(wsdlUri, configuration, null, true);
}
public ServiceDiscoveryHelper(String wsdlUri, ServiceHelperConfiguration configuration, String tempPath)
throws WSDLException, IOException, TransformerException, URISyntaxException {
this(wsdlUri, configuration, tempPath, true);
}
public ServiceDiscoveryHelper(String wsdlUri, ServiceHelperConfiguration configuration, String tempPath, boolean createTempFiles)
throws WSDLException, IOException, TransformerException, URISyntaxException {
this.wsdlUri = wsdlUri;
this.configuration = configuration;
this.wsdlTmpDir = createTempWsdlDir(tempPath);
this.createTempFiles = createTempFiles;
if(createTempFiles) {
this.wsdlTmpDir = createTempWsdlDir(tempPath);
}
init();
}
@@ -139,7 +141,9 @@ public class ServiceDiscoveryHelper {
namespaces = collectNamespaces();
generateTempWsdlFile();
if(this.createTempFiles) {
generateTempWsdlFile();
}
}
@@ -436,6 +440,10 @@ public class ServiceDiscoveryHelper {
return definitions.get(this.LOCAL_WSDL_NAME);
}
Collection<Definition> getDefinitions() {
return definitions.values();
}
/**
* Return the xml schema collection
*
@@ -450,7 +458,11 @@ public class ServiceDiscoveryHelper {
}
public String getLocalWsdlUri() {
return new File(wsdlTmpDir, this.LOCAL_WSDL_NAME).toURI().toString();
if(createTempFiles) {
return new File(wsdlTmpDir, this.LOCAL_WSDL_NAME).toURI().toString();
} else {
return this.wsdlUri;
}
}
public Set<String> getNamespaces() {
@@ -464,4 +476,33 @@ public class ServiceDiscoveryHelper {
return "NOLOCATION";
}
}
public static void main(String[] args) throws Exception {
System.setProperty("javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl");
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
System.setProperty("javax.xml.accessExternalSchema", "all");
//shade the log level for DynamicClientFactory.class
java.util.logging.Logger LOG = org.apache.cxf.common.logging.LogUtils.getL7dLogger(org.apache.cxf.endpoint.dynamic.DynamicClientFactory.class);
LOG.setLevel(java.util.logging.Level.WARNING);
ServiceDiscoveryHelper helper = new ServiceDiscoveryHelper("http://gcomputer.net/webservices/knowledge.asmx?WSDL", null, null, false);
//ServiceDiscoveryHelper helper = new ServiceDiscoveryHelper("/Users/wangwei/Downloads/knowledge.wsdl", null, null, false);
/*
WSDLMetadataUtils utils = new WSDLMetadataUtils();
//WSDLMetadataUtils.OperationInfo info = utils.parseOperationInfo(helper, "KnowledgeLeakSoap12", "Knowledge");
WSDLMetadataUtils.OperationInfo info = utils.parseOperationInfo(helper, null, "Knowledge");
System.out.println(info.operationName);
System.out.println(info.port);
System.out.println(info.service);
System.out.println(info.inputParameters);
System.out.println(info.outputParameter);
System.out.println("done");
*/
org.talend.webservice.helper.ServiceInvokerHelper serviceInvokerHelper = new org.talend.webservice.helper.ServiceInvokerHelper(helper, null);
Map<String, Object> result = serviceInvokerHelper.invokeDynamic("Knowledge", Arrays.asList(1));
System.out.println(result);
}
}

View File

@@ -3,30 +3,6 @@
*/
package org.talend.webservice.helper;
import java.beans.PropertyDescriptor;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import javax.wsdl.Input;
import javax.wsdl.Message;
import javax.wsdl.Operation;
import javax.wsdl.Output;
import javax.wsdl.Port;
import javax.wsdl.Service;
import javax.wsdl.WSDLException;
import javax.xml.bind.annotation.XmlSchema;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.cxf.endpoint.Client;
@@ -39,11 +15,18 @@ import org.talend.webservice.helper.conf.ServiceHelperConfiguration;
import org.talend.webservice.helper.map.MapConverter;
import org.talend.webservice.jaxb.JAXBUtils;
import org.talend.webservice.jaxb.JAXBUtils.IdentifierType;
import org.talend.webservice.mapper.AnyPropertyMapper;
import org.talend.webservice.mapper.ClassMapper;
import org.talend.webservice.mapper.EmptyMessageMapper;
import org.talend.webservice.mapper.MapperFactory;
import org.talend.webservice.mapper.MessageMapper;
import org.talend.webservice.mapper.*;
import javax.wsdl.*;
import javax.xml.bind.annotation.XmlSchema;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
import java.beans.PropertyDescriptor;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.*;
/**
*
@@ -261,6 +244,61 @@ public class ServiceInvokerHelper implements ClassMapper {
return MapConverter.deepMapToMap(result);
}
//auto decide the service, port, and operation name and params are necessary
public Map<String, Object> invokeDynamic(String operationNameAndPortName, List<Object> param_values)
throws Exception, LocalizedException {
String portName = null;
String operationName = operationNameAndPortName;
try {
portName = operationName.substring(operationName.indexOf("(") + 1, operationName.indexOf(")"));
operationName = operationName.substring(0, operationName.indexOf("("));
} catch (Exception ignored) {
}
WSDLMetadataUtils utils = new WSDLMetadataUtils();
WSDLMetadataUtils.OperationInfo info = utils.parseOperationInfo(this.serviceDiscoveryHelper, portName, operationName);
Map<String, Object> paramsMap = null;
if(param_values!=null && !param_values.isEmpty()) {
List<String> paths = new ArrayList<>();
flat(paths, info.inputParameters, null);
int size = Math.min(paths.size(), param_values.size());
paramsMap = new HashMap<>();
for(int i=0;i<size;i++) {
paramsMap.put(paths.get(i), param_values.get(i));
}
if (!paramsMap.isEmpty()) {
paramsMap = MapConverter.mapToDeepMap(paramsMap);
}
if (paramsMap.isEmpty()) {
paramsMap = null;
}
}
Map<String, Object> result = invoke(info.service, info.port, info.operationName, paramsMap);
if(result==null || result.isEmpty()) return null;
return MapConverter.deepMapToMap(result, true);
}
private void flat(List<String> paths, List<WSDLMetadataUtils.ParameterInfo> inputParameters, String path) {
if(inputParameters==null || inputParameters.isEmpty()) {
if(path!=null) {
paths.add(path);
}
return;
}
for(WSDLMetadataUtils.ParameterInfo info : inputParameters) {
flat(paths, info.childParameters, path!=null? path + "." + info.name : info.name);
}
}
protected String getClassNameForType(QName xmlSchemaTypeMapperQname) {
StringBuilder sb = new StringBuilder();
sb.append(getPackageForNamespaceURI(xmlSchemaTypeMapperQname.getNamespaceURI()));

View File

@@ -0,0 +1,640 @@
package org.talend.webservice.helper;
import org.apache.ws.commons.schema.*;
import org.w3c.dom.Element;
import javax.wsdl.*;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.UnknownExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPBinding;
import javax.wsdl.extensions.soap.SOAPBody;
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.extensions.soap12.SOAP12Binding;
import javax.wsdl.extensions.soap12.SOAP12Body;
import javax.wsdl.extensions.soap12.SOAP12Operation;
import javax.wsdl.factory.WSDLFactory;
import javax.xml.namespace.QName;
import java.io.File;
import java.net.URL;
import java.util.*;
public class WSDLMetadataUtils {
WSDLFactory wsdlFactory = null;
private Vector<XmlSchema> wsdlTypes = new Vector<XmlSchema>();
private List<String> parametersName = new ArrayList<String>();
private List<String> schemaNames = new ArrayList<String>();
private List<String> documentBaseList = new ArrayList<String>();
private List<XmlSchemaElement> allXmlSchemaElement = new ArrayList<XmlSchemaElement>();
private List<XmlSchemaType> allXmlSchemaType = new ArrayList<XmlSchemaType>();
public final static String DEFAULT_SOAP_ENCODING_STYLE = "http://schemas.xmlsoap.org/soap/encoding/";
public WSDLMetadataUtils() throws WSDLException {
wsdlFactory = WSDLFactory.newInstance();
}
public static class OperationInfo {
QName port;
QName service;
String operationName;
List<ParameterInfo> inputParameters = new ArrayList<ParameterInfo>();
List<ParameterInfo> outputParameter = new ArrayList<ParameterInfo>();
}
public class ParameterInfo {
String name;
/* list of parameters, only filled if complex type */
List<ParameterInfo> childParameters = new ArrayList<ParameterInfo>();
}
//not thread safe
private List<OperationInfo> operations;
private String targetOperationName;
private String currentPort;
private QName currentService;
public OperationInfo parseOperationInfo(ServiceDiscoveryHelper sdh, String port, String operationName) throws Exception {
this.targetOperationName = operationName;
Collection<Definition> defs = sdh.getDefinitions();
wsdlTypes = createSchemaFromTypes(defs);
collectAllXmlSchemaElement();
collectAllXmlSchemaType();
//only fetch services from main wsdl/definition, others for elements and type definition
Map services = defs.iterator().next().getServices();
if (services != null) {
Iterator iter = services.values().iterator();
while (iter.hasNext()) {
List<OperationInfo> operations = getOperations((Service) iter.next());
for(OperationInfo info : operations) {
if(port==null) {
return info;
}
if(port.equals(info.port.getLocalPart())) {
return info;
}
}
}
}
throw new RuntimeException("can't find the operation : " + operationName + " with port : " + port);
}
private void collectAllXmlSchemaElement() {
for (int i = 0; i < wsdlTypes.size(); i++) {
XmlSchema xmlSchema = (wsdlTypes.elementAt(i));
if (xmlSchema == null) {
continue;
}
Map<QName, XmlSchemaElement> elements = xmlSchema.getElements();
Iterator elementsItr = elements.values().iterator();
while (elementsItr.hasNext()) {
XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) elementsItr.next();
allXmlSchemaElement.add(xmlSchemaElement);
}
}
}
private void collectAllXmlSchemaType() {
for (int i = 0; i < wsdlTypes.size(); i++) {
XmlSchema xmlSchema = (wsdlTypes.elementAt(i));
if (xmlSchema == null) {
continue;
}
Map<QName, XmlSchemaType> xmlSchemaObjectTable = xmlSchema.getSchemaTypes();
Iterator typesItr = xmlSchemaObjectTable.values().iterator();
while (typesItr.hasNext()) {
XmlSchemaType xmlSchemaType = (XmlSchemaType) typesItr.next();
allXmlSchemaType.add(xmlSchemaType);
}
}
}
protected Vector<XmlSchema> createSchemaFromTypes(Collection<Definition> wsdlDefinitions) throws WSDLException {
Vector<XmlSchema> schemas = new Vector<XmlSchema>();
Set<String> imports = new HashSet<String>();
Element schemaElementt = null;
Map importElement = null;
List includeElement = null;
for (Definition def : wsdlDefinitions) {
if (def.getTypes() != null) {
List schemaExtElem = findExtensibilityElement(def.getTypes().getExtensibilityElements(), "schema");
for (int i = 0; i < schemaExtElem.size(); i++) {
ExtensibilityElement schemaElement = (ExtensibilityElement) schemaExtElem.get(i);
if (schemaElement != null && schemaElement instanceof UnknownExtensibilityElement) {
schemaElementt = ((UnknownExtensibilityElement) schemaElement).getElement();
String documentBase = ((javax.wsdl.extensions.schema.Schema) schemaElement).getDocumentBaseURI();
XmlSchema schema = createschemafromtype(schemaElementt, def, documentBase);
if (schema != null) {
schemas.add(schema);
if (schema.getTargetNamespace() != null) {
schemaNames.add(schema.getTargetNamespace());
}
}
importElement = ((javax.wsdl.extensions.schema.Schema) schemaElement).getImports();
if (importElement != null && importElement.size() > 0) {
findImportSchema(def, schemas, importElement, imports);
}
}
if (schemaElement != null && schemaElement instanceof javax.wsdl.extensions.schema.Schema) {
schemaElementt = ((javax.wsdl.extensions.schema.Schema) schemaElement).getElement();
String documentBase = ((javax.wsdl.extensions.schema.Schema) schemaElement).getDocumentBaseURI();
Boolean isHaveImport = false;
importElement = ((javax.wsdl.extensions.schema.Schema) schemaElement).getImports();
if (importElement != null && importElement.size() > 0) {
Iterator keyIterator = importElement.keySet().iterator();
if (importElement.size() > 0) {
isHaveImport = true;
}
}
XmlSchema schema = createschemafromtype(schemaElementt, def, documentBase);
if (schema != null) {
schemas.add(schema);
if (schema.getTargetNamespace() != null) {
schemaNames.add(schema.getTargetNamespace());
}
}
if (isHaveImport) {
findImportSchema(def, schemas, importElement, imports);
}
}
}
}
}
return schemas;
}
private void findIncludesSchema(Definition wsdlDefinition, Vector schemas, List includeElement) throws WSDLException {
Element schemaElementt;
for (int i = 0; i < includeElement.size(); i++) {
schemaElementt = ((com.ibm.wsdl.extensions.schema.SchemaReferenceImpl) includeElement.get(i)).getReferencedSchema()
.getElement();
String documentBase = ((com.ibm.wsdl.extensions.schema.SchemaReferenceImpl) includeElement.get(i))
.getReferencedSchema().getDocumentBaseURI();
XmlSchema schemaInclude = createschemafromtype(schemaElementt, wsdlDefinition, documentBase);
if (schemaInclude != null) {
schemas.add(schemaInclude);
if (schemaInclude.getTargetNamespace() != null) {
schemaNames.add(schemaInclude.getTargetNamespace());
}
}
}
}
private void findImportSchema(Definition wsdlDefinition, Vector schemas, Map importElement, Set<String> imports)
throws WSDLException {
Element schemaElementt;
List includeElement = null;
Iterator keyIterator = importElement.keySet().iterator();
Boolean isHaveImport = false;
while (keyIterator.hasNext()) {
Object object = keyIterator.next();
if (object != null) {
String key = object.toString();
Vector importEle = (Vector) importElement.get(key);
for (int i = 0; i < importEle.size(); i++) {
Map importChildElement = null;
com.ibm.wsdl.extensions.schema.SchemaImportImpl importImpl = (com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle
.elementAt(i);
// to avoid import cycle
String importLocation = importImpl.getSchemaLocationURI() + ":" + importImpl.getNamespaceURI();
if (imports.contains(importLocation)) {
continue;
} else {
imports.add(importLocation);
}
if (importImpl.getReferencedSchema() != null) {
schemaElementt = importImpl.getReferencedSchema().getElement();
String documentBase = importImpl.getReferencedSchema().getDocumentBaseURI();
if ((com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle.elementAt(i) != null) {
if (((com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle.elementAt(i)).getReferencedSchema() != null) {
importChildElement = ((com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle.elementAt(i))
.getReferencedSchema().getImports();
if (importChildElement != null && importChildElement.size() > 0 && !isIncludeSchema(documentBase)) {
isHaveImport = true;
documentBaseList.add(documentBase);
// validateImportUrlPath(importElement);
}
}
}
XmlSchema schemaImport = createschemafromtype(schemaElementt, wsdlDefinition, documentBase);
if (schemaImport != null) {
schemas.add(schemaImport);
if (schemaImport.getTargetNamespace() != null) {
schemaNames.add(schemaImport.getTargetNamespace());
}
}
}
if (isHaveImport) {
findImportSchema(wsdlDefinition, schemas, importChildElement, imports);
}
if ((com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle.elementAt(i) != null) {
if (((com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle.elementAt(i)).getReferencedSchema() != null) {
includeElement = ((com.ibm.wsdl.extensions.schema.SchemaImportImpl) importEle.elementAt(i))
.getReferencedSchema().getIncludes();
if (includeElement != null && includeElement.size() > 0) {
findIncludesSchema(wsdlDefinition, schemas, includeElement);
}
}
}
}
}
}
}
private List findExtensibilityElement(List extensibilityElements, String elementType) {
List elements = new ArrayList();
if (extensibilityElements != null) {
Iterator iter = extensibilityElements.iterator();
while (iter.hasNext()) {
ExtensibilityElement element = (ExtensibilityElement) iter.next();
if (element.getElementType().getLocalPart().equalsIgnoreCase(elementType)) {
elements.add(element);
}
}
}
return elements;
}
private XmlSchema createschemafromtype(Element schemaElement, Definition wsdlDefinition, String documentBase)
throws WSDLException {
if (schemaElement == null) {
throw new WSDLException(WSDLException.INVALID_WSDL, "Unable to find schema extensibility element in WSDL");
}
XmlSchema xmlSchema = null;
XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
xmlSchemaCollection.setBaseUri(fixDocumentBase(documentBase));
xmlSchema = xmlSchemaCollection.read(schemaElement);
return xmlSchema;
}
private String fixDocumentBase(String documentBase) {
String fixedPath = documentBase;
try {
URL url = new URL(documentBase);
File file = new File(url.getFile());
fixedPath = file.toURI().toString();
} catch (Exception e) {
fixedPath = documentBase;
}
return fixedPath;
}
private Boolean isIncludeSchema(String documentBase) {
Boolean isHaveSchema = false;
for (int i = 0; i < documentBaseList.size(); i++) {
String documentBaseTem = documentBaseList.get(i);
if (documentBaseTem.equals(documentBase)) {
isHaveSchema = true;
}
}
return isHaveSchema;
}
private List<OperationInfo> getOperations(Service service) {
currentService = service.getQName();
List<OperationInfo> result = new ArrayList<>();
Map ports = service.getPorts();
Iterator portIter = ports.values().iterator();
while (portIter.hasNext()) {
Port port = (Port) portIter.next();
Binding binding = port.getBinding();
currentPort = port.getName();
result.addAll(buildOperations(binding));
}
return result;
}
private List<OperationInfo> buildOperations(Binding binding) {
List<OperationInfo> result = new ArrayList<>();
List operations = binding.getBindingOperations();
if (operations != null && !operations.isEmpty()) {
List soapBindingElems = findExtensibilityElement(binding.getExtensibilityElements(), "binding");
String style = "document"; // default
ExtensibilityElement soapBindingElem = (ExtensibilityElement) soapBindingElems.get(0);
if (soapBindingElem != null && soapBindingElem instanceof SOAPBinding) {
SOAPBinding soapBinding = (SOAPBinding) soapBindingElem;
style = soapBinding.getStyle();
} else if (soapBindingElem != null && soapBindingElem instanceof SOAP12Binding) {
SOAP12Binding soapBinding = (SOAP12Binding) soapBindingElem;
style = soapBinding.getStyle();
}
Iterator opIter = operations.iterator();
while (opIter.hasNext()) {
BindingOperation oper = (BindingOperation) opIter.next();
List operElems = findExtensibilityElement(oper.getExtensibilityElements(), "operation");
ExtensibilityElement operElem = (ExtensibilityElement) operElems.get(0);
if(!targetOperationName.equals(oper.getName())) {
continue;
}
OperationInfo operationInfo = new OperationInfo();
operationInfo.service = currentService;
operationInfo.port = new QName(currentService.getNamespaceURI(), currentPort);
operationInfo.operationName = oper.getName();
//TODO do different?
if (operElem != null && operElem instanceof SOAPOperation) {
buildOperation(operationInfo, oper);
} else if (operElem != null && operElem instanceof SOAP12Operation) {
buildOperation(operationInfo, oper);
}
result.add(operationInfo);
}
}
return result;
}
private void buildOperation(OperationInfo operationInfo, BindingOperation bindingOper) {
Operation oper = bindingOper.getOperation();
List operElems = findExtensibilityElement(bindingOper.getExtensibilityElements(), "operation");
ExtensibilityElement operElem = (ExtensibilityElement) operElems.get(0);
if (operElem != null && operElem instanceof SOAPOperation) {//TODO do different?
SOAPOperation soapOperation = (SOAPOperation) operElem;
} else if (operElem != null && operElem instanceof SOAP12Operation) {
SOAP12Operation soapOperation = (SOAP12Operation) operElem;
}
BindingInput bindingInput = bindingOper.getBindingInput();
BindingOutput bindingOutput = bindingOper.getBindingOutput();
List bodyElems = findExtensibilityElement(bindingInput.getExtensibilityElements(), "body");
ExtensibilityElement bodyElem = (ExtensibilityElement) bodyElems.get(0);
if (bodyElem != null && bodyElem instanceof SOAPBody) {
SOAPBody soapBody = (SOAPBody) bodyElem;
List styles = soapBody.getEncodingStyles();
String encodingStyle = null;
if (styles != null) {
encodingStyle = styles.get(0).toString();
}
if (encodingStyle == null) {
encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
}
//TODO get namespace uri here?
//soapBody.getNamespaceURI();
} else if (bodyElem != null && bodyElem instanceof SOAP12Body) {
SOAP12Body soapBody = (SOAP12Body) bodyElem;
String encodingStyle = null;
if (soapBody.getEncodingStyle() != null) {
encodingStyle = soapBody.getEncodingStyle().toString();
}
if (encodingStyle == null) {
encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
}
//TODO get namespace uri here?
//soapBody.getNamespaceURI();
}
Input inDef = oper.getInput();
if (inDef != null) {
Message inMsg = inDef.getMessage();
if (inMsg != null) {
getParameterFromMessage(operationInfo, inMsg, 1);
}
}
//don't need output parameter struct now
/*
Output outDef = oper.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
if (outMsg != null) {
getParameterFromMessage(operationInfo, outMsg, 2);
}
}
*/
}
private void getParameterFromMessage(OperationInfo operationInfo, Message msg, int manner) {
List msgParts = msg.getOrderedParts(null);
Iterator iter = msgParts.iterator();
while (iter.hasNext()) {
Part part = (Part) iter.next();
String partName = part.getName();
String partElement = null;
String namespace = null;
if (part.getElementName() != null) {
partElement = part.getElementName().getLocalPart();
namespace = part.getElementName().getNamespaceURI();
} else if (part.getTypeName() != null) {
partElement = part.getTypeName().getLocalPart();
namespace = part.getTypeName().getNamespaceURI();
}
// add root parameter from message.
ParameterInfo parameterRoot = new ParameterInfo();
parameterRoot.name = partName;
if (manner == 1) {
operationInfo.inputParameters.add(parameterRoot);
} else {
operationInfo.outputParameter.add(parameterRoot);
}
if (allXmlSchemaElement.size() > 0) {
buildParameterFromElements(partElement, parameterRoot, manner);
} else if (allXmlSchemaType.size() > 0) {
buileParameterFromTypes(namespace, partElement, parameterRoot, manner);
}
}
}
private void buildParameterFromElements(String partElement, ParameterInfo parameterRoot, int ioOrRecursion) {
if (ioOrRecursion < 3) {
parametersName.clear();
parametersName.add(parameterRoot.name);
} else if (ioOrRecursion == 3) {
parametersName.add(parameterRoot.name);
}
Iterator elementsItr = allXmlSchemaElement.iterator();
if (partElement != null) {
while (elementsItr.hasNext()) {
XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) elementsItr.next();
if (partElement.equals(xmlSchemaElement.getName())) {
if (xmlSchemaElement.getSchemaType() != null) {
if (xmlSchemaElement.getSchemaType() instanceof XmlSchemaComplexType) {
XmlSchemaComplexType xmlElementComplexType = (XmlSchemaComplexType) xmlSchemaElement.getSchemaType();
XmlSchemaParticle xmlSchemaParticle = xmlElementComplexType.getParticle();
if (xmlSchemaParticle instanceof XmlSchemaGroupParticle) {
XmlSchemaGroupParticle xmlSchemaGroupBase = (XmlSchemaGroupParticle) xmlSchemaParticle;
if (xmlSchemaGroupBase != null) {
buildParameterFromCollection(xmlSchemaGroupBase, parameterRoot, ioOrRecursion);
}
} else if (xmlSchemaElement.getSchemaTypeName() != null) {
String paraTypeName = xmlSchemaElement.getSchemaTypeName().getLocalPart();
String paraTypeNamespace = xmlSchemaElement.getSchemaTypeName().getNamespaceURI();
if (paraTypeName != null) {
buileParameterFromTypes(paraTypeNamespace, paraTypeName, parameterRoot, ioOrRecursion);
}
}
} else if (xmlSchemaElement.getSchemaType() instanceof XmlSchemaSimpleType) {
XmlSchemaSimpleType xmlSchemaSimpleType = (XmlSchemaSimpleType) xmlSchemaElement.getSchemaType();
String typeName = xmlSchemaSimpleType.getName();
if (typeName != null && typeName.equals("anyType")) {
ParameterInfo parameterSon = new ParameterInfo();
parameterSon.name = "anyType";
parameterRoot.childParameters.add(parameterSon);
}
}
} else if (xmlSchemaElement.getSchemaTypeName() != null) {
String paraTypeName = xmlSchemaElement.getSchemaTypeName().getLocalPart();
String paraTypeNamespace = xmlSchemaElement.getSchemaTypeName().getNamespaceURI();
if (paraTypeName != null) {
buileParameterFromTypes(paraTypeNamespace, paraTypeName, parameterRoot, ioOrRecursion);
}
}
}
}
}
}
private void buileParameterFromTypes(String paraNamespace, String paraType, ParameterInfo parameter, int ioOrRecursion) {
if (ioOrRecursion < 3) {
parametersName.clear();
parametersName.add(parameter.name);
} else if (ioOrRecursion == 3) {
parametersName.add(parameter.name);
}
//twebserviceinput need auto metadata fetch for input parameters, but it only support very easy, not support custom defined type usage like this:
//<element type="tns="s:anyCustomDefinedSimpleOrComplexType"">
//so nothing to do here, TODO make sure it
}
private void buildParameterFromCollection(XmlSchemaGroupParticle xmlSchemaGroupParticle, ParameterInfo parameter,
int ioOrRecursion) {
if (!(xmlSchemaGroupParticle instanceof XmlSchemaSequence)) {
throw new RuntimeException("don't support that complex parameter type, only support xsd:sequence");
}
XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) xmlSchemaGroupParticle;
List<XmlSchemaSequenceMember> sequences = xmlSchemaSequence.getItems();
for (XmlSchemaSequenceMember sequence : sequences) {
if (sequence instanceof XmlSchemaAny) {//TODO remove it as not support too
ParameterInfo parameterSon = new ParameterInfo();
parameterSon.name = "_content_";
parameter.childParameters.add(parameterSon);
} else if (sequence instanceof XmlSchemaElement) {//this is the major part we support
XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) sequence;
String elementName = xmlSchemaElement.getName();
ParameterInfo parameterSon = new ParameterInfo();
parameterSon.name= elementName;
parameter.childParameters.add(parameterSon);
Boolean isHave = false;
if (!parametersName.isEmpty() && parameterSon.name != null) {
for (int p = 0; p < parametersName.size(); p++) {
if (parameterSon.name.equals(parametersName.get(p))) {
isHave = true;
}
}
}
if (xmlSchemaElement.getSchemaTypeName() != null) {
String elementTypeName = xmlSchemaElement.getSchemaTypeName().getLocalPart();
String elementTypeNamespace = xmlSchemaElement.getSchemaTypeName().getNamespaceURI();
if (elementTypeName != null && elementTypeName.equals("anyType")) {//TODO remove it
parameterSon.name = xmlSchemaElement.getName() + ":anyType";
}
if (!isHave && !WsdlTypeUtil.isJavaBasicType(elementTypeName)) {
buileParameterFromTypes(elementTypeNamespace, elementTypeName, parameterSon, ioOrRecursion);
}
} else if (xmlSchemaElement.getSchemaType() != null) {
if (xmlSchemaElement.getSchemaType() instanceof XmlSchemaComplexType) {
throw new RuntimeException("don't support nested or ref complex type in xsd:sequence");
} else if (xmlSchemaElement.getSchemaType() instanceof XmlSchemaSimpleType) {
XmlSchemaSimpleType xmlSchemaSimpleType = (XmlSchemaSimpleType) xmlSchemaElement.getSchemaType();
String typeName = xmlSchemaSimpleType.getName();
if (typeName != null && typeName.equals("anyType")) {
ParameterInfo pSon = new ParameterInfo();
pSon.name = "anyType";
parameter.childParameters.add(pSon);
}
}
} else if (xmlSchemaElement.getRef() != null) {//TODO twebserviceinput support it before?
String elementTypeName = xmlSchemaElement.getRef().getTargetQName().getLocalPart();
if (!isHave && !WsdlTypeUtil.isJavaBasicType(elementTypeName)) {
buildParameterFromElements(elementTypeName, parameterSon, ioOrRecursion);
}
}
} else if (sequence instanceof XmlSchemaAttribute) {
XmlSchemaAttribute xmlSchemaAttribute = (XmlSchemaAttribute) sequence;
String elementName = xmlSchemaAttribute.getName();
ParameterInfo parameterSon = new ParameterInfo();
parameterSon.name = elementName;
parameter.childParameters.add(parameterSon);
Boolean isHave = false;
if (!parametersName.isEmpty() && parameterSon.name != null) {
for (int p = 0; p < parametersName.size(); p++) {
if (parameterSon.name.equals(parametersName.get(p))) {
isHave = true;
}
}
}
if (xmlSchemaAttribute.getSchemaTypeName() != null) {
String elementTypeName = xmlSchemaAttribute.getSchemaTypeName().getLocalPart();
String elementTypeNamespace = xmlSchemaAttribute.getSchemaTypeName().getNamespaceURI();
if (!isHave && !WsdlTypeUtil.isJavaBasicType(elementTypeName)) {
buileParameterFromTypes(elementTypeNamespace, elementTypeName, parameterSon, ioOrRecursion);
}
} else if (xmlSchemaAttribute.getRef() != null) {//TODO twebserviceinput support it before?
String refName = xmlSchemaAttribute.getRef().getTargetQName().getLocalPart();
if (!isHave) {
buildParameterFromElements(refName, parameterSon, ioOrRecursion);
}
}
} else {
throw new RuntimeException("don't support the nest type in xsd:sequence");
}
}
}
}

View File

@@ -0,0 +1,39 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.webservice.helper;
public class WsdlTypeUtil {
public static Boolean isJavaBasicType(String typeName) {
Boolean isJavaBasicType = false;
if (typeName == null) {
return false;
}
if ("String".equalsIgnoreCase(typeName)) {
isJavaBasicType = true;
} else if ("int".equalsIgnoreCase(typeName)) {
isJavaBasicType = true;
} else if ("long".equalsIgnoreCase(typeName)) {
isJavaBasicType = true;
} else if ("double".equalsIgnoreCase(typeName)) {
isJavaBasicType = true;
} else if ("float".equalsIgnoreCase(typeName)) {
isJavaBasicType = true;
} else if ("char".equalsIgnoreCase(typeName)) {
isJavaBasicType = true;
}
return isJavaBasicType;
}
}

View File

@@ -15,12 +15,17 @@ import java.util.logging.Logger;
import javax.wsdl.xml.WSDLLocator;
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.xml.sax.InputSource;
/**
@@ -49,10 +54,10 @@ public class WSDLLocatorImpl implements WSDLLocator {
}
public InputSource getBaseInputSource() {
GetMethod get = createGetMethod(wsdlUri);
HttpRequestBase get = createGetMethod(wsdlUri);
try {
httpClient.executeMethod(get);
InputStream is = get.getResponseBodyAsStream();
HttpResponse response = httpClient.execute(get);
InputStream is = response.getEntity().getContent();
inputStreams.add(is);
return new InputSource(is);
} catch (IOException ex) {
@@ -64,9 +69,9 @@ public class WSDLLocatorImpl implements WSDLLocator {
try {
URL url = getURL(parentLocation, importLocation);
latestImportUri = url.toExternalForm();
GetMethod get = createGetMethod(latestImportUri);
httpClient.executeMethod(get);
InputStream is = get.getResponseBodyAsStream();
HttpRequestBase get = createGetMethod(latestImportUri);
HttpResponse response = httpClient.execute(get);
InputStream is = response.getEntity().getContent();
inputStreams.add(is);
return new InputSource(is);
} catch (MalformedURLException ex) {
@@ -110,36 +115,44 @@ public class WSDLLocatorImpl implements WSDLLocator {
inputStreams.clear();
}
private GetMethod createGetMethod(String uri) {
GetMethod get = new GetMethod(uri);
private HttpRequestBase createGetMethod(String uri) {
HttpGet get = new HttpGet(uri);
if (configuration.getCookie() != null) {
get.setRequestHeader(HTTP_HEADER_COOKIE, configuration.getCookie());
get.setHeader(HTTP_HEADER_COOKIE, configuration.getCookie());
}
return get;
}
private HttpClient createHttpClient() {
HttpClient httpClient = new HttpClient();
HttpClientBuilder builder = HttpClients.custom();
CredentialsProvider credentialsProvider = null;
if (configuration.getProxyServer() != null) {
HostConfiguration hostConfiguration = new HostConfiguration();
hostConfiguration.setProxy(configuration.getProxyServer(), configuration.getProxyPort());
httpClient.setHostConfiguration(hostConfiguration);
builder.setProxy(new HttpHost(configuration.getProxyServer(), configuration.getProxyPort()));
}
if (configuration.getUsername() != null) {
Credentials credentials = new UsernamePasswordCredentials(configuration.getUsername(), configuration.getPassword());
httpClient.getState().setCredentials(AuthScope.ANY, credentials);
if (credentialsProvider == null) {
credentialsProvider = new BasicCredentialsProvider();
}
credentialsProvider
.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(configuration.getUsername(), configuration.getPassword()));
}
if (configuration.getProxyUsername() != null) {
Credentials credentials = new UsernamePasswordCredentials(configuration.getProxyUsername(),
configuration.getProxyPassword());
httpClient.getState().setProxyCredentials(AuthScope.ANY, credentials);
httpClient.getHostConfiguration().setProxy(configuration.getProxyServer(), configuration.getProxyPort());
if (credentialsProvider == null) {
credentialsProvider = new BasicCredentialsProvider();
}
credentialsProvider
.setCredentials(new AuthScope(configuration.getProxyServer(), configuration.getProxyPort()),
new UsernamePasswordCredentials(configuration.getProxyUsername(),
configuration.getProxyPassword()));
builder.setProxy(new HttpHost(configuration.getProxyServer(), configuration.getProxyPort()));
}
return httpClient;
if (credentialsProvider != null) {
builder.setDefaultCredentialsProvider(credentialsProvider);
}
return builder.build();
}
}

View File

@@ -4,15 +4,13 @@
*/
package org.talend.webservice.helper.map;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.xml.namespace.QName;
import org.talend.webservice.helper.PathUtil;
import org.talend.webservice.mapper.AnyTypeMapper;
import sun.awt.image.ImageWatched;
/**
*
@@ -24,35 +22,44 @@ public class MapConverter {
public static final String LEFT_SQUARE_BRACKET = "[";
public static final String RIGHT_SQUARE_BRACKET = "]";
private static Map<String, Object> newMap(boolean keepOrder) {
if(keepOrder) return new LinkedHashMap<>();
return new HashMap<>();
}
public static Map<String, Object> deepMapToMap(Map<String, Object> map) {
return deepMapToMap(map, null, SEPARATOR);
return deepMapToMap(map, null, SEPARATOR, false);
}
public static Map<String, Object> deepMapToMap(Map<String, Object> map, boolean keepOrder) {
return deepMapToMap(map, null, SEPARATOR, keepOrder);
}
public static Map<String, Object> mapToDeepMap(Map<String, Object> map) {
return mapToDeepMap(map, SEPARATOR);
}
private static Map<String, Object> deepMapToMap(Object value, String k, String sep) {
private static Map<String, Object> deepMapToMap(Object value, String k, String sep, boolean keepOrder) {
if (value instanceof Map) {
Map<String, Object> map = (Map<String, Object>) value;
Map<String, Object> out = new HashMap<String, Object>();
Map<String, Object> out = newMap(keepOrder);
for (Map.Entry<String, Object> entry : map.entrySet()) {
if (k == null) {
out.putAll(deepMapToMap(entry.getValue(), entry.getKey(), sep));
out.putAll(deepMapToMap(entry.getValue(), entry.getKey(), sep, keepOrder));
} else {
out.putAll(deepMapToMap(entry.getValue(), k + sep + entry.
getKey(), sep));
getKey(), sep, keepOrder));
}
}
return out;
} else if (value instanceof List) {
List<Object> list = (List<Object>) value;
Map<String, Object> out = new HashMap<String, Object>();
Map<String, Object> out = newMap(keepOrder);
int i = 0;
for (Object val : list) {
StringBuffer sb = new StringBuffer();
sb.append(k).append(LEFT_SQUARE_BRACKET).append(i).append(RIGHT_SQUARE_BRACKET);
out.putAll(deepMapToMap(val, sb.toString(), sep));
out.putAll(deepMapToMap(val, sb.toString(), sep, keepOrder));
i++;
}
out.put(k + ".size", list.size());

View File

@@ -42,14 +42,18 @@ import javax.xml.transform.Result;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamResult;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.common.jaxb.JAXBBeanInfo;
import org.apache.cxf.common.jaxb.JAXBContextProxy;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.spi.ClassGeneratorClassLoader;
import org.apache.cxf.common.util.ASMHelper;
import org.apache.cxf.common.util.ASMHelper.ClassWriter;
import org.apache.cxf.common.util.ASMHelper.FieldVisitor;
import org.apache.cxf.common.util.ASMHelper.Label;
import org.apache.cxf.common.util.ASMHelper.MethodVisitor;
import org.apache.cxf.common.util.ASMHelperImpl;
import org.apache.cxf.common.util.CachedClass;
import org.apache.cxf.common.util.PackageUtils;
import org.apache.cxf.common.util.ReflectionInvokationHandler;
@@ -578,7 +582,7 @@ public final class JAXBUtils {
public static void setNamespaceWrapper(final Map<String, String> nspref, Marshaller marshaller) throws PropertyException {
Object mapper = null;
if (marshaller.getClass().getName().contains(".internal.")) {
mapper = createNamespaceWrapper(nspref);
mapper = createNamespaceWrapper(null, nspref);
if (mapper == null) {
LOG.log(Level.INFO, "Could not create namespace mapper for JDK internal" + " JAXB implementation.");
} else {
@@ -595,6 +599,31 @@ public final class JAXBUtils {
}
}
/*
* To avoid possible runtime collision.
*/
public static Object setNamespaceMapper(Bus bus, final Map<String, String> nspref,
Marshaller marshaller) throws PropertyException {
Object mapper = null;
if (marshaller.getClass().getName().contains(".internal.")) {
mapper = createNamespaceWrapper(bus, nspref);
if (mapper == null) {
LOG.log(Level.INFO, "Could not create namespace mapper for JDK internal" + " JAXB implementation.");
} else {
marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", mapper);
}
} else {
try {
Class<?> cls = Class.forName("org.apache.cxf.common.jaxb.NamespaceMapper");
mapper = cls.getConstructor(Map.class).newInstance(nspref);
} catch (Exception ex) {
LOG.log(Level.INFO, "Could not create NamespaceMapper", ex);
}
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", mapper);
}
return mapper;
}
public static BridgeWrapper createBridge(Set<Class<?>> ctxClasses, QName qname, Class<?> refcls, Annotation anns[])
throws JAXBException {
try {
@@ -1018,16 +1047,17 @@ public final class JAXBUtils {
return false;
}
private static synchronized Object createNamespaceWrapper(Map<String, String> map) {
ASMHelper helper = new ASMHelper();
private static synchronized Object createNamespaceWrapper(Bus bus, Map<String, String> map) {
ASMHelper helper = new ASMHelperImpl();
String className = "org.apache.cxf.jaxb.NamespaceMapperInternal";
Class<?> cls = helper.findClass(className, JAXBUtils.class);
NamespaceMapperClassGenerator nmcg = new NamespaceMapperClassGenerator(bus);
Class<?> cls = nmcg.findClass(className, JAXBUtils.class);
if (cls == null) {
ClassWriter cw = helper.createClassWriter();
if (cw == null) {
return null;
}
cls = createNamespaceWrapperInternal(helper, cw);
cls = createNamespaceWrapperInternal(helper, cw, nmcg);
}
try {
return cls.getConstructor(Map.class).newInstance(map);
@@ -1036,7 +1066,7 @@ public final class JAXBUtils {
}
}
private static Class<?> createNamespaceWrapperInternal(ASMHelper helper, ClassWriter cw) {
private static Class<?> createNamespaceWrapperInternal(ASMHelper helper, ClassWriter cw, NamespaceMapperClassGenerator nmcg) {
String className = "org.apache.cxf.jaxb.NamespaceMapperInternal";
FieldVisitor fv;
MethodVisitor mv;
@@ -1127,7 +1157,7 @@ public final class JAXBUtils {
}
}
return helper.loadClass(className, cls, bts);
return nmcg.loadClass(className, cls, bts);
}
public static JAXBBeanInfo getBeanInfo(JAXBContextProxy context, Class<?> cls) {
@@ -1138,4 +1168,20 @@ public final class JAXBUtils {
return ReflectionInvokationHandler.createProxyWrapper(o, JAXBBeanInfo.class);
}
private static class NamespaceMapperClassGenerator extends ClassGeneratorClassLoader {
private NamespaceMapperClassGenerator(Bus bus) {
super(bus == null ? BusFactory.getDefaultBus() : bus);
}
@Override
protected Class<?> findClass(String className, Class<?> cls) {
return super.findClass(className, cls);
}
@Override
protected Class<?> loadClass(String className, Class<?> cls, byte[] bytes) {
return super.loadClass(className, cls, bytes);
}
}
}

View File

@@ -3,13 +3,12 @@
*/
package org.talend.webservice.mapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.talend.webservice.exception.LocalizedException;
import javax.xml.namespace.QName;
import org.talend.webservice.exception.LocalizedException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
*
@@ -151,7 +150,7 @@ public class ComplexTypeMapper implements TypeMapper {
if (!clazz.getName().equals(beanName)) {
ComplexTypeMapper instanceComplexTypeMapper = findInstanceByClassName(beanName);
if (instanceComplexTypeMapper != null) {
Map<String, Object> values = new HashMap<String, Object>();
Map<String, Object> values = new LinkedHashMap<String, Object>();
values.put(ABSTRACT_TYPE_NAME, instanceComplexTypeMapper.typeName);
values.put(instanceComplexTypeMapper.typeName.getLocalPart(), instanceComplexTypeMapper.typeToValue(bean));
return values;
@@ -167,7 +166,7 @@ public class ComplexTypeMapper implements TypeMapper {
return null;
}
} else {
Map<String, Object> values = new HashMap<String, Object>(mappers.size());
Map<String, Object> values = new LinkedHashMap<String, Object>(mappers.size());
for (Map.Entry<String, PropertyMapper> entry : mappers.entrySet()) {
Object value = entry.getValue().getValueFrom(bean);
if (value != null) {
@@ -198,7 +197,7 @@ public class ComplexTypeMapper implements TypeMapper {
if (params == null) {
return null;
}
Map<String, Object> values = new HashMap<String, Object>(mappers.size());
Map<String, Object> values = new LinkedHashMap<String, Object>(mappers.size());
int i = 0;
for (Object param : params) {

View File

@@ -4,6 +4,7 @@
package org.talend.webservice.mapper;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -336,7 +337,8 @@ public class MapperFactory {
Class<?> clazz = classMapper.getClassForType(xmlSchemaComplexType.getQName(), orderedMap.keyList(), 1);
// 3.create propertyMapper (propertyName,class,schemaTypeMap,typeMapperQname)
Map<String, PropertyMapper> mappers = new HashMap<String, PropertyMapper>();
//need to use the order map as the order is important for response auto parser by index
Map<String, PropertyMapper> mappers = new LinkedHashMap<>();
for (String key : properties.keySet()) {
Object xmlSchemaObject = properties.get(key);
if (xmlSchemaObject == null) {

View File

@@ -5,6 +5,7 @@
package org.talend.webservice.mapper;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.wsdl.Message;
@@ -152,7 +153,7 @@ public class MessageMapperImpl implements MessageMapper {
return wrappedValue;
} else {
List<Part> orderedParts = message.getOrderedParts(null);
Map<String, Object> values = new HashMap<String, Object>(params.length);
Map<String, Object> values = new LinkedHashMap<String, Object>(params.length);
int i = 0;
for (Object param : params) {
Part part = orderedParts.get(i);

View File

@@ -1,7 +0,0 @@
org.talend.ws.exception.IllegalPropertyAccessException=\u0391\u03B4\u03C5\u03BD\u03B1\u03BC\u03AF\u03B1 \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7\u03C2 \u03C3\u03C4\u03B7\u03BD \u03B9\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B1 {0} \u03C0\u03BF\u03C5 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03C1\u03BF\u03C3\u03B2\u03AC\u03C3\u03B9\u03BC\u03B7 \u03B3\u03B9\u03B1 \u03C4\u03CD\u03C0\u03BF {1}
org.talend.ws.exception.NoSuchPropertyException=\u0397 \u03B9\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B1 {0} \u03B4\u03B5\u03BD \u03C5\u03C0\u03AC\u03C1\u03C7\u03B5\u03B9 \u03B3\u03B9\u03B1 \u03C4\u03BF\u03BD \u03C4\u03CD\u03C0\u03BF {1}
org.talend.ws.exception.Instantiation=\u0391\u03B4\u03C5\u03BD\u03B1\u03BC\u03AF\u03B1 \u03BD\u03B1 \u03B4\u03BF\u03B8\u03B5\u03AF \u03C5\u03C0\u03CC\u03C3\u03C4\u03B1\u03C3\u03B7 \u03C3\u03B5 \u03BA\u03BB\u03AC\u03C3\u03B7 \u03C4\u03CD\u03C0\u03BF\u03C5 {0}
org.talend.ws.exception.illegalAccessValueOf=\u0391\u03B4\u03C5\u03BD\u03B1\u03BC\u03AF\u03B1 \u03BA\u03BB\u03AE\u03C3\u03B7\u03C2 \u03BC\u03B5\u03B8\u03CC\u03B4\u03BF\u03C5 valueOf \u03B3\u03B9\u03B1 \u03C4\u03CD\u03C0\u03BF enum {0}
org.talend.ws.exception.Unknown=\u039C\u03B9\u03B1 \u03AC\u03B3\u03BD\u03C9\u03C3\u03C4\u03B7 \u03B5\u03BE\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7 \u03C0\u03C1\u03BF\u03AD\u03BA\u03C5\u03C8\u03B5
org.talend.ws.exception.InvalidEnumValueException=\u0397 \u03C4\u03B9\u03BC\u03AE {0} \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B3\u03B9\u03B1 enum {1}
org.talend.ws.exception.InvalidParameterAnyType=\u03A0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03C1\u03BF\u03C3\u03B4\u03B9\u03BF\u03C1\u03AF\u03C3\u03B5\u03C4\u03B5 \u03AD\u03BD\u03B1\u03BD \u03C7\u03AC\u03C1\u03C4\u03B7 \u03C3\u03B1\u03BD \u03B1\u03C5\u03C4\u03CC\u03BD \u03B3\u03B9\u03B1 anyTypes : {anyType: value, anyType_type: qname}

View File

@@ -1,8 +0,0 @@
org.talend.ws.exception.IllegalPropertyAccessException=Unable to access property {0} which is not accessible for type {1}
org.talend.ws.exception.NoSuchPropertyException=Property {0} does not exist for type {1}
org.talend.ws.exception.Instantiation=Unable to instantiate class of type {0}
org.talend.ws.exception.InvocationTargetPropertyAccessor=A property accessor has thrown an exception : property {0} of class {1}
org.talend.ws.exception.illegalAccessValueOf=Unable to call method valueOf for enum type {0}
org.talend.ws.exception.Unknown=An unknown exception has been thrown
org.talend.ws.exception.InvalidEnumValueException=Value {0} is not valid for enum {1}
org.talend.ws.exception.InvalidParameterAnyType=You must specify a map like this for anyTypes : {anyType: value, anyType_type: qname} pour les anyType

View File

@@ -1,6 +1,8 @@
org.talend.ws.exception.IllegalPropertyAccessException=Impossible d'acc\u00e9der \u00e0 la propri\u00e9t\u00e9 {0} qui est inaccessible pour le type {1}
org.talend.ws.exception.NoSuchPropertyException=La propri\u00e9t\u00e9 {0} n'existe pas pour le type {1}
org.talend.ws.exception.Instantiation=Impossible d'instancier la classe de type {0}
org.talend.ws.exception.illegalAccessValueOf=Impossible d'appeler une m\u00e9thode valueOf pour le type enum {0}
org.talend.ws.exception.Unknown=Une exception inconnue a \u00e9t\u00e9 rencontr\u00e9e
org.talend.ws.exception.IllegalPropertyAccessException=Impossible d'acc\u00E9der \u00E0 la propri\u00E9t\u00E9 {0} qui est inaccessible pour le type {1}
org.talend.ws.exception.NoSuchPropertyException=La propri\u00E9t\u00E9 {0} n'existe pas pour le type {1}
org.talend.ws.exception.Instantiation=Impossible d'instancier le type de classe {0}
org.talend.ws.exception.InvocationTargetPropertyAccessor=Un accesseur de propri\u00E9t\u00E9 a retourner une exception : propri\u00E9t\u00E9 {0} de classe {1}
org.talend.ws.exception.illegalAccessValueOf=Impossible d'appeler une m\u00E9thode valueOf pour le type enum {0}
org.talend.ws.exception.Unknown=Une exception inconnue a \u00E9t\u00E9 d\u00E9clench\u00E9e
org.talend.ws.exception.InvalidEnumValueException=La valeur {0} n'est pas valide pour enum {1}
org.talend.ws.exception.InvalidParameterAnyType=Vous devez sp\u00E9cifier une Map comme celle-ci pour anyTypes : {anyType: value, anyType_type: qname} pour les anyType

View File

@@ -1,8 +1,8 @@
org.talend.ws.exception.IllegalPropertyAccessException=\u30BF\u30A4\u30D7{1}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
org.talend.ws.exception.IllegalPropertyAccessException={0} \u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u308C\u306F {1} \u578B\u306E\u305F\u3081\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3002
org.talend.ws.exception.NoSuchPropertyException=\u30BF\u30A4\u30D7{1}\u306E\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306F\u5B58\u5728\u3057\u307E\u305B\u3093
org.talend.ws.exception.Instantiation=\u30BF\u30A4\u30D7{0}\u306E\u30AF\u30E9\u30B9\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
org.talend.ws.exception.InvocationTargetPropertyAccessor=\u30D7\u30ED\u30D1\u30C6\u30A3\u30A2\u30AF\u30BB\u30C3\u30B5\u306F\u4F8B\u5916\u3092\u767A\u751F\u3055\u305B\u307E\u3057\u305F: \u30AF\u30E9\u30B9{1}\u306E\u30D7\u30ED\u30D1\u30C6\u30A3{0}
org.talend.ws.exception.illegalAccessValueOf=enum\u578B{0}\u306E\u30E1\u30BD\u30C3\u30C9valueOf\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093
org.talend.ws.exception.Unknown=\u4E0D\u660E\u306A\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F
org.talend.ws.exception.InvalidEnumValueException=\u5024{0}\u306F\u5217\u6319\u578B{1}\u3068\u3057\u3066\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
org.talend.ws.exception.InvalidParameterAnyType=\u3053\u306E\u3088\u3046\u306AanyTypes\u306E\u30DE\u30C3\u30D7\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {anyType: value, anyType_type: qname}
org.talend.ws.exception.Instantiation={0} \u578B\u306E\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002
org.talend.ws.exception.InvocationTargetPropertyAccessor=\u30D7\u30ED\u30D1\u30C6\u30A3\u30A2\u30AF\u30BB\u30B9\u306B\u3088\u308A\u3001\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F\uFF1A\u30AF\u30E9\u30B9 {1} \u306E\u30D7\u30ED\u30D1\u30C6\u30A3 {0}
org.talend.ws.exception.illegalAccessValueOf=\u5217\u6319\u578B {0} \u306EvalueOf\u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
org.talend.ws.exception.Unknown=\u4E0D\u660E\u306A\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F
org.talend.ws.exception.InvalidEnumValueException=\u5024 {0} \u306Fenum\u578B {1} \u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
org.talend.ws.exception.InvalidParameterAnyType=\u30DE\u30C3\u30D7\u306F\u3069\u306E\u30BF\u30A4\u30D7\u306B\u3064\u3044\u3066\u3082\u4EE5\u4E0B\u306E\u3088\u3046\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {anyType: value, anyType_type: qname}

View File

@@ -3,6 +3,6 @@ org.talend.ws.exception.NoSuchPropertyException=\u5C5E\u6027 {0} \u5BF9\u4E8E\u7
org.talend.ws.exception.Instantiation=\u65E0\u6CD5\u5B9E\u4F8B\u5316\u7C7B\u578B {0} \u7684\u7C7B
org.talend.ws.exception.InvocationTargetPropertyAccessor=\u5C5E\u6027\u8BBF\u95EE\u5668\u629B\u51FA\u4E86\u4E00\u4E2A\u5F02\u5E38\uFF1A\u7C7B {1} \u7684\u5C5E\u6027 {0}
org.talend.ws.exception.illegalAccessValueOf=\u65E0\u6CD5\u4E3A\u679A\u4E3E\u7C7B\u578B {0} \u8C03\u7528\u65B9\u6CD5 valueOf
org.talend.ws.exception.Unknown=\u629B\u51FA\u4E86\u4E00\u4E2A\u672A\u77E5\u7684\u5F02\u5E38
org.talend.ws.exception.Unknown=\u53D1\u751F\u4E00\u4E2A\u672A\u77E5\u5F02\u5E38
org.talend.ws.exception.InvalidEnumValueException=\u503C {0} \u5BF9\u4E8E\u679A\u4E3E {1} \u65E0\u6548
org.talend.ws.exception.InvalidParameterAnyType=\u60A8\u5FC5\u987B\u6309\u5982\u4E0B\u6240\u793A\u4E3A anyType \u6307\u5B9A\u6620\u5C04\uFF1A{anyType: value, anyType_type: qname}

View File

@@ -63,9 +63,9 @@
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>

View File

@@ -5,7 +5,7 @@
<groupId>org.talend</groupId>
<artifactId>talendMQConnectionUtil</artifactId>
<version>1.0.1-20190215</version>
<version>1.1.0-20220307</version>
<packaging>jar</packaging>
<name>talendMQConnectionUtil</name>
@@ -55,13 +55,8 @@
</dependency>
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq</artifactId>
<version>8.0.0.9</version>
</dependency>
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mqjms</artifactId>
<version>8.0.0.9</version>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>9.2.4.0</version>
</dependency>
<dependency>
<groupId>javax.resource</groupId>
@@ -71,7 +66,7 @@
<dependency>
<groupId>org.talend</groupId>
<artifactId>talendMQRFH2</artifactId>
<version>1.0.1-20190206</version>
<version>1.1.0-20220307</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>

View File

@@ -53,9 +53,9 @@
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
</dependencies>
<build>

View File

@@ -2,7 +2,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.libraries</groupId>
<groupId>org.talend.components</groupId>
<artifactId>talendssl</artifactId>
<version>1.0-20190118</version>
<packaging>jar</packaging>

View File

@@ -4,7 +4,16 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.components</groupId>
<artifactId>talendzip</artifactId>
<version>1.2-20210901</version>
<version>1.3</version>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.talendforge.org/modules/licenses/APACHE_v2.txt</url>
<distribution>may be downloaded from the Maven repository</distribution>
</license>
</licenses>
<build>
<plugins>
<plugin>
@@ -52,7 +61,7 @@
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.3</version>
<version>2.10.0</version>
</dependency>
<dependency>
@@ -61,10 +70,5 @@
<version>1.21</version>
</dependency>
<dependency>
<groupId>org.talend.components</groupId>
<artifactId>checkArchive</artifactId>
<version>1.2-20210901</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,184 +1,183 @@
package org.talend.archive;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
// import javax.crypto.Cipher;
public class IntegrityUtil {
/**
* Is used to check if the zip file is corrupted/destroyed
*
* @param file
* @return
*/
public static boolean isZipValid(final File file) {
ZipFile zipFile = null;
try {
zipFile = new ZipFile(file);
return true;
} catch (IOException e) {
return false;
} finally {
try {
if (zipFile != null) {
zipFile.close();
zipFile = null;
}
} catch (IOException e) {
}
}
}
public static void validate(final File file) {
ZipFile zipFile = null;
try {
zipFile = new ZipFile(file);
} catch (IOException e) {
} finally {
try {
if (zipFile != null) {
zipFile.close();
zipFile = null;
}
} catch (IOException e) {
}
}
}
/**
* To check if the encrpted zip file is corrupted or not
*
* @param file
* @param password
* @return
*/
public static boolean isEncryptedZipValid(final File file, String password) {
ZipArchiveInputStream input = null;
InputStream target = null;
try {
target = new FileInputStream(file);
target = new CipherInputStream(target, createCipher(Cipher.DECRYPT_MODE, password));
input = new ZipArchiveInputStream(target);
ArchiveEntry entry = input.getNextEntry();
return true;
} catch (IOException e) {
return false;
} catch (Exception e) {
return false;
} finally {
try {
if (input != null) {
input.close();
input = null;
}
if (target != null) {
target.close();
target = null;
}
} catch (IOException e) {
}
}
}
/**
* Used to check tar.gz/.tgz/.gz file is corrupted/destroyed
*
* @param fileName
* @return
*/
public static boolean isGZIPValid(final String fileName) {
GZIPInputStream inputStream = null;
InputStream is = null;
try {
is = new FileInputStream(new File(fileName));
inputStream = new GZIPInputStream(is);
return true;
} catch (IOException e) {
return false;
}finally {
try {
if (inputStream != null) {
inputStream.close();
inputStream = null;
} else if(is != null) {
is.close();
is = null;
}
} catch (IOException e) {
}
}
}
/**
* Used to check tar.tar file is corrupted/destroyed
*
* @param fileName
* @return
*/
public static boolean isTarValid(final String fileName) {
TarArchiveInputStream inputStream = null;
InputStream is = null;
try {
is = new FileInputStream(new File(fileName));
inputStream = new TarArchiveInputStream(is);
return inputStream.canReadEntryData(inputStream.getNextEntry());
} catch (IOException e) {
return false;
}finally {
try {
if (inputStream != null) {
inputStream.close();
inputStream = null;
} else if(is != null) {
is.close();
is = null;
}
} catch (IOException e) {
}
}
}
/**
*
* @param mode
* @param password
* @return
* @throws Exception
*/
public static Cipher createCipher(int mode, String password) throws Exception {
String alg = "PBEWithSHA1AndDESede"; // BouncyCastle has better algorithms
PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray());
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(alg);
SecretKey secretKey = keyFactory.generateSecret(keySpec);
Cipher cipher = Cipher.getInstance("PBEWithSHA1AndDESede");
cipher.init(mode, secretKey, new PBEParameterSpec("saltsalt".getBytes(), 2000));
return cipher;
}
}
package com.talend.compress.zip;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;
// import javax.crypto.Cipher;
public class IntegrityUtil {
/**
* Is used to check if the zip file is corrupted/destroyed
*
* @param file
* @return
*/
public static boolean isZipValid(final File file) {
ZipFile zipFile = null;
try {
zipFile = new ZipFile(file);
return true;
} catch (IOException e) {
return false;
} finally {
try {
if (zipFile != null) {
zipFile.close();
zipFile = null;
}
} catch (IOException e) {
}
}
}
public static void validate(final File file) {
ZipFile zipFile = null;
try {
zipFile = new ZipFile(file);
} catch (IOException e) {
} finally {
try {
if (zipFile != null) {
zipFile.close();
zipFile = null;
}
} catch (IOException e) {
}
}
}
/**
* To check if the encrpted zip file is corrupted or not
*
* @param file
* @param password
* @return
*/
public static boolean isEncryptedZipValid(final File file, String password) {
ZipArchiveInputStream input = null;
InputStream target = null;
try {
target = new FileInputStream(file);
target = new CipherInputStream(target, createCipher(Cipher.DECRYPT_MODE, password));
input = new ZipArchiveInputStream(target);
ArchiveEntry entry = input.getNextEntry();
return true;
} catch (IOException e) {
return false;
} catch (Exception e) {
return false;
} finally {
try {
if (input != null) {
input.close();
input = null;
}
if (target != null) {
target.close();
target = null;
}
} catch (IOException e) {
}
}
}
/**
* Used to check tar.gz/.tgz/.gz file is corrupted/destroyed
*
* @param fileName
* @return
*/
public static boolean isGZIPValid(final String fileName) {
GZIPInputStream inputStream = null;
InputStream is = null;
try {
is = new FileInputStream(new File(fileName));
inputStream = new GZIPInputStream(is);
return true;
} catch (IOException e) {
return false;
}finally {
try {
if (inputStream != null) {
inputStream.close();
inputStream = null;
} else if(is != null) {
is.close();
is = null;
}
} catch (IOException e) {
}
}
}
/**
* Used to check tar.tar file is corrupted/destroyed
*
* @param fileName
* @return
*/
public static boolean isTarValid(final String fileName) {
TarArchiveInputStream inputStream = null;
InputStream is = null;
try {
is = new FileInputStream(new File(fileName));
inputStream = new TarArchiveInputStream(is);
return inputStream.canReadEntryData(inputStream.getNextEntry());
} catch (IOException e) {
return false;
}finally {
try {
if (inputStream != null) {
inputStream.close();
inputStream = null;
} else if(is != null) {
is.close();
is = null;
}
} catch (IOException e) {
}
}
}
/**
*
* @param mode
* @param password
* @return
* @throws Exception
*/
public static Cipher createCipher(int mode, String password) throws Exception {
String alg = "PBEWithSHA1AndDESede"; // BouncyCastle has better algorithms
PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray());
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(alg);
SecretKey secretKey = keyFactory.generateSecret(keySpec);
Cipher cipher = Cipher.getInstance("PBEWithSHA1AndDESede");
cipher.init(mode, secretKey, new PBEParameterSpec("saltsalt".getBytes(), 2000));
return cipher;
}
}

View File

@@ -1,10 +1,11 @@
package com.talend.compress.zip;
import java.io.File;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Optional;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.model.FileHeader;
public class Unzip {
@@ -96,9 +97,10 @@ public class Unzip {
"Please enter the password and try again..");
}
ZipFile zipFile = new ZipFile(sourceZip);
ZipFile zipFile = new ZipFile(sourceZip,password.toCharArray());
if(encording != null){
zipFile.setFileNameCharset(encording);
zipFile.setCharset(Charset.forName(encording));
}
if (checkArchive) {
@@ -108,10 +110,6 @@ public class Unzip {
}
}
if (zipFile.isEncrypted()) {
zipFile.setPassword(password);
}
List fileHeaderList = zipFile.getFileHeaders();
if (fileHeaderList == null) {
@@ -130,7 +128,7 @@ public class Unzip {
filename = filename.substring(filename.lastIndexOf('/') + 1);
}
zipFile.extractFile(fileHeader, targetDir, null, filename);
zipFile.extractFile(fileHeader, targetDir, filename);
util.addUnzippedFiles(targetDir, filename);
}
}
@@ -147,7 +145,7 @@ public class Unzip {
}
if (checkArchive) {
if (!org.talend.archive.IntegrityUtil.isEncryptedZipValid(file,
if (!IntegrityUtil.isEncryptedZipValid(file,
password)) {
throw new RuntimeException("The file " + sourceZip
+ " is corrupted, process terminated...");
@@ -158,7 +156,7 @@ public class Unzip {
try {
is = new java.io.FileInputStream(sourceZip);
is = new javax.crypto.CipherInputStream(is,
org.talend.archive.IntegrityUtil.createCipher(
IntegrityUtil.createCipher(
javax.crypto.Cipher.DECRYPT_MODE, password));
org.apache.commons.compress.archivers.zip.ZipArchiveInputStream input = new org.apache.commons.compress.archivers.zip.ZipArchiveInputStream(
new java.io.BufferedInputStream(is),Optional.ofNullable(encording).orElse("UTF8"));
@@ -184,7 +182,7 @@ public class Unzip {
// apache common compress impl
public void doUnzipWithoutDecryption() throws Exception {
if (checkArchive
&& !org.talend.archive.IntegrityUtil
&& !IntegrityUtil
.isZipValid(new java.io.File(sourceZip))) {
Thread.sleep(1000); // To make the process terminated after the
// System.out.println

View File

@@ -5,16 +5,20 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.GZIPOutputStream;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.util.Zip4jConstants;
import net.lingala.zip4j.model.enums.AesKeyStrength;
import net.lingala.zip4j.model.enums.CompressionLevel;
import net.lingala.zip4j.model.enums.CompressionMethod;
import net.lingala.zip4j.model.enums.EncryptionMethod;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipUtils;
@@ -26,7 +30,7 @@ public class Zip {
private String targetZip;
private boolean overwriteExistTargetZip = true;
private boolean makeTargetDir = false;
private int compressLevel = 4;
private CompressionLevel compressLevel = CompressionLevel.MEDIUM_FAST;
private String encoding = "ISO-8859-15";
private boolean allFiles = true;
@@ -40,8 +44,8 @@ public class Zip {
private boolean useZip4jEncryption = false;
private int encryptionMethod = Zip4jConstants.ENC_METHOD_AES;
private int aesKeyStrength = Zip4jConstants.AES_STRENGTH_256;
private EncryptionMethod encryptionMethod = EncryptionMethod.AES;
private AesKeyStrength aesKeyStrength = AesKeyStrength.KEY_STRENGTH_256;
private String archiveFormat = "zip";
private boolean syncFlush;
@@ -79,19 +83,29 @@ public class Zip {
}
public void setCompressLevel(int compressLevel) {
this.compressLevel = compressLevel;
switch (compressLevel){
case 0:
this.compressLevel = CompressionLevel.NO_COMPRESSION;
break;
case 4:
this.compressLevel = CompressionLevel.MEDIUM_FAST;
break;
case 9:
this.compressLevel = CompressionLevel.ULTRA;
break;
}
}
public void setMakeTargetDir(boolean makeTargetDir) {
this.makeTargetDir = makeTargetDir;
}
public void setEncryptionMethod(int encryptionMethod) {
this.encryptionMethod = encryptionMethod;
public void setEncryptionMethod(String encryptionMethod) {
this.encryptionMethod = EncryptionMethod.valueOf(encryptionMethod);
}
public void setAesKeyStrength(int aesKeyStrength) {
this.aesKeyStrength = aesKeyStrength;
this.aesKeyStrength = AesKeyStrength.getAesKeyStrengthFromRawCode(aesKeyStrength);
}
public String getArchiveFormat() {
@@ -185,7 +199,7 @@ public class Zip {
targetFile.setLastModified(System.currentTimeMillis());
FileOutputStream fos = new FileOutputStream(targetFile);
final boolean syncFlush = this.syncFlush;
final int compressLevel = this.compressLevel;
final int compressLevel = this.compressLevel.getLevel();
TarArchiveOutputStream taos = new TarArchiveOutputStream(new GZIPOutputStream(fos, syncFlush) {
{
this.def.setLevel(compressLevel);
@@ -222,7 +236,7 @@ public class Zip {
OutputStream out = new FileOutputStream(tarFile);
try {
final boolean syncFlush = this.syncFlush;
final int compressLevel = this.compressLevel;
final int compressLevel = this.compressLevel.getLevel();
GZIPOutputStream gcos = new GZIPOutputStream(out, syncFlush) {
{
this.def.setLevel(compressLevel);
@@ -247,7 +261,7 @@ public class Zip {
try {
output_stream = new java.io.FileOutputStream(targetZip);
if (isEncrypted && !"".equals(password)) {
output_stream = new javax.crypto.CipherOutputStream(output_stream, org.talend.archive.IntegrityUtil.createCipher(
output_stream = new javax.crypto.CipherOutputStream(output_stream, IntegrityUtil.createCipher(
javax.crypto.Cipher.ENCRYPT_MODE, password));
}
} catch (Exception e) {
@@ -260,7 +274,7 @@ public class Zip {
org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream out = null;
out = new org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream(
new java.io.BufferedOutputStream(output_stream));
out.setLevel(compressLevel);
out.setLevel(compressLevel.getLevel());
// set filename & comment encoding
out.setEncoding(encoding);
if ("ALWAYS".equals(zip64Mode)) {
@@ -302,26 +316,26 @@ public class Zip {
// zip4j impl
private void doZip2(final File source, final List<File> list) throws Exception {
ZipFile zipFile = new ZipFile(targetZip);
ZipFile zipFile = new ZipFile(targetZip,password.toCharArray());
if ("UTF-8".equalsIgnoreCase(encoding)) {
encoding = "UTF8";
}
zipFile.setFileNameCharset(encoding);
zipFile.setCharset(Charset.forName(encoding));
ZipParameters params = new ZipParameters();
params.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
params.setCompressionMethod(CompressionMethod.DEFLATE);
params.setCompressionLevel(compressLevel);
if (isEncrypted && !"".equals(password)) {
params.setEncryptFiles(true);
params.setEncryptionMethod(encryptionMethod);
if (Zip4jConstants.ENC_METHOD_AES == encryptionMethod) {
if (encryptionMethod == EncryptionMethod.AES) {
params.setAesKeyStrength(aesKeyStrength);
}
params.setPassword(password);
}
params.setDefaultFolderPath(source.getAbsoluteFile().getPath());
zipFile.addFiles((ArrayList) list, params);
zipFile.addFiles(list, params);
}
}

View File

@@ -19,8 +19,6 @@ bin.excludes = components/tAlfrescoOutput/wstx-lgpl-3.2.7.jar,\
components/tRSSInput/nekohtml.jar,\
components/tAlfrescoOutput/wstx-lgpl-3.2.7.jar,\
components/tAdvancedXMLMapHash/trove.jar,\
components/tCloudStart/logback-core-1.0.9.jar,\
components/tCloudStart/logback-classic-1.0.9.jar,\
components/tLineChart/jcommon-1.0.6.jar,\
components/tMomInput/jnp-client.jar,\
components/tMomInput/javassist.jar,\

View File

@@ -388,9 +388,12 @@ class GenerateToolByDom4j{
for(XMLNode attri:node.attributes){
addAttribute(currEleName,attri);
}
if(node.name.indexOf(":")>0){
int idx = node.name.indexOf(":");
if(idx > 0){
String prefix = node.name.substring(0, idx);
String localName = node.name.substring(idx + 1);
%>
<%touchXMLNode.getXMLNode(currEleName);%>.setName("<%=node.name%>");
<%touchXMLNode.getXMLElement(currEleName);%>.setQName(org.dom4j.DocumentHelper.createQName("<%=localName%>",<%touchXMLNode.getXMLElement(currEleName);%>.getNamespaceForPrefix("<%=prefix%>")));
<%
}
int index = 0;

View File

@@ -174,7 +174,7 @@ globalMap.put("<%=cid%>_ERROR_MESSAGE",e.getMessage());
if (nestRoot != null) {
boolean isDefaultNameSpaceAtRoot = "".equals(nestRoot.getQName().getNamespace().getPrefix());
for (org.dom4j.Element tmp: (java.util.List<org.dom4j.Element>) nestRoot.elements()) {
if (("").equals(tmp.getQName().getNamespace().getURI()) && ("").equals(tmp.getQName().getNamespace().getPrefix()) && isDefaultNameSpaceAtRoot) {
if (isDefaultNameSpaceAtRoot && ("").equals(tmp.getQName().getNamespace().getURI()) && ("").equals(tmp.getQName().getNamespace().getPrefix())) {
tmp.setQName(org.dom4j.DocumentHelper.createQName(tmp.getName(), nestRoot.getQName().getNamespace()));
}
replaceDefaultNameSpace(tmp);

View File

@@ -69,8 +69,8 @@
REQUIRED="true"
/>
<IMPORT
NAME="Log4j"
MODULE="log4j-1.2.17.jar" MVN="mvn:log4j/log4j/1.2.17" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/log4j-1.2.17.jar"
NAME="reload4j-1.2.19"
MODULE="reload4j-1.2.19.jar" MVN="mvn:ch.qos.reload4j/reload4j/1.2.19"
REQUIRED="true"
BundleID=""
/>

View File

@@ -68,8 +68,8 @@
REQUIRED="true"
/>
<IMPORT
NAME="Log4j"
MODULE="log4j-1.2.17.jar" MVN="mvn:log4j/log4j/1.2.17" UrlPath="platform:/plugin/org.talend.libraries.apache/lib/log4j-1.2.17.jar"
NAME="reload4j-1.2.19"
MODULE="reload4j-1.2.19.jar" MVN="mvn:ch.qos.reload4j/reload4j/1.2.19"
REQUIRED="true"
BundleID=""
/>

View File

@@ -231,14 +231,14 @@
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar"
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848"
REQUIRED="true" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED="true" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
<IMPORT NAME="jackson-databind-2.13.2.2.jar" MODULE="jackson-databind-2.13.2.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED="true" />
<IMPORT NAME="jackson-annotations-2.11.4.jar" MODULE="jackson-annotations-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
<IMPORT NAME="jackson-annotations-2.13.2.jar" MODULE="jackson-annotations-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED="true" />
<IMPORT NAME="httpcore-4.4.13.jar" MODULE="httpcore-4.4.13.jar"
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.13"

View File

@@ -558,14 +558,14 @@
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar"
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848"
REQUIRED="true" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED="true" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
<IMPORT NAME="jackson-databind-2.13.2.2.jar" MODULE="jackson-databind-2.13.2.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED="true" />
<IMPORT NAME="jackson-annotations-2.11.4.jar" MODULE="jackson-annotations-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
<IMPORT NAME="jackson-annotations-2.13.2.jar" MODULE="jackson-annotations-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED="true" />
<IMPORT NAME="httpcore-4.4.13.jar" MODULE="httpcore-4.4.13.jar"
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.13"

View File

@@ -288,14 +288,14 @@
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar"
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848"
REQUIRED="true" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED="true" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
<IMPORT NAME="jackson-databind-2.13.2.2.jar" MODULE="jackson-databind-2.13.2.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED="true" />
<IMPORT NAME="jackson-annotations-2.11.4.jar" MODULE="jackson-annotations-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
<IMPORT NAME="jackson-annotations-2.13.2.jar" MODULE="jackson-annotations-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED="true" />
<IMPORT NAME="httpcore-4.4.13.jar" MODULE="httpcore-4.4.13.jar"
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.13"

View File

@@ -348,14 +348,14 @@
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar"
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848"
REQUIRED="true" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED="true" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
<IMPORT NAME="jackson-databind-2.13.2.2.jar" MODULE="jackson-databind-2.13.2.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED="true" />
<IMPORT NAME="jackson-annotations-2.11.4.jar" MODULE="jackson-annotations-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
<IMPORT NAME="jackson-annotations-2.13.2.jar" MODULE="jackson-annotations-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED="true" />
<IMPORT NAME="httpcore-4.4.13.jar" MODULE="httpcore-4.4.13.jar"
MVN="mvn:org.apache.httpcomponents/httpcore/4.4.13"

View File

@@ -384,11 +384,11 @@
<IMPORT NAME="adal4j" MODULE="adal4j-1.6.7.jar" MVN="mvn:com.microsoft.azure/adal4j/1.6.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-lang3" MODULE="commons-lang3-3.10.jar" MVN="mvn:org.apache.commons/commons-lang3/3.10" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-codec" MODULE="commons-codec-1.14.jar" MVN="mvn:commons-codec/commons-codec/1.14" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="oauth2-oidc-sdk" MODULE="oauth2-oidc-sdk-9.7.jar" MVN="mvn:com.nimbusds/oauth2-oidc-sdk/9.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="content-type" MODULE="content-type-2.1.jar" MVN="mvn:com.nimbusds/content-type/2.1" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="json-smart" MODULE="json-smart-2.4.7.jar" MVN="mvn:net.minidev/json-smart/2.4.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-8.11.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/8.11" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-9.22.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/9.22" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="javax.mail" MODULE="javax.mail-1.6.2.jar" MVN="mvn:com.sun.mail/javax.mail/1.6.2" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -207,11 +207,11 @@
<IMPORT NAME="adal4j" MODULE="adal4j-1.6.7.jar" MVN="mvn:com.microsoft.azure/adal4j/1.6.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="commons-lang3" MODULE="commons-lang3-3.10.jar" MVN="mvn:org.apache.commons/commons-lang3/3.10" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="commons-codec" MODULE="commons-codec-1.14.jar" MVN="mvn:commons-codec/commons-codec/1.14" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="gson" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="gson" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="oauth2-oidc-sdk" MODULE="oauth2-oidc-sdk-9.7.jar" MVN="mvn:com.nimbusds/oauth2-oidc-sdk/9.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="content-type" MODULE="content-type-2.1.jar" MVN="mvn:com.nimbusds/content-type/2.1" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="json-smart" MODULE="json-smart-2.4.7.jar" MVN="mvn:net.minidev/json-smart/2.4.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-8.11.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/8.11" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-9.22.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/9.22" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
<IMPORT NAME="javax.mail" MODULE="javax.mail-1.6.2.jar" MVN="mvn:com.sun.mail/javax.mail/1.6.2" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -267,11 +267,11 @@
<IMPORT NAME="adal4j" MODULE="adal4j-1.6.7.jar" MVN="mvn:com.microsoft.azure/adal4j/1.6.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-lang3" MODULE="commons-lang3-3.10.jar" MVN="mvn:org.apache.commons/commons-lang3/3.10" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-codec" MODULE="commons-codec-1.14.jar" MVN="mvn:commons-codec/commons-codec/1.14" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="oauth2-oidc-sdk" MODULE="oauth2-oidc-sdk-9.7.jar" MVN="mvn:com.nimbusds/oauth2-oidc-sdk/9.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="content-type" MODULE="content-type-2.1.jar" MVN="mvn:com.nimbusds/content-type/2.1" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="json-smart" MODULE="json-smart-2.4.7.jar" MVN="mvn:net.minidev/json-smart/2.4.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-8.11.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/8.11" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-9.22.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/9.22" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="javax.mail" MODULE="javax.mail-1.6.2.jar" MVN="mvn:com.sun.mail/javax.mail/1.6.2" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -338,11 +338,11 @@
<IMPORT NAME="adal4j" MODULE="adal4j-1.6.7.jar" MVN="mvn:com.microsoft.azure/adal4j/1.6.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-lang3" MODULE="commons-lang3-3.10.jar" MVN="mvn:org.apache.commons/commons-lang3/3.10" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-codec" MODULE="commons-codec-1.14.jar" MVN="mvn:commons-codec/commons-codec/1.14" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="oauth2-oidc-sdk" MODULE="oauth2-oidc-sdk-9.7.jar" MVN="mvn:com.nimbusds/oauth2-oidc-sdk/9.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="content-type" MODULE="content-type-2.1.jar" MVN="mvn:com.nimbusds/content-type/2.1" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="json-smart" MODULE="json-smart-2.4.7.jar" MVN="mvn:net.minidev/json-smart/2.4.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-8.11.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/8.11" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-9.22.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/9.22" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="javax.mail" MODULE="javax.mail-1.6.2.jar" MVN="mvn:com.sun.mail/javax.mail/1.6.2" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -323,11 +323,11 @@
<IMPORT NAME="adal4j" MODULE="adal4j-1.6.7.jar" MVN="mvn:com.microsoft.azure/adal4j/1.6.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-lang3" MODULE="commons-lang3-3.10.jar" MVN="mvn:org.apache.commons/commons-lang3/3.10" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-codec" MODULE="commons-codec-1.14.jar" MVN="mvn:commons-codec/commons-codec/1.14" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="gson" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="oauth2-oidc-sdk" MODULE="oauth2-oidc-sdk-9.7.jar" MVN="mvn:com.nimbusds/oauth2-oidc-sdk/9.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="content-type" MODULE="content-type-2.1.jar" MVN="mvn:com.nimbusds/content-type/2.1" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="json-smart" MODULE="json-smart-2.4.7.jar" MVN="mvn:net.minidev/json-smart/2.4.7" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-8.11.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/8.11" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="nimbus-jose-jwt" MODULE="nimbus-jose-jwt-9.22.jar" MVN="mvn:com.nimbusds/nimbus-jose-jwt/9.22" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="javax.mail" MODULE="javax.mail-1.6.2.jar" MVN="mvn:com.sun.mail/javax.mail/1.6.2" REQUIRED_IF="(ACTIVE_DIR_AUTH == 'true') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -283,10 +283,10 @@
<IMPORT NAME="google-api-services-oauth2-v2-rev20200213-1.31.0.jar" MODULE="google-api-services-oauth2-v2-rev20200213-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-oauth2/v2-rev20200213-1.31.0" REQUIRED="true" />
<IMPORT NAME="google-api-services-bigquery-v2-rev20201030-1.31.0.jar" MODULE="google-api-services-bigquery-v2-rev20201030-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-bigquery/v2-rev20201030-1.31.0" REQUIRED="true" />
<IMPORT NAME="google-http-client-1.38.0.jar" MODULE="google-http-client-1.38.0.jar" MVN="mvn:com.google.http-client/google-http-client/1.38.0" REQUIRED="true" />
<IMPORT NAME="google-oauth-client-1.31.0.jar" MODULE="google-oauth-client-1.31.0.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.31.0" REQUIRED="true" />
<IMPORT NAME="google-oauth-client-1.33.3.jar" MODULE="google-oauth-client-1.33.3.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.33.3" REQUIRED="true" />
<IMPORT NAME="google-http-client-jackson2-1.38.0.jar" MODULE="google-http-client-jackson2-1.38.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson2/1.38.0" REQUIRED="true" />
<IMPORT NAME="guava-20.0.jar" MODULE="guava-20.0.jar" MVN="mvn:com.google.guava/guava/20.0" REQUIRED="true" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED="true" />
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2" REQUIRED="true" />
<!-- REQUIRED FOR GOOGLE STORAGE -->
<IMPORT NAME="jets3t-0.9.1" MODULE="jets3t-0.9.1.jar" MVN="mvn:org.talend.libraries/jets3t-0.9.1/6.0.0" REQUIRED="true" />
<IMPORT NAME="commons-logging-1.2" MODULE="commons-logging-1.2.jar" MVN="mvn:commons-logging/commons-logging/1.2" REQUIRED="true" />
@@ -312,7 +312,7 @@
<IMPORT NAME="google-cloud-storage-1.104.0" MODULE="google-cloud-storage-1.104.0.jar" MVN="mvn:com.google.cloud/google-cloud-storage/1.104.0" REQUIRED_IF="(AUTH_TYPE == 'GS_SERVICE_ACCOUNT') OR (AUTH_TYPE == 'TOKEN')" />
<!-- Transitive dependencies of google-cloud-storage -->
<IMPORT NAME="google-api-services-storage-v1-rev20201112-1.31.0" MODULE="google-api-services-storage-v1-rev20201112-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-storage/v1-rev20201112-1.31.0" REQUIRED_IF="(AUTH_TYPE == 'GS_SERVICE_ACCOUNT') OR (AUTH_TYPE == 'TOKEN')" />
<IMPORT NAME="gson-2.8.6" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED="true" />
<IMPORT NAME="gson-2.8.9" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED="true" />
<IMPORT NAME="javax.annotation-api" MODULE="javax.annotation-api-1.3.jar" MVN="mvn:javax.annotation/javax.annotation-api/1.3" REQUIRED_IF="(AUTH_TYPE == 'GS_SERVICE_ACCOUNT') OR (AUTH_TYPE == 'TOKEN')" />
<IMPORT NAME="protobuf-java-3.4.0" MODULE="protobuf-java-3.4.0.jar" MVN="mvn:com.google.protobuf/protobuf-java/3.4.0" REQUIRED_IF="(AUTH_TYPE == 'GS_SERVICE_ACCOUNT') OR (AUTH_TYPE == 'TOKEN')" />
<IMPORT NAME="error_prone_annotation-2.1.3" MODULE="error_prone_annotation-2.1.3.jar" MVN="mvn:com.google.errorprone/error_prone_annotations/2.1.3" REQUIRED_IF="(AUTH_TYPE == 'GS_SERVICE_ACCOUNT') OR (AUTH_TYPE == 'TOKEN')" />

View File

@@ -205,10 +205,10 @@
<IMPORT NAME="google-api-services-oauth2-v2-rev20200213-1.31.0.jar" MODULE="google-api-services-oauth2-v2-rev20200213-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-oauth2/v2-rev20200213-1.31.0" REQUIRED="true" />
<IMPORT NAME="google-api-services-bigquery-v2-rev20201030-1.31.0.jar" MODULE="google-api-services-bigquery-v2-rev20201030-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-bigquery/v2-rev20201030-1.31.0" REQUIRED="true" />
<IMPORT NAME="google-http-client-1.38.0.jar" MODULE="google-http-client-1.38.0.jar" MVN="mvn:com.google.http-client/google-http-client/1.38.0" REQUIRED="true" />
<IMPORT NAME="google-oauth-client-1.31.0.jar" MODULE="google-oauth-client-1.31.0.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.31.0" REQUIRED="true" />
<IMPORT NAME="google-oauth-client-1.33.3.jar" MODULE="google-oauth-client-1.33.3.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.33.3" REQUIRED="true" />
<IMPORT NAME="google-http-client-jackson2-1.38.0.jar" MODULE="google-http-client-jackson2-1.38.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson2/1.38.0" REQUIRED="true" />
<IMPORT NAME="guava-20.0.jar" MODULE="guava-20.0.jar" MVN="mvn:com.google.guava/guava/20.0" REQUIRED="true" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED="true" />
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2" REQUIRED="true" />
<IMPORT NAME="google-cloud-bigquery-1.126.3.jar" MODULE="google-cloud-bigquery-1.126.3.jar" MVN="mvn:com.google.cloud/google-cloud-bigquery/1.126.3" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
<!-- TODO remove it -->
@@ -227,7 +227,7 @@
<IMPORT NAME="opencensus-api-0.24.0" MODULE="opencensus-api-0.24.0.jar" MVN="mvn:io.opencensus/opencensus-api/0.24.0" REQUIRED="true" />
<IMPORT NAME="opencensus-contrib-http-util-0.24.0" MODULE="opencensus-contrib-http-util-0.24.0.jar" MVN="mvn:io.opencensus/opencensus-contrib-http-util/0.24.0" REQUIRED="true" />
<IMPORT NAME="grpc-context-1.22.1" MODULE="grpc-context-1.22.1.jar" MVN="mvn:io.grpc/grpc-context/1.22.1" REQUIRED="true" />
<IMPORT NAME="gson-2.8.6" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
<IMPORT NAME="gson-2.8.9" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
</IMPORTS>
</CODEGENERATION>
<RETURNS>

View File

@@ -191,11 +191,11 @@
<IMPORT NAME="google-api-services-oauth2-v2-rev20200213-1.31.0.jar" MODULE="google-api-services-oauth2-v2-rev20200213-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-oauth2/v2-rev20200213-1.31.0" REQUIRED="true" />
<IMPORT NAME="google-api-services-bigquery-v2-rev20201030-1.31.0.jar" MODULE="google-api-services-bigquery-v2-rev20201030-1.31.0.jar" MVN="mvn:com.google.apis/google-api-services-bigquery/v2-rev20201030-1.31.0" REQUIRED="true" />
<IMPORT NAME="google-http-client-1.38.0.jar" MODULE="google-http-client-1.38.0.jar" MVN="mvn:com.google.http-client/google-http-client/1.38.0" REQUIRED="true" />
<IMPORT NAME="google-oauth-client-1.31.0.jar" MODULE="google-oauth-client-1.31.0.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.31.0" REQUIRED="true" />
<IMPORT NAME="google-oauth-client-1.33.3.jar" MODULE="google-oauth-client-1.33.3.jar" MVN="mvn:com.google.oauth-client/google-oauth-client/1.33.3" REQUIRED="true" />
<IMPORT NAME="google-http-client-jackson2-1.38.0.jar" MODULE="google-http-client-jackson2-1.38.0.jar" MVN="mvn:com.google.http-client/google-http-client-jackson2/1.38.0" REQUIRED="true" />
<IMPORT NAME="guava-20.0.jar" MODULE="guava-20.0.jar" MVN="mvn:com.google.guava/guava/20.0" REQUIRED="true"/>
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED="true"/>
<IMPORT NAME="jackson-core-2.13.2.jar" MODULE="jackson-core-2.13.2.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2" REQUIRED="true"/>
<IMPORT NAME="google-cloud-bigquery-1.126.3.jar" MODULE="google-cloud-bigquery-1.126.3.jar"
MVN="mvn:com.google.cloud/google-cloud-bigquery/1.126.3"
REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'"/>
@@ -232,7 +232,7 @@
<IMPORT NAME="opencensus-api-0.24.0" MODULE="opencensus-api-0.24.0.jar" MVN="mvn:io.opencensus/opencensus-api/0.24.0" REQUIRED="true" />
<IMPORT NAME="opencensus-contrib-http-util-0.24.0" MODULE="opencensus-contrib-http-util-0.24.0.jar" MVN="mvn:io.opencensus/opencensus-contrib-http-util/0.24.0" REQUIRED="true" />
<IMPORT NAME="grpc-context-1.22.1" MODULE="grpc-context-1.22.1.jar" MVN="mvn:io.grpc/grpc-context/1.22.1" REQUIRED="true" />
<IMPORT NAME="gson-2.8.6" MODULE="gson-2.8.6.jar" MVN="mvn:com.google.code.gson/gson/2.8.6" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
<IMPORT NAME="gson-2.8.9" MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED_IF="AUTH_MODE == 'SERVICEACCOUNT'" />
</IMPORTS>
</CODEGENERATION>
<RETURNS>

View File

@@ -72,13 +72,13 @@
MODULE="boxjavalibv2-v3.0.10.jar" MVN="mvn:net.box/boxjavalibv2/v3.0.10"
REQUIRED="true" />
<IMPORT NAME="jackson-core"
MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED="true" />
<IMPORT NAME="jackson-databind"
MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
MODULE="jackson-databind-2.13.2.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED="true" />
<IMPORT NAME="jackson-annotations"
MODULE="jackson-annotations-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
MODULE="jackson-annotations-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED="true" />
<IMPORT NAME="apache-http-client"
MODULE="httpclient-4.5.13.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.13"

View File

@@ -127,13 +127,13 @@
MODULE="boxjavalibv2-v3.0.10.jar" MVN="mvn:net.box/boxjavalibv2/v3.0.10"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-core"
MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-databind"
MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
MODULE="jackson-databind-2.13.2.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-annotations"
MODULE="jackson-annotations-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
MODULE="jackson-annotations-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="apache-http-client"
MODULE="httpclient-4.5.13.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.13"

View File

@@ -88,13 +88,13 @@
MODULE="boxjavalibv2-v3.0.10.jar" MVN="mvn:net.box/boxjavalibv2/v3.0.10"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-core"
MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-databind"
MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
MODULE="jackson-databind-2.13.2.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-annotations"
MODULE="jackson-annotations-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
MODULE="jackson-annotations-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="apache-http-client"
MODULE="httpclient-4.5.13.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.13"

View File

@@ -98,13 +98,13 @@
MODULE="boxjavalibv2-v3.0.10.jar" MVN="mvn:net.box/boxjavalibv2/v3.0.10"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-core"
MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-databind"
MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
MODULE="jackson-databind-2.13.2.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-annotations"
MODULE="jackson-annotations-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
MODULE="jackson-annotations-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="apache-http-client"
MODULE="httpclient-4.5.13.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.13"

View File

@@ -106,13 +106,13 @@
MODULE="boxjavalibv2-v3.0.10.jar" MVN="mvn:net.box/boxjavalibv2/v3.0.10"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-core"
MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
MODULE="jackson-core-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-databind"
MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4"
MODULE="jackson-databind-2.13.2.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="jackson-annotations"
MODULE="jackson-annotations-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.11.4"
MODULE="jackson-annotations-2.13.2.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-annotations/2.13.2"
REQUIRED_IF="USE_EXISTING_CONNECTION == 'false'" />
<IMPORT NAME="apache-http-client"
MODULE="httpclient-4.5.13.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.13"

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