Compare commits

...

210 Commits

Author SHA1 Message Date
vdrokov
86134d6361 fix(TESB-27739): Set default value for exportJobAsMicroService variable after microservice has been exported. 2019-12-31 16:00:58 +02:00
Mike Yan
bebc3050d1 fix(TESB-27614): Check NPE for 'files' node in route assembly file (#2942) 2019-12-24 18:06:23 +08:00
kjwang
33a383a413 Fix TUP-24554 Potential NullPointerException (#2938)
https://jira.talendforge.org/browse/TUP-24554
2019-12-24 17:07:18 +08:00
hwang-talend
4e235931d0 bugfix(TUP-22500):jars already existed on nexus still try to upload (#2909)
bugfix(TUP-22500):jars already existed on nexus still try to upload
2019-12-23 10:17:54 +08:00
kjwang
3269e50dcd Fix TUP-25511 Targeted job use database run bat file fail after package (#2922)
out
https://jira.talendforge.org/browse/TUP-25511
2019-12-23 10:08:25 +08:00
hcyi
c55fb30045 fix(TUP-25575):Upgrade tacokit to 1.1.15. (#2930) 2019-12-20 17:28:01 +08:00
bhe-talendbj
8c57f7f34d bugfix(TUP-23557) Get routine dependencies recursively (#2923) 2019-12-19 11:36:29 +08:00
vdrokov
4623022e03 TESB-27401 refresh pom file using AggregatorPomsHelper. (#2927) 2019-12-19 10:43:58 +08:00
bhe-talendbj
b352645b67 bugfix(TUP-25362) Export org.talend.utils.migration package (#2925) 2019-12-18 09:36:05 +08:00
jiezhang-tlnd
0b6d09fe19 fix tos log4j default (#2921) 2019-12-16 16:27:18 +08:00
vdrokov
95e7b2cec2 TESB-27401 Fix TESB-27401 by refreshing list of libraries present in memory into pom file. The list resides in memory just need to refresh it. (#2887)
Add recursive routine to search for a bean that is used to refresh libraries list.
Add maven pom change listener synchronizer. Check if IRunProcess service was registered.
2019-12-13 16:03:28 +02:00
wchen-talend
01749151dc Fix(TUP-25336):Unable to save mapping_Oracle.xml metadata setting (#2900) 2019-12-13 17:47:48 +08:00
jiezhang-tlnd
6c71d8eef7 Jzhang/feat/tup 24651 add choice between log4j and log4j2 in project settings (#2862)
* feat(TUP-24651)Add choice between log4j and log4j2 in project settings

* enable log4j on tos

* fix junit for log4j
2019-12-13 17:22:36 +08:00
Chao MENG
82048e1057 Jackson update/tup 24026 update to 2 10 1 (#2916)
* fix(TUP-24026): update jackson to 2.10.1

* fix(TUP-24026): update jackson to 2.10.1
2019-12-13 15:29:25 +08:00
Zhiwei Xue
4337618568 fix(TUP-24719): improve the exception handling of signature failure. (#2912) 2019-12-13 10:07:18 +08:00
bhe-talendbj
8d25035ce2 bugfix(TUP-25237) Add method clear modules per job (#2902) 2019-12-12 15:26:16 +08:00
Zhiwei Xue
cca649e285 fix(TUP-24719):fix junit and tuj failure (#2910) 2019-12-12 11:59:08 +08:00
kjwang
b70d78cfc4 TUP-22573 [CVE:high] Backend : pkg:maven/org.apache.cxf:cxf-api:2.7.7 requires version upgrade (#2589)
* TUP-22573 [CVE:high] Backend : pkg:maven/org.apache.cxf:cxf-api:2.7.7
requires version upgrade
https://jira.talendforge.org/browse/TUP-22573
2019-12-11 17:38:02 +08:00
bhe-talendbj
0640bbdec0 bugfix(TUP-25362) Fix MigrationTokenUtilTest (#2907) 2019-12-11 17:27:08 +08:00
Zhiwei Xue
eee74c58e1 feat(TUP-24717):Activate/Deactivate plugins when install patch/update (#2811)
* feat(TUP-24717):Activate/Deactivate plugins when install patch/update

* feat(TUP-24718):Limit the size of studio when install updates.

* feat(TUP-24719):Studio updates need to install new components by
project/license type

* feat(TUP-24718): Copy signature file to configuration directory

* feat(TUP-25187):Activate new/remove old third-party bundles from studio
after upgrade to new version

* feat(TUP-25187):fix several bugs.

* feat(TUP-25187):fix drop list format.
2019-12-11 16:05:31 +08:00
kjwang
33116d41ea TUP-25343 [BUG] database can't dataview after set (#2901)
routine.encryption.key.v2
https://jira.talendforge.org/browse/TUP-25343
2019-12-11 11:25:23 +08:00
kjwang
c81eefda4c Kjwang/fix tup 24953 nexus 3 gets populated by crypto utils.jar (#2883)
* Fix TUP-24953 Nexus 3 gets populated by crypto-utils.jar
https://jira.talendforge.org/browse/TUP-24953

* TUP-24953 Nexus 3 gets populated by crypto-utils.jar
https://jira.talendforge.org/browse/TUP-24953
2019-12-10 16:26:56 +08:00
wang wei
56a48fa889 Revert "fix(TDI-43101) : support to generate a sample logging file for runtime lineage (#2855)" (#2899)
This reverts commit d889b21c6d.
2019-12-10 15:12:35 +08:00
Antoine Parent
ab6aa521e7 fix(TBD-9669): add method signature for class RunStat (#2888)
* fix(TBD-9669): add method signature for class RunStat

add a new signature for the method "log"

* fix(TBD-9669): add method signature for failed tujs

fix variable name as it lead to compile error
2019-12-09 10:16:15 +01:00
hzhao-talendbj
36102a662f bugfix(TUP-25194)External jar sync issue in studio using tLibraryLoad (#2867)
* bugfix(TUP-25194)External jar sync issue in studio using tLibraryLoad
2019-12-09 16:57:30 +08:00
Liu Xinquan
574312bf7e TDQ-17742 change the dialog title to Enter a new license key (#2879) 2019-12-09 15:57:20 +08:00
Colm O hEigeartaigh
a96a2d3ffa TUP-25362 - Consolidate Migration token parsing in a single place (#2877) 2019-12-09 14:56:34 +08:00
bhe-talendbj
e476f16b1d bugfix(TUP-25441) Decrypt M3 format data with correct key (#2896)
* bugfix(TUP-25441) Decrypt M3 format data with correct key

* bugfix(TUP-25441) Update KEY_SYSTEM_M3 to KEY_SYSTEM_DEFAULT
2019-12-09 14:29:07 +08:00
Jane Ding
107a5cc42d fix(TUP-25391)[Proxy]Can not logon project after install Metadata Bridge (#2892)
* fix(TUP-25391)[Proxy]Can't logon project after install Metadata Bridge
successfully
https://jira.talendforge.org/browse/TUP-25391

* fix(TUP-25391)[Proxy]Can't logon project after install Metadata Bridge
successfully
https://jira.talendforge.org/browse/TUP-25391
2019-12-09 14:25:04 +08:00
kjwang
773e9b85ec kjwang/Fix TUP-22966 Remove hard-coded key in class (#2894)
org.talend.utils.security.AESEncryption and
routines.system.PasswordEncryptUtil (Fix failed junit)
https://jira.talendforge.org/browse/TUP-22966
2019-12-09 10:09:45 +08:00
hzhao-talendbj
8adce7711f feat(TUP-24382)Enable HTTPS with authentication (#2859)
* feat(TUP-24382)Enable HTTPS with authentication

* feat(TUP-24382)Enable HTTPS with authentication
2019-12-06 17:46:25 +08:00
Dmytro Sylaiev
3f62e44068 fix(TDI-43085): Update jackson deps to the 2.10.1 (#2872) 2019-12-06 11:22:49 +02:00
Jane Ding
f5e10343fe fix(TUP-23082)[Performance] import specific job takes more than 44 mins (#2891)
and still going on
Revert the same name import issue fix
2019-12-06 12:39:23 +08:00
kjwang
a2daae515c Fix failed junit (#2889) 2019-12-06 10:36:29 +08:00
Richard Lecomte
b5240d1762 Rlecomte/fix/tdi 42188 harden deserialization 2 (#2884)
* fix : TDI-42188

Harden Deserializaion (RunTrace)
InputStream in a try-with-resource block (GetJarsToRegister)

* fix : TDI-42188

Harden Deserializaion (RunTrace)
InputStream in a try-with-resource block (GetJarsToRegister)

* fix : TDI-42188

Copy expectedTypes to avoid security leak
Better type checking

* fix : TDI-42188

Deserialized type checked in GetJarsToRegister

* fix : TDI-42188

Removed deserialized type checking in GetJarsToRegister
2019-12-05 10:25:30 +01:00
kjwang
d95d058e75 Kjwang/fix tup 22966 remove hard coded key in password encrypt util 1 (#2829)
* feat(TUP-24862) Key rotation

* feat(TUP-24862) Add key rotation

* feat(TUP-24862) Refactor

* feat(TUP-24862) Refactor

* feat(TUP-24862) Fix logger

* feat(TUP-24862) Add Key rotation

* feat(TUP-24862) add test case

* feat(TUP-24862) Fix test case

* feat(TUP-24862) Fix password encrypt util

* feat(TUP-24862) Resolve comments

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966

* kjwang/Fix TUP-22966 Remove hard-coded key in PasswordEncryptUtil_1
https://jira.talendforge.org/browse/TUP-22966
2019-12-05 15:00:46 +08:00
Jane Ding
e623b1d136 feat(TUP-24849)Remove jars from the studio (#2815)
* feat(TUP-24849)Remove jars from the studio
https://jira.talendforge.org/browse/TUP-24849

* feat(TUP-24849)Remove jars from the studio
https://jira.talendforge.org/browse/TUP-24849

* Revert "feat(TUP-24849)Remove jars from the studio https://jira.talendforge.org/browse/TUP-24849"

This reverts commit 2ac4704b2e.

* feat(TUP-24849)Remove jars from the studio
https://jira.talendforge.org/browse/TUP-24849

* Revert "feat(TUP-24849)Remove jars from the studio https://jira.talendforge.org/browse/TUP-24849"

This reverts commit 68ac603849.

* feat(TUP-24849)Remove jars from the studio
https://jira.talendforge.org/browse/TUP-24849
2019-12-05 12:13:48 +08:00
Oleksii Zatsepin
c4dadb8ee9 TAC-13613: Support of official Microsoft SQL driver on UI (#2881) 2019-12-04 13:58:28 +03:00
Jane Ding
2791c1e35b Jding/tup 23082 import specific job takes more than 44 mins (#2868)
* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082

* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082

* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082

* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082
For batch delete, save project many times during delete process change
to save once at end

* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082

* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082

* fix(TUP-23082)[Performance] import specific job takes more than 44 mins
and still going on
https://jira.talendforge.org/browse/TUP-23082
2019-12-04 10:49:22 +08:00
Sizhao Liu
1137336db3 feat(TDQ-17504): update to lucene8 in studio (#2870)
* feat(TDQ-17504): update to lucene8 in studio

* include lucene 8 module

* remove lucene 6 lib module

* ensure the plugin is unpacked
2019-12-03 15:23:33 +01:00
Emmanuel GALLOIS
29d7c17bbf fix(TDI-43300): fix tacokit component jar clash with locales (#2874) 2019-12-02 21:35:16 +08:00
Chao MENG
7dde7cf4d0 fix(TUP-24749): [7.2.1] issue to download component jar via https proxy (#2876)
https://jira.talendforge.org/browse/TUP-24749
2019-12-02 19:38:14 +08:00
Chao MENG
1818864a43 fix(TUP-25344): can't logon project after change workspace if set log4j2 (#2869)
fix(TUP-25344): can't logon project after change workspace if set log4j2
https://jira.talendforge.org/browse/TUP-25344
2019-12-02 10:29:32 +08:00
Chao MENG
4c67a9780a fix(TUP-24749): [7.2.1] issue to download component jar via https proxy (#2856)
* fix(TUP-24749): [7.2.1] issue to download component jar via https proxy

https://jira.talendforge.org/browse/TUP-24749
2019-11-29 10:22:33 +08:00
bhe-talendbj
9e9f1b3478 bugfix(TUP-25186) Skip migration tasks already executed (#2864)
* bugfix(TUP-25186) Skip migration tasks already executed

* bugfix(TUP-25186) Resolve comments

* bugfix(TUP-25186) Add test case

* bugfix(TUP-25186) Add test case

* bugfix(TUP-25186) Fix Test case
2019-11-28 18:17:44 +08:00
Chao MENG
e6c2ea8bab Revert "Revert "feat(TUP-25006): Redshift SSO support with Ping Federate (#2820)" (#2827)" (#2828)
This reverts commit 57a0d745f3.
2019-11-28 14:39:33 +08:00
jiezhang-tlnd
98bbe0416e fix(TUP-24511)Some of the jars are both in the list downloaded (#2799)
successfully and failed.
2019-11-28 10:18:47 +08:00
wang wei
d889b21c6d fix(TDI-43101) : support to generate a sample logging file for runtime lineage (#2855)
* fix(TDI-33262): align slf4j version to 1.8.0-beta4

* Revert "fix(TDI-33262): align slf4j version to 1.8.0-beta4"

This reverts commit 68bb6ba4dd.

* bump the version as we update the jar which remove log4j1 dependency and
then use slf4j

* fix(TDI-43101): [Research] Generate a sample logging file for runtime
lineage

* fix(TDI-43101): fix it
2019-11-26 18:11:20 +08:00
wang wei
e50a3e7352 fix(TDI-43211): not find the slf4j-api-1.7.25.jar in lib dir (#2858) 2019-11-26 13:48:41 +08:00
Jane Ding
60031484ea Jding/tup 24732 check loop dependency issues (#2844)
* fix(TUP-24732)Studio Code tab doesn't generate code/show errors in Job
https://jira.talendforge.org/browse/TUP-24732

* fix(TUP-24732)Studio Code tab doesn't generate code/show errors in Job
https://jira.talendforge.org/browse/TUP-24732

* fix(TUP-24732)Studio Code tab doesn't generate code/show errors in Job
https://jira.talendforge.org/browse/TUP-24732

* fix(TUP-24732)[7.2.1] Studio Code tab doesn't generate code/show errors
in Job
https://jira.talendforge.org/browse/TUP-24732
2019-11-26 10:44:02 +08:00
Chao MENG
1633f648af feat(TUP-24720): Remove component manager in the studio (#2818)
* feat(TUP-24720): Remove component manager in the studio

https://jira.talendforge.org/browse/TUP-24720

* feat(TUP-24720): Remove component manager in the studio

https://jira.talendforge.org/browse/TUP-24720
2019-11-25 17:08:34 +08:00
kjwang
3f96aec487 Revert "bugfix(TUP-24953):Nexus 3 gets populated by crypto-utils.jar (#2845)" (#2857)
This reverts commit f99f08aab6.
2019-11-25 10:44:36 +08:00
wang wei
1bf2a79f3c fix(TDI-43211): fix the pom (#2854) 2019-11-22 14:13:37 +08:00
hwang-talend
f99f08aab6 bugfix(TUP-24953):Nexus 3 gets populated by crypto-utils.jar (#2845)
* bugfix(TUP-24953):Nexus 3 gets populated by crypto-utils.jar

* bugfix(TUP-24953):Nexus 3 gets populated by crypto-utils.jar
2019-11-22 12:52:33 +08:00
jiezhang-tlnd
53fb0e7182 feat(TUP-24894)add dependency (#2839)
* feat(TUP-24894)add dependency

* feat(TUP-24894)add some jar mostly for DB needs
2019-11-22 11:41:56 +08:00
wang wei
273fe48fa7 fix(TDI-43211): SharedDBConnectionLog4j use log4j1 api, should use slf4j (#2841) 2019-11-22 11:01:21 +08:00
zshen-talend
4a9beeb93c fix(TDQ-17661): improve the code about switch context (#2832)
* fix(TDQ-17661): improve the code about switch context

* fix(TDQ-17661): Make sure the switch context dialog opening one time.
And modify name of connection although it is a action of switch context

* fix(TDQ-17661):Make sure the swtich action only valid when the studio
contains TDQ service
2019-11-21 18:40:41 +08:00
bhe-talendbj
9a6fe39e7d feat(TUP-24862) encryption key rotation (#2806)
* feat(TUP-24862) Key rotation

* feat(TUP-24862) Add key rotation

* feat(TUP-24862) Refactor

* feat(TUP-24862) Refactor

* feat(TUP-24862) Fix logger

* feat(TUP-24862) Add Key rotation

* feat(TUP-24862) add test case

* feat(TUP-24862) Fix test case

* feat(TUP-24862) Fix password encrypt util

* feat(TUP-24862) Resolve comments

* feat(TUP-24862) Resolve comments
2019-11-21 10:13:37 +08:00
Chao MENG
8387d30864 fix(TUP-24942): need to do studio metadata mapping to tsapbapi (#2847)
fix(TUP-24942): need to do studio metadata mapping to tsapbapi components for the new closedlist when D&D metadata to job
https://jira.talendforge.org/browse/TUP-24942
2019-11-20 15:02:22 +08:00
Chao MENG
78beb90c63 fix(TUP-24942): need to do studio metadata mapping to tsapbapi (#2843)
fix(TUP-24942): need to do studio metadata mapping to tsapbapi components for the new closedlist when D&D metadata to job
https://jira.talendforge.org/browse/TUP-24942
2019-11-20 10:53:48 +08:00
bhe-talendbj
753eb9a860 bugfix(TUP-24578) Exclude all of dynamic distribution maven urls from (#2825)
mavenUrlIndex.xml
2019-11-19 17:41:39 +08:00
hzhao-talendbj
3c4089f3f0 Hengzhao/feat/tup 21079 allow to setup a different nexus for proxy of official nexus (#2781)
* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* fix(TUP-24324)7.2.1 - Need a list of open source libraries that are
hosted in the global repository and all the license types that Talend
would host in the Global Repository

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus

* feat(TUP-21079)Allow to setup a different nexus for proxy of official
nexus
2019-11-19 10:45:53 +08:00
Zhiwei Xue
2447eaae6f fix(TUP-25123):Problem of dependencies with spark joblets (#2821) 2019-11-15 16:21:11 +08:00
Chao MENG
4819dc013b fix(TUP-25052): File json miss source schema when after do export to context. (#2830)
* fix(TUP-25052): File json miss source schema when after do export to
context.
https://jira.talendforge.org/browse/TUP-25052
2019-11-15 15:40:28 +08:00
Chao MENG
64f76aea1a fix(TUP-24749): [7.2.1] issue to download component jar via https proxy (#2840)
* fix(TUP-24749): [7.2.1] issue to download component jar via https proxy

https://jira.talendforge.org/browse/TUP-24749

* fix(TUP-24749): [7.2.1] issue to download component jar via https proxy

https://jira.talendforge.org/browse/TUP-24749
2019-11-15 15:07:24 +08:00
kjwang
44e8b184f2 TUP-25052 File json miss source schema when after do export to context. (#2836)
https://jira.talendforge.org/browse/TUP-25052
2019-11-15 14:40:08 +08:00
AlixMetivier
d2bc51edd8 fix(tbd-9542): fix getIncomingType and added method for tMap (#2838)
* added method to be seen in tcommon

* fixed method getIncomingType in case previous node is tMap

* missing import
2019-11-13 15:14:27 +01:00
AlixMetivier
5a0c3c50dc fix(TBD-9542): support tMap with dummyMaps (#2835)
* added method to be seen in tcommon

* fixed method getIncomingType in case previous node is tMap
2019-11-13 14:52:16 +01:00
kjwang
245a5bb510 TUP-25101 The key store password missing of component "tSetKeyStore" (#2824)
when import into studio
https://jira.talendforge.org/browse/TUP-25101
2019-11-13 10:54:21 +08:00
kjwang
57a0d745f3 Revert "feat(TUP-25006): Redshift SSO support with Ping Federate (#2820)" (#2827)
This reverts commit ebe51530ae.
2019-11-08 18:01:49 +08:00
Chao MENG
ebe51530ae feat(TUP-25006): Redshift SSO support with Ping Federate (#2820)
https://jira.talendforge.org/browse/TUP-25006
2019-11-08 18:00:14 +08:00
wang wei
9d5b376155 fix(TDI-33262): support log4j2 (#2763) 2019-11-07 18:05:11 +08:00
jiezhang-tlnd
77973b2807 feat(TUP-24894) add the jul-to-slf4j.jar (#2819) 2019-11-07 11:30:38 +08:00
SunChaoqun
a1441b1b51 TESB-26696:Route - Beans package not visible to test cases (#2810) 2019-11-06 18:17:09 +08:00
jiezhang-tlnd
7fb2fa2f15 feat(TUP-24894)Automatically review / changes slf4j/log4j dependencies (#2814)
* feat(TUP-24894)Automatically review / changes slf4j/log4j dependencies

* format code

* feat(TUP-24894)Automatically review / changes slf4j/log4j dependencies
2019-11-06 17:35:40 +08:00
Chao MENG
8e401b6f1d Cmeng/bugfix/tup 24749 proxy issue (#2808)
* fix(TUP-24749): [7.2.1] issue to download component jar via https proxy

https://jira.talendforge.org/browse/TUP-24749
https://jira.talendforge.org/browse/TUP-24783
https://jira.talendforge.org/browse/TUP-24606
2019-11-06 11:16:09 +08:00
Jane Ding
a95c9e3940 Jding/tup 24732 studio code tab doesn't show error (#2805)
* fix(TUP-24732)Studio Code tab doesn't generate code/show errors in Job
https://jira.talendforge.org/browse/TUP-24732

* fix(TUP-24732)Studio Code tab doesn't generate code/show errors in Job
https://jira.talendforge.org/browse/TUP-24732

* fix(TUP-24732)Studio Code tab doesn't generate code/show errors in Job
https://jira.talendforge.org/browse/TUP-24732
2019-11-06 10:52:13 +08:00
Jane Ding
cabef426f9 fix(TUP-25050)Cannot Read data from xsd file while creating xml metadata (#2809)
https://jira.talendforge.org/browse/TUP-25050
2019-11-05 10:31:55 +08:00
hcyi
952f28e9fe fix(TUP-24944):Fail to create teradata connection if connection with (#2796)
additional parameters.
2019-11-04 16:32:18 +08:00
hzhao-talendbj
37bb18b6a6 Hengzhao/bugfix/tup 24324 7.2.1 need a list of open source libraries that are hosted in the global repository and all the license types that talend would host in the global repository (#2701)
* fix(TUP-24324)7.2.1 - Need a list of open source libraries that are
hosted in the global repository and all the license types that Talend
would host in the Global Repos
2019-11-04 14:36:57 +08:00
hwang-talend
15af08e876 Hwang/tup 24076 1031 (#2800)
* bugfix(TUP-24076):Unresponsive Nexus blocks Studio during remote
connection start-up

* bugfix(TUP-24076):Unresponsive Nexus blocks Studio during remote
connection start-up

* bugfix(TUP-24076):Unresponsive Nexus blocks Studio during remote
connection start-up

* bugfix(TUP-24076):Unresponsive Nexus blocks Studio during remote
connection start-up

* bugfix(TUP-24076):Unresponsive Nexus blocks Studio during remote
connection start-up
2019-11-04 14:02:12 +08:00
Chao MENG
912702dc8e fix(TUP-24954): Error "XML format is incorrect", when customer try to (#2803)
fix(TUP-24954): Error "XML format is incorrect", when customer try to define a 'File XML metadata' using a XSD file
https://jira.talendforge.org/browse/TUP-24954
2019-11-04 11:47:58 +08:00
bhe-talendbj
910f191106 bugfix(TUP-25048) Add https transporter (#2802)
* bugfix(TUP-25048) Add https transporter

* bugfix(TUP-25048) Add fix for NPE
2019-11-01 10:26:13 +08:00
zshen-talend
25b9736e6a fix(TDQ-17660): After create DB connection successfully , nothing store under repository (#2797)
* fix(TDQ-17660): fix the issue which After create DB connection
successfully , nothing store under repository

* fix(TDQ-17660): clear the code
2019-10-30 15:01:15 +01:00
bhe-talendbj
9b9d44f62d bugfix(TUP-24978) can not download ojdbc8-12.2.0.1.jar (#2793)
* bugfix(TUP-24978) Download jar

* bugfix(TUP-24986) For maven artifact resolver, rever to http transporter

* bugfix(TUP-24978) Remove unused import
2019-10-29 15:29:13 +08:00
Zhiwei Xue
4f2f4ad5ed fix(TUP-24623):fix regression. (#2787) 2019-10-28 10:11:32 +08:00
SunChaoqun
31e63d367a TESB-27139:"Could not find the context Default" is shown in runtime when (#2789)
deploy a route into runtime
2019-10-25 18:48:36 +08:00
Mike Yan
374ef473cd fix (TESB-24597): backport docker esb fixes to master (#2672)
* fix (TESB-25283): backport docker esb fixes to master

* fix (TESB-25283): backport docker esb fixes to master

* fix (TESB-25283): backport docker esb fixes to master

* fix (TESB-25283): backport docker esb fixes to master

* fix(TESB-27087): Add condition for checking ESB service is loaded

* fix(TESB-24597): remove unused variable
2019-10-25 10:30:42 +08:00
msjian
39fe107d2b fix(TDQ-17536): fix tDqReportRun job run fail after upgrade encryption (#2775) 2019-10-25 10:25:42 +08:00
AlixMetivier
655418754a add method to fix arguments (#2788) 2019-10-24 13:14:47 +02:00
bhe-talendbj
bd38f3bb24 bugfix(TUP-24695) deploy artifacts anonymous (#2774)
* bugfix(TUP-24695) deploy or download jars with anonymous user

* bugfix(TUP-24695) Update meta and build properties

* bugfix(TUP-24695) Refactor
2019-10-23 17:09:13 +08:00
Roman
96a90bc9d4 fix(TDI-43022): change LN method in Routines (#2751) 2019-10-23 07:41:17 +03:00
hcyi
a89a694105 fix(TUP-24917):Upgrade tacokit to 1.1.14. (#2776) 2019-10-22 10:11:14 +08:00
Zhiwei Xue
c70c995827 fix(TUP-24623):Compilation error on the job with project references (#2757) 2019-10-18 15:54:16 +08:00
Chao MENG
bc82ca517e feat(TUP-21518) Remove CryptoHelper (#2771)
https://jira.talendforge.org/browse/TUP-21518
Add resource into eclipse project
2019-10-18 11:39:11 +08:00
Zhiwei Xue
2c07f47523 fix(TUP-24365):fix m2 repository problem for zero installation CI (#2764) 2019-10-18 10:21:20 +08:00
hzhao-talendbj
668fd255c2 fix(TUP-24613)routine section does not allow user to edit required (#2759)
* fix(TUP-24613)routine section does not allow user to edit required
checkbox

* fix(TUP-24613)routine section does not allow user to edit required
checkbox

* fix(TUP-24613)routine section does not allow user to edit required
checkbox

* fix(TUP-24613)routine section does not allow user to edit required
checkbox
2019-10-18 10:06:50 +08:00
bhe-talendbj
755fed6f00 feat(TUP-21518) Remove CryptoHelper (#2655)
* feat(TUP-21518) initial change from cryptohelper to AESEncryption

feat(TUP-21518) Replace CryptoHelper

feat(TUP-21518) Revert migration related changes and changes to old hardcoded key of AESEncryption, tracked by https://jira.talendforge.org/browse/TUP-22966

feat(TUP-21518) Add CryptoHelperWrapper which will be intended for
migration

feat(TUP-21518) Add methods to CryptoHelperWrapper

feat(TUP-21518) Fix Separate migration code

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Format source code

* feat(TUP-21518) Uptake new daikon lib

* feat(TUP-21518) initial change from cryptohelper to AESEncryption

feat(TUP-21518) Replace CryptoHelper

feat(TUP-21518) Revert migration related changes and changes to old hardcoded key of AESEncryption, tracked by https://jira.talendforge.org/browse/TUP-22966

feat(TUP-21518) Add CryptoHelperWrapper which will be intended for
migration

feat(TUP-21518) Add methods to CryptoHelperWrapper

feat(TUP-21518) Fix Separate migration code

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Rename AESEncryption

feat(TUP-21518) Format source code

feat(TUP-21518) Uptake new daikon lib

feat(TUP-21518) Rename encryption key

* feat(TUP-21518) Update system property

* kjwang/Fix TUP-24212 Create migration for CryptoHelper to AES upgrading
https://jira.talendforge.org/browse/TUP-24212

* feat(TUP-21518) Update log level

* feat(TUP-21518) Set encryption key system property only if it is not set

* kjwang/Fix TUP-24212 Create migration for CryptoHelper to AES upgrading
https://jira.talendforge.org/browse/TUP-24212

* kjwang/Fix TUP-24212 Create migration for CryptoHelper to AES upgrading
https://jira.talendforge.org/browse/TUP-24212

* kjwang/Fix TUP-24212 Create migration for CryptoHelper to AES upgrading
https://jira.talendforge.org/browse/TUP-24212

* feat(TUP-21518) Set up default keys

* kjwang/Fix TUP-24212 Create migration for CryptoHelper to AES upgrading
https://jira.talendforge.org/browse/TUP-24212

* feat(TUP-21518) Setup default encryption keys

* feat(TUP-21518) Update crypto-utils

* feat(TUP-21518) Merge changes

* kjwang/Fix TUP-24212 Create migration for CryptoHelper to AES upgrading
https://jira.talendforge.org/browse/TUP-24212

* feat(TUP-21518) Fix test case and load default keys for tac and
jobserver

* feat(TUP-21518) Fix load key file

* feat(TUP-21518) Revert pom_minimal and server

* feat(TUP-21518) Fix test case

* feat(TUP-21518) Fix test case

* feat(TUP-21518) Fix test case

* feat(TUP-21518) Fix ElementParameterParserTest

* fix(TDQ-16616): refactor the code to make it reuseable

* feat(TUP-21518) Fix TUP-24580

* feat(TUP-21518) Fix TUP-24578

* feat(TUP-21518) Add JDBC connection type

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Refactor

* feat(TUP-21518) Fix log

* feat(TUP-21518) Fix format of source code

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Load migration.token.encryption.key from local jar

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Resolve comments

* feat(TUP-21518) Fix TUP-24868
2019-10-18 09:36:24 +08:00
mbasiuk-talend
66c3ce0a83 fix(TDI-43035): use only main connection category (#2754)
* fix(TDI-43035): use only main connection category

* fix(TDI-43035): use better condition to catch the issue
2019-10-17 16:00:01 +03:00
hwang-talend
4236b866da bugfix(TUP-24563):Specifying a custom MVN URI in a Bean still ends up (#2761)
bugfix(TUP-24563):Specifying a custom MVN URI in a Bean still ends up turning into a reference to the default 6.0.0-SNAPSHOT version
2019-10-14 16:50:54 +08:00
Jane Ding
cbf672ed2c fix(TUP-24735)Studio fails to sync jars with Artifactory if password has (#2756)
* fix(TUP-24735)Studio fails to sync jars with Artifactory if password has
'@' character in it
https://jira.talendforge.org/browse/TUP-24735

* fix(TUP-24735)Studio fails to sync jars with Artifactory if password has
'@' character in it
https://jira.talendforge.org/browse/TUP-24735

* fix(TUP-24735)Studio fails to sync jars with Artifactory if password has
'@' character in it
https://jira.talendforge.org/browse/TUP-24735
2019-10-14 11:07:44 +08:00
nrousseau
01923b38ab Revert "fix(TBD-9333): add new methods to get previous node (#2760)" (#2765)
This reverts commit 03958a67cb.
2019-10-14 10:02:46 +08:00
zshen-talend
d530c609b8 fix(TDQ-17435): merge switch context method between DI and DQ (#2744)
* fix(TDQ-17435): merge switch context method between DI and DQ

* fix(TDQ-17435): modify the issue when swich context again and again

* fix(TDQ-17435): make sure original context get correctly value
2019-10-12 16:53:46 +08:00
hcyi
570338e9ff fix(TUP-24800):Upgrade tacokit to release version of 1.1.13 (#2753) 2019-10-12 11:15:37 +08:00
AlixMetivier
03958a67cb fix(TBD-9333): add new methods to get previous node (#2760)
* added new method to getPrevious component

* javadoc

* refacto javadoc

* Update INode.java
2019-10-11 15:54:52 +02:00
hcyi
bc0926739b fix:fix a fail junit. (#2752) 2019-10-10 09:58:48 +08:00
hwang-talend
36f4c0eff3 bugfix(TUP-24577):Spark job can't run if it uses a spark joblet (#2743)
bugfix(TUP-24577):Spark job can't run if it uses a spark joblet
2019-10-09 17:06:17 +08:00
qiongli
22654e6d4b feat(TDQ-17284) Avoid NPE to support "IF" condition in componet XML (#2734) 2019-10-09 14:45:23 +08:00
sbliu
4072bd93e9 TMDM-13924 Schema tree show empty when retrieve entity for mdm connection.
Change the pattern string to adapt to jdk8 & jdk11; extract method to get next name and won't change selected entity name; replace the exception handler and exception catch pattern.
2019-10-09 14:09:56 +08:00
Max
c4cc17db4d Fix/tbd 9289 (#2747)
* TBD-9289: fix

* Removed unnecessary import
2019-10-07 12:31:39 +03:00
Zhiwei Xue
c0dc58d18a fix(TUP-24310):routines is duplicated in the reactor (#2742)
* fix(TUP-24310):routines is duplicated in the reactor

* fix(TUP-24310):routines is duplicated in the reactor.
2019-09-27 18:59:04 +08:00
jiezhang-tlnd
1d266d5488 feat(TUP-24444)Add choice between log4j and log4j2 in project settings (#2712)
* feat(TUP-24444)Add choice between log4j and log4j2 in project settings
https://jira.talendforge.org/browse/TUP-24444

* feat(TUP-24444)after run job then change logj4, the pom file isn't
update
2019-09-23 18:38:12 +08:00
wang wei
15216b8be3 fix(TDI-42183): Avoid locale dependent checks (#2715)
* fix(TDI-42183): Avoid locale dependent checks

* fix(TDI-42183): declare the code come from apache commons lang
2019-09-23 18:04:06 +08:00
wang wei
1f385ee333 fix(TDI-42187): Fix Double Checked Locking in GlobalResource (#2708)
* fix(TDI-42187): Fix Double Checked Locking in GlobalResource

* fix(TDI-42187): use more readable method
2019-09-23 17:42:49 +08:00
Chao MENG
0e4cd386dc fix(TUP-23905): Job disappearing after merging git branches (#2738)
https://jira.talendforge.org/browse/TUP-23905

Hide id options, and set `keep original id` as default
2019-09-23 15:03:57 +08:00
hwang-talend
17d96e1fa5 Revert "bugfix(TUP-24029):[FTP] Connection wizard add timeout property (#2684)" (#2736)
Revert "bugfix(TUP-24029):[FTP] Connection wizard add timeout property
This reverts commit 992e01de37.
2019-09-23 14:45:33 +08:00
jiezhang-tlnd
f1ec81bced fix(TUP-23960)Following TDI-42674, update dependency for Redshift database metadata (#2721)
* fix(TUP-23960)Following TDI-42674, update dependency for Redshift
database metadata
https://jira.talendforge.org/browse/TUP-23960

* fix(TUP-23960)Following TDI-42674, update dependency for Redshift
database metadata
https://jira.talendforge.org/browse/TUP-23960
2019-09-23 14:42:20 +08:00
hcyi
2bcd3b2050 fix(TUP-24084):Change the display of the new Couchbase component names. (#2720) 2019-09-23 12:35:54 +08:00
Zhiwei Xue
132eb3fa3a fix(TUP-24310):routines is duplicated in the reactor (#2719) 2019-09-23 11:24:04 +08:00
Jane Ding
b94b99f1c8 fix(TUP-24433)Migrating Big Data Jobs from 7.1.1 to 7.2.1 is adding the (#2735)
routines-7.1.1.jar instead of routines-7.2.1.jar
https://jira.talendforge.org/browse/TUP-24433
2019-09-23 10:48:56 +08:00
hwang-talend
64083d1e2e bugfix(TUP-24563):Specifying a custom MVN URI in a Bean still ends up (#2716)
bugfix(TUP-24563):Specifying a custom MVN URI in a Bean still ends up turning into a reference to the default 6.0.0-SNAPSHOT version
2019-09-19 15:06:30 +08:00
wang wei
7b21c010e2 fix(TDI-42192): Use SecureRandom in system routines (#2707) 2019-09-18 18:34:00 +08:00
kjwang
3d08e7a41c kjwang/Fix TUP-24579 MacOS : unable to access remote project after (#2718)
applying TPS-3363
https://jira.talendforge.org/browse/TUP-24579
2019-09-18 18:25:30 +08:00
Mike Yan
107c52119a fix(TESB-26415): beansType is null with pure DI licence (#2724)
fix(TESB-26415): beansType is null with pure DI licence
2019-09-18 18:21:22 +08:00
hwang-talend
992e01de37 bugfix(TUP-24029):[FTP] Connection wizard add timeout property (#2684)
bugfix(TUP-24029):[FTP] Connection wizard add timeout property
2019-09-18 17:01:07 +08:00
Zhiwei Xue
5bdc4ceef7 fix(TUP-24310):routines is duplicated in the reactor (#2706) 2019-09-12 10:33:49 +08:00
SunChaoqun
d2eaeb7b97 TESB-26415:Cannot publish Route with Routelet to snapshots when project (#2702)
has a ref project defined
2019-09-11 17:14:03 +08:00
hzhao-talendbj
a53ffdfbf4 feat(TUP-24028)Add Azure datacenter part of the studio connection (#2685) 2019-09-11 17:11:57 +08:00
hzhao-talendbj
dc92855b54 fix(TUP-23555)Unnecessary xmlMappings will be included in a built job (#2699) 2019-09-09 10:52:49 +08:00
Chao MENG
e8d1ce17d0 fix(TUP-23905): Job disappearing after merging git branches (#2703)
fix(TUP-23905): Job disappearing after merging git branches
https://jira.talendforge.org/browse/TUP-23905
2019-09-09 10:44:37 +08:00
Chao MENG
ba19f14fc9 fix(TUP-23905): Job disappearing after merging git branches (#2700)
fix(TUP-23905): Job disappearing after merging git branches
https://jira.talendforge.org/browse/TUP-23905
2019-09-06 10:12:06 +08:00
Zhiwei Xue
1a73160d6b fix(TUP-24323):_tdm folder is missing after build thmap job (#2687) 2019-09-03 10:17:48 +08:00
jiezhang-tlnd
6efbc76223 fix(TUP-24411)Error message: unable to update task config if the Context parameters have same values but different case (#2691)
* fix(TUP-24411)Error message: unable to update task config if the Context
parameters have same values but different case
https://jira.talendforge.org/browse/TUP-24411

* fix(TUP-24411)Error message: unable to update task config if the Context
parameters have same values but different case.
https://jira.talendforge.org/browse/TUP-24411

* fix(TUP-24411)Error message: unable to update task config if the Context
parameters have same values but different case

* fix(TUP-24411)Error message: unable to update task config if the Context
parameters have same values but different case
https://jira.talendforge.org/browse/TUP-24411

* fix(TUP-24411)Error message: unable to update task config if the Context
parameters have same values but different case
https://jira.talendforge.org/browse/TUP-24411

* fix(TUP-24411)Error message: unable to update task config if the Context
parameters have same values but different case
https://jira.talendforge.org/browse/TUP-24411
2019-09-02 11:28:05 +08:00
Richard Lecomte
2aae24829a fix : TDI-42776 (#2692)
* fix : TDI-42776

Numeric sequence is now thread safe
2019-08-30 10:50:32 +02:00
kjwang
ea091c2cda kjwang/Fix TUP-24363 Create excel metadata get error (#2686)
Fix :TUP-24363 Create excel metadata get error:Exception in thread
"main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
2019-08-27 11:59:47 +08:00
hwang-talend
ef5869370d bugfix(TUP-24249):Added the column but not reflected to json metadata (#2673)
* bugfix(TUP-24249):Added the column but not reflected to json metadata
2019-08-27 10:38:45 +08:00
jiezhang-tlnd
dfc277d886 fix(TUP-24248)when edit the metadata, the display content is different (#2682)
as when created
https://jira.talendforge.org/browse/TUP-24248
2019-08-23 14:50:55 +08:00
kjwang
7a75fdc057 Kjwang/fix tup 24170 set crypto utils as bundle (#2661)
* Fix TUP-24170 Set crypto-utils as bundle to make the master compile with
daikon 0.31.10-SNAPSHOT
https://jira.talendforge.org/browse/TUP-24170

* Fix TUP-24170 Set crypto-utils as bundle to make the master compile with
daikon 0.31.10-SNAPSHOT
https://jira.talendforge.org/browse/TUP-24170

* Fix TUP-24170 Set crypto-utils as bundle to make the master compile with
daikon 0.31.10-SNAPSHOT
https://jira.talendforge.org/browse/TUP-24170

* Fix TUP-24170 Set crypto-utils as bundle to make the master compile with
daikon 0.31.10-SNAPSHOT
https://jira.talendforge.org/browse/TUP-24170

* Fix TUP-24170 Set crypto-utils as bundle to make the master compile with
daikon 0.31.10-SNAPSHOT
https://jira.talendforge.org/browse/TUP-24170
2019-08-22 15:39:51 +08:00
Zhiwei Xue
f4ecdf00c6 fix(TUP-23568):nexus password display in studio error log (#2564) 2019-08-22 10:46:08 +08:00
Mike Yan
3ab6dc8441 fix(TESB-26560): Add dependencies for karaf maven plugin (#2681) 2019-08-21 23:09:48 +08:00
Mike Yan
f6903ae6d6 fix(TESB-26560): remove duplicate karaf plugin (#2680) 2019-08-21 18:22:54 +08:00
Mike Yan
c05f0c4518 fix(TESB-26560): Moved karaf plugin and build-helper plugin position (#2679)
* fix(TESB-26560): Update to karaf maven plugin

* fix(TESB-26560): Moved karaf plugin and build-helper plugin position
2019-08-21 18:15:44 +08:00
Chao MENG
00837db7bf fix(TUP-24226): Studio doesn't load latest jar for TCOMPv0 update site patch
fix(TUP-24226): Studio doesn't load latest jar for TCOMPv0 update site patch
https://jira.talendforge.org/browse/TUP-24226
2019-08-21 11:12:47 +08:00
Roman
667fbf90ad fix(TDI-42034): update Redshift jar to 1.2.32.1056 (#2666) 2019-08-20 09:25:57 +03:00
wang wei
17a34e40ac fix(TDI-42443): tRunJob component - Enabling custom JVM params for independent child jobs(#2646) 2019-08-20 14:16:20 +08:00
Mike Yan
80484dc111 fix(TESB-26560): Update to karaf maven plugin (#2670) 2019-08-20 14:07:57 +08:00
jiezhang-tlnd
3cd8ee2958 fix(TUP-24159)XML metadata wizard showing inconsistent view on V711 (#2671)
comparing with V6 Studio
https://jira.talendforge.org/browse/TUP-24159
2019-08-20 10:25:47 +08:00
hwang-talend
5d75d89161 bugfix(TUP-23583):Unable to see all tables in AS400 Connection (#2620)
* bugfix(TUP-23583):Unable to see all tables in AS400 Connection
2019-08-19 15:19:59 +08:00
jiezhang-tlnd
a518891e99 fix(TUP-24232)JDBC metadata connection for Redshift when exported as (#2667)
context, unable to retrieve schema
https://jira.talendforge.org/browse/TUP-24232
2019-08-19 11:38:45 +08:00
Emmanuel GALLOIS
a26002f9a2 feat(TDI-40339): add Snowflake SQL Templates (#2633)
* feat(TDI-40339): add Snowflake Merge template
* feat(TDI-40339): add Snowflake table management templates
* fix(TDI-40339): correct create target table template
* fix(TDI-40339): remove the OR REPLACE statement
2019-08-16 11:23:22 +02:00
wang wei
bea0b2a13b fix(TDI-42522): avoid 65535 issue (#2540) 2019-08-16 11:59:59 +08:00
Jane Ding
020d7af9fe Jding/tup 24162 studio version is not correct after applied serveral patches (#2654)
* fix(TUP-24162)Studio version is not correct after applied serveral
patches on 7.2.1
https://jira.talendforge.org/browse/TUP-24162

* fix(TUP-24162)Studio version is not correct after applied serveral
patches on 7.2.1
https://jira.talendforge.org/browse/TUP-24162

* fix(TUP-24162)Studio version is not correct after applied serveral
patches on 7.2.1
https://jira.talendforge.org/browse/TUP-24162
2019-08-14 19:38:50 +08:00
jiezhang-tlnd
12649f7a3d fix(TUP-20372)[git] Use Project Settings is not checked as default for job (#2662)
* fix(TUP-20372)[git] Use Project Settings is not checked as default for
job
https://jira.talendforge.org/browse/TUP-20372

* fix(TUP-20372)[git] Use Project Settings is not checked as default for
job
https://jira.talendforge.org/browse/TUP-20372
2019-08-14 19:29:48 +08:00
pyzhou
e9b5ce029d fix(TDI-42725): change groupID EXAUtil (#2657) 2019-08-13 17:41:52 +08:00
msjian
94f5432d89 chore(TDQ-16113): code refactor (#2656)
* chore(TDQ-16113): code refactor

* refactor code
2019-08-13 15:35:48 +08:00
Zhiwei Xue
bd26e3e912 fix(TUP-23637):7.x missing local_project for big data spark batch job (#2604) 2019-08-13 11:41:59 +08:00
Irene Wang
73a2bdc6ec Deploy org.talend.utils 2019-08-09 14:09:36 +02:00
sbliu
14b6b30d43 TMDM-13805 Can read entity and navigator to previous/next page.
* TMDM-13805 Can read entity and navigator to previous/next page.

* TMDM-13805 The whole process of read entity won't change the entity.

* TMDM-13805 Disable drag/drop from table to tree for schema mapping page of reading output type mdm connection.
2019-08-09 10:02:20 +00:00
Pingwen Lin
6e4b940576 TMDM-12997 Add more fields in the Jounal from the MDM Web UI (#2640) 2019-08-09 14:12:36 +08:00
jiezhang-tlnd
c8ba22bde9 fix(TUP-24159)XML metadata wizard showing inconsistent view on V711 (#2651)
comparing with V6 Studio
https://jira.talendforge.org/browse/TUP-24159
2019-08-09 10:54:28 +08:00
Jane Ding
02d9f42f8c fix(TUP-22556)TDI License: It takes 190s to finish Import Progress (#2648)
https://jira.talendforge.org/browse/TUP-22556
2019-08-08 19:28:37 +08:00
SunChaoqun
adaf9f3f96 TESB-26174:Error on Job with multiple tRunJob calling Call another Child (#2592)
job with tESBConsumer component
2019-08-07 12:10:19 +08:00
hzhao-talendbj
03944cda7e fix(TUP-23571)issue for download jar to local nexus (#2644) 2019-08-07 10:51:33 +08:00
jiezhang-tlnd
7cb53dd732 fix(TUP-23998)Studio language not working as expected (#2643)
https://jira.talendforge.org/browse/TUP-23998
2019-08-06 15:31:06 +08:00
jiezhang-tlnd
cdbee411a0 fix(TUP-23998)Studio language not working as expected (#2642)
https://jira.talendforge.org/browse/TUP-23998
2019-08-06 14:43:22 +08:00
jiezhang-tlnd
085bc038a2 fix(TUP-20372) Use Project Settings is not checked as default for job (#2638)
* fix(TUP-20372) Use Project Settings is not checked as default for job
https://jira.talendforge.org/browse/TUP-20372

* fix(TUP-20372)[git] Use Project Settings is not checked as default for
job
https://jira.talendforge.org/browse/TUP-20372

* fix(TUP-20372)[git] Use Project Settings is not checked as default for
job
https://jira.talendforge.org/browse/TUP-20372
2019-08-06 10:48:49 +08:00
hbhong
666e9060fb TMDM-13806 Fixed "Guess" schema return an empty schema for Talend MDM connection (#2636) 2019-08-02 16:49:43 +08:00
jiezhang-tlnd
7de7c1c24a fix(TUP-23933)Metadata connection for Redshift SSO considers username & (#2637)
password as separate field
https://jira.talendforge.org/browse/TUP-23933
2019-08-02 10:32:14 +08:00
Emmanuel GALLOIS
faa61885aa fix(TDI-41662): change ExcelReader.parse signature (#2639) 2019-08-01 18:24:30 +02:00
jiezhang-tlnd
5f31fe7286 fix(TUP-23998)Studio language not working as expected (#2630)
* fix(TUP-23998)Studio language not working as expected
https://jira.talendforge.org/browse/TUP-23998

* fix(TUP-23998)Studio language not working as expected
https://jira.talendforge.org/browse/TUP-23998
2019-08-01 16:36:58 +08:00
sbliu
57c6b45cf0 TMDM-13648 fix the event loop exception when refreshing wizard page during edit receive type entity. 2019-08-01 02:40:21 +00:00
SunChaoqun
624c33c8ce TESB-24597:Docker Support for Microservice - CI Part (#2634) 2019-07-31 18:37:45 +08:00
Chao MENG
a2847353fa fix(TUP-20943): Code generates with an error when Pattern check fails if (#2629)
contain back slash
https://jira.talendforge.org/browse/TUP-20943
2019-07-31 17:39:35 +08:00
sbliu
e5306d1924 TMDM-13648 Metadata / Talend MDM / Export as context / Retrieve Entity => Error / entities list empty after Studio restart
* TMDM-13648 Fix bug that can not retrieve entity after connection parameters exported as context;
           fix bug that can not switch to previous page;
           fix can not set correct name after change the mdm concept type(mdm model).
           fix Spelling case error of password label when editing mdm connection.

* TMDM-13648 Show correct mdm file step form according to first step mdm type selection.

* TMDM-13648 Fix problem:
     1. Not editable for input/receive type schema page;
     2. Can not refresh receive type schema page according to selected entity;
     3. Can not perform finish for receive type schema page introduced by schema file deleted;
     4. thread exception caused by widget disposed.

* TMDM-13648 remove commented code.
2019-07-31 07:31:52 +00:00
Chao MENG
6ee8a1c151 Cmeng/bugfix/tup 23914 json wizard encoding (#2628)
* fix(TUP-23914): JSON with accented characters is not being recognized
when creating a new JSON file in Metadata.
https://jira.talendforge.org/browse/TUP-23914
2019-07-31 10:04:24 +08:00
qiongli
d826efb9e9 fix(TDQ-17308) Update the new driver name and mvn url (#2621) 2019-07-29 17:43:41 +08:00
jiezhang-tlnd
5ea77ef738 fix(TUP-23854)Can't create EDI until I open error log view (#2615)
https://jira.talendforge.org/browse/TUP-23854
2019-07-29 15:26:36 +08:00
Jane Ding
804d715dec fix(TUP-22943)checkbox with empty item name display on window Save (#2618)
Resources
https://jira.talendforge.org/browse/TUP-22943
2019-07-29 15:11:59 +08:00
hcyi
5dc7a930db fix(TUP-20928):Suggestable doesn't work for TextArea in Studio (#2626) 2019-07-29 14:55:57 +08:00
SunChaoqun
8f9a411c43 TESB-24597:Docker Support for Microservice - CI Part (#2606)
* TESB-24597:Docker Support for Microservice - CI Part
2019-07-26 10:39:51 +08:00
kjwang-talend
92fda0840e TUP-23950 Error in calling spark job from trunjob job inside standard (#2613) (#2614)
job
https://jira.talendforge.org/browse/TUP-23950
2019-07-25 17:52:16 +08:00
Chao MENG
17abd3cff4 fix(TUP-23984): JSON metadata wizard for output mode throws class cast (#2624)
exception on Linux and Mac
https://jira.talendforge.org/browse/TUP-23984
2019-07-25 15:41:46 +08:00
msjian
6f6943a58f chore(TDQ-16113): fix exception (#2623) 2019-07-25 14:30:41 +08:00
msjian
8a73c53a82 fix(TDQ-16113): fix not use insecure source of entropy (Random) (#2611) 2019-07-25 09:55:46 +08:00
Jane Ding
15396b7aa2 fix(TUP-23789)Pom files are not generated sometimes for the jobs in (#2610)
* fix(TUP-23789)Pom files are not generated sometimes for the jobs in
7.1.1
https://jira.talendforge.org/browse/TUP-23789

* fix(TUP-23789)Pom files are not generated sometimes for the jobs in
7.1.1
https://jira.talendforge.org/browse/TUP-23789
Add a junit.
2019-07-24 16:18:56 +08:00
jiezhang-tlnd
3e1101aebd fix(TUP-23588)For tCreateTable, the Database Type is always Mysql after dragging and dropping from database Metadata (#2603)
* fix(TUP-23588)For tCreateTable, the Database Type is always Mysql after
dragging and dropping from database Metadata

* fix(TUP-23588)For tCreateTable, the Database Type is always Mysql after
dragging and dropping from database Metadata
2019-07-23 10:10:43 +08:00
msjian
7dd62f1758 fix(TDQ-13393): readonly user logon remote project only can read (#2599) 2019-07-17 17:37:09 +08:00
pyzhou
5d20f69fb6 Fix(TDI-42572):upgrade EXAUtil version (#2602) 2019-07-17 10:07:20 +08:00
hzhao-talendbj
85a78d76b9 fix(TUP-23536)Component cannot share to Nexus3.15 from local (#2601) 2019-07-16 18:19:21 +08:00
jiezhang-tlnd
d26568a1f0 fix(TUP-23520)add junit (#2594) 2019-07-16 11:20:05 +08:00
zshen-talend
160da94c84 chor(TDQ-17069): remove unused code (#2522) 2019-07-15 15:53:53 +08:00
hcyi
9d3b31a842 fix(TUP-23743):ERROR when Job in MDM project calling Job in Reference DI (#2585)
project:import routines.DataQuality cannot be resolved.
2019-07-15 11:39:34 +08:00
hcyi
176e4b3f64 fix(TUP-23106):Tacokit components cannot be copy-pasted in Job Design (#2588)
* fix(TUP-23106):Tacokit components cannot be copy-pasted in Job Design

* fix(TUP-23106):Tacokit components cannot be copy-pasted in Job Design
2019-07-12 19:08:10 +08:00
sbliu
0e4896e7f9 TMDM-13549 Adapt the the dialog type and change the success connection message. 2019-07-11 08:59:34 +00:00
kjwang-talend
c907379c7b Fix TUP-22582 [CVE:high] Backend : (#2587)
pkg:maven/org.codehaus.plexus:plexus-utils:1.5.15 requires version
upgrade (Fix can't build job with sub job)
https://jira.talendforge.org/browse/TUP-22583
2019-07-10 15:08:06 +08:00
hzhao-talendbj
125546f661 fix(TUP-23701) DB connection settings screen does not display all field (#2584)
items
2019-07-10 10:30:54 +08:00
kjwang-talend
06112e76e2 Kjwang/fix tup 22582 cve plexus utils (#2581)
* Fix TUP-22582 [CVE:high] Backend :
pkg:maven/org.codehaus.plexus:plexus-utils:1.5.15 requires version
upgrade
https://jira.talendforge.org/browse/TUP-22583

* Fix TUP-22582 [CVE:high] Backend :
pkg:maven/org.codehaus.plexus:plexus-utils:1.5.15 requires version
upgrade
https://jira.talendforge.org/browse/TUP-22583

* Fix TUP-22582 [CVE:high] Backend :
pkg:maven/org.codehaus.plexus:plexus-utils:1.5.15 requires version
upgrade
https://jira.talendforge.org/browse/TUP-22583

* Fix TUP-22582 [CVE:high] Backend :
pkg:maven/org.codehaus.plexus:plexus-utils:1.5.15 requires version
upgrade
https://jira.talendforge.org/browse/TUP-22583

* Fix TUP-22582 [CVE:high] Backend :
pkg:maven/org.codehaus.plexus:plexus-utils:1.5.15 requires version
upgrade
https://jira.talendforge.org/browse/TUP-22583
2019-07-09 17:53:12 +08:00
Pingwen Lin
8648d38ee5 TMDM-13727 Remove dependency from Studio to MDM CE artifacts (#2582) 2019-07-08 14:19:45 +08:00
Zhiwei Xue
f0d02b4be9 refix assembly problem (#2578) 2019-07-05 18:14:18 +08:00
hzhao-talendbj
475dc1b0f4 fix(TUP-23363)'save the property' to metadata get error (#2574) 2019-07-05 10:50:00 +08:00
kjwang-talend
66203e0497 Fix TUP-22583 [CVE:high] Backend : pkg:maven/ch.qos.logback:logback-core:1.0.6 requires version upgrade (#2563)
* Fix TUP-22583 [CVE:high] Backend :
pkg:maven/ch.qos.logback:logback-core:1.0.6 requires version upgrade
https://jira.talendforge.org/browse/TUP-22583

* Fix TUP-22583 [CVE:high] Backend :
pkg:maven/ch.qos.logback:logback-core:1.0.6 requires version upgrade
https://jira.talendforge.org/browse/TUP-22583
2019-07-04 18:45:55 +08:00
Jane Ding
47391d8c10 fix(TUP-22200)Import XML tree from xsd file throw (#2565)
* fix(TUP-22200)Import XML tree from xsd file throw
indexOutOfBoundsException
https://jira.talendforge.org/browse/TUP-22200

* fix(TUP-22200)Import XML tree from xsd file throw
indexOutOfBoundsException
https://jira.talendforge.org/browse/TUP-22200

* fix(TUP-22200)Import XML tree from xsd file throw
indexOutOfBoundsException
https://jira.talendforge.org/browse/TUP-22200

* fix(TUP-22200)Import XML tree from xsd file throw
indexOutOfBoundsException
https://jira.talendforge.org/browse/TUP-22200
2019-07-04 10:24:43 +08:00
jiezhang-tlnd
06a591b004 fix(TUP-23371)Studio_will_dead_when_TAC_accidentally_disconnected (#2568)
* fix(TUP-23371)Studio_will_dead_when_TAC_accidentally_disconnected

* fix(TUP-23371): Studio_will_dead_when_TAC_accidentally_disconnected
https://jira.talendforge.org/browse/TUP-23371

* fix(TUP-23371)Studio will dead when TAC accidentally disconnected
https://jira.talendforge.org/browse/TUP-23371

* fix(TUP-23371)Studio will dead when TAC accidentally disconnected
https://jira.talendforge.org/browse/TUP-23371

* fix(TUP-23371)[GIT] Studio will dead when TAC accidentally disconnected
https://jira.talendforge.org/browse/TUP-23371

* fix(TUP-23371)[GIT] Studio will dead when TAC accidentally disconnected
https://jira.talendforge.org/browse/TUP-23371

* fix(TUP-23371)Studio will dead when TAC accidentally disconnected
2019-07-03 18:01:39 +08:00
Pierre Teyssier
6edb8fbcd0 TDI-42616 : bump tacokit/connector to 1.3.0-SNAPSHOT (#2572) 2019-07-03 15:20:51 +08:00
msjian
4583b8cb4c fix(TDQ-17268): for mssql datatime2 type should be interval (#2571) 2019-07-03 12:48:30 +08:00
jiezhang-tlnd
42ea72df1b fix(TUP-23520)Change schema order function doesnot work (#2543) 2019-07-03 10:48:31 +08:00
Ivan Gonchar
b6d46c501b chore(TDI-42600): upgrade Components version to 0.28.0-SNAPSHOT (#2569) 2019-07-03 09:24:48 +08:00
hcyi
85f5299f5e fix(TUP-23264):Studio can't find dependencies for tacokit components. (#2566) 2019-07-01 11:29:14 +08:00
Chao MENG
764d39dd8a fix(TUP-20577): [BUG]Cannot support 2 kinds of versions (#2554)
fix(TUP-20577): [BUG]Cannot support 2 kinds of versions
https://jira.talendforge.org/browse/TUP-20577
2019-07-01 11:10:19 +08:00
Irene Wang
97a8f63e69 Revert "DEVOPS-3416 Deploy all plugins for Black Duck scans"
This reverts commit c648e147a8.
2019-06-28 12:11:58 +02:00
538 changed files with 14692 additions and 15309 deletions

View File

@@ -51,16 +51,17 @@
fragment="true"/>
<plugin
id="org.talend.libraries.apache.lucene6"
id="org.talend.libraries.apache.lucene8"
download-size="0"
install-size="0"
version="0.0.0"/>
version="0.0.0"
unpack="true"/>
<plugin
id="org.talend.libraries.apache.lucene4"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
unpack="true"/>
</feature>

View File

@@ -20,8 +20,10 @@
<import plugin="org.apache.servicemix.bundles.avro" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.commons.configuration" version="2.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.talend.daikon" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.daikon.exception" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.daikon.crypto.utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
</feature>

View File

@@ -114,6 +114,9 @@ public class CommonsPlugin implements BundleActivator {
return Boolean.getBoolean("junit_test"); //$NON-NLS-1$
}
public static boolean isTUJTest() {
return "org.talend.rcp.branding.tuj.product".equals(Platform.getProduct().getId()); //$NON-NLS-1$
}
/**
* Answer the file associated with name. This handles the case of running as a plugin and running standalone which

View File

@@ -58,3 +58,6 @@ AS400ResultSet.unknowCloumn=Invalid argument\: unknown column name
AS400ResultSet.parameterIndex=Invalid argument\: parameter index
AS400ResultSet.outofRange=\ is out of range.
ITaCoKitService.exception.multipleInstance=More than one instance found: {0}
TalendProxySelector.exception.badUriMap=Bad uri map: {0}
TalendProxySelector.exception.proxySelectionError=Error occurs when selecting proxy for {0}

View File

@@ -21,29 +21,23 @@ import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import org.apache.commons.codec.binary.Base64;
import org.talend.utils.security.AESEncryption;
import org.talend.utils.security.StudioEncryption;
/**
* DOC chuang class global comment. Detailled comment
*/
public class PasswordEncryptUtil {
public static String ENCRYPT_KEY = "Encrypt"; //$NON-NLS-1$
private static String rawKey = "Talend-Key"; //$NON-NLS-1$
public static String PREFIX_PASSWORD = "ENC:["; //$NON-NLS-1$
public static String POSTFIX_PASSWORD = "]"; //$NON-NLS-1$
public static final String ENCRYPT_KEY = "Encrypt"; //$NON-NLS-1$
private static SecretKey key = null;
private static SecureRandom secureRandom = new SecureRandom();
private static final SecureRandom SECURERANDOM = new SecureRandom();
private static SecretKey getSecretKey() throws Exception {
if (key == null) {
byte rawKeyData[] = rawKey.getBytes();
byte rawKeyData[] = StudioEncryption.getKeySource(StudioEncryption.EncryptionKeyName.MIGRATION.toString(), false)
.getKey();
DESKeySpec dks = new DESKeySpec(rawKeyData);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); //$NON-NLS-1$
key = keyFactory.generateSecret(dks);
@@ -65,7 +59,7 @@ public class PasswordEncryptUtil {
SecretKey key = getSecretKey();
Cipher c = Cipher.getInstance("DES"); //$NON-NLS-1$
c.init(Cipher.ENCRYPT_MODE, key, secureRandom);
c.init(Cipher.ENCRYPT_MODE, key, SECURERANDOM);
byte[] cipherByte = c.doFinal(input.getBytes());
String dec = new String(Base64.encodeBase64(cipherByte));
return dec;
@@ -85,7 +79,7 @@ public class PasswordEncryptUtil {
byte[] dec = Base64.decodeBase64(input.getBytes());
SecretKey key = getSecretKey();
Cipher c = Cipher.getInstance("DES"); //$NON-NLS-1$
c.init(Cipher.DECRYPT_MODE, key, secureRandom);
c.init(Cipher.DECRYPT_MODE, key, SECURERANDOM);
byte[] clearByte = c.doFinal(dec);
return new String(clearByte);
}
@@ -99,7 +93,7 @@ public class PasswordEncryptUtil {
if (input == null) {
return input;
}
return PREFIX_PASSWORD + AESEncryption.encryptPassword(input) + POSTFIX_PASSWORD;
return StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.ROUTINE).encrypt(input);
}
/**

View File

@@ -19,6 +19,7 @@ import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
@@ -192,6 +193,27 @@ public class VersionUtils {
return talendVersion;
}
public static String getTalendPureVersion(String fullProductVersion) {
String version = fullProductVersion;
String[] splitStr = fullProductVersion.split("-"); //$NON-NLS-1$
Pattern pattern = Pattern.compile("((\\d+\\.){2}\\d.*)"); //$NON-NLS-1$
StringBuffer versionStr = new StringBuffer();
boolean find = false;
for (String str : splitStr) {
if (find) {
versionStr.append("-").append(str); //$NON-NLS-1$
}else {
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
find = true;
versionStr.append(str); // $NON-NLS-1$
}
}
}
return getTalendVersion(versionStr.toString());
}
public static String getTalendVersion(String productVersion) {
try {
org.osgi.framework.Version v = new org.osgi.framework.Version(productVersion);

View File

@@ -342,7 +342,7 @@ public class CharsetToolkit {
return (buffer[0] == -2 && buffer[1] == -1);
}
public static String getCharset(File file){
public static String getCharset(File file) {
String charset = "UTF-8";
byte[] fileContent = null;
FileInputStream fin = null;
@@ -350,11 +350,18 @@ public class CharsetToolkit {
fin = new FileInputStream(file.getPath());
fileContent = new byte[(int) file.length()];
fin.read(fileContent);
byte[] data = fileContent;
byte[] data = fileContent;
charset = getCharset(data);
} catch (IOException e) {
charset = "UTF-8";
} finally {
if (fin != null) {
try {
fin.close();
} catch (IOException e) {
// Ignore here
}
}
}
return charset;
}

View File

@@ -10,36 +10,32 @@
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.updates.runtime.ui.feature.model.impl;
package org.talend.commons.utils.network;
import org.talend.updates.runtime.model.ExtraFeature;
import org.talend.updates.runtime.ui.feature.model.IFeatureItem;
import java.io.IOException;
import java.net.SocketAddress;
import java.net.URI;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.ExceptionHandler;
/**
* DOC cmeng class global comment. Detailled comment
*/
public abstract class AbstractFeatureItem implements IFeatureItem {
public abstract class AbstractProxySelectorProvider implements IProxySelectorProvider {
private String title;
private ExtraFeature feature;
private boolean isDebugMode = CommonsPlugin.isDebugMode();
@Override
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
public Object getKey() {
return this;
}
@Override
public ExtraFeature getFeature() {
return feature;
public void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe) {
if (isDebugMode) {
ExceptionHandler.process(ioe);
}
}
public void setFeature(ExtraFeature feature) {
this.feature = feature;
}
}

View File

@@ -10,21 +10,25 @@
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.updates.runtime.ui.feature.form.listener;
package org.talend.commons.utils.network;
import org.eclipse.jface.operation.IRunnableWithProgress;
import java.io.IOException;
import java.net.Proxy;
import java.net.SocketAddress;
import java.net.URI;
import java.util.List;
/**
* DOC cmeng class global comment. Detailled comment
*/
public interface ICheckListener {
public interface IProxySelectorProvider {
public void showMessage(String message, int level);
Object getKey();
public String getMessage();
boolean canHandle(final URI uri);
public void updateButtons();
List<Proxy> select(final URI uri);
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws Exception;
void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe);
}

View File

@@ -49,9 +49,10 @@ public class NetworkUtil {
if ("true".equals(disableInternet)) { //$NON-NLS-1$
return false;
}
HttpURLConnection conn = null;
try {
URL url = new URL(HTTP_NETWORK_URL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(4000);
conn.setReadTimeout(4000);
@@ -63,9 +64,36 @@ public class NetworkUtil {
if (strMessage.equals("OK")) { //$NON-NLS-1$
return true;
}
conn.disconnect();
} catch (Exception e) {
return false;
} finally {
conn.disconnect();
}
return true;
}
public static boolean isNetworkValid(String url) {
if (url == null) {
return isNetworkValid();
}
return checkValidWithHttp(url);
}
private static boolean checkValidWithHttp(String urlString) {
HttpURLConnection conn = null;
try {
URL url = new URL(urlString);
conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(4000);
conn.setReadTimeout(4000);
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
conn.getResponseMessage();
} catch (Exception e) {
// if not reachable , will throw exception(time out/unknown host) .So if catched exception, make it a
// invalid server
return false;
} finally {
conn.disconnect();
}
return true;
}

View File

@@ -13,37 +13,155 @@
package org.talend.commons.utils.network;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.SocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Priority;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.i18n.internal.Messages;
/**
* DOC cmeng class global comment. Detailled comment
*/
public class TalendProxySelector extends ProxySelector {
public static final String PROP_PRINT_LOGS = "talend.studio.proxy.printLogs";
private static final String ECLIPSE_PROXY_SELECTOR = ".EclipseProxySelector"; //$NON-NLS-1$
private static final String PROP_ALLOW_PROXY_REDIRECT = "talend.studio.proxy.allowProxyRedirect";
private static final String PROP_ALLOW_PROXY_REDIRECT_EXCLUDE = "talend.studio.proxy.redirect.whiteList";
private static final String PROP_PROXY_HOST_MAP = "talend.studio.proxy.hostMap";
private static final String PROP_DISABLE_DEFAULT_SELECTOR = "talend.studio.proxy.disableDefaultSelector";
/**
* Example: update.talend.com,socket:http,https:http;nexus.talend.com,socket,http;,socket:http
*/
private static final String PROP_PROXY_MAP_HOST_DEFAULT = "";
/**
* Example: svn.company.com;nexus.company.com
*/
private static final String PROP_ALLOW_PROXY_REDIRECT_EXCLUDE_DEFAULT = "";
private static final String KEY_DEFAULT = ":default:";
private ProxySelector defaultSelector;
final private List<IProxySelectorProvider> selectorProviders;
final private Map<Object, Collection<IProxySelectorProvider>> selectorProviders;
private Map<String, Map<String, String>> hostMap;
private Set<String> redirectWhiteList;
private volatile static TalendProxySelector instance;
private static Object instanceLock = new Object();
private boolean printProxyLog = false;
private boolean allowProxyRedirect = false;
private boolean disableDefaultSelector = false;
private TalendProxySelector(final ProxySelector defaultSelector) {
this.defaultSelector = defaultSelector;
selectorProviders = new ArrayList<>();
selectorProviders = Collections.synchronizedMap(new HashMap<>());
allowProxyRedirect = Boolean.valueOf(System.getProperty(PROP_ALLOW_PROXY_REDIRECT, Boolean.FALSE.toString()));
disableDefaultSelector = Boolean.valueOf(System.getProperty(PROP_DISABLE_DEFAULT_SELECTOR, Boolean.FALSE.toString()));
printProxyLog = Boolean.valueOf(System.getProperty(PROP_PRINT_LOGS, Boolean.FALSE.toString()));
initHostMap();
initRedirectList();
}
private void initHostMap() {
try {
hostMap = new HashMap<>();
String property = System.getProperty(PROP_PROXY_HOST_MAP, PROP_PROXY_MAP_HOST_DEFAULT);
if (StringUtils.isEmpty(property)) {
return;
}
String[] splits = property.split(";");
for (String split : splits) {
try {
int index = split.indexOf(',');
String uri = split.substring(0, index);
String key = StringUtils.strip(uri);
if (StringUtils.isBlank(key)) {
key = KEY_DEFAULT;
}
key = key.toLowerCase();
Map<String, String> protocolMap = hostMap.get(key);
if (protocolMap == null) {
protocolMap = new HashMap<>();
hostMap.put(key, protocolMap);
}
int protocolMapIndex = index + 1;
String protocolMapStr = split.substring(protocolMapIndex);
String[] entry = protocolMapStr.split(",");
for (String pMap : entry) {
try {
String[] mapEntry = pMap.split(":");
if (mapEntry.length != 2) {
ExceptionHandler.process(
new Exception(Messages.getString("TalendProxySelector.exception.badUriMap", pMap)));
continue;
}
protocolMap.put(mapEntry[0].toLowerCase(), mapEntry[1].toLowerCase());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
private void initRedirectList() {
try {
redirectWhiteList = new HashSet<>();
String property = System.getProperty(PROP_ALLOW_PROXY_REDIRECT_EXCLUDE, PROP_ALLOW_PROXY_REDIRECT_EXCLUDE_DEFAULT);
if (StringUtils.isEmpty(property)) {
return;
}
String[] split = property.split(";");
for (String host : split) {
host = StringUtils.strip(host);
if (StringUtils.isBlank(host)) {
host = KEY_DEFAULT;
}
redirectWhiteList.add(host);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
public static TalendProxySelector getInstance() {
@@ -81,8 +199,109 @@ public class TalendProxySelector extends ProxySelector {
@Override
public List<Proxy> select(final URI uri) {
final Set<Proxy> resultFromProviders = new HashSet<>();
List<IProxySelectorProvider> providers = getProxySelectorProviders();
Set<Proxy> results = new LinkedHashSet<>();
try {
final Set<Proxy> resultFromProviders = getProxysFromProviders(uri);
if (resultFromProviders != null && !resultFromProviders.isEmpty()) {
results.addAll(resultFromProviders);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
ProxySelector defaultProxySelector = getDefaultProxySelector();
if (defaultProxySelector != null) {
URI newUri = getNewUri(uri);
List<Proxy> defaultProxys = defaultProxySelector.select(newUri);
try {
results.addAll(filterProxys(uri, defaultProxys));
} catch (Exception e) {
results.addAll(defaultProxys);
ExceptionHandler.process(e);
}
}
if (printProxyLog) {
String proxys = results.toString();
ExceptionHandler.log("Selected proxys for " + uri + ", " + proxys);
ExceptionHandler.process(new Exception("Proxy call stacks"), Priority.INFO);
}
return new LinkedList<Proxy>(results);
}
private List<Proxy> filterProxys(final URI uri, List<Proxy> defaultProxys) {
List<Proxy> result = new ArrayList<>();
if (defaultProxys != null && !defaultProxys.isEmpty()) {
for (Proxy proxy : defaultProxys) {
SocketAddress addr = null;
Proxy.Type proxyType = null;
if (proxy != null) {
proxyType = proxy.type();
addr = proxy.address();
}
boolean redirect = true;
if (!allowProxyRedirect) {
String host = uri.getHost();
if (host == null) {
host = "";
}
host = StringUtils.strip(host).toLowerCase();
if (this.redirectWhiteList.contains(host) || this.redirectWhiteList.contains(KEY_DEFAULT)) {
redirect = true;
} else if (Proxy.Type.DIRECT == proxyType
|| (addr != null && StringUtils.equals(uri.getHost(), ((InetSocketAddress) addr).getHostString()))) {
redirect = false;
}
}
if (redirect) {
result.add(proxy);
} else {
result.add(Proxy.NO_PROXY);
}
}
}
return result;
}
private URI getNewUri(URI uri) {
URI newUri = uri;
if (newUri != null) {
String host = newUri.getHost();
Map<String, String> protocolMap = null;
if (StringUtils.isNotBlank(host)) {
protocolMap = hostMap.get(host.toLowerCase());
}
if (protocolMap == null) {
protocolMap = hostMap.get(KEY_DEFAULT);
}
if (protocolMap != null) {
String schema = newUri.getScheme();
if (schema != null) {
String lowercasedProtocol = schema.toLowerCase();
String preferedProtocol = protocolMap.get(lowercasedProtocol);
if (StringUtils.isNotBlank(preferedProtocol)) {
try {
newUri = new URI(preferedProtocol, newUri.getUserInfo(), newUri.getHost(), newUri.getPort(),
newUri.getPath(), newUri.getQuery(), newUri.getFragment());
} catch (URISyntaxException e) {
if (printProxyLog) {
ExceptionHandler.process(new Exception(
Messages.getString("TalendProxySelector.exception.proxySelectionError", newUri), e),
Priority.WARN);
}
}
}
}
}
}
return newUri;
}
private Set<Proxy> getProxysFromProviders(final URI uri) {
final Set<Proxy> resultFromProviders = new LinkedHashSet<>();
Collection<IProxySelectorProvider> providers = getCustomProviders(uri);
if (providers != null) {
providers.stream().forEach(p -> {
if (instance == p) {
@@ -100,36 +319,79 @@ public class TalendProxySelector extends ProxySelector {
}
});
}
List<Proxy> result = new ArrayList<>();
return resultFromProviders;
}
if (resultFromProviders != null && !resultFromProviders.isEmpty()) {
result.addAll(resultFromProviders);
}
ProxySelector defaultProxySelector = getDefaultProxySelector();
if (defaultProxySelector != null) {
List<Proxy> defaultProxys = defaultProxySelector.select(uri);
if (defaultProxys != null && !defaultProxys.isEmpty()) {
result.addAll(defaultProxys);
private Collection<IProxySelectorProvider> getCustomProviders(final URI uri) {
Collection<IProxySelectorProvider> providers = Collections.EMPTY_LIST;
Collection<Object> possibleKeys = getPossibleKeys(uri);
for (Object key : possibleKeys) {
providers = this.selectorProviders.get(key);
if (providers != null) {
break;
}
}
return result;
return providers;
}
public PasswordAuthentication getHttpPasswordAuthentication() {
String[] schemas = new String[] { "http", "https" };
for (String schema : schemas) {
String proxyUser = System.getProperty(schema + ".proxyUser");
String proxyPassword = System.getProperty(schema + ".proxyPassword");
if (StringUtils.isNotBlank(proxyUser)) {
char[] pwdChars = new char[0];
if (proxyPassword != null && !proxyPassword.isEmpty()) {
pwdChars = proxyPassword.toCharArray();
}
return new PasswordAuthentication(proxyUser, pwdChars);
}
}
return null;
}
public boolean addProxySelectorProvider(IProxySelectorProvider provider) {
List<IProxySelectorProvider> proxySelectorProviders = getProxySelectorProviders();
if (!proxySelectorProviders.contains(provider)) {
return proxySelectorProviders.add(provider);
try {
Object key = provider.getKey();
Collection<IProxySelectorProvider> collection = this.selectorProviders.get(key);
if (collection == null) {
synchronized (this.selectorProviders) {
collection = this.selectorProviders.get(key);
if (collection == null) {
collection = Collections.synchronizedList(new LinkedList<>());
this.selectorProviders.put(key, collection);
}
}
}
collection.add(provider);
return true;
} catch (Exception e) {
ExceptionHandler.process(e);
}
return false;
}
public boolean removeProxySelectorProvider(IProxySelectorProvider provider) {
return getProxySelectorProviders().remove(provider);
}
private List<IProxySelectorProvider> getProxySelectorProviders() {
return selectorProviders;
try {
Object key = provider.getKey();
Collection<IProxySelectorProvider> collection = this.selectorProviders.get(key);
if (collection != null) {
synchronized (this.selectorProviders) {
collection = this.selectorProviders.get(key);
if (collection != null) {
collection.remove(provider);
if (collection.isEmpty()) {
this.selectorProviders.remove(key);
}
}
}
}
return true;
} catch (Exception e) {
ExceptionHandler.process(e);
}
return false;
}
public ProxySelector getDefaultProxySelector() {
@@ -142,7 +404,7 @@ public class TalendProxySelector extends ProxySelector {
@Override
public void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe) {
List<IProxySelectorProvider> providers = getProxySelectorProviders();
Collection<IProxySelectorProvider> providers = getCustomProviders(uri);
if (providers != null) {
providers.stream().forEach(p -> {
if (p.canHandle(uri)) {
@@ -157,23 +419,111 @@ public class TalendProxySelector extends ProxySelector {
}
}
public static abstract class AbstractProxySelectorProvider implements IProxySelectorProvider {
public IProxySelectorProvider createDefaultProxySelectorProvider() {
if (disableDefaultSelector) {
return null;
}
return new DefaultProxySelectorProvider(Thread.currentThread());
}
public IProxySelectorProvider createDefaultProxySelectorProvider(String host) {
if (disableDefaultSelector) {
return null;
}
return new DefaultProxySelectorProvider(host);
}
public static Collection<Object> getPossibleKeys(URI uri) {
Collection<Object> possibleKeys = new ArrayList<>();
possibleKeys.add(Thread.currentThread());
if (uri != null) {
String uriHost = uri.getHost();
if (StringUtils.isNotBlank(uriHost)) {
possibleKeys.add(uriHost);
}
}
return possibleKeys;
}
private class DefaultProxySelectorProvider extends AbstractProxySelectorProvider {
private Thread currentThread = null;
private String host = null;
public DefaultProxySelectorProvider(Thread thread) {
this.currentThread = thread;
}
public DefaultProxySelectorProvider(String host) {
this.host = host;
if (StringUtils.isNotBlank(this.host)) {
this.host = this.host.toLowerCase();
}
}
@Override
public void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe) {
// nothing to do
public Object getKey() {
if (this.currentThread != null) {
return currentThread;
}
if (this.host != null) {
return this.host;
}
return super.getKey();
}
@Override
public boolean canHandle(URI uri) {
if (disableDefaultSelector) {
return false;
}
if (currentThread != null && Thread.currentThread() == currentThread) {
return true;
}
if (host != null) {
if (uri == null) {
return false;
}
String uriHost = uri.getHost();
if (StringUtils.isNotBlank(uriHost)) {
return this.host.equals(uriHost.toLowerCase());
}
return false;
}
return false;
}
@Override
public List<Proxy> select(URI uri) {
List<Proxy> result = new ArrayList<>();
try {
ProxySelector defaultProxySelector = getDefaultProxySelector();
if (defaultProxySelector != null) {
List<Proxy> defaultProxys = defaultProxySelector.select(uri);
if (defaultProxys != null && !defaultProxys.isEmpty()) {
for (Proxy proxy : defaultProxys) {
SocketAddress addr = null;
Proxy.Type proxyType = null;
if (proxy != null) {
proxyType = proxy.type();
addr = proxy.address();
}
if (Proxy.Type.DIRECT == proxyType || (addr != null
&& StringUtils.equals(uri.getHost(), ((InetSocketAddress) addr).getHostString()))) {
result.add(Proxy.NO_PROXY);
} else {
result.add(proxy);
}
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
return result;
}
}
public static interface IProxySelectorProvider {
boolean canHandle(final URI uri);
List<Proxy> select(final URI uri);
void connectFailed(final URI uri, final SocketAddress sa, final IOException ioe);
}
}

View File

@@ -136,3 +136,4 @@ ArchiveDirectoryChooser.DataTransfer_browse=B&rowse...
ArchiveDirectoryChooser.WizardProjectsImportPage_ArchiveSelectTitle=Select &archive file:
ArchiveDirectoryChooser.FileExport_selectDestinationMessage=Select a directory to export to.
ArchiveDirectoryChooser.ArchiveExport_description=Export resources to an archive file on the local file system.
DisplayUtils.NotSupportedExceptionOnLinux=Linux/Unit doesn't support multiple display.

View File

@@ -20,6 +20,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.ui.i18n.Messages;
import org.talend.commons.utils.system.EnvironmentUtils;
/**
* Utility methods to work with Display object
@@ -128,6 +130,13 @@ public class DisplayUtils {
}
public static void syncExecInNewUIThread(Runnable runnable, DeviceData deviceData) throws Exception {
/**
* Linux doesn't allow creating a display instance in a new thread after upgrading eclipse platform 4.10, we can
* remove this check if future eclipse version support it again
*/
if (EnvironmentUtils.isLinuxUnixSystem()) {
throw new UnsupportedOperationException(Messages.getString("DisplayUtils.NotSupportedExceptionOnLinux"));//$NON-NLS-1$
}
final Semaphore semaphore = new Semaphore(1, true);
semaphore.acquire();
Thread thread = new Thread(new Runnable() {

View File

@@ -22,6 +22,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Tree;
@@ -111,7 +112,7 @@ public class BackgroundRefresher implements IBackgroundRefresher {
*/
@Override
protected void execute(final boolean isFinalExecution, Object data) {
drawableComposite.getBgDrawableComposite().getDisplay().syncExec(new Runnable() {
Display.getDefault().syncExec(new Runnable() {
public void run() {
if (isFinalExecution) {
@@ -339,7 +340,7 @@ public class BackgroundRefresher implements IBackgroundRefresher {
}
if ((WindowSystem.isGTK() || EnvironmentUtils.isMacOsSytem()) && child instanceof Tree) {
returnedPoint.y += ((Tree) child).getHeaderHeight();
returnedPoint.y += ((Table) child).getItemHeight();
returnedPoint.y += ((Tree) child).getItemHeight();
}
child = child.getParent();
ScrollBar vScrollBar = child.getVerticalBar();

View File

@@ -33,6 +33,7 @@ import org.eclipse.swt.widgets.TreeItem;
import org.talend.commons.ui.runtime.i18n.Messages;
import org.talend.commons.ui.runtime.utils.TableUtils;
import org.talend.commons.ui.runtime.ws.WindowSystem;
import org.talend.commons.ui.swt.advanced.dataeditor.AbstractDataTableEditorView;
import org.talend.commons.ui.swt.drawing.background.IBackgroundRefresher;
import org.talend.commons.ui.swt.drawing.background.IBgDrawableComposite;
import org.talend.commons.ui.swt.drawing.link.BezierHorizontalLink;
@@ -464,4 +465,19 @@ public class TreeToTablesLinker<D1, D2> extends BgDrawableComposite implements I
}
}
protected <B> void loadItemDataForLazyLoad(AbstractDataTableEditorView<B> tableEditorView) {
if (!tableEditorView.getTableViewerCreator().isLazyLoad()) {
return;
}
List<B> beansList = tableEditorView.getExtendedTableModel().getBeansList();
Table table = tableEditorView.getTable();
for (TableItem tableItem : table.getItems()) {
if (tableItem.getData() == null) {
int index = table.indexOf(tableItem);
B schemaTarget = beansList.get(index);
tableItem.setData(schemaTarget);
}
}
}
}

View File

@@ -212,4 +212,5 @@ RenameFolderAction.warning.cannotFind.message=Cannot rename folder, it may have
RenameFolderAction.warning.cannotFind.title=Action not available
ConvertJobsUtil.warning.title=Warning
ConvertJobsUtil.warning.message=The target framework is not fully supported for this release.
ConvertJobsUtil.warning.message=The target framework is not fully supported for this release.
SyncLibrariesLoginTask.createStatsLogAndImplicitParamter=Create stats log and implicit parameters

View File

@@ -2,12 +2,25 @@ package org.talend.core.repository.logintask;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResourceRuleFactory;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.LoginException;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ICoreService;
import org.talend.core.repository.i18n.Messages;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.repository.utils.ProjectDataJsonProvider;
import org.talend.login.AbstractLoginTask;
import org.talend.repository.ProjectManager;
import org.talend.repository.RepositoryWorkUnit;
public class SyncLibrariesLoginTask extends AbstractLoginTask implements IRunnableWithProgress {
@@ -20,7 +33,38 @@ public class SyncLibrariesLoginTask extends AbstractLoginTask implements IRunnab
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
coreService.createStatsLogAndImplicitParamter(ProjectManager.getInstance().getCurrentProject());
try {
if (ProjectDataJsonProvider.hasFilledProjectSettingFile(ProjectManager.getInstance().getCurrentProject())) {
return;
}
} catch (PersistenceException e1) {
ExceptionHandler.process(e1);
return;
}
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(
new RepositoryWorkUnit<Void>(Messages.getString("SyncLibrariesLoginTask.createStatsLogAndImplicitParamter")) {
@Override
protected void run() throws LoginException, PersistenceException {
try {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IResourceRuleFactory ruleFactory = workspace.getRuleFactory();
ProjectManager projectManager = ProjectManager.getInstance();
ISchedulingRule refreshRule = ruleFactory.refreshRule(
projectManager.getResourceProject(projectManager.getCurrentProject().getEmfProject()));
workspace.run(new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
coreService
.createStatsLogAndImplicitParamter(ProjectManager.getInstance().getCurrentProject());
}
}, refreshRule, IWorkspace.AVOID_UPDATE, monitor);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
});
}
}

View File

@@ -215,8 +215,18 @@ public interface IRepositoryFactory {
public void deleteObjectPhysical(Project project, IRepositoryViewObject objToDelete, String version,
boolean fromEmptyRecycleBin, boolean isDeleteOnRemote) throws PersistenceException;
public void batchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList, boolean isDeleteOnRemote)
throws PersistenceException;
/**
*
* Batch delete the object of the given object list.
*
* @param project - The object's project.
* @param objToDeleteList - The objects list.
* @param isDeleteAllVersion - True: delete all version by object id; False: delete object by id and version.
* @param isDeleteOnRemote
* @throws PersistenceException
*/
public void batchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
boolean isDeleteAllVersion, boolean isDeleteOnRemote) throws PersistenceException;
/**
* Restore a logically deleted object. <code>isDeleted</code> on this object will now returned <code>false</code>.

View File

@@ -774,6 +774,20 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
log.info(Messages.getString("ProxyRepositoryFactory.log.physicalDeletion", str)); //$NON-NLS-1$
}
/*
* (non-Javadoc)
*
* @see
* org.talend.repository.model.IProxyRepositoryFactory#forceBatchDeleteObjectPhysical(org.talend.core.model.general.
* Project, java.util.List, boolean, boolean)
*/
@Override
public void forceBatchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
boolean isDeleteAllVersion, boolean isDeleteOnRemote) throws PersistenceException {
this.repositoryFactoryFromProvider.batchDeleteObjectPhysical(project, objToDeleteList, isDeleteAllVersion,
isDeleteOnRemote);
}
/*
* (non-Javadoc)
*
@@ -932,7 +946,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
.getService(IRunProcessService.class);
service.batchDeleteAllVersionTalendJobProject(idList);
}
this.repositoryFactoryFromProvider.batchDeleteObjectPhysical(project, repositoryObjectList, false);
this.repositoryFactoryFromProvider.batchDeleteObjectPhysical(project, repositoryObjectList, true, false);
// save project will handle git/svn update
this.repositoryFactoryFromProvider.saveProject(project);

View File

@@ -406,6 +406,38 @@ public class ProjectDataJsonProvider {
return null;
}
public static boolean hasFilledProjectSettingFile(org.talend.core.model.general.Project project) throws PersistenceException {
FileInputStream InputStream = null;
boolean hasFilled = false;
try {
IProject physProject = ResourceUtils.getProject(project);
IPath location = physProject.getLocation();
File file = ProjectDataJsonProvider.getLoadingConfigurationFile(location, FileConstants.PROJECTSETTING_FILE_NAME);
if (file != null && file.exists()) {
InputStream = new FileInputStream(file);
ProjectSettings projectSetting = new ObjectMapper().readValue(new FileInputStream(file), ProjectSettings.class);
if (projectSetting != null) {
ImplicitContextSettingJson implicitContextSettingJson = projectSetting.getImplicitContextSettingJson();
if (implicitContextSettingJson != null) {
ParametersTypeJson parametersTypeJson = implicitContextSettingJson.getParametersTypeJson();
if (parametersTypeJson != null) {
List<ElementParameterTypeJson> elementParameters = parametersTypeJson.getElementParameters();
if (elementParameters.size() > 0) {
hasFilled = true;
}
}
}
}
}
} catch (Exception e1) {
throw new PersistenceException(e1);
} finally {
closeInputStream(InputStream);
}
return hasFilled;
}
protected static ImplicitContextSettingJson getImplicitContextSettingJson(ImplicitContextSettings implicitContextSettings) {
if (implicitContextSettings != null) {
ImplicitContextSettingJson implicitContextSettingJson = new ImplicitContextSettingJson(implicitContextSettings);

View File

@@ -131,4 +131,22 @@ public class ProjectHelper {
}
return null;
}
/**
* define the different value for the project types the string value in the licence files Matcht the java enum name
* this is a copy of org.talend.commons.model.KeyConstants.ProjectType to avoid adding the all library
*
*/
public static enum ProjectType {
DI,
DQ,
MDM;
}
public static int getProjectTypeOrdinal(org.talend.core.model.properties.Project project) {
if (project != null && project.getType() != null) {
return ProjectType.valueOf(project.getType()).ordinal();
}
return 0;
}
}

View File

@@ -97,7 +97,7 @@
<dbType type="CHAR"/>
<dbType type="NCHAR"/>
<dbType type="LONG"/>
<dbtype type="CLOB"/>
<dbType type="CLOB"/>
</talendType>
</talendToDbTypes>
<dbToTalendTypes><!-- Adviced mappings -->

View File

@@ -29,6 +29,8 @@
<dbType type="xs:time" ignoreLen="true" ignorePre="true"/>
<dbType type="xs:decimal" ignoreLen="true" ignorePre="true"/>
<dbType type="xs:QName" ignoreLen="true" ignorePre="true"/>
<dbType type="xs:list" ignoreLen="true" ignorePre="true"/>
<dbType type="xs:union" ignoreLen="true" ignorePre="true"/>
</dbTypes>
<language name="java">
@@ -141,6 +143,12 @@
<dbType type="xs:time">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="xs:list">
<talendType type="id_List" default="true" />
</dbType>
<dbType type="xs:union">
<talendType type="id_Object" default="true" />
</dbType>
</dbToTalendTypes>
</language>
</dbms>

View File

@@ -12,11 +12,14 @@
// ============================================================================
package org.talend.core;
import java.util.List;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.utils.IXSDPopulationUtil;
@@ -47,6 +50,8 @@ public interface IESBService extends IService {
public StringBuffer getAllTheJObNames(IRepositoryNode jobList);
public List<String> getSerivceRelatedJobIds(Item serviceItem);
public void deleteOldRelation(String jobID);
// public void setSelectedItem(Item, )
@@ -59,6 +64,8 @@ public interface IESBService extends IService {
public void copyDataServiceRelateJob(Item newItem);
public boolean isRESTService(ProcessItem processItem);
public IXSDPopulationUtil getXSDPopulationUtil();
public boolean isWSDLEditor(IWorkbenchPart part);

View File

@@ -89,6 +89,8 @@ public interface ILibraryManagerService extends IService {
* @return
*/
public boolean retrieve(String jarNeeded, String pathToStore, IProgressMonitor... monitorWrap);
public boolean retrieve(String jarNeeded, String jarURL, String pathToStore, IProgressMonitor... monitorWrap);
public boolean retrieve(String jarNeeded, String pathToStore, boolean showDialog, IProgressMonitor... monitorWrap);
@@ -206,8 +208,12 @@ public interface ILibraryManagerService extends IService {
*/
public boolean isJarNeedToBeDeployed(File jarFile);
public boolean isSameFile(File f1, File f2);
public void checkModuleStatus(ModuleNeeded module);
public String getJarNameFromMavenuri(String mavenURI);
public void guessMavenRUIFromIndex(File jarFile, Map<String, String> sourceAndMavenUri);
}

View File

@@ -210,4 +210,9 @@ public interface ITDQRepositoryService extends IService {
* @param ruManager: RepositoryUpdateManager
*/
void updateAllContextInAnalysisAndReport(RepositoryUpdateManager ruManager, Object parameter, boolean isUpdated);
/**
* @param chooseContext the context name which want to swtich
*/
void popupSwitchContextFailedMessage(String chooseContext);
}

View File

@@ -316,7 +316,7 @@ public class ClassLoaderFactory {
String jarsStr = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS);
moduleList = jarsStr.split(";"); //$NON-NLS-1$
} else {
String index = getDistributionIndex(metadataConn); //$NON-NLS-1$
String index = getDistributionIndex(metadataConn);
moduleList = getDriverModuleList(index);
}
return moduleList;
@@ -365,39 +365,41 @@ public class ClassLoaderFactory {
return hdClassLoader;
}
private static synchronized IConfigurationElement[] getConfigurationElements() {
if (isCacheChanged()) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT_ID);
}
private static IConfigurationElement[] getConfigurationElements() {
checkCache();
return configurationElements;
}
private static boolean isCacheChanged() {
if (classLoadersMap == null) {
return true;
}
if (configurationElements == null) {
return true;
}
private synchronized static void checkCache() {
boolean isCacheChanged = false;
if (configurationElements != null) {
for (IConfigurationElement configElement : configurationElements) {
if (!configElement.isValid()) {
return true;
isCacheChanged = true;
}
}
}
if (cacheVersion != null && !cacheVersion.equals(BigDataBasicUtil.getDynamicDistributionCacheVersion())) {
return true;
if (!StringUtils.equals(cacheVersion, BigDataBasicUtil.getDynamicDistributionCacheVersion())) {
isCacheChanged = true;
}
if (isCacheChanged) {
init();
IExtensionRegistry registry = Platform.getExtensionRegistry();
configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT_ID);
cacheVersion = BigDataBasicUtil.getDynamicDistributionCacheVersion();
} else {
if (classLoadersMap == null) {
init();
}
if (configurationElements == null) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT_ID);
}
}
return false;
}
private static Map<String, DynamicClassLoader> getClassLoaderMap() {
if (isCacheChanged()) {
init();
cacheVersion = BigDataBasicUtil.getDynamicDistributionCacheVersion();
}
checkCache();
return classLoadersMap;
}
}

View File

@@ -47,6 +47,8 @@ public class DatabaseConnStrUtil {
// for match url has :<port> exist
private static final String PATTERN_PORT = "(:\\d{1,5})";
private static final String DATABASE_STRING = "DATABASE=";
private static String getStringReplace(final String init, final String before, final String after,
final boolean supportContext) {
return getStringReplace(init, before, after, supportContext, false);
@@ -127,6 +129,13 @@ public class DatabaseConnStrUtil {
} else {
s = getStringReplace(s, EDatabaseConnVar.PORT.getVariable(), port, supportContext);
}
if (EDatabaseConnTemplate.TERADATA.equals(connStr)) {
if (StringUtils.isNotBlank(sid)) {
s = getStringReplace(s, EDatabaseConnVar.SID.getVariable(), DATABASE_STRING + sid, supportContext);
} else {
s = getStringReplace(s, EDatabaseConnVar.SID.getVariable() + ",", sid, supportContext); //$NON-NLS-1$
}
}
s = getStringReplace(s, EDatabaseConnVar.SID.getVariable(), sid, supportContext);
s = getStringReplace(s, EDatabaseConnVar.SERVICE_NAME.getVariable(), sid, supportContext);
s = getStringReplace(s, EDatabaseConnVar.DATASOURCE.getVariable(), datasource, supportContext);
@@ -565,7 +574,7 @@ public class DatabaseConnStrUtil {
List<ERepositoryObjectType> extraTypes = new ArrayList<>();
IGenericDBService dbService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericDBService.class)) {
dbService = (IGenericDBService) GlobalServiceRegister.getDefault().getService(IGenericDBService.class);
dbService = GlobalServiceRegister.getDefault().getService(IGenericDBService.class);
}
if (dbService != null) {
extraTypes.addAll(dbService.getExtraTypes());

View File

@@ -107,7 +107,7 @@ public enum EDatabaseVersion4Drivers {
PLUSPSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL,
"Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9.X", "V9_X", "postgresql-9.4-1201.jdbc41.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-9.4-1201.jdbc41.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IBMDB2(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
"db2jcc_license_cisuz.jar" })), //$NON-NLS-1$
IBMDB2ZOS(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2ZOS, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
@@ -164,11 +164,11 @@ public enum EDatabaseVersion4Drivers {
MAPRDB(new DbVersion4Drivers(EDatabaseTypeName.MAPRDB, new String[] {})),
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
"redshift-jdbc42-no-awssdk-1.2.20.1043.jar")), //$NON-NLS-1$
"redshift-jdbc42-no-awssdk-1.2.32.1056.jar")), //$NON-NLS-1$
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "redshift-jdbc42-no-awssdk-1.2.20.1043.jar", "aws-java-sdk-1.11.406.jar", "jackson-core-2.9.5.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackson-databind-2.9.5.jar", "jackson-annotations-2.9.0.jar", "httpcore-4.4.9.jar", "httpclient-4.5.5.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.1.3.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "redshift-jdbc42-no-awssdk-1.2.32.1056.jar", "aws-java-sdk-1.11.406.jar", "jackson-core-2.9.9.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackson-databind-2.9.9.jar", "jackson-annotations-2.9.0.jar", "httpcore-4.4.9.jar", "httpclient-4.5.5.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.1.3.jar", "commons-codec-1.6.jar" })), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.30-bin.jar")); //$NON-NLS-1$

View File

@@ -60,6 +60,15 @@ public interface IComponent {
public String getOriginalName();
/**
* Only for component display (palette,search)
*
* @return
*/
default public String getDisplayName() {
return getName();
}
public String getLongName();
public String getOriginalFamilyName();

View File

@@ -98,6 +98,15 @@ public class JobContext implements IContext, Cloneable {
return true;
}
public boolean containsSameParameterIgnoreCase(String parameterName) {
for (IContextParameter contextParam : contextParameterList) {
if (contextParam.getName() != null && contextParam.getName().equalsIgnoreCase(parameterName)) {
return true;
}
}
return false;
}
/**
* Commented by Marvin Wang on Mar.2, 2012, the user who invokes the method should notice that if the
* <code>JobContext</code> has more than one <code>ContextParameter</code>s which names are same, this case will

View File

@@ -29,5 +29,4 @@ public interface INexusService extends IService {
ArtifactRepositoryBean getPublishNexusServerBean(String repositoryId);
ArtifactRepositoryBean getArtifactRepositoryFromServer();
}

View File

@@ -45,6 +45,14 @@ public interface ISAPConstant {
public static final String CHANGING = "CHANGING";//$NON-NLS-1$
public static final String PARAMETER_TYPE = "PARAMETER_TYPE";//$NON-NLS-1$
public static final String PARAMETER_TYPE_IMPORT = "IMPORT";//$NON-NLS-1$
public static final String PARAMETER_TYPE_CHANGING = "CHANGING";//$NON-NLS-1$
public static final String PARAMETER_TYPE_TABLES = "TABLES";//$NON-NLS-1$
/*
*
*/

View File

@@ -153,7 +153,7 @@ public class MetadataTable implements IMetadataTable, Cloneable {
List<IMetadataColumn> temp = new ArrayList<IMetadataColumn>();
temp.addAll(this.listColumns);
temp.addAll(this.unusedColumns);
if (originalColumns != null) {
if (originalColumns != null && isRepository) {
Collections.sort(temp, new Comparator<IMetadataColumn>() {
@Override

View File

@@ -585,11 +585,6 @@ public final class MetadataToolHelper {
public static void copyTable(IMetadataTable source, IMetadataTable target, String targetDbms,
boolean avoidUsedColumnsFromInput) {
copyTable(source, target, targetDbms, avoidUsedColumnsFromInput, false);
}
public static void copyTable(IMetadataTable source, IMetadataTable target, String targetDbms,
boolean avoidUsedColumnsFromInput, boolean withCustoms) {
if (source == null || target == null) {
return;
}
@@ -609,7 +604,7 @@ public final class MetadataToolHelper {
List<IMetadataColumn> columnsTAdd = new ArrayList<IMetadataColumn>();
for (IMetadataColumn column : source.getListColumns(!avoidUsedColumnsFromInput)) {
IMetadataColumn targetColumn = target.getColumn(column.getLabel());
IMetadataColumn newTargetColumn = column.clone(withCustoms);
IMetadataColumn newTargetColumn = column.clone();
if (targetColumn == null) {
columnsTAdd.add(newTargetColumn);
newTargetColumn
@@ -674,7 +669,7 @@ public final class MetadataToolHelper {
List<IMetadataColumn> targetColumns = target.getListColumns();
List<String> temp = new ArrayList<String>(tColumns);
if (targetColumns != null) {
List<String> columnNames = new ArrayList<String>();
final List<String> columnNames = new ArrayList<String>();
for(IMetadataColumn column : targetColumns){
columnNames.add(column.getLabel());
}

View File

@@ -93,10 +93,10 @@ public class ComponentToRepositoryProperty {
// impossible to use OCI in oracle
IElementParameter elementParameter = node.getElementParameter("CONNECTION_TYPE"); //$NON-NLS-1$
if (elementParameter != null) {
if ("ORACLE_OCI".equals(elementParameter.getValue())) { //$NON-NLS-1$
if ("ORACLE_WALLET".equals(elementParameter.getValue())) { //$NON-NLS-1$
Shell shell = Display.getCurrent().getActiveShell();
String title = Messages.getString("ComponentToRepositoryProperty.error"); //$NON-NLS-1$
String message = Messages.getString("ComponentToRepositoryProperty.ImpossibleUseOCI"); //$NON-NLS-1$
String message = Messages.getString("ComponentToRepositoryProperty.ImpossibleUseWALLET"); //$NON-NLS-1$
MessageDialog.openError(shell, title, message);
return false;
}
@@ -503,6 +503,10 @@ public class ComponentToRepositoryProperty {
parameter = node.getElementParameter("CONNECTION_TYPE"); //$NON-NLS-1$
// if ("ORACLE_OCI".equals(parameter.getValue())) {
// }
if ("ORACLE_OCI".equals(parameter.getValue())) {
connection.setDatabaseType(EDatabaseTypeName.ORACLE_OCI.getDisplayName());
connection.setProductId(EDatabaseTypeName.ORACLE_OCI.getProduct());
}
if ("ORACLE_SERVICE_NAME".equals(parameter.getValue()) || "service_name".equals(parameter.getValue())) { //$NON-NLS-1$ //$NON-NLS-2$
connection.setDatabaseType(EDatabaseTypeName.ORACLESN.getDisplayName());
@@ -510,7 +514,8 @@ public class ComponentToRepositoryProperty {
} else if ("ORACLE_SID".equals(parameter.getValue()) || "sid".equals(parameter.getValue())) { //$NON-NLS-1$ //$NON-NLS-2$
connection.setDatabaseType(EDatabaseTypeName.ORACLEFORSID.getDisplayName());
connection.setProductId(EDatabaseTypeName.ORACLESN.getProduct());
} else if ("ORACLE_CUSTOM".equals(parameter.getValue()) || "rac".equals(parameter.getValue())) { //$NON-NLS-1$ //$NON-NLS-2$
} else if ("ORACLE_CUSTOM".equals(parameter.getValue()) || "rac".equals(parameter.getValue()) //$NON-NLS-1$ //$NON-NLS-2$
|| "ORACLE_RAC".equals(parameter.getValue())) {
connection.setDatabaseType(EDatabaseTypeName.ORACLE_CUSTOM.getDisplayName());
connection.setProductId(EDatabaseTypeName.ORACLESN.getProduct());
}
@@ -668,6 +673,12 @@ public class ComponentToRepositoryProperty {
if (connection.getDatabaseType().equals(EDatabaseTypeName.ORACLESN.getDisplayName())) {
setDatabaseValueForOracleSeverName(connection, node, param);
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.ORACLE_CUSTOM.getDisplayName())) {
setDatabaseValueForOracleCustom(connection, node, param);
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.ORACLE_OCI.getDisplayName())) {
setDatabaseValueForOracleOci(connection, node, param);
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.ACCESS.getDisplayName())) {
setDatabaseValueForAccess(connection, node, param);
}
@@ -683,6 +694,9 @@ public class ComponentToRepositoryProperty {
if (connection.getDatabaseType().equals(EDatabaseTypeName.PSQL.getDisplayName())) {
setDatabaseValueForPSQL(connection, node, param);
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.PLUSPSQL.getDisplayName())) {
setDatabaseValueForPLUSPSQL(connection, node, param);
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.SYBASEASE.getDisplayName())
|| connection.getDatabaseType().equals(EDatabaseTypeName.SYBASEIQ.getDisplayName())) {
setDatabaseValueForSysbase(connection, node, param);
@@ -699,6 +713,11 @@ public class ComponentToRepositoryProperty {
if (connection.getDatabaseType().equals(EDatabaseTypeName.GENERAL_JDBC.getDisplayName())) {
setDatabaseValueForJdbc(connection, node, param);
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.MSSQL.getDisplayName())) {
setDatabaseValueForMSSql(connection, node, param);
}
}
/**
@@ -756,6 +775,53 @@ public class ComponentToRepositoryProperty {
}
}
private static void setDatabaseValueForOracleCustom(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DB_VERSION".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param);
String dbVersionName = EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.ORACLE_CUSTOM, value);
if (value != null) {
connection.setDbVersionString(dbVersionName);
}
}
if ("SID".equals(param.getRepositoryValue())) { //$NON-NLS-1$
if (param != null && "ORACLE_OCI".equals(param.getValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, node.getElementParameter("LOCAL_SERVICE_NAME")); //$NON-NLS-1$
if (value != null) {
connection.setSID(value);
}
} else {
String value = getParameterValue(connection, node, node.getElementParameter("DBNAME")); //$NON-NLS-1$
if (value != null) {
connection.setSID(value);
}
}
}
}
private static void setDatabaseValueForOracleOci(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DB_VERSION".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param);
String dbVersionName = EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.ORACLE_OCI, value);
if (value != null) {
connection.setDbVersionString(dbVersionName);
}
}
if ("SID".equals(param.getRepositoryValue())) { //$NON-NLS-1$
if (param != null && "ORACLE_OCI".equals(param.getValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, node.getElementParameter("LOCAL_SERVICE_NAME")); //$NON-NLS-1$
if (value != null) {
connection.setSID(value);
}
} else {
String value = getParameterValue(connection, node, node.getElementParameter("DBNAME")); //$NON-NLS-1$
if (value != null) {
connection.setSID(value);
}
}
}
}
private static void setDatabaseValueForAs400(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DB_VERSION".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param);
@@ -797,6 +863,16 @@ public class ComponentToRepositoryProperty {
}
}
}
private static void setDatabaseValueForPLUSPSQL(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DB_VERSION".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param);
String dbVersionName = EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.PLUSPSQL, value);
if (value != null) {
connection.setDbVersionString(dbVersionName);
}
}
}
private static void setDatabaseValueForSysbase(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DB_VERSION".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param); // $NON-NLS-1$
@@ -806,6 +882,16 @@ public class ComponentToRepositoryProperty {
}
}
}
private static void setDatabaseValueForMSSql(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DRIVER".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param);
String dbVersionName = EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.MSSQL, value);
if (value != null) {
connection.setDbVersionString(dbVersionName);
}
}
}
private static void setDatabaseValueForAccess(DatabaseConnection connection, INode node, IElementParameter param) {
if ("DB_VERSION".equals(param.getRepositoryValue())) { //$NON-NLS-1$
String value = getParameterValue(connection, node, param);

View File

@@ -1697,6 +1697,11 @@ public class RepositoryToComponentProperty {
return "STANDARD";
}
}
if (value.equals("DBTYPE")) {
String repositoryType = connection.getDatabaseType();
EDatabaseTypeName typeFromDbType = EDatabaseTypeName.getTypeFromDbType(repositoryType);
return typeFromDbType.getXMLType();
}
return null;

View File

@@ -39,7 +39,7 @@ public abstract class AbstractNode implements INode {
private ComponentProperties componentProperties;
List<? extends IElementParameter> elementParameters;
List<? extends IElementParameter> elementParameters = new ArrayList<IElementParameter>();
private List<? extends IConnection> outgoingConnections = new ArrayList<IConnection>();

View File

@@ -22,6 +22,7 @@ import org.talend.core.model.components.IComponent;
import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.MetadataTable;
import org.talend.core.model.process.node.MapperExternalNode;
/**
* Concrete class to instanciate as an AbstractNode for the BigData code generators
@@ -76,6 +77,9 @@ public class BigDataNode extends AbstractNode implements IBigDataNode {
IBigDataNode node = (IBigDataNode) incomingConnections.get(0).getSource();
String requiredOutputType = node.getRequiredOutputType();
return requiredOutputType != null ? requiredOutputType : node.getIncomingType();
} else if (incomingConnections.get(0).getSource() instanceof MapperExternalNode) {
MapperExternalNode node = (MapperExternalNode) incomingConnections.get(0).getSource();
return node.getShouldGenerateDataset() ? "DATASET" : "KEYVALUE";
} else {
// We are on an external node => PairRDD
// TODO Maybe on the futur we need to handle RDD or DataFrame, but this required a big refactoring

View File

@@ -22,6 +22,7 @@ public enum EParameterFieldType {
TEXT,
TEXT_AREA,
PASSWORD,
LICENSEKEY, // xqliu TDQ-17742
MEMO_SQL,
MEMO_PERL,
MEMO_JAVA,
@@ -123,7 +124,8 @@ public enum EParameterFieldType {
TACOKIT_GUESS_SCHEMA,
TACOKIT_BUTTON,
TACOKIT_SUGGESTABLE_TABLE,
TACOKIT_VALUE_SELECTION;
TACOKIT_VALUE_SELECTION,
TACOKIT_TEXT_AREA_SELECTION;
public String getName() {
return toString();

View File

@@ -62,4 +62,6 @@ public interface IContext {
public IContext clone();
public boolean sameAs(IContext context);
public boolean containsSameParameterIgnoreCase(String parameterName);
}

View File

@@ -25,6 +25,7 @@ import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.ITDQItemService;
import org.talend.core.PluginChecker;
import org.talend.core.hadoop.IHadoopClusterService;
@@ -33,7 +34,6 @@ import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.model.properties.Property;
import org.talend.core.model.properties.SQLPatternItem;
import org.talend.core.model.relationship.Relation;
@@ -898,33 +898,14 @@ public final class ProcessUtils {
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(property.getItem());
// route job
if (itemType != null && (itemType.equals(ERepositoryObjectType.PROCESS_ROUTE)
|| itemType.equals(ERepositoryObjectType.PROCESS_ROUTELET))) {
|| itemType.equals(ERepositoryObjectType.PROCESS_ROUTELET)
|| "CAMEL".equals(process.getComponentsType()))) {
needBeans = true;
}
}
}
}
if (needBeans && GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
IProxyRepositoryService service = (IProxyRepositoryService) GlobalServiceRegister.getDefault()
.getService(IProxyRepositoryService.class);
ERepositoryObjectType beansType = ERepositoryObjectType.valueOf("BEANS"); //$NON-NLS-1$
try {
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
List<IRepositoryViewObject> all = factory.getAll(project, beansType);
List<ProjectReference> references = ProjectManager.getInstance().getCurrentProject()
.getProjectReferenceList(true);
for (ProjectReference ref : references) {
all.addAll(factory.getAll(new Project(ref.getReferencedProject()), beansType));
}
if (!all.isEmpty()) { // has bean
return true;
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
return false;
return needBeans && GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class);
}
public static boolean isRequiredPigUDFs(IProcess process) {

View File

@@ -20,4 +20,8 @@ import org.talend.core.model.process.AbstractExternalNode;
*/
public abstract class MapperExternalNode extends AbstractExternalNode {
public boolean getShouldGenerateDataset() {
return false;
}
}

View File

@@ -575,6 +575,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
public final static ERepositoryObjectType METADATA_SAP_BW_INFOOBJECT = ERepositoryObjectType
.valueOf("METADATA_SAP_BW_INFOOBJECT"); //$NON-NLS-1$
public final static ERepositoryObjectType JDBC = ERepositoryObjectType.valueOf("JDBC"); //$NON-NLS-1$
private static Map<String, ERepositoryObjectType> typeCacheById = new HashMap<String, ERepositoryObjectType>();
ERepositoryObjectType(String key, String folder, String type, boolean isStaticNode, int ordinal, String[] products,
@@ -1311,7 +1313,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
public boolean addExtraProducts(String[] productsArray) {
if (productsArray != null && productsArray.length > 0) {
if (this.products == null && this.products.length == 0) {
if (this.products == null || this.products.length == 0) {
this.products = productsArray;
} else {
String[] tmp = new String[this.products.length + productsArray.length];

View File

@@ -13,6 +13,7 @@
package org.talend.core.model.routines;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
@@ -31,9 +32,12 @@ import org.osgi.framework.Bundle;
import org.talend.commons.utils.resource.FileExtensions;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.ISVNProviderServiceInCoreRuntime;
import org.talend.core.PluginChecker;
import org.talend.core.model.general.LibraryInfo;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
/**
* wchen class global comment. Detailled comment
@@ -96,9 +100,12 @@ public class RoutineLibraryMananger {
try {
URL fileUrl = FileLocator.toFileURL(entry);
if(fileUrl != null){
if (!"file".equals(fileUrl.getProtocol())) throw new IllegalArgumentException();
URI fileUri = new File(fileUrl.getFile()).toURI();
libManagerService.deploy(fileUri);
if (!"file".equals(fileUrl.getProtocol())) throw new IllegalArgumentException();
File file = new File(fileUrl.getFile());
if (needDeploy(fileUrl)) {
URI fileUri = file.toURI();
libManagerService.deploy(fileUri);
}
}
} catch (Exception e) {
log.warn("Cannot deploy: " + bundleName + path);
@@ -114,6 +121,56 @@ public class RoutineLibraryMananger {
}
}
public boolean needDeploy(URL fileUrl) throws IOException, Exception {
File file = new File(fileUrl.getFile());
ILibraryManagerService libManagerService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
}
if (libManagerService != null) {
Map<String, String> sourceAndMavenUri = new HashMap<>();
libManagerService.guessMavenRUIFromIndex(file, sourceAndMavenUri);
String mavUri = null;
boolean isSnapshot = false;
for (String key : sourceAndMavenUri.keySet()) {
if (sourceAndMavenUri.get(key).equals(file.getPath())) {
mavUri = key;
break;
}
}
if (mavUri == null) {
return true;
}
final MavenArtifact parseMvnUrl = MavenUrlHelper.parseMvnUrl(mavUri);
if (parseMvnUrl != null) {
if (parseMvnUrl.getVersion() != null && parseMvnUrl.getVersion().endsWith(MavenConstants.SNAPSHOT)) {
isSnapshot = true;
}
}
TalendLibsServerManager manager = TalendLibsServerManager.getInstance();
ArtifactRepositoryBean customNexusServer = manager.getCustomNexusServer();
File jarFile = null;
try {
jarFile = libManagerService.resolveJar(customNexusServer, mavUri);
} catch (Exception ex) {
// Ignore here
}
boolean exist = (jarFile != null && jarFile.exists());
if (exist) {
if (isSnapshot) {
boolean isSame = libManagerService.isSameFile(jarFile, file);
if (!isSame) {
return true;
}
}
} else {
return true;
}
}
return false;
}
public Map<String, List<LibraryInfo>> getRoutineAndJars() {
if (routineAndJars == null) {
routineAndJars = new HashMap<String, List<LibraryInfo>>();

View File

@@ -684,16 +684,15 @@ public class NodeUtil {
}
List<? extends IConnection> listInConns = node.getIncomingConnections();
if (listInConns != null && listInConns.size() > 0) {
String retResult = getPrivateConnClassName(listInConns.get(0));
if (retResult == null) {
return conn.getName();
} else {
return retResult;
for (IConnection connection : listInConns) {
if (EConnectionType.FLOW_REF != connection.getLineStyle()) {
String retResult = getPrivateConnClassName(connection);
return retResult != null ? retResult : conn.getName();
}
}
}
}
return null;
}
/**

View File

@@ -41,11 +41,11 @@ import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.daikon.security.CryptoHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementValueType;
import org.talend.repository.ProjectManager;
import org.talend.utils.security.StudioEncryption;
/**
* cli class global comment. Detailled comment
@@ -77,21 +77,24 @@ public final class ParameterValueUtil {
}
}
} else if (param.getValue() instanceof List) { // for TABLE
List<Map<String, Object>> tableValues = (List<Map<String, Object>>) param.getValue();
for (Map<String, Object> line : tableValues) {
for (String key : line.keySet()) {
Object cellValue = line.get(key);
if (cellValue instanceof String) { // cell is text so
// rename data if
// needed
String value = (String) cellValue;
if (value.contains(oldName)) {
// line.put(key, value.replaceAll(oldName,
// newName));
// String newValue = renameValues(value, oldName, newName, flag);
String newValue = splitQueryData(oldName, newName, value);
if (!value.equals(newValue)) {
line.put(key, newValue);
List tableValues = (List) param.getValue();
for (Object current : tableValues) {
if (current != null && current instanceof Map) {
Map<String, Object> line = (Map<String, Object>) current;
for (String key : line.keySet()) {
Object cellValue = line.get(key);
if (cellValue instanceof String) { // cell is text so
// rename data if
// needed
String value = (String) cellValue;
if (value.contains(oldName)) {
// line.put(key, value.replaceAll(oldName,
// newName));
// String newValue = renameValues(value, oldName, newName, flag);
String newValue = splitQueryData(oldName, newName, value);
if (!value.equals(newValue)) {
line.put(key, newValue);
}
}
}
}
@@ -721,13 +724,22 @@ public final class ParameterValueUtil {
return true;
}
} else if (param.getValue() instanceof List) { // for TABLE
List<Map<String, Object>> tableValues = (List<Map<String, Object>>) param.getValue();
for (Map<String, Object> line : tableValues) {
for (String key : line.keySet()) {
Object cellValue = line.get(key);
if (cellValue instanceof String) { // cell is text so
// test data
if (ParameterValueUtil.valueContains((String) cellValue, name)) {
List tableValues = (List) param.getValue();
for (Object current : tableValues) {
if (current != null) {
if (current instanceof Map) {
Map<String, Object> line = (Map<String, Object>) current;
for (String key : line.keySet()) {
Object cellValue = line.get(key);
if (cellValue instanceof String) { // cell is text so
// test data
if (ParameterValueUtil.valueContains((String) cellValue, name)) {
return true;
}
}
}
} else if (current instanceof String) {
if (ParameterValueUtil.valueContains((String) current, name)) {
return true;
}
}
@@ -830,7 +842,8 @@ public final class ParameterValueUtil {
if (contextParam != null) {
String docValue = contextParam.getValue();
if (docValue != null) {
String encryptValue = CryptoHelper.getDefault().encrypt(docValue);
String encryptValue = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM)
.encrypt(docValue);
if (encryptValue != null) {
return encryptValue;
}
@@ -866,7 +879,8 @@ public final class ParameterValueUtil {
if (param != null) {
Object docValue = param.getValue();
if (docValue != null && docValue instanceof String) {
String encryptValue = CryptoHelper.getDefault().encrypt(docValue.toString());
String encryptValue = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM)
.encrypt(docValue.toString());
if (encryptValue != null) {
return encryptValue;
}

View File

@@ -12,14 +12,12 @@
// ============================================================================
package org.talend.core.nexus;
import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.Proxy.Type;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
@@ -37,9 +35,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.network.IProxySelectorProvider;
import org.talend.commons.utils.network.TalendProxySelector;
import org.talend.commons.utils.network.TalendProxySelector.IProxySelectorProvider;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenUrlHelper;
@@ -167,7 +164,7 @@ public abstract class HttpClientTransport {
}
}
private IProxySelectorProvider addProxy(final DefaultHttpClient httpClient, URI requestURI) {
public static IProxySelectorProvider addProxy(final DefaultHttpClient httpClient, URI requestURI) {
IProxySelectorProvider proxySelectorProvider = null;
try {
if (Boolean.valueOf(System.getProperty(PROP_PROXY_HTTP_CLIENT_USE_DEFAULT_SETTINGS, Boolean.FALSE.toString()))) {
@@ -185,10 +182,10 @@ public abstract class HttpClientTransport {
}
final Proxy finalProxy = usedProxy;
InetSocketAddress address = (InetSocketAddress) finalProxy.address();
String proxyServer = address.getHostName();
String proxyServer = address.getHostString();
int proxyPort = address.getPort();
PasswordAuthentication proxyAuthentication = Authenticator.requestPasswordAuthentication(proxyServer,
address.getAddress(), proxyPort, "Http Proxy", "Http proxy authentication", null);
TalendProxySelector proxySelector = TalendProxySelector.getInstance();
PasswordAuthentication proxyAuthentication = proxySelector.getHttpPasswordAuthentication();
if (proxyAuthentication != null) {
String proxyUser = proxyAuthentication.getUserName();
if(StringUtils.isNotBlank(proxyUser)){
@@ -203,7 +200,7 @@ public abstract class HttpClientTransport {
}
HttpHost proxyHost = new HttpHost(proxyServer, proxyPort);
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
proxySelectorProvider = createProxySelectorProvider();
proxySelectorProvider = proxySelector.createDefaultProxySelectorProvider();
}
return proxySelectorProvider;
} finally {
@@ -213,61 +210,12 @@ public abstract class HttpClientTransport {
}
}
private void removeProxy(IProxySelectorProvider proxySelectorProvider) {
public static void removeProxy(IProxySelectorProvider proxySelectorProvider) {
if (proxySelectorProvider != null) {
TalendProxySelector.getInstance().removeProxySelectorProvider(proxySelectorProvider);
}
}
private IProxySelectorProvider createProxySelectorProvider() {
IProxySelectorProvider proxySelectorProvider = new TalendProxySelector.AbstractProxySelectorProvider() {
private Thread currentThread = Thread.currentThread();
@Override
public List<Proxy> select(URI uri) {
// return Collections.EMPTY_LIST;
List<Proxy> newProxys = new ArrayList<>();
if (uri == null) {
return newProxys;
}
String schema = uri.getScheme();
if (schema != null && schema.toLowerCase().startsWith("socket")) { //$NON-NLS-1$
try {
URI newUri = new URI("https", uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
uri.getQuery(), uri.getFragment());
List<Proxy> proxys = TalendProxySelector.getInstance().getDefaultProxySelector().select(newUri);
if (proxys != null && !proxys.isEmpty()) {
newProxys.addAll(proxys);
} else {
newUri = new URI("http", uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
uri.getQuery(), uri.getFragment());
proxys = TalendProxySelector.getInstance().getDefaultProxySelector().select(newUri);
if (proxys != null && !proxys.isEmpty()) {
newProxys.addAll(proxys);
}
}
} catch (URISyntaxException e) {
ExceptionHandler.process(e);
}
}
return newProxys;
}
@Override
public boolean canHandle(URI uri) {
if (Thread.currentThread() == currentThread) {
return true;
}
return false;
}
};
return proxySelectorProvider;
}
public void processResponseCode(HttpResponse response) throws BusinessException {
StatusLine statusLine = response.getStatusLine();
int responseCode = statusLine.getStatusCode();

View File

@@ -29,4 +29,6 @@ public class NexusConstants {
public static final String SNAPSHOTS = "@snapshots";//$NON-NLS-1$
public static final String DISALLOW_RELEASES = "@noreleases";//$NON-NLS-1$
public static final String DYNAMIC_DISTRIBUTION = "https://talend-update.talend.com/nexus/content/groups/dynamicdistribution/";
}

View File

@@ -0,0 +1,33 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.nexus;
import java.io.IOException;
public class ResolverExceptionHandler {
public static IOException hideCredential(IOException e) {
// hide the user/password in the error
String regex = "\\://(.+)\\:(.+)@"; //$NON-NLS-1$
String message = e.getMessage();
message = message.replaceAll(regex, "://"); //$NON-NLS-1$
Exception cause = null;
if (e.getCause() != null) {
String causeMessage = e.getCause().getMessage();
causeMessage = causeMessage.replaceAll(regex, "://"); //$NON-NLS-1$
cause = new Exception(causeMessage);
}
return new IOException(message, cause);
}
}

View File

@@ -63,6 +63,16 @@ public class TalendLibsServerManager {
public static final String TALEND_LIB_SERVER = "https://talend-update.talend.com/nexus/";//$NON-NLS-1$
public static final String NEXUS_PROXY_URL = "nexus.proxy.url";
public static final String NEXUS_PROXY_TYPE = "nexus.proxy.type";
public static final String NEXUS_PROXY_USERNAME = "nexus.proxy.username";
public static final String NEXUS_PROXY_PASSWORD = "nexus.proxy.password";
public static final String NEXUS_PROXY_REPOSITORY_ID = "nexus.proxy.repository.id";
public static final String TALEND_LIB_USER = "";//$NON-NLS-1$
public static final String TALEND_LIB_PASSWORD = "";//$NON-NLS-1$
@@ -167,12 +177,15 @@ public class TalendLibsServerManager {
public ArtifactRepositoryBean getTalentArtifactServer() {
ArtifactRepositoryBean serverBean = new ArtifactRepositoryBean();
serverBean.setServer(System.getProperty(KEY_LIB_REPO_URL, TALEND_LIB_SERVER));
serverBean.setUserName(TALEND_LIB_USER);
serverBean.setPassword(TALEND_LIB_PASSWORD);
serverBean.setRepositoryId(TALEND_LIB_REPOSITORY);
String nexusType = System.getProperty(NEXUS_PROXY_TYPE);
if (nexusType != null) {
serverBean.setType(nexusType);
}
serverBean.setServer(System.getProperty(NEXUS_PROXY_URL, TALEND_LIB_SERVER));
serverBean.setUserName(System.getProperty(NEXUS_PROXY_USERNAME, TALEND_LIB_USER));
serverBean.setPassword(System.getProperty(NEXUS_PROXY_PASSWORD, TALEND_LIB_PASSWORD));
serverBean.setRepositoryId(System.getProperty(NEXUS_PROXY_REPOSITORY_ID, TALEND_LIB_REPOSITORY));
serverBean.setOfficial(true);
return serverBean;
}

View File

@@ -24,6 +24,9 @@ import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ManagedService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.network.IProxySelectorProvider;
import org.talend.commons.utils.network.TalendProxySelector;
import org.talend.core.runtime.CoreRuntimePlugin;
/**
@@ -101,8 +104,27 @@ public class TalendMavenResolver {
}
public static File resolve(String mvnUri) throws IOException, RuntimeException {
return getMavenResolver().resolve(mvnUri);
public static File resolve(String mvnUri) throws IOException {
TalendProxySelector selectorInstance = null;
IProxySelectorProvider proxySelector = null;
try {
try {
selectorInstance = TalendProxySelector.getInstance();
proxySelector = selectorInstance.createDefaultProxySelectorProvider();
if (proxySelector != null) {
selectorInstance.addProxySelectorProvider(proxySelector);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
return getMavenResolver().resolve(mvnUri);
} catch (IOException e) {
throw ResolverExceptionHandler.hideCredential(e);
} finally {
if (proxySelector != null && selectorInstance != null) {
selectorInstance.removeProxySelectorProvider(proxySelector);
}
}
}
public static void upload(String groupId, String artifactId, String classifier, String extension, String version,
@@ -110,7 +132,11 @@ public class TalendMavenResolver {
getMavenResolver().upload(groupId, artifactId, classifier, extension, version, artifact);
}
public static MavenResolver getMavenResolver() throws RuntimeException {
public static void initMavenResovler() throws RuntimeException {
getMavenResolver();
}
private static MavenResolver getMavenResolver() throws RuntimeException {
if (mavenResolver == null) {
final BundleContext context = CoreRuntimePlugin.getInstance().getBundle().getBundleContext();
ServiceReference<org.ops4j.pax.url.mvn.MavenResolver> mavenResolverService = context

View File

@@ -101,6 +101,8 @@ public interface ITalendCorePrefConstants {
public static final String FORBIDDEN_MAPPING_LENGTH_PREC_LOGIC = "forbidden_mapping_length_prec_logic"; //$NON-NLS-1$
public static final String METADATA_PREFERENCE_PAGE_ENABLE_BASIC = "metadata_preference_page_enable_basic"; //$NON-NLS-1$
public static final String DATA_COLLECTOR_ENABLED = "active_data_collector"; //$NON-NLS-1$
public static final String DATA_COLLECTOR_UPLOAD_PERIOD = "active_data_collector_times"; //$NON-NLS-1$

View File

@@ -23,6 +23,10 @@ public interface IAdditionalInfo {
void onEvent(final String event, final Object... parameters);
default Object func(final String funcName, final Object... params) throws Exception {
throw new UnsupportedOperationException();
}
void cloneAddionalInfoTo(final IAdditionalInfo targetAdditionalInfo);
}

View File

@@ -24,7 +24,7 @@ public class MavenArtifact implements Cloneable {
private static final char ARTIFACT_SEPARATOR = '-';
private String repositoryUrl, groupId, artifactId, version, type, classifier, description, url, license, licenseUrl,
distribution, username, password, lastUpdated;
distribution, username, password, lastUpdated, sha1, md5;
public String getLastUpdated() {
return this.lastUpdated;
@@ -138,6 +138,22 @@ public class MavenArtifact implements Cloneable {
this.password = password;
}
public String getSha1() {
return sha1;
}
public void setSha1(String sha1) {
this.sha1 = sha1;
}
public String getMd5() {
return md5;
}
public void setMd5(String md5) {
this.md5 = md5;
}
/**
*
* DOC ggu Comment method "getFileName".

View File

@@ -42,6 +42,8 @@ public interface MavenConstants {
static final String POM_FILTER = "POM_FILTER";
static final String USE_PROFILE_MODULE = "USE_PROFILE_MODULE";
/*
* for lib
*/

View File

@@ -19,7 +19,7 @@ import java.net.URLDecoder;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Assert;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.daikon.security.CryptoHelper;
import org.talend.utils.security.StudioEncryption;
/**
* DOC ggu class global comment. Detailled comment
@@ -47,8 +47,6 @@ public class MavenUrlHelper {
public static final String USER_PASSWORD_SPLITER = ":";
private static CryptoHelper cryptoHelper;
public static MavenArtifact parseMvnUrl(String mvnUrl) {
return parseMvnUrl(mvnUrl, true);
}
@@ -332,19 +330,15 @@ public class MavenUrlHelper {
return uri;
}
private static CryptoHelper getCryptoHelper() {
if (cryptoHelper == null) {
cryptoHelper = CryptoHelper.getDefault();
}
return cryptoHelper;
}
public static String encryptPassword(String password) {
return getCryptoHelper().encrypt(password);
return StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).encrypt(password);
}
public static String decryptPassword(String password) {
return getCryptoHelper().decrypt(password);
if (StudioEncryption.hasEncryptionSymbol(password)) {
return StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(password);
}
return password;
}
public static String generateModuleNameByMavenURI(String uri) {

View File

@@ -19,6 +19,7 @@ import java.util.Set;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
/**
* DOC nrousseau class global comment. Detailled comment
@@ -78,7 +79,7 @@ public class LastGenerationInfo {
* @return the modulesNeededPerJob
*/
public Set<ModuleNeeded> getModulesNeededWithSubjobPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!modulesNeededWithSubjobPerJob.containsKey(key)) {
modulesNeededWithSubjobPerJob.put(key, new HashSet<ModuleNeeded>());
}
@@ -90,7 +91,7 @@ public class LastGenerationInfo {
* @return the modulesNeededPerJob
*/
public Set<ModuleNeeded> getModulesNeededPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!modulesNeededPerJob.containsKey(key)) {
modulesNeededPerJob.put(key, new HashSet<ModuleNeeded>());
}
@@ -103,7 +104,7 @@ public class LastGenerationInfo {
* @return the contextPerJob
*/
public Set<String> getContextPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!contextPerJob.containsKey(key)) {
contextPerJob.put(key, new HashSet<String>());
}
@@ -116,7 +117,7 @@ public class LastGenerationInfo {
* @param modulesNeededPerJob the modulesNeededPerJob to set
*/
public void setModulesNeededPerJob(String jobId, String jobVersion, Set<ModuleNeeded> modulesNeeded) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
modulesNeededPerJob.put(key, new HashSet<ModuleNeeded>(modulesNeeded));
}
@@ -125,8 +126,8 @@ public class LastGenerationInfo {
*
* @param modulesNeededWithSubjobPerJob the modulesNeededWithSubjobPerJob to set
*/
public void setModulesNeededWithSubjobPerJob(String jobId, String jobVersion, Set<ModuleNeeded> modulesNeeded) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
public void setModulesNeededWithSubjobPerJob(String jobId, String jobVersion, Set<ModuleNeeded> modulesNeeded) {
String key = this.getProcessKey(jobId, jobVersion);
if (modulesNeeded == null) {
modulesNeededWithSubjobPerJob.put(key, null);
} else {
@@ -140,17 +141,17 @@ public class LastGenerationInfo {
* @param contextPerJob the contextPerJob to set
*/
public void setContextPerJob(String jobId, String jobVersion, Set<String> contexts) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
contextPerJob.put(key, new HashSet<String>(contexts));
}
public void setUseDynamic(String jobId, String jobVersion, boolean dynamic) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
useDynamic.put(key, dynamic);
}
public boolean isUseDynamic(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!useDynamic.containsKey(key)) {
return false;
}
@@ -162,12 +163,12 @@ public class LastGenerationInfo {
}
public void setUseRules(String jobId, String jobVersion, boolean useRules) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
this.useRules.put(key, useRules);
}
public boolean isUseRules(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!useRules.containsKey(key)) {
return false;
}
@@ -179,12 +180,12 @@ public class LastGenerationInfo {
}
public void setUsePigUDFs(String jobId, String jobVersion, boolean useRules) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
this.usedPigUDFs.put(key, useRules);
}
public boolean isUsePigUDFs(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!usedPigUDFs.containsKey(key)) {
return false;
}
@@ -251,7 +252,7 @@ public class LastGenerationInfo {
* @return the modulesNeededPerJob
*/
public Set<String> getRoutinesNeededPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!routinesNeededPerJob.containsKey(key)) {
routinesNeededPerJob.put(key, new HashSet<String>());
}
@@ -279,7 +280,8 @@ public class LastGenerationInfo {
}
private String getProcessKey(String jobId, String jobVersion) {
return jobId + "_" + jobVersion; //$NON-NLS-1$
String pureJobId = ProcessUtils.getPureItemId(jobId);
return pureJobId + "_" + jobVersion; //$NON-NLS-1$
}
/**
@@ -288,7 +290,7 @@ public class LastGenerationInfo {
* @return the pigudfNeededPerJob
*/
public Set<String> getPigudfNeededPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!pigudfNeededPerJob.containsKey(key)) {
pigudfNeededPerJob.put(key, new HashSet<String>());
}
@@ -302,7 +304,7 @@ public class LastGenerationInfo {
* @param modulesNeededPerJob the modulesNeededPerJob to set
*/
public void setRoutinesNeededPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
routinesNeededPerJob.put(key, new HashSet<String>(modulesNeeded));
}
@@ -312,7 +314,7 @@ public class LastGenerationInfo {
* @param pigudfNeededPerJob the pigudfNeededPerJob to set
*/
public void setPigudfNeededPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
pigudfNeededPerJob.put(key, new HashSet<String>(modulesNeeded));
}
@@ -321,7 +323,7 @@ public class LastGenerationInfo {
* @return the modulesNeededPerJob
*/
public Set<String> getRoutinesNeededWithSubjobPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!routinesNeededWithSubjobPerJob.containsKey(key)) {
routinesNeededWithSubjobPerJob.put(key, new HashSet<String>());
}
@@ -334,7 +336,7 @@ public class LastGenerationInfo {
* @return the pigudfNeededWithSubjobPerJob
*/
public Set<String> getPigudfNeededWithSubjobPerJob(String jobId, String jobVersion) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
if (!pigudfNeededWithSubjobPerJob.containsKey(key)) {
pigudfNeededWithSubjobPerJob.put(key, new HashSet<String>());
}
@@ -348,7 +350,7 @@ public class LastGenerationInfo {
* @param modulesNeededPerJob the modulesNeededPerJob to set
*/
public void setRoutinesNeededWithSubjobPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
routinesNeededWithSubjobPerJob.put(key, new HashSet<String>(modulesNeeded));
}
@@ -358,7 +360,7 @@ public class LastGenerationInfo {
* @param pigudfNeededWithSubjobPerJob the pigudfNeededWithSubjobPerJob to set
*/
public void setPigudfNeededWithSubjobPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
String key = this.getProcessKey(jobId, jobVersion);
pigudfNeededWithSubjobPerJob.put(key, new HashSet<String>(modulesNeeded));
}
@@ -368,6 +370,15 @@ public class LastGenerationInfo {
}
}
/**
* Clear modules per job cache, not thread safe
*/
public void clearModulesNeededPerJob() {
if (!modulesNeededPerJob.isEmpty()) {
modulesNeededPerJob.clear();
}
}
public void clean() {
modulesNeededPerJob.clear();
routinesNeededPerJob.clear();

View File

@@ -1,21 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import org.talend.core.IService;
public interface IUpdateService extends IService {
boolean checkComponentNexusUpdate();
}

View File

@@ -99,6 +99,8 @@ public interface IJobletProviderService extends IService {
public IEditorPart openJobletItem(JobletProcessItem item);
public boolean isJobletItem(Item item);
public boolean isJobletProcess(IProcess process);
public Action getMoveToJobletAction(IWorkbenchPart part, INode jobletNode, Map<INode, IConnection> nodeMap);

View File

@@ -22,8 +22,8 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.prefs.SSLPreferenceConstants;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.daikon.security.CryptoHelper;
import org.talend.daikon.security.SSLContextProvider;
import org.talend.utils.security.StudioEncryption;
/**
*
@@ -34,7 +34,7 @@ public class StudioSSLContextProvider {
private static SSLContext context;
private static final IPreferenceStore store = CoreRuntimePlugin.getInstance().getCoreService().getPreferenceStore();
private static final IPreferenceStore STORE = CoreRuntimePlugin.getInstance().getCoreService().getPreferenceStore();
public static synchronized SSLContext getContext() throws Exception {
if (null == context) {
@@ -44,15 +44,14 @@ public class StudioSSLContextProvider {
}
public static synchronized void buildContext() throws Exception {
String keypath = store.getString(SSLPreferenceConstants.KEYSTORE_FILE);
String keypass = store.getString(SSLPreferenceConstants.KEYSTORE_PASSWORD);
String keytype = store.getString(SSLPreferenceConstants.KEYSTORE_TYPE);
String trustpath = store.getString(SSLPreferenceConstants.TRUSTSTORE_FILE);
String trustpass = store.getString(SSLPreferenceConstants.TRUSTSTORE_PASSWORD);
String trusttype = store.getString(SSLPreferenceConstants.TRUSTSTORE_TYPE);
CryptoHelper cryptoHelper = CryptoHelper.getDefault();
keypass = cryptoHelper.decrypt(keypass);
trustpass = cryptoHelper.decrypt(trustpass);
String keypath = STORE.getString(SSLPreferenceConstants.KEYSTORE_FILE);
String keypass = STORE.getString(SSLPreferenceConstants.KEYSTORE_PASSWORD);
String keytype = STORE.getString(SSLPreferenceConstants.KEYSTORE_TYPE);
String trustpath = STORE.getString(SSLPreferenceConstants.TRUSTSTORE_FILE);
String trustpass = STORE.getString(SSLPreferenceConstants.TRUSTSTORE_PASSWORD);
String trusttype = STORE.getString(SSLPreferenceConstants.TRUSTSTORE_TYPE);
keypass = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(keypass);
trustpass = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(trustpass);
try {
if (StringUtils.isEmpty(keypath) && StringUtils.isEmpty(trustpath)) {
context = null;
@@ -88,12 +87,12 @@ public class StudioSSLContextProvider {
private static void changeProperty() {
final IPreferenceStore sslStore = CoreRuntimePlugin.getInstance().getCoreService().getPreferenceStore();
CryptoHelper cryptoHelper = CryptoHelper.getDefault();
String keyStore = sslStore.getString(SSLPreferenceConstants.KEYSTORE_FILE);
if (keyStore != null && !"".equals(keyStore.trim())) {
System.setProperty(SSLPreferenceConstants.KEYSTORE_FILE, keyStore);
System.setProperty(SSLPreferenceConstants.KEYSTORE_PASSWORD,
cryptoHelper.decrypt(sslStore.getString(SSLPreferenceConstants.KEYSTORE_PASSWORD)));
StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM)
.decrypt(sslStore.getString(SSLPreferenceConstants.KEYSTORE_PASSWORD)));
System.setProperty(SSLPreferenceConstants.KEYSTORE_TYPE, sslStore.getString(SSLPreferenceConstants.KEYSTORE_TYPE));
} else {
System.clearProperty(SSLPreferenceConstants.KEYSTORE_FILE);
@@ -104,7 +103,8 @@ public class StudioSSLContextProvider {
if (trustStore != null && !"".equals(trustStore.trim())) {
System.setProperty(SSLPreferenceConstants.TRUSTSTORE_FILE, trustStore);
System.setProperty(SSLPreferenceConstants.TRUSTSTORE_PASSWORD,
cryptoHelper.decrypt(sslStore.getString(SSLPreferenceConstants.TRUSTSTORE_PASSWORD)));
StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM)
.decrypt(sslStore.getString(SSLPreferenceConstants.TRUSTSTORE_PASSWORD)));
System.setProperty(SSLPreferenceConstants.TRUSTSTORE_TYPE, sslStore.getString(SSLPreferenceConstants.TRUSTSTORE_TYPE));
} else {
System.clearProperty(SSLPreferenceConstants.TRUSTSTORE_FILE);

View File

@@ -19,7 +19,9 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -79,6 +81,8 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
}
private Collection<RoutineItem> getAll(ERepositoryObjectType type, boolean syncRef) throws SystemException {
// init code project
getRunProcessService().getTalendCodeJavaProject(type);
// remove routine with same name in reference project
final Map<String, RoutineItem> beansList = new HashMap<String, RoutineItem>();
for (IRepositoryViewObject obj : getRepositoryService().getProxyRepositoryFactory().getAll(type)) {
@@ -95,27 +99,37 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
return (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
}
private void getReferencedProjectRoutine(final Map<String, RoutineItem> beansList, final Project project,
ERepositoryObjectType routineType, boolean syncRef) throws SystemException {
for (IRepositoryViewObject obj : getRepositoryService().getProxyRepositoryFactory().getAll(project, routineType)) {
private Set<IRepositoryViewObject> getReferencedProjectRoutine(final Map<String, RoutineItem> beansList,
final Project project, ERepositoryObjectType routineType, boolean syncRef) throws SystemException {
// init ref code project
if (syncRef) {
getRunProcessService().getTalendCodeJavaProject(routineType, project.getTechnicalLabel());
}
Set<IRepositoryViewObject> routines = new HashSet<>();
routines.addAll(getRepositoryService().getProxyRepositoryFactory().getAll(project, routineType));
for (IRepositoryViewObject obj : routines) {
final String key = obj.getProperty().getLabel();
// it does not have a routine with same name
if (!beansList.containsKey(key)) {
beansList.put(key, (RoutineItem) obj.getProperty().getItem());
}
if (syncRef) {
// sync routine
syncRoutine((RoutineItem) obj.getProperty().getItem(), false, true, true);
}
}
for (ProjectReference projectReference : project.getProjectReferenceList()) {
routines.addAll(getReferencedProjectRoutine(beansList, new Project(projectReference.getReferencedProject()),
routineType, syncRef));
}
if (syncRef) {
routines.stream().forEach(obj -> {
try {
syncRoutine((RoutineItem) obj.getProperty().getItem(), project.getTechnicalLabel(), true, true);
} catch (SystemException e) {
ExceptionHandler.process(e);
}
});
// sync system routine
syncSystemRoutine(project);
}
for (ProjectReference projectReference : project.getProjectReferenceList()) {
getReferencedProjectRoutine(beansList, new Project(projectReference.getReferencedProject()), routineType, syncRef);
}
return routines;
}
protected void syncSystemRoutine(Project project) throws SystemException {
@@ -128,24 +142,17 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
}
protected IFile getRoutineFile(RoutineItem routineItem) throws SystemException {
return getRoutineFile(routineItem, true);
return getRoutineFile(routineItem, ProjectManager.getInstance().getCurrentProject().getTechnicalLabel());
}
protected IFile getRoutineFile(RoutineItem routineItem, boolean currentProject) throws SystemException {
String projectTechName;
if (currentProject) {
projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
} else {
projectTechName = ProjectManager.getInstance().getProject(routineItem).getTechnicalLabel();
}
protected IFile getRoutineFile(RoutineItem routineItem, String projectTechName) throws SystemException {
ITalendProcessJavaProject talendProcessJavaProject = getRunProcessService()
.getTalendCodeJavaProject(ERepositoryObjectType.getItemType(routineItem), projectTechName);
if (talendProcessJavaProject == null) {
return null;
}
IFolder routineFolder = talendProcessJavaProject.getSrcSubFolder(null, routineItem.getPackageType());
IFile file = routineFolder.getFile(routineItem.getProperty().getLabel() + JavaUtils.JAVA_EXTENSION);
return file;
return routineFolder.getFile(routineItem.getProperty().getLabel() + JavaUtils.JAVA_EXTENSION);
}
private IFile getProcessFile(ProcessItem item) throws SystemException {
@@ -193,30 +200,31 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
@Override
public void syncRoutine(RoutineItem routineItem, boolean copyToTemp) throws SystemException {
syncRoutine(routineItem, true, copyToTemp, false);
syncRoutine(routineItem, ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), copyToTemp, false);
}
@Override
public void syncRoutine(RoutineItem routineItem, boolean copyToTemp, boolean forceUpdate) throws SystemException {
syncRoutine(routineItem, true, copyToTemp, forceUpdate);
syncRoutine(routineItem, ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), copyToTemp, forceUpdate);
}
@Override
public void syncRoutine(RoutineItem routineItem, boolean currentProject, boolean copyToTemp, boolean forceUpdate) throws SystemException {
public void syncRoutine(RoutineItem routineItem, String projectTechName, boolean copyToTemp, boolean forceUpdate)
throws SystemException {
boolean needSync = false;
if (routineItem != null) {
if (forceUpdate || !isRoutineUptodate(routineItem)) {
needSync = true;
} else {
IFile file = getRoutineFile(routineItem, currentProject);
IFile file = getRoutineFile(routineItem, projectTechName);
if (file != null && !file.exists()) {
needSync = true;
}
}
}
if (needSync) {
doSyncRoutine(routineItem, currentProject, copyToTemp);
if (currentProject) {
doSyncRoutine(routineItem, projectTechName, copyToTemp);
if (ProjectManager.getInstance().getCurrentProject().getTechnicalLabel().equals(projectTechName)) {
setRoutineAsUptodate(routineItem);
}
}
@@ -224,14 +232,14 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
public void syncRoutine(RoutineItem routineItem) throws SystemException {
if (routineItem != null) {
doSyncRoutine(routineItem, true, true);
doSyncRoutine(routineItem, ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), true);
setRoutineAsUptodate(routineItem);
}
}
private void doSyncRoutine(RoutineItem routineItem, boolean currentProject, boolean copyToTemp) throws SystemException {
private void doSyncRoutine(RoutineItem routineItem, String projectTechName, boolean copyToTemp) throws SystemException {
try {
IFile file = getRoutineFile(routineItem, currentProject);
IFile file = getRoutineFile(routineItem, projectTechName);
if (file == null) {
return;
}
@@ -374,7 +382,7 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
@Override
public void syncAllBeansForLogOn() throws SystemException {
for (RoutineItem beanItem : getBeans(true)) {
syncRoutine(beanItem, true, true, true);
syncRoutine(beanItem, true, true);
}
}

View File

@@ -45,7 +45,8 @@ public interface ITalendSynchronizer {
void syncRoutine(RoutineItem routineItem, boolean copyToTemp, boolean forceUpdate) throws SystemException;
void syncRoutine(RoutineItem routineItem, boolean currentProject, boolean copyToTemp, boolean forceUpdate) throws SystemException;
void syncRoutine(RoutineItem routineItem, String projectTechName, boolean copyToTemp, boolean forceUpdate)
throws SystemException;
IFile getFile(Item item) throws SystemException;

View File

@@ -159,6 +159,8 @@ public interface IDesignerCoreService extends IService {
public Set<ModuleNeeded> getNeededLibrariesForProcess(IProcess process, boolean withChildrens);
public Set<ModuleNeeded> getNeededLibrariesForProcessBeforeUpdateLog(IProcess process, boolean withChildrens);
public Set<ModuleNeeded> getNeededModules(INode node, boolean withChildrens);
public void switchToCurContextsView();
@@ -195,4 +197,7 @@ public interface IDesignerCoreService extends IService {
public void setTACReadTimeout(int timeout);
boolean isDelegateNode(INode node);
boolean isNeedContextInJar(IProcess process);
}

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.designer.runprocess;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
@@ -254,6 +255,9 @@ public interface IProcessor {
public String[] getCommandLine(boolean needContext, boolean externalUse, int statOption, int traceOption,
String... codeOptions);
public String[] getCommandLine(boolean needContext, boolean externalUse, int statOption, int traceOption, boolean ignoreCustomJVMSetting,
String... codeOptions);
public void setContext(IContext context);
@@ -295,6 +299,8 @@ public interface IProcessor {
String[] getJVMArgs();
Set<ModuleNeeded> getNeededModules(int options);
public void updateModulesAfterSetLog4j(Collection<ModuleNeeded> modulesNeeded);
Set<JobInfo> getBuildChildrenJobs();

View File

@@ -216,6 +216,8 @@ public interface IRunProcessService extends IService {
ITalendProcessJavaProject getTalendJobJavaProject(Property property);
IFolder getCodeSrcFolder(ERepositoryObjectType type, String projectTechName);
ITalendProcessJavaProject getTempJavaProject();
void clearProjectRelatedSettings();
@@ -237,4 +239,6 @@ public interface IRunProcessService extends IService {
public void handleJobDependencyLoop(JobInfo mainJobInfo, List<JobInfo> listJobs, IProgressMonitor progressMonitor)
throws Exception;
public boolean isSelectLog4j2();
}

View File

@@ -71,7 +71,12 @@ public class ItemCacheManager {
processItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1]);
} else {
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(parsedArray[0]);
processItem = getProcessItem(project, parsedArray[1]);
if (project != null) {
processItem = getProcessItem(project, parsedArray[1]);
}
if (processItem == null) {
processItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1]);
}
}
return processItem;
}
@@ -112,7 +117,12 @@ public class ItemCacheManager {
refProcessItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1], version);
} else {
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(parsedArray[0]);
refProcessItem = getProcessItem(project, parsedArray[1], version);
if (project != null) {
refProcessItem = getProcessItem(project, parsedArray[1], version);
}
if (refProcessItem == null) {
refProcessItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1], version);
}
}
return refProcessItem;
}

View File

@@ -200,6 +200,10 @@ public final class ProjectManager {
* return all the referenced projects of current project.
*/
public List<Project> getAllReferencedProjects(boolean force) {
return getAllReferencedProjects(getCurrentProject(), force);
}
public List<Project> getAllReferencedProjects(Project targetProject, boolean force) {
List<Project> allReferencedprojects = new ArrayList<Project>();
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
if (this.getCurrentProject() == null) {
@@ -212,7 +216,7 @@ public final class ProjectManager {
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
if (factory != null) {
List<org.talend.core.model.properties.Project> rProjects = factory
.getReferencedProjects(this.getCurrentProject());
.getReferencedProjects(targetProject);
if (rProjects != null) {
for (org.talend.core.model.properties.Project p : rProjects) {
Project project = new Project(p);

View File

@@ -461,6 +461,9 @@ public interface IProxyRepositoryFactory {
public void forceDeleteObjectPhysical(IRepositoryViewObject objToDelete, String version, boolean isDeleteOnRemote) throws PersistenceException;
public void forceBatchDeleteObjectPhysical(Project project, List<IRepositoryViewObject> objToDeleteList,
boolean isDeleteAllVersion, boolean isDeleteOnRemote) throws PersistenceException;
public Property getUptodateProperty(Project project, Property property) throws PersistenceException;
public Property getUptodateProperty(Property property) throws PersistenceException;

View File

@@ -138,4 +138,6 @@ public interface IRepositoryService extends IService {
boolean isGIT();
public void setShouldCheckRepoViewCommonNavigatorDirty(IRepositoryView repView, boolean shouldFlag);
}

View File

@@ -98,6 +98,8 @@ public class RepositoryConstants {
public static final String REPOSITORY_CLOUD_APAC_ID = "cloud_apac"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_US_WEST_ID = "cloud_us_west"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_CUSTOM_ID = "cloud_custom"; //$NON-NLS-1$
public static final String REPOSITORY_URL = "url"; //$NON-NLS-1$

View File

@@ -35,6 +35,7 @@ import org.talend.core.model.general.ConnectionBean;
import org.talend.utils.json.JSONArray;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
import org.talend.utils.security.EncryptedProperties;
/**
* DOC hwang class global comment. Detailled comment
@@ -126,8 +127,8 @@ public class ConnectionUserPerReader {
if (!isHaveUserPer()) {
createPropertyFile();
}
try {
proper.load(new FileInputStream(perfile));
try (FileInputStream fi = new FileInputStream(perfile)) {
proper.load(fi);
isRead = true;
} catch (FileNotFoundException e) {
e.printStackTrace();
@@ -176,9 +177,7 @@ public class ConnectionUserPerReader {
}
proper.setProperty("connection.define", usersJsonArray.toString());//$NON-NLS-1$
}
try {
FileOutputStream out = new FileOutputStream(perfile);
try (FileOutputStream out = new FileOutputStream(perfile)) {
proper.store(out, null);
} catch (Exception e) {
e.printStackTrace();
@@ -202,9 +201,8 @@ public class ConnectionUserPerReader {
proper.remove("connection.lastConnection"); //$NON-NLS-1$
}
}
FileOutputStream out;
try {
out = new FileOutputStream(perfile);
;
try (FileOutputStream out = new FileOutputStream(perfile)) {
proper.store(out, null);
} catch (Exception e) {
e.printStackTrace();
@@ -286,9 +284,7 @@ public class ConnectionUserPerReader {
IPreferenceStore prefStore = PlatformUI.getPreferenceStore();
proper.setProperty("connection.readRegistration", Integer.toString(prefStore.getInt("REGISTRATION_TRIES")));
proper.setProperty("connection.readRegistrationDone", Integer.toString(prefStore.getInt("REGISTRATION_DONE")));
try {
FileOutputStream out = new FileOutputStream(perfile);
try (FileOutputStream out = new FileOutputStream(perfile)) {
proper.store(out, null);
} catch (Exception e) {
e.printStackTrace();
@@ -317,8 +313,7 @@ public class ConnectionUserPerReader {
String val = entry.getValue();
proper.setProperty(key, val);
}
try {
FileOutputStream out = new FileOutputStream(perfile);
try (FileOutputStream out = new FileOutputStream(perfile)) {
proper.store(out, null);
} catch (Exception e) {
e.printStackTrace();
@@ -334,9 +329,7 @@ public class ConnectionUserPerReader {
}
IPreferenceStore prefStore = PlatformUI.getPreferenceStore();
proper.setProperty("connection.licenseManagement", Integer.toString(prefStore.getInt("LICENSE_VALIDATION_DONE")));
try {
FileOutputStream out = new FileOutputStream(perfile);
try (FileOutputStream out = new FileOutputStream(perfile)) {
proper.store(out, null);
} catch (Exception e) {
e.printStackTrace();
@@ -362,8 +355,7 @@ public class ConnectionUserPerReader {
this.readProperties();
}
proper.setProperty("connection.installDone", Boolean.TRUE.toString()); //$NON-NLS-1$
try {
FileOutputStream out = new FileOutputStream(perfile);
try (FileOutputStream out = new FileOutputStream(perfile)) {
proper.store(out, null);
} catch (Exception e) {
e.printStackTrace();

View File

@@ -619,4 +619,6 @@ I18nPreferencePage.importBabili=Import Translation from Babili
I18nPreferencePage.restart=Restart
I18nPreferencePage.restartButton=Need to restart to take effect.
I18nPreferencePage.restoreDefault=Restore default
I18nPreferencePage.wait_process=Process will hold on several minutes, please wait...
I18nPreferencePage.wait_process=Process will hold on several minutes, please wait...
MetadataPreferencePage.EnableBasic.name=Enable Basic Authentication Header
MetadataPreferencePage.MessageDialog.Restart=Will restart the studio to apply this setting. \nAre you sure?

View File

@@ -152,11 +152,11 @@ public class FilteredCheckboxTree extends Composite {
*/
static {
ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PlatformUI.PLUGIN_ID,
"$nl$/icons/full/etool16/clear_co.gif"); //$NON-NLS-1$
"$nl$/icons/full/etool16/clear_co.png"); //$NON-NLS-1$
if (descriptor != null) {
JFaceResources.getImageRegistry().put(CLEAR_ICON, descriptor);
}
descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PlatformUI.PLUGIN_ID, "$nl$/icons/full/dtool16/clear_co.gif"); //$NON-NLS-1$
descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PlatformUI.PLUGIN_ID, "$nl$/icons/full/dtool16/clear_co.png"); //$NON-NLS-1$
if (descriptor != null) {
JFaceResources.getImageRegistry().put(DCLEAR_ICON, descriptor);
}

View File

@@ -472,7 +472,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
paramNameFound = true;
paramName = NEW_PARAM_NAME + numParam;
for (int i = 0; i < listParams.size(); i++) {
if (paramName.equals(listParams.get(i).getName())) {
if (paramName.equalsIgnoreCase(listParams.get(i).getName())) {
paramNameFound = false;
}
}

View File

@@ -715,6 +715,13 @@ public class SelectRepositoryContextDialog extends SelectionDialog {
if (param != null && param.isBuiltIn()) {
return false;
}
if (param == null) {
boolean containsSameParameterIgnoreCase = manager.getDefaultContext()
.containsSameParameterIgnoreCase(paramType.getName());
if (containsSameParameterIgnoreCase) {
return false;
}
}
}
return true;
}

View File

@@ -17,6 +17,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.gef.commands.Command;
@@ -152,8 +153,8 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
String uinqueTableName = node.getProcess().generateUniqueConnectionName(
MultiSchemasUtil.getConnectionBaseName(newMetadatTable.getLabel()));
String paramType = getParamType(newMetadatTable, isInput);
if (paramType == null) {
String type = getType(newMetadatTable, isInput);
if (type == null) {
return;
}
if (selectionIndex != null && selectionIndex < paramValues.size()) {
@@ -165,18 +166,19 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
paramValues.add(valueMap);
}
valueMap.put(ISAPConstant.NAME, TalendQuoteUtils.addQuotes(newMetadatTable.getLabel()));
valueMap.put(ISAPConstant.TYPE, paramType);
valueMap.put(ISAPConstant.TYPE, type);
valueMap.put(ISAPConstant.FIELD_SCHEMA, uinqueTableName);
if (isInput) {
valueMap.put(ISAPConstant.PARENT_ROW, ""); //$NON-NLS-1$
if (functionUnit != null && functionUnit.getParamData() != null
&& functionUnit.getParamData().getInputRoot() != null) {
for (SAPFunctionParameter param : functionUnit.getParamData().getInputRoot().getChildren()) {
if (param.getName().equals(newMetadatTable.getTableName())) {
valueMap.put(ISAPConstant.CHANGING, param.isChanging());
}
}
String inputParameterType = getInputParameterType(functionUnit, newMetadatTable);
if (StringUtils.isBlank(inputParameterType)) {
inputParameterType = ISAPConstant.PARAMETER_TYPE_IMPORT;
}
valueMap.put(ISAPConstant.PARAMETER_TYPE, inputParameterType);
valueMap.put(ISAPConstant.CHANGING, ISAPConstant.PARAMETER_TYPE_CHANGING.equals(inputParameterType));
Map<String, String> properties = newMetadatTable.getAdditionalProperties();
if (properties != null) {
properties.put(ISINPUT, TRUE);
@@ -195,7 +197,37 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
}
}
private String getParamType(IMetadataTable table, boolean isInput) {
private String getInputParameterType(SAPFunctionUnit funcUnit, IMetadataTable newMetadatTable) {
String parameterType = "";
if (funcUnit != null && funcUnit.getParamData() != null && funcUnit.getParamData().getInputRoot() != null) {
SAPFunctionParameter foundParam = null;
String tableName = newMetadatTable.getTableName();
for (SAPFunctionParameter param : funcUnit.getParamData().getInputRoot().getChildren()) {
if (tableName.equals(param.getName())) {
foundParam = param;
break;
}
}
if (foundParam != null) {
if (foundParam.isChanging()) {
parameterType = ISAPConstant.PARAMETER_TYPE_CHANGING;
} else {
if (ISAPConstant.PARAM_TABLE.equals(foundParam.getType())) {
if (foundParam.isTableResideInTables()) {
parameterType = ISAPConstant.PARAMETER_TYPE_TABLES;
} else {
parameterType = ISAPConstant.PARAMETER_TYPE_IMPORT;
}
} else {
parameterType = ISAPConstant.PARAMETER_TYPE_IMPORT;
}
}
}
}
return parameterType;
}
private String getType(IMetadataTable table, boolean isInput) {
if (functionUnit == null) {
return null;
}

View File

@@ -47,7 +47,9 @@ import org.talend.commons.utils.VersionUtils;
import org.talend.core.CorePlugin;
import org.talend.core.model.genhtml.FileCopyUtils;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.ui.i18n.Messages;
import org.talend.repository.model.IProxyRepositoryFactory;
public abstract class I18nPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
@@ -138,19 +140,27 @@ public abstract class I18nPreferencePage extends FieldEditorPreferencePage imple
serbian = "Serbian"; //$NON-NLS-1$
}
String[][] entryNamesAndValues =
{ { Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH), Locale.ENGLISH.getLanguage() },
{ Locale.FRENCH.getDisplayLanguage(Locale.FRENCH), Locale.FRENCH.getLanguage() },
{ Locale.CHINESE.getDisplayLanguage(Locale.CHINESE), "zh_CN" },
{ Locale.GERMAN.getDisplayLanguage(Locale.GERMAN), Locale.GERMAN.getLanguage() },
{ Locale.JAPANESE.getDisplayLanguage(Locale.JAPANESE), Locale.JAPANESE.getLanguage() },
{ Locale.ITALIAN.getDisplayLanguage(Locale.ITALIAN), Locale.ITALIAN.getLanguage() },
{ "Brasil", "pt_BR" }, //$NON-NLS-1$ //$NON-NLS-2$
{ spanish, "es" }, { russian, "ru" }, //$NON-NLS-1$ //$NON-NLS-2$
{ Locale.KOREA.getDisplayLanguage(Locale.KOREA), "kr" }, { "Turkish", "tr" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
{ greek, "el" }, { "Hrvatski", "hr" }, { arabic, "ar" }, { serbian, "sr" }, { "Polski", "pl" },
{ "Romanian", "ro" }, { "Netherlands", "nl" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
// // /$NON-NLS-7$
String slovak = "Sloven\u010dina";//$NON-NLS-1$
try {
utf8Bytes = slovak.getBytes("UTF8");//$NON-NLS-1$
slovak = new String(utf8Bytes, "UTF8");//$NON-NLS-1$
} catch (UnsupportedEncodingException e2) {
slovak = "Slovak";//$NON-NLS-1$
}
String[][] entryNamesAndValues = { { Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH), Locale.ENGLISH.getLanguage() },
{ Locale.FRENCH.getDisplayLanguage(Locale.FRENCH) + " (French)", Locale.FRENCH.getLanguage() }, //$NON-NLS-1$
{ Locale.CHINESE.getDisplayLanguage(Locale.CHINESE) + " (Chinese)", "zh_CN" }, //$NON-NLS-1$ //$NON-NLS-2$
{ Locale.GERMAN.getDisplayLanguage(Locale.GERMAN) + " (German)", Locale.GERMAN.getLanguage() }, //$NON-NLS-1$
{ Locale.JAPANESE.getDisplayLanguage(Locale.JAPANESE) + " (Japanese)", Locale.JAPANESE.getLanguage() }, //$NON-NLS-1$
{ Locale.ITALIAN.getDisplayLanguage(Locale.ITALIAN) + " (Italian)", Locale.ITALIAN.getLanguage() }, //$NON-NLS-1$
{ "Brasil (Brazilian)", "pt_BR" }, //$NON-NLS-1$ //$NON-NLS-2$
{ spanish + " (Spanish)", "es" }, { russian + " (Russion)", "ru" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
{ Locale.KOREA.getDisplayLanguage(Locale.KOREA) + " (Korean)", "kr" }, { "Turkish (Turkish)", "tr" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
{ greek + " (Greek)", "el" }, { "Hrvatski (Croatian)", "hr" }, { arabic + " (Arabic)", "ar" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$
{ serbian + " (Serbian)", "sr" }, { "Polski (Polish)", "pl" }, { "Romanian (Romanian)", "ro" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$
{ "Netherlands (Netherlands)", "nl" }, { slovak + " (Slovak)", "sk" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
{ "Current OS Language", Locale.getDefault().getLanguage() } };//$NON-NLS-1$
languageSelectionEditor = new OneLineComboFieldEditor(ITalendCorePrefConstants.LANGUAGE_SELECTOR,
Messages.getString("I18nPreferencePage.needRestart"), entryNamesAndValues, getFieldEditorParent()); //$NON-NLS-1$
addField(languageSelectionEditor);
@@ -219,6 +229,8 @@ public abstract class I18nPreferencePage extends FieldEditorPreferencePage imple
}
}
});
handleUserReadOnlyStatus(composite);
}
private void applyBabiliResource(String zipFileName) {
@@ -649,4 +661,27 @@ public abstract class I18nPreferencePage extends FieldEditorPreferencePage imple
fields.add(editor);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.PreferencePage#contributeButtons(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void contributeButtons(Composite parent) {
super.contributeButtons(parent);
handleUserReadOnlyStatus(parent);
}
/**
*
* When the user is read only for current project then setting composite is disable
*
* @param mainComposite
*/
public void handleUserReadOnlyStatus(Composite mainComposite) {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
if (factory.isUserReadOnlyOnCurrentProject()) {
mainComposite.setEnabled(false);
}
}
}

View File

@@ -1,5 +1,9 @@
package org.talend.core.ui.preference.metadata;
import java.io.File;
import java.util.Properties;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
@@ -7,13 +11,20 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.i18n.Messages;
import org.talend.core.ui.utils.PluginUtil;
public class MetadataPrecisionPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
IntegerFieldEditor xmlColumnsLimit;
private static final String DISABLED_SCHEMES_KEY = "jdk.http.auth.tunneling.disabledSchemes";
public MetadataPrecisionPage() {
setPreferenceStore(CoreUIPlugin.getDefault().getPreferenceStore());
}
@@ -30,6 +41,9 @@ public class MetadataPrecisionPage extends FieldEditorPreferencePage implements
textControl.setToolTipText("Set the maximum number of schema table columns the xml metadata support. ");
xmlColumnsLimit.setValidRange(1, Short.MAX_VALUE);
addField(xmlColumnsLimit);
addField(new BooleanFieldEditor(ITalendCorePrefConstants.METADATA_PREFERENCE_PAGE_ENABLE_BASIC,
Messages.getString("MetadataPreferencePage.EnableBasic.name"), getFieldEditorParent()));
}
public void init(IWorkbench workbench) {
@@ -39,7 +53,29 @@ public class MetadataPrecisionPage extends FieldEditorPreferencePage implements
public boolean performOk() {
getPreferenceStore().setValue(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML, xmlColumnsLimit.getIntValue());
return super.performOk();
boolean stored = getPreferenceStore().getBoolean(ITalendCorePrefConstants.METADATA_PREFERENCE_PAGE_ENABLE_BASIC);
boolean ok = super.performOk();
boolean checked = getPreferenceStore().getBoolean(ITalendCorePrefConstants.METADATA_PREFERENCE_PAGE_ENABLE_BASIC);
if (stored != checked) {
try {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
boolean confirm = MessageDialog.openConfirm(window.getShell(), "Confirm", //$NON-NLS-1$
Messages.getString("MetadataPreferencePage.MessageDialog.Restart")); //$NON-NLS-1$
File configFile = PluginUtil.getStudioConfigFile();
Properties configProperties = PluginUtil.readProperties(configFile);
if (checked) {
configProperties.setProperty(DISABLED_SCHEMES_KEY, "");
} else {
configProperties.remove(DISABLED_SCHEMES_KEY);
}
PluginUtil.saveProperties(configFile, configProperties, null);
if (confirm) {
PlatformUI.getWorkbench().restart();
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return ok;
}
}

View File

@@ -18,8 +18,8 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.daikon.security.CryptoHelper;
import org.talend.daikon.token.TokenGenerator;
import org.talend.utils.security.StudioEncryption;
import us.monoid.json.JSONObject;
@@ -47,7 +47,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
}
public static String calcUniqueId() {
return TokenGenerator.generateMachineToken(new CryptoHelper(CryptoHelper.PASSPHRASE));
return TokenGenerator.generateMachineToken((src) -> StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).encrypt(src));
}
/*

View File

@@ -12,11 +12,18 @@
// ============================================================================
package org.talend.core.ui.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
import java.util.Properties;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -104,4 +111,28 @@ public class PluginUtil {
}
return part.getEditorSite().getId();
}
public static File getStudioConfigFile() throws Exception {
URL configLocation = new URL("platform:/config/config.ini"); //$NON-NLS-1$
URL fileUrl = FileLocator.toFileURL(configLocation);
return URIUtil.toFile(new URI(fileUrl.getProtocol(), fileUrl.getPath(), fileUrl.getQuery()));
}
public static Properties readProperties(final File config) {
final Properties configuration = new Properties();
try (final InputStream stream = new FileInputStream(config)) {
configuration.load(stream);
} catch (final IOException e) {
throw new IllegalArgumentException(e);
}
return configuration;
}
public static void saveProperties(final File config, Properties prop, String comment) {
try (FileOutputStream oFile = new FileOutputStream(config)) {
prop.store(oFile, comment);
}catch(final IOException e) {
throw new IllegalArgumentException(e);
}
}
}

View File

@@ -54,6 +54,7 @@ import org.talend.core.model.metadata.QueryUtil;
import org.talend.core.model.metadata.builder.ConvertionHelper;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.process.ElementParameterParser;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.IRepositoryViewObject;
@@ -280,9 +281,10 @@ public class CoreService implements ICoreService {
ICodeGeneratorService codeGenService = (ICodeGeneratorService) GlobalServiceRegister.getDefault().getService(
ICodeGeneratorService.class);
codeGenService.createRoutineSynchronizer().syncAllRoutinesForLogOn();
codeGenService.createRoutineSynchronizer().syncAllPigudfForLogOn();
if (ProcessUtils.isRequiredPigUDFs(null)) {
codeGenService.createRoutineSynchronizer().syncAllPigudfForLogOn();
}
}
}
@Override

View File

@@ -16,7 +16,7 @@ import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.talend.commons.exception.WarningException;
import org.talend.commons.exception.ExceptionHandler;
/**
* cli class global comment. Detailled comment
@@ -104,26 +104,31 @@ public final class ProcessStreamTrashReaderUtil {
public static void readAndForget(final Process process) {
try {
final String encoding = "UTF-8";
// input stream thread
new Thread() {
public void run() {
InputStream is = process.getInputStream();
InputStreamReader din = new InputStreamReader(is);
BufferedReader reader = new BufferedReader(din);
try {
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println("getInputStream " + line); //$NON-NLS-1$
}
} catch (Exception ex) {
// nothing to do
} finally {
InputStream is = process.getInputStream();
InputStreamReader din = new InputStreamReader(is, encoding);
BufferedReader reader = new BufferedReader(din);
try {
is.close();
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println("getInputStream " + line); //$NON-NLS-1$
}
} catch (Exception ex) {
// nothing to do
} finally {
try {
is.close();
} catch (Exception ex) {
// nothing to do
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}.start();
@@ -132,23 +137,31 @@ public final class ProcessStreamTrashReaderUtil {
new Thread() {
public void run() {
InputStream is = process.getErrorStream();
InputStreamReader din = new InputStreamReader(is);
BufferedReader reader = new BufferedReader(din);
try {
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println("getErrorStream " + line); //$NON-NLS-1$
throw new WarningException("AAAAA");
}
} catch (Exception ex) {
// nothing to do
} finally {
InputStream is = process.getErrorStream();
InputStreamReader din = new InputStreamReader(is, encoding);
BufferedReader reader = new BufferedReader(din);
StringBuilder strBuilder = new StringBuilder();
try {
is.close();
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println("getErrorStream " + line); //$NON-NLS-1$
strBuilder.append(line).append("\n");
}
} catch (Exception ex) {
// nothing to do
} finally {
try {
is.close();
} catch (Exception ex) {
// nothing to do
}
}
if (!strBuilder.toString().replaceAll("[\n]", " ").trim().isEmpty()) {
throw new Exception(strBuilder.toString());
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}.start();

View File

@@ -15,7 +15,10 @@ package org.talend.core.services;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.osgi.service.prefs.BackingStoreException;
import org.talend.commons.exception.PersistenceException;
@@ -54,6 +57,9 @@ public interface ICoreTisService extends IService {
public void downLoadAndInstallUpdates(String userName, String password, String adminUrl) throws Exception;
public void downLoadAndInstallUpdates(IProgressMonitor monitor, String userName, String password, String adminUrl)
throws Exception;
public boolean isLicenseExpired();
public boolean isTheSameType(String userName, String password, String adminUrl);
@@ -66,4 +72,10 @@ public interface ICoreTisService extends IService {
public void updateConfiguratorBundles(File configFile, File tempConfigFile) throws IOException;
Map<String, String> getExtraBundleInfo4Patch(File featureIndexFile) throws IOException;
Map<String, String> getDropBundleInfo() throws IOException;
Set<String> getComponentBlackList();
}

View File

@@ -64,6 +64,8 @@ import org.talend.core.language.LanguageManager;
import org.talend.core.model.components.ComponentCategory;
import org.talend.core.model.components.EComponentType;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IComponentsFactory;
import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.IMetadataColumn;
@@ -81,6 +83,7 @@ import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.Relation;
@@ -258,6 +261,7 @@ public class ProcessorUtilities {
exportConfig = false;
exportAsOSGI = false;
exportTimeStamp = null;
exportJobAsMicroService = false;
}
public static String getInterpreter() {
@@ -613,28 +617,55 @@ public class ProcessorUtilities {
return processor;
}
private static boolean checkLoopDependencies(Relation mainJobInfo, Map<String, String> idToLastestVersionMap)
public static boolean checkLoopDependencies(Relation mainJobInfo, Map<String, String> idToLastestVersionMap)
throws ProcessorException {
List<Relation> itemsJobRelatedTo = getItemsRelation(mainJobInfo, idToLastestVersionMap);
List<Relation> relationChecked = new ArrayList<>();
relationChecked.add(mainJobInfo);
return checkLoopDependencies(mainJobInfo, itemsJobRelatedTo, relationChecked, idToLastestVersionMap);
return checkLoopDependencies(mainJobInfo, mainJobInfo, itemsJobRelatedTo, relationChecked, idToLastestVersionMap);
}
private static boolean checkLoopDependencies(Relation mainRelation, List<Relation> itemsJobRelatedTo,
private static boolean checkLoopDependencies(Relation mainRelation, Relation currentRelation,
List<Relation> itemsJobRelatedTo,
List<Relation> relationChecked, Map<String, String> idToLastestVersionMap) throws ProcessorException {
boolean hasDependency = false;
for (Relation relation : itemsJobRelatedTo) {
try {
// means the tRunjob deactivate, or one of the specific version tRunjon deactivate, skip
Map<String, Set<String>> actTrunjobHM = getActivateTRunjobMap(currentRelation.getId(),
currentRelation.getVersion());
if (actTrunjobHM.get(relation.getId()) == null
|| !actTrunjobHM.get(relation.getId()).contains(relation.getVersion())) {
continue;
}
} catch (Exception e) {
throw new ProcessorException(e);
}
hasDependency = relation.getId().equals(mainRelation.getId())
&& relation.getVersion().equals(mainRelation.getVersion());
if (!hasDependency) {
List<Relation> itemsChildJob = getItemsRelation(relation, idToLastestVersionMap);
if (!relationChecked.contains(relation)) {
relationChecked.add(relation);
hasDependency = checkLoopDependencies(mainRelation, itemsChildJob, relationChecked, idToLastestVersionMap);
hasDependency = checkLoopDependencies(mainRelation, relation, itemsChildJob, relationChecked,
idToLastestVersionMap);
}
if (!hasDependency) {
for (Relation childRelation : itemsChildJob) {
try {
// means the tRunjob deactivate, or one of the specific version tRunjon deactivate, skip
Map<String, Set<String>> activateTRunjobMap = getActivateTRunjobMap(relation.getId(),
relation.getVersion());
if (activateTRunjobMap.get(childRelation.getId()) == null
|| !activateTRunjobMap.get(childRelation.getId()).contains(childRelation.getVersion())) {
continue;
}
} catch (Exception e) {
throw new ProcessorException(e);
}
hasDependency = checkLoopDependencies(childRelation, idToLastestVersionMap);
if (hasDependency) {
break;
@@ -650,6 +681,133 @@ public class ProcessorUtilities {
return hasDependency;
}
private static Map<String, Set<String>> getActivateTRunjobMap(String id, String version) throws PersistenceException {
Map<String, Set<String>> actTrunjobHM = new HashMap<String, Set<String>>();
ProcessType processType = null;
try {
IRepositoryViewObject currentJobObject = ProxyRepositoryFactory.getInstance().getSpecificVersion(id, version, true);
if (currentJobObject != null) {
Item item = currentJobObject.getProperty().getItem();
if (item instanceof ProcessItem) {
processType = ((ProcessItem) item).getProcess();
} else if (item instanceof JobletProcessItem) {
processType = ((JobletProcessItem) item).getJobletProcess();
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
if (processType != null) {
List<Project> allProjects = new ArrayList<Project>();
allProjects.add(ProjectManager.getInstance().getCurrentProject());
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects());
List<String> jobletsComponentsList = new ArrayList<String>();
IComponentsFactory componentsFactory = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentsService.class)) {
IComponentsService compService = (IComponentsService) GlobalServiceRegister.getDefault()
.getService(IComponentsService.class);
if (compService != null) {
componentsFactory = compService.getComponentsFactory();
for (IComponent component : componentsFactory.readComponents()) {
if (component.getComponentType() == EComponentType.JOBLET) {
jobletsComponentsList.add(component.getName());
}
}
}
}
String jobletPaletteType = null;
String frameWork = processType.getFramework();
if (StringUtils.isBlank(frameWork)) {
jobletPaletteType = ComponentCategory.CATEGORY_4_DI.getName();
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARK.getName();
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
}
for (Object nodeObject : processType.getNode()) {
NodeType node = (NodeType) nodeObject;
// not tRunjob && not joblet then continue
if (!node.getComponentName().equals("tRunJob") && !jobletsComponentsList.contains(node.getComponentName())) { // $NON-NLS-1$
continue;
}
boolean nodeActivate = true;
String processIds = null;
String processVersion = null;
for (Object elementParam : node.getElementParameter()) {
ElementParameterType elemParamType = (ElementParameterType) elementParam;
if ("PROCESS:PROCESS_TYPE_PROCESS".equals(elemParamType.getName())) { // $NON-NLS-1$
processIds = elemParamType.getValue();
if (StringUtils.isNotBlank(processIds)) {
for (String jobId : processIds.split(ProcessorUtilities.COMMA)) {
if (actTrunjobHM.get(jobId) == null) {
actTrunjobHM.put(jobId, new HashSet<String>());
}
}
}
} else if ("PROCESS:PROCESS_TYPE_VERSION".equals(elemParamType.getName()) // $NON-NLS-1$
|| "PROCESS_TYPE_VERSION".equals(elemParamType.getName())) { // $NON-NLS-1$
processVersion = elemParamType.getValue();
} else if ("ACTIVATE".equals(elemParamType.getName())) { // $NON-NLS-1$
nodeActivate = Boolean.parseBoolean(elemParamType.getValue());
}
}
if (nodeActivate) {
if (StringUtils.isNotBlank(processIds)) {
for (String jobId : processIds.split(ProcessorUtilities.COMMA)) {
String actualVersion = processVersion;
if (RelationshipItemBuilder.LATEST_VERSION.equals(processVersion)) {
for (Project project : allProjects) {
IRepositoryViewObject lastVersion = null;
lastVersion = ProxyRepositoryFactory.getInstance().getLastVersion(project, jobId);
if (lastVersion != null) {
actualVersion = lastVersion.getVersion();
break;
}
}
}
if (actTrunjobHM.get(jobId) != null) {
actTrunjobHM.get(jobId).add(actualVersion);
}
}
} else if (componentsFactory != null && jobletPaletteType != null) {
// for joblet
IComponent cc = componentsFactory.get(node.getComponentName(), jobletPaletteType);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IJobletProviderService.class)) {
IJobletProviderService jobletService = (IJobletProviderService) GlobalServiceRegister.getDefault()
.getService(IJobletProviderService.class);
Property property = jobletService.getJobletComponentItem(cc);
if (property != null && StringUtils.isNotBlank(property.getId())) {
String jobletId = property.getId();
if (actTrunjobHM.get(jobletId) == null) {
actTrunjobHM.put(jobletId, new HashSet<String>());
}
String actualVersion = processVersion;
if (RelationshipItemBuilder.LATEST_VERSION.equals(processVersion)) {
for (Project project : allProjects) {
IRepositoryViewObject lastVersion = null;
lastVersion = ProxyRepositoryFactory.getInstance().getLastVersion(project, jobletId);
if (lastVersion != null) {
actualVersion = lastVersion.getVersion();
break;
}
}
}
actTrunjobHM.get(jobletId).add(actualVersion);
}
}
}
}
}
}
return actTrunjobHM;
}
private static List<Relation> getItemsRelation(Relation mainJobInfo, Map<String, String> idToLastestVersionMap) throws ProcessorException {
List<Relation> itemsJobRelatedTo = new ArrayList<Relation>();
try {
@@ -756,7 +914,7 @@ public class ProcessorUtilities {
public static boolean hasMetadataDynamic(IProcess currentProcess, JobInfo jobInfo) {
boolean hasDynamicMetadata = false;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class) && !isExportConfig()) {
IDesignerCoreService designerCoreService =
(IDesignerCoreService) GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
for (INode node : currentProcess.getGraphicalNodes()) {
@@ -1073,9 +1231,11 @@ public class ProcessorUtilities {
JobInfo parentJob = jobInfo.getFatherJobInfo();
if (parentJob != null && (parentJob.getProcessor() != null)) {
for (JobInfo subJob : parentJob.getProcessor().getBuildChildrenJobs()) {
if (ProcessUtils.isSameProperty(subJob.getJobId(), jobInfo.getJobId(), false)) {
subJob.setProcessor(processor);
}
}
}
if (!timerStarted) {
@@ -1229,14 +1389,23 @@ public class ProcessorUtilities {
public static void cleanSourceFolder(IProgressMonitor progressMonitor, IProcess currentProcess,
IProcessor processor) {
try {
ITalendProcessJavaProject jobProject = processor.getTalendJavaProject();
// clean up source code
IPath codePath = processor.getSrcCodePath().removeLastSegments(2);
IFolder srcFolder = processor.getTalendJavaProject().getProject().getFolder(codePath);
IFolder srcFolder = jobProject.getProject().getFolder(codePath);
String jobPackageFolder = JavaResourcesHelper.getJobClassPackageFolder(currentProcess);
for (IResource resource : srcFolder.members()) {
if (resource.getProjectRelativePath().toPortableString().endsWith(jobPackageFolder)) {
break;
if (!resource.getProjectRelativePath().toPortableString().endsWith(jobPackageFolder)) {
resource.delete(true, progressMonitor);
}
}
// clean up resources folder if needed
if (ProcessorUtilities.isExportConfig() && !designerCoreService.isNeedContextInJar(currentProcess)) {
for (IResource resource : jobProject.getResourcesFolder().members()) {
if (resource.exists()) {
resource.delete(true, progressMonitor);
}
}
resource.delete(true, progressMonitor);
}
} catch (CoreException e) {
ExceptionHandler.process(e);
@@ -2026,7 +2195,15 @@ public class ProcessorUtilities {
public static String[] getCommandLine(String targetPlatform, boolean skipClasspathJar, boolean externalUse,
String processId, String contextName, int statisticPort, int tracePort, String... codeOptions)
throws ProcessorException {
return getCommandLine(targetPlatform, skipClasspathJar, externalUse,
processId, contextName, statisticPort, tracePort, false, codeOptions);
}
//ignoreCustomJVMSetting mean will generate the java command without the job VM setting in studio "Run job" setting and studio preferences "Run/Debug" setting
//only use for TDI-42443 in tRunJob
public static String[] getCommandLine(String targetPlatform, boolean skipClasspathJar, boolean externalUse,
String processId, String contextName, int statisticPort, int tracePort, boolean ignoreCustomJVMSetting, String... codeOptions)
throws ProcessorException {
IProcessor processor = findProcessorFromJobList(processId, contextName, null);
if (processor != null && targetPlatform.equals(processor.getTargetPlatform())) {
if (processor.isProcessUnloaded()) {
@@ -2035,7 +2212,7 @@ public class ProcessorUtilities {
boolean oldSkipClasspathJar = processor.isSkipClasspathJar();
processor.setSkipClasspathJar(skipClasspathJar);
try {
return processor.getCommandLine(true, externalUse, statisticPort, tracePort, codeOptions);
return processor.getCommandLine(true, externalUse, statisticPort, tracePort, ignoreCustomJVMSetting, codeOptions);
} finally {
processor.setSkipClasspathJar(oldSkipClasspathJar);
}
@@ -2053,7 +2230,7 @@ public class ProcessorUtilities {
}
// because all jobs are based one new way, set the flag "oldBuildJob" to false.
return getCommandLine(false, skipClasspathJar, targetPlatform, externalUse, process,
selectedProcessItem.getProperty(), contextName, true, statisticPort, tracePort, codeOptions);
selectedProcessItem.getProperty(), contextName, true, statisticPort, tracePort, ignoreCustomJVMSetting, codeOptions);
}
/**
@@ -2127,6 +2304,14 @@ public class ProcessorUtilities {
public static String[] getCommandLine(boolean oldBuildJob, boolean skipClasspathJar, String targetPlatform,
boolean externalUse, IProcess currentProcess, Property property, String contextName, boolean needContext,
int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
return getCommandLine(oldBuildJob, skipClasspathJar, targetPlatform,
externalUse, currentProcess, property, contextName, needContext,
statisticPort, tracePort, false, codeOptions);
}
private static String[] getCommandLine(boolean oldBuildJob, boolean skipClasspathJar, String targetPlatform,
boolean externalUse, IProcess currentProcess, Property property, String contextName, boolean needContext,
int statisticPort, int tracePort, boolean ignoreCustomJVMSetting, String... codeOptions) throws ProcessorException {
if (currentProcess == null) {
return new String[] {};
}
@@ -2139,7 +2324,7 @@ public class ProcessorUtilities {
processor.setSkipClasspathJar(skipClasspathJar);
processor.setTargetPlatform(targetPlatform);
processor.setOldBuildJob(oldBuildJob);
return processor.getCommandLine(needContext, externalUse, statisticPort, tracePort, codeOptions);
return processor.getCommandLine(needContext, externalUse, statisticPort, tracePort, ignoreCustomJVMSetting, codeOptions);
}
public static String[] getCommandLine(boolean oldBuildJob, String targetPlatform, boolean externalUse,
@@ -2588,15 +2773,44 @@ public class ProcessorUtilities {
return doSupportDynamicHadoopConfLoading(property) && !isExportAsOSGI();
}
public static boolean isEsbJob(String processId, String version) {
return esbJobs.contains(esbJobKey(processId, version));
public static boolean isEsbJob(IProcess process) {
return isEsbJob(process, false);
}
public static boolean isEsbJob(IProcess process, boolean checkCurrentProcess) {
if (process instanceof IProcess2) {
if (checkCurrentProcess) {
for (INode n : process.getGraphicalNodes()) {
if (isEsbComponentName(n.getComponent().getName())) {
return true;
}
}
} else {
Set<JobInfo> infos = ProcessorUtilities.getChildrenJobInfo(((IProcess2) process).getProperty().getItem(), false);
for (JobInfo jobInfo : infos) {
ProcessType processType = jobInfo.getProcessItem().getProcess();
EList<NodeType> nodes = processType.getNode();
for (NodeType nodeType : nodes) {
if (isEsbComponentName(nodeType.getComponentName())) {
return true;
}
}
}
}
return false;
}
return false;
}
private static void addEsbJob(JobInfo jobInfo) {
if (esbJobs.contains(esbJobKey(jobInfo.getJobId(), jobInfo.getJobVersion()))) {
return;
}
esbJobs.add(esbJobKey(jobInfo.getJobId(), jobInfo.getJobVersion()));
if (jobInfo.getFatherJobInfo() != null) {
addEsbJob(jobInfo.getFatherJobInfo());
@@ -2628,5 +2842,4 @@ public class ProcessorUtilities {
public static boolean isNeedProjectProcessId(String componentName) {
return "tRunJob".equalsIgnoreCase(componentName) || "cTalendJob".equalsIgnoreCase(componentName);
}
}

View File

@@ -277,6 +277,9 @@ public class ATreeNode {
* @throws OdaException
*/
public void setDataType(String type) throws OdaException {
if (type == null) {
type = "";
}
originalDataType = new String(type);
this.dataType = getDataType(type);
}

View File

@@ -43,8 +43,10 @@ import org.eclipse.xsd.XSDImport;
import org.eclipse.xsd.XSDModelGroup;
import org.eclipse.xsd.XSDParticle;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTerm;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.XSDVariety;
import org.eclipse.xsd.impl.XSDNamedComponentImpl;
import org.eclipse.xsd.util.XSDConstants;
import org.eclipse.xsd.util.XSDResourceImpl;
@@ -355,12 +357,15 @@ public class XSDPopulationUtil2 implements IXSDPopulationUtil {
}
}
if (!resolvedAsComplex) {
String dataType = xsdElementDeclarationParticle.getTypeDefinition().getQName();
XSDTypeDefinition typeDefinition = xsdElementDeclarationParticle.getTypeDefinition();
String dataType = typeDefinition.getQName();
if (!XSDConstants
.isSchemaForSchemaNamespace(xsdElementDeclarationParticle.getTypeDefinition().getTargetNamespace())
&& xsdElementDeclarationParticle.getTypeDefinition().getBaseType() != null) {
if (!"xs:anySimpleType".equals(xsdElementDeclarationParticle.getTypeDefinition().getBaseType().getQName())) {
dataType = xsdElementDeclarationParticle.getTypeDefinition().getBaseType().getQName();
.isSchemaForSchemaNamespace(typeDefinition.getTargetNamespace())
&& typeDefinition.getBaseType() != null) {
if (!"xs:anySimpleType".equals(typeDefinition.getBaseType().getQName())) {
dataType = typeDefinition.getBaseType().getQName();
} else if (typeDefinition instanceof XSDSimpleTypeDefinition) {
dataType = getVarietyType(((XSDSimpleTypeDefinition) typeDefinition).getVariety());
}
}
partNode.setDataType(dataType);
@@ -378,6 +383,16 @@ public class XSDPopulationUtil2 implements IXSDPopulationUtil {
}
}
private String getVarietyType(XSDVariety variety) {
String dataType = "xs:anyType";
if (XSDVariety.LIST_LITERAL.equals(variety)) {
dataType = "xs:list";
} else if (XSDVariety.UNION_LITERAL.equals(variety)) {
dataType = "xs:union";
}
return dataType;
}
private void handleOptionalAttribute(ATreeNode node, XSDParticle xsdParticle) {
if (node == null || xsdParticle == null || xsdParticle.getElement() == null) {
return;
@@ -485,6 +500,17 @@ public class XSDPopulationUtil2 implements IXSDPopulationUtil {
}
if (xsdTypeDefinition instanceof XSDComplexTypeDefinition) {
addComplexTypeDetails(xsdSchema, node, xsdTypeDefinition, prefix, namespace, "/" + elementName + "/");
} else if (xsdTypeDefinition instanceof XSDSimpleTypeDefinition) {
String dataType = xsdTypeDefinition.getQName();
if (!XSDConstants.isSchemaForSchemaNamespace(xsdTypeDefinition.getTargetNamespace())
&& xsdTypeDefinition.getBaseType() != null) {
if (!"xs:anySimpleType".equals(xsdTypeDefinition.getBaseType().getQName())) {
dataType = xsdTypeDefinition.getBaseType().getQName();
} else if (xsdTypeDefinition instanceof XSDSimpleTypeDefinition) {
dataType = getVarietyType(((XSDSimpleTypeDefinition) xsdTypeDefinition).getVariety());
}
}
node.setDataType(dataType);
}
List<String> namespaceList = new ArrayList(namespaceToPrefix.keySet());
Collections.reverse(namespaceList);
@@ -565,7 +591,11 @@ public class XSDPopulationUtil2 implements IXSDPopulationUtil {
particleToTreeNode.clear();
}
return rootNodes.get(0);
if (rootNodes.isEmpty()) {
return null;
} else {
return rootNodes.get(0);
}
}
private void addSubstitutionDetails(XSDSchema xsdSchema, ATreeNode parentNode, XSDElementDeclaration elementDeclaration,
@@ -760,11 +790,14 @@ public class XSDPopulationUtil2 implements IXSDPopulationUtil {
ATreeNode childNode = new ATreeNode();
childNode.setValue(attributeDeclarationName);
childNode.setType(ATreeNode.ATTRIBUTE_TYPE);
String dataType = xsdAttributeDeclaration.getTypeDefinition().getQName();
XSDTypeDefinition baseType = xsdAttributeDeclaration.getTypeDefinition().getBaseType();
if (!XSDConstants.isSchemaForSchemaNamespace(xsdAttributeDeclaration.getTypeDefinition().getTargetNamespace())) {
XSDSimpleTypeDefinition typeDefinition = xsdAttributeDeclaration.getTypeDefinition();
String dataType = typeDefinition.getQName();
XSDTypeDefinition baseType = typeDefinition.getBaseType();
if (!XSDConstants.isSchemaForSchemaNamespace(typeDefinition.getTargetNamespace())) {
if (baseType != null && !"xs:anySimpleType".equals(baseType.getQName())) { //$NON-NLS-1$
dataType = baseType.getQName();
} else if (typeDefinition instanceof XSDSimpleTypeDefinition) {
dataType = getVarietyType(((XSDSimpleTypeDefinition) typeDefinition).getVariety());
}
}
if (dataType != null && dataType.length() > 0) {

View File

@@ -1,29 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/commons-codec.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-connector-basic.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-impl.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-spi.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-classpath.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-file.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-http.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-wagon.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-util.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-utils.jar"/>
<classpathentry exported="true" kind="lib" path="lib/slf4j-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wagon-provider-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-aether-provider-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-model-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-model-builder-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-repository-metadata-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-interpolation-1.19.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-utils-3.0.17.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/wagon-http-lightweight.jar" sourcepath="D:/.m2/repository/org/apache/maven/wagon/wagon-http-lightweight/3.0.0/wagon-http-lightweight-3.0.0-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-file.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-http.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wagon-file.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jsoup.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wagon-http-shared.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wagon-http.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-connector-basic.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-impl.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-spi.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-classpath.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-wagon.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-util.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-utils.jar"/>
<classpathentry exported="true" kind="lib" path="lib/slf4j-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wagon-provider-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-aether-provider-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-model-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-model-builder-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-repository-metadata-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-interpolation-1.19.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-utils-3.0.17.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -26,13 +26,18 @@ Bundle-ClassPath: .,
lib/maven-resolver-impl.jar,
lib/maven-resolver-spi.jar,
lib/maven-resolver-transport-classpath.jar,
lib/maven-resolver-transport-file.jar,
lib/maven-resolver-transport-http.jar,
lib/maven-resolver-transport-wagon.jar,
lib/maven-resolver-util.jar,
lib/plexus-utils.jar,
lib/slf4j-api.jar,
lib/wagon-provider-api.jar
lib/wagon-provider-api.jar,
lib/jsoup.jar,
lib/wagon-http-shared.jar,
lib/wagon-http.jar,
lib/wagon-file.jar,
lib/maven-resolver-transport-file.jar,
lib/maven-resolver-transport-http.jar,
lib/wagon-http-lightweight.jar
Export-Package: org.talend.designer.maven.aether,
org.talend.designer.maven.aether.comparator,
org.talend.designer.maven.aether.node,

View File

@@ -2,4 +2,11 @@ source.. = src/main/java/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
lib/
lib/,\
lib/jsoup.jar,\
lib/wagon-http-shared.jar,\
lib/wagon-http.jar,\
lib/wagon-file.jar,\
lib/maven-resolver-transport-file.jar,\
lib/maven-resolver-transport-http.jar,\
lib/wagon-http-lightweight.jar

View File

@@ -11,6 +11,7 @@
<packaging>eclipse-plugin</packaging>
<properties>
<maven.resolver.version>1.3.1</maven.resolver.version>
<wagon.version>3.0.0</wagon.version>
</properties>
<dependencies>
@@ -45,10 +46,25 @@
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>${wagon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${wagon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>${wagon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>

View File

@@ -17,24 +17,21 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.codehaus.plexus.PlexusContainerException;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.deployment.DeployRequest;
import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.repository.Authentication;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
import org.eclipse.aether.spi.connector.transport.TransporterFactory;
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.eclipse.aether.util.artifact.SubArtifact;
import org.eclipse.aether.util.listener.ChainedRepositoryListener;
import org.eclipse.aether.util.listener.ChainedTransferListener;
import org.eclipse.aether.util.repository.AuthenticationBuilder;
import org.talend.designer.maven.aether.util.MavenLibraryResolverProvider;
import org.talend.designer.maven.aether.util.TalendAetherProxySelector;
/**
* created by wchen on Aug 10, 2017 Detailled comment
@@ -44,34 +41,19 @@ public class RepositorySystemFactory {
private static Map<LocalRepository, DefaultRepositorySystemSession> sessions = new HashMap<LocalRepository, DefaultRepositorySystemSession>();
private static RepositorySystem system;
private static RepositorySystem newRepositorySystem() {
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
locator.addService(TransporterFactory.class, FileTransporterFactory.class);
locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
@Override
public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
exception.printStackTrace();
}
});
return locator.getService(RepositorySystem.class);
}
private static DefaultRepositorySystemSession newRepositorySystemSession(String localRepositoryPath) {
private static DefaultRepositorySystemSession newRepositorySystemSession(String localRepositoryPath)
throws PlexusContainerException {
LocalRepository localRepo = new LocalRepository(localRepositoryPath);
DefaultRepositorySystemSession repositorySystemSession = sessions.get(localRepo);
if (repositorySystemSession == null) {
repositorySystemSession = MavenRepositorySystemUtils.newSession();
repositorySystemSession
.setLocalRepositoryManager(system.newLocalRepositoryManager(repositorySystemSession, localRepo));
.setLocalRepositoryManager(
MavenLibraryResolverProvider.newRepositorySystem().newLocalRepositoryManager(repositorySystemSession,
localRepo));
repositorySystemSession.setTransferListener(new ChainedTransferListener());
repositorySystemSession.setRepositoryListener(new ChainedRepositoryListener());
repositorySystemSession.setProxySelector(new TalendAetherProxySelector());
}
return repositorySystemSession;
@@ -81,9 +63,7 @@ public class RepositorySystemFactory {
String userName, String password, String groupId, String artifactId, String classifier, String extension,
String version) throws Exception {
DefaultRepositorySystemSession session = null;
if (system == null) {
system = newRepositorySystem();
}
RepositorySystem system = MavenLibraryResolverProvider.newRepositorySystem();
session = newRepositorySystemSession(localRepository);
DeployRequest deployRequest = new DeployRequest();
@@ -107,6 +87,7 @@ public class RepositorySystemFactory {
Authentication auth = new AuthenticationBuilder().addUsername(userName).addPassword(password).build();
RemoteRepository distRepo = new RemoteRepository.Builder(repositoryId, "default", repositoryUrl).setAuthentication(auth)
.build();
distRepo = new RemoteRepository.Builder(distRepo).setProxy(new TalendAetherProxySelector().getProxy(distRepo)).build();
deployRequest.setRepository(distRepo);

View File

@@ -36,10 +36,11 @@ import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.collection.DependencySelector;
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.graph.DefaultDependencyNode;
import org.eclipse.aether.graph.Exclusion;
import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.internal.transport.wagon.PlexusWagonConfigurator;
import org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider;
import org.eclipse.aether.repository.Authentication;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
@@ -48,10 +49,6 @@ import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResult;
import org.eclipse.aether.resolution.VersionRangeRequest;
import org.eclipse.aether.resolution.VersionRangeResult;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
import org.eclipse.aether.spi.connector.transport.TransporterFactory;
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.eclipse.aether.util.artifact.JavaScopes;
import org.eclipse.aether.util.graph.selector.AndDependencySelector;
import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
@@ -111,11 +108,11 @@ public class DynamicDistributionAetherUtils {
RepositorySystem repoSystem = null;
if (multiThread) {
repoSystem = newRepositorySystem();
repoSystem = MavenLibraryResolverProvider.newRepositorySystemForResolver();
} else {
repoSystem = repoSystemMap.get(key);
if (repoSystem == null) {
repoSystem = newRepositorySystem();
repoSystem = MavenLibraryResolverProvider.newRepositorySystemForResolver();
repoSystemMap.put(key, repoSystem);
}
}
@@ -152,6 +149,7 @@ public class DynamicDistributionAetherUtils {
builder = builder.setAuthentication(auth);
}
RemoteRepository central = builder.build();
central = new RemoteRepository.Builder(central).setProxy(new TalendAetherProxySelector().getProxy(central)).build();
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(dependency);
@@ -283,7 +281,7 @@ public class DynamicDistributionAetherUtils {
if (monitor == null) {
monitor = new DummyDynamicMonitor();
}
RepositorySystem repSystem = newRepositorySystem();
RepositorySystem repSystem = MavenLibraryResolverProvider.newRepositorySystemForResolver();
RepositorySystemSession repSysSession = newSession(repSystem, localPath, monitor);
updateDependencySelector((DefaultRepositorySystemSession) repSysSession, monitor);
@@ -307,6 +305,7 @@ public class DynamicDistributionAetherUtils {
builder = builder.setAuthentication(auth);
}
RemoteRepository central = builder.build();
central = new RemoteRepository.Builder(central).setProxy(new TalendAetherProxySelector().getProxy(central)).build();
VersionRangeRequest verRangeRequest = new VersionRangeRequest();
verRangeRequest.addRepository(central);
@@ -329,7 +328,7 @@ public class DynamicDistributionAetherUtils {
if (monitor == null) {
monitor = new DummyDynamicMonitor();
}
RepositorySystem repSystem = newRepositorySystem();
RepositorySystem repSystem = MavenLibraryResolverProvider.newRepositorySystemForResolver();
RepositorySystemSession repSysSession = newSession(repSystem, localPath, monitor);
updateDependencySelector((DefaultRepositorySystemSession) repSysSession, monitor);
@@ -353,6 +352,7 @@ public class DynamicDistributionAetherUtils {
builder = builder.setAuthentication(auth);
}
RemoteRepository central = builder.build();
central = new RemoteRepository.Builder(central).setProxy(new TalendAetherProxySelector().getProxy(central)).build();
VersionRangeRequest verRangeRequest = new VersionRangeRequest();
verRangeRequest.addRepository(central);
@@ -411,21 +411,13 @@ public class DynamicDistributionAetherUtils {
// }
// }
private static RepositorySystem newRepositorySystem() {
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
locator.addService(TransporterFactory.class, FileTransporterFactory.class);
locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
return locator.getService(RepositorySystem.class);
}
private static RepositorySystemSession newSession(RepositorySystem system, String repositoryPath, IDynamicMonitor monitor)
throws CoreException {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository(repositoryPath);
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setProxySelector(new TalendAetherProxySelector());
updateDependencySelector(session, monitor);

View File

@@ -12,12 +12,25 @@
// ============================================================================
package org.talend.designer.maven.aether.util;
import java.io.FileReader;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.model.License;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.providers.file.FileWagon;
import org.apache.maven.wagon.providers.http.HttpWagon;
import org.apache.maven.wagon.providers.http.LightweightHttpWagonAuthenticator;
import org.apache.maven.wagon.providers.http.LightweightHttpsWagon;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
@@ -25,6 +38,8 @@ import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.internal.transport.wagon.PlexusWagonConfigurator;
import org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider;
import org.eclipse.aether.repository.Authentication;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
@@ -34,9 +49,12 @@ import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
import org.eclipse.aether.spi.connector.transport.TransporterFactory;
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.eclipse.aether.transport.wagon.WagonTransporterFactory;
import org.eclipse.aether.util.repository.AuthenticationBuilder;
import org.eclipse.m2e.core.MavenPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.NexusConstants;
import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.core.runtime.maven.MavenArtifact;
@@ -48,10 +66,17 @@ public class MavenLibraryResolverProvider {
private RepositorySystem defaultRepoSystem;
private RepositorySystem dynamicRepoSystem;
private RepositorySystemSession defaultRepoSystemSession;
private RepositorySystemSession dynamicRepoSystemSession;
private RemoteRepository defaultRemoteRepository = null;
private RemoteRepository dynamicRemoteRepository = null;
private static MavenLibraryResolverProvider instance;
public static MavenLibraryResolverProvider getInstance() {
@@ -70,9 +95,11 @@ public class MavenLibraryResolverProvider {
return instance;
}
private MavenLibraryResolverProvider() {
defaultRepoSystem = newRepositorySystem();
private MavenLibraryResolverProvider() throws PlexusContainerException {
defaultRepoSystem = newRepositorySystemForResolver();
dynamicRepoSystem = newRepositorySystemForResolver();
defaultRepoSystemSession = newSession(defaultRepoSystem, getLocalMVNRepository());
dynamicRepoSystemSession = newSession(dynamicRepoSystem, getLocalMVNRepository());
ArtifactRepositoryBean talendServer = TalendLibsServerManager.getInstance().getTalentArtifactServer();
if (talendServer.getUserName() == null && talendServer.getPassword() == null) {
defaultRemoteRepository = new RemoteRepository.Builder("talend", "default", talendServer.getRepositoryURL()).build(); //$NON-NLS-1$ //$NON-NLS-2$
@@ -82,55 +109,108 @@ public class MavenLibraryResolverProvider {
defaultRemoteRepository = new RemoteRepository.Builder("talend", "default", talendServer.getRepositoryURL()) //$NON-NLS-1$ //$NON-NLS-2$
.setAuthentication(authentication).build();
}
defaultRemoteRepository = new RemoteRepository.Builder(defaultRemoteRepository)
.setProxy(new TalendAetherProxySelector().getProxy(defaultRemoteRepository)).build();
Authentication authentication = new AuthenticationBuilder().addUsername("studio-dl-client").addPassword(
"studio-dl-client")
.build();
String serverUrl = talendServer.getServer();
if (!serverUrl.endsWith(NexusConstants.SLASH)) {
serverUrl += NexusConstants.SLASH;
}
dynamicRemoteRepository = new RemoteRepository.Builder("talend2", "default",
NexusConstants.DYNAMIC_DISTRIBUTION).setAuthentication(authentication).build();
dynamicRemoteRepository = new RemoteRepository.Builder(dynamicRemoteRepository)
.setProxy(new TalendAetherProxySelector().getProxy(dynamicRemoteRepository)).build();
}
public ArtifactResult resolveArtifact(MavenArtifact aritfact) throws Exception {
public ArtifactResult resolveArtifact(MavenArtifact aritfact, boolean is4Parent) throws Exception {
ArtifactRequest artifactRequest = new ArtifactRequest();
RemoteRepository remoteRepo = getRemoteRepositroy(aritfact);
artifactRequest.addRepository(remoteRepo);
if (is4Parent) {
artifactRequest.addRepository(dynamicRemoteRepository);
}
Artifact artifact = new DefaultArtifact(aritfact.getGroupId(), aritfact.getArtifactId(), aritfact.getClassifier(),
aritfact.getType(), aritfact.getVersion());
ArtifactRequest artifactRequest = new ArtifactRequest();
artifactRequest.addRepository(remoteRepo);
artifactRequest.setArtifact(artifact);
ArtifactResult result = defaultRepoSystem.resolveArtifact(defaultRepoSystemSession, artifactRequest);
ArtifactResult result = null;
if (is4Parent) {
result = dynamicRepoSystem.resolveArtifact(dynamicRepoSystemSession, artifactRequest);
} else {
result = defaultRepoSystem.resolveArtifact(defaultRepoSystemSession, artifactRequest);
}
return result;
}
public Map<String, Object> resolveDescProperties(MavenArtifact aritfact) throws Exception {
public Map<String, Object> resolveDescProperties(MavenArtifact aritfact, boolean is4Parent) throws Exception {
Map<String, Object> properties = null;
MavenArtifact clonedArtifact = aritfact.clone();
clonedArtifact.setType("pom"); //$NON-NLS-1$
ArtifactResult result = resolveArtifact(clonedArtifact);
ArtifactResult result = resolveArtifact(clonedArtifact, is4Parent);
if (result != null && result.isResolved()) {
properties = new HashMap<String, Object>();
Model model = MavenPlugin.getMavenModelManager().readMavenModel(result.getArtifact().getFile());
MavenXpp3Reader reader = new MavenXpp3Reader();
Model model = reader.read(new FileReader(result.getArtifact().getFile()));
// Model model = MavenPlugin.getMavenModelManager().readMavenModel(result.getArtifact().getFile());
if (model != null) {
properties.put("type", model.getPackaging()); //$NON-NLS-1$
properties.put("license.count", model.getLicenses().size()); //$NON-NLS-1$
int licenseCount = 0;
if (model.getLicenses() != null) {
for (int i = 0; i < model.getLicenses().size(); i++) {
License license = model.getLicenses().get(i);
properties.put("license." + i + ".name", license.getName()); //$NON-NLS-1$//$NON-NLS-2$
properties.put("license." + i + ".url", license.getUrl()); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("license." + i + ".comments", license.getComments()); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("license." + i + ".distribution", license.getDistribution()); //$NON-NLS-1$ //$NON-NLS-2$
if (StringUtils.isNotBlank(license.getName()) || StringUtils.isNotBlank(license.getUrl())) {
properties.put("license." + i + ".name", license.getName()); //$NON-NLS-1$//$NON-NLS-2$
properties.put("license." + i + ".url", license.getUrl()); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("license." + i + ".comments", license.getComments()); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("license." + i + ".distribution", license.getDistribution()); //$NON-NLS-1$ //$NON-NLS-2$
licenseCount++;
}
}
}
properties.put("license.count", licenseCount); //$NON-NLS-1$
Parent parent = model.getParent();
if (parent != null) {
properties.put("parent.groupId", parent.getGroupId());
properties.put("parent.version", parent.getVersion());
properties.put("parent.artifactId", parent.getArtifactId());
} else {
properties.remove("parent.groupId");
properties.remove("parent.version");
properties.remove("parent.artifactId");
}
}
}
return properties;
}
public RemoteRepository getRemoteRepositroy(MavenArtifact aritfact) {
RemoteRepository remoteRepository = null;
Consumer<RemoteRepository> update = null;
if (aritfact != null && aritfact.getRepositoryUrl() != null) {
if (urlToRepositoryMap.containsKey(aritfact.getRepositoryUrl())) {
return urlToRepositoryMap.get(aritfact.getRepositoryUrl());
remoteRepository = urlToRepositoryMap.get(aritfact.getRepositoryUrl());
} else {
remoteRepository = buildRemoteRepository(aritfact);
urlToRepositoryMap.put(aritfact.getRepositoryUrl(), remoteRepository);
}
RemoteRepository repository = buildRemoteRepository(aritfact);
urlToRepositoryMap.put(aritfact.getRepositoryUrl(), repository);
return repository;
update = (r) -> urlToRepositoryMap.put(aritfact.getRepositoryUrl(), r);
} else {
remoteRepository = defaultRemoteRepository;
update = (r) -> defaultRemoteRepository = r;
}
return defaultRemoteRepository;
try {
remoteRepository = new RemoteRepository.Builder(remoteRepository)
.setProxy(defaultRepoSystemSession.getProxySelector().getProxy(remoteRepository)).build();
update.accept(remoteRepository);
} catch (Exception e) {
ExceptionHandler.process(e);
}
return remoteRepository;
}
private RemoteRepository buildRemoteRepository(MavenArtifact aritfact) {
@@ -143,15 +223,53 @@ public class MavenLibraryResolverProvider {
repository = new RemoteRepository.Builder("talend", "default", aritfact.getRepositoryUrl()) //$NON-NLS-1$ //$NON-NLS-2$
.setAuthentication(authentication).build();
}
repository = new RemoteRepository.Builder(repository).setProxy(new TalendAetherProxySelector().getProxy(repository))
.build();
return repository;
}
private RepositorySystem newRepositorySystem() {
public static RepositorySystem newRepositorySystem() throws PlexusContainerException {
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
// TUP-24695 change to wagon transporters
locator.addService(TransporterFactory.class, WagonTransporterFactory.class);
PlexusContainer pc = new DefaultPlexusContainer();
LightweightHttpsWagon https = new LightweightHttpsWagon();
https.setAuthenticator(new LightweightHttpWagonAuthenticator());
pc.addComponent(https, Wagon.class, "https");
pc.addComponent(new HttpWagon(), Wagon.class, "http");
pc.addComponent(new FileWagon(), Wagon.class, "file");
WagonTransporterFactory tf = (WagonTransporterFactory) locator.getService(TransporterFactory.class);
tf.setWagonConfigurator(new PlexusWagonConfigurator(pc));
tf.setWagonProvider(new PlexusWagonProvider(pc));
locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
@Override
public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
exception.printStackTrace();
}
});
return locator.getService(RepositorySystem.class);
}
public static RepositorySystem newRepositorySystemForResolver() {
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
locator.addService(TransporterFactory.class, FileTransporterFactory.class);
locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
@Override
public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
exception.printStackTrace();
}
});
return locator.getService(RepositorySystem.class);
}
@@ -160,6 +278,7 @@ public class MavenLibraryResolverProvider {
LocalRepository localRepo = new LocalRepository( /* "target/local-repo" */target);
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setProxySelector(new TalendAetherProxySelector());
return session;
}

View File

@@ -0,0 +1,98 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.designer.maven.aether.util;
import org.eclipse.aether.repository.Authentication;
import org.eclipse.aether.repository.Proxy;
import org.eclipse.aether.repository.ProxySelector;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.util.repository.AuthenticationBuilder;
import org.eclipse.aether.util.repository.DefaultProxySelector;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.network.TalendProxySelector;
/**
* DOC cmeng class global comment. Detailled comment
*/
public class TalendAetherProxySelector implements ProxySelector {
private boolean isTalendDebug = false;
public TalendAetherProxySelector() {
isTalendDebug = Boolean.valueOf(System.getProperty(TalendProxySelector.PROP_PRINT_LOGS, "false"));
}
@Override
public Proxy getProxy(RemoteRepository repository) {
/**
* Update each time in case the settings are changed
*/
Proxy proxy = createProxySelector().getProxy(repository);
if (isTalendDebug) {
try {
if (repository != null) {
String proxyStr = "";
if (proxy != null) {
proxyStr = proxy.getType() + " " + proxy.toString() + ", proxy user: "
+ (proxy.getAuthentication() != null ? "..." : "<empty>");
}
ExceptionHandler.log("Aether proxy> host: " + repository.getHost() + ", proxy: " + proxyStr);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return proxy;
}
private DefaultProxySelector createProxySelector() {
DefaultProxySelector proxySelector = new DefaultProxySelector();
javaDefaultProxy(proxySelector);
return proxySelector;
}
private void javaDefaultProxy(DefaultProxySelector proxySelector) {
String[] schemas = new String[] { "http", "https" };
for (String schema : schemas) {
Proxy proxy = createProxy(schema);
if (proxy != null) {
proxySelector.add(proxy, System.getProperty(schema + ".nonProxyHosts"));
}
}
}
private org.eclipse.aether.repository.Proxy createProxy(String schema) {
String proxyHost = System.getProperty(schema + ".proxyHost");
if (proxyHost == null) {
return null;
}
String proxyUser = System.getProperty(schema + ".proxyUser");
String proxyPassword = System.getProperty(schema + ".proxyPassword");
int proxyPort = Integer.parseInt(System.getProperty(schema + ".proxyPort", "8080"));
Authentication authentication = createAuthentication(proxyUser, proxyPassword);
org.eclipse.aether.repository.Proxy proxyObj = new org.eclipse.aether.repository.Proxy(schema, proxyHost, proxyPort,
authentication);
return proxyObj;
}
private Authentication createAuthentication(String proxyUser, String proxyPassword) {
Authentication authentication = null;
if (proxyUser != null) {
authentication = new AuthenticationBuilder().addUsername(proxyUser).addPassword(proxyPassword).build();
}
return authentication;
}
}

View File

@@ -46,12 +46,6 @@
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>features-maven-plugin-2-2-9-tos</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>maven-bundle-plugin-2-3-7-tos</artifactId>
@@ -76,18 +70,30 @@
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-zip</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>build-helper-maven-plugin-3-0-0-tos</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>karaf-maven-plugin-4-2-4-tos</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-zip</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>karaf-maven-plugin-4-2-4-tos</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<profiles>
<profile>

View File

@@ -7,41 +7,30 @@
<version>7.3.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>features-maven-plugin-2-2-9-tos</artifactId>
<artifactId>karaf-maven-plugin-4-2-4-tos</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.2.9</version>
<artifactId>karaf-maven-plugin</artifactId>
<version>4.2.4</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
<version>1.6.4</version>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.2.0</version>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-tree</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.1</version>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.0.2.RELEASE</version>
<type>pom</type>
</dependency>
<!-- Required by commons-lang-2.6.pom -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-parent</artifactId>
<version>17</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -10,9 +10,9 @@
<artifactId>studio-maven-repository-build</artifactId>
<packaging>pom</packaging>
<modules>
<module>plugins/features-maven-plugin-2-2-9</module>
<module>plugins/maven-bundle-plugin-2-3-7</module>
<module>plugins/maven-bundle-plugin-2-5-3</module>
<module>plugins/karaf-maven-plugin-4-2-4</module>
<module>plugins/maven-install-plugin-2-5-1</module>
<module>plugins/talend-compiler-plugin</module>
<module>plugins/build-helper-maven-plugin-3-0-0</module>

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