Compare commits

...

117 Commits

Author SHA1 Message Date
undx
0d23acac28 Merge branch 'maintenance/7.3' into undx/TCOMP-1752_JobServer 2020-08-12 13:15:00 +02:00
Nicolas Rousseau
08c2082e8a chore(TUP-26710):update version 2020-08-12 15:20:28 +08:00
bhe-talendbj
8740f3b1da fix(TUP-27506): Update minor version (#3546) 2020-08-12 14:56:30 +08:00
jiezhang-tlnd
e08c225198 revert fix (#3547) 2020-08-12 14:54:57 +08:00
bhe-talendbj
fef6605f83 fix(TUP-27374): fix test case (#3545)
* fix(TUP-27374): fix test case

* fix(TUP-27374): fix test case
2020-08-11 15:10:32 +08:00
jiezhang-tlnd
af83d9d393 fix(TUP-28078)metadata folder generated under .../poms/jobs when create (#3520)
new connection in remote project
https://jira.talendforge.org/browse/TUP-28078
2020-08-11 14:23:22 +08:00
wang wei
45a92717f9 fix(TDI-44192): Update dom4j to 2.1.3 (#3453) 2020-08-11 10:19:08 +08:00
Dmytro Grygorenko
7191b77c5c Enable precision check for Timestamp datatype. (#3495)
* fix(TDI-44457): added precision check for Datetime and Timestamp datatypes.

* fix(TDI-44457): Remove default precision value

* fix(TDI-44457): add default precision 3 (to be tested)

* fix(TDI-44457): enable precision for Timestamp only (to be tested)
2020-08-10 15:47:42 +03:00
undx
903c239444 feat(TCOMP-1752): add TaCoKit Resources folders 2020-08-09 19:48:16 +02:00
undx
071777f408 feat(TCOMP-1752): skip TaCoKit dependencies 2020-08-09 19:48:06 +02:00
undx
a5c9ecb967 feat(TCOMP-1752): remove TaCoKit dependencies 2020-08-09 19:47:52 +02:00
Jürgen Kindler
18c2e53223 TPSVC-15154 - allow debug logs for deletions to see which files are purged (#3531) 2020-08-06 21:13:32 +08:00
Zhiwei Xue
16fbcf34f3 feat(TUP-28142):Add talendDebug for CI (#3525) 2020-08-06 17:50:53 +08:00
Chao MENG
495ebda155 fix(TUP-27989): Git related issues checked with support (#3494)
https://jira.talendforge.org/browse/TUP-27989
2020-08-06 15:02:39 +08:00
wang wei
8f36da5ee1 fix(TDI-44481): upgrade commons-beanutils to 1.9.4 (#3448) 2020-08-06 12:45:58 +08:00
bhe-talendbj
0828f2951a fix(TUP-28002): Search release repository before uploading jars (#3503)
* fix(TUP-28002): Search release repository before uploading jars

* fix(TUP-28002): Fix NPE

* fix(TUP-28002): Check snapshot as well
2020-08-04 18:11:02 +08:00
Jane Ding
5da999c4bd feat(TUP-25566):All the recycle bin should not be build or executed (#3527)
https://jira.talendforge.org/browse/TUP-25566

Signed-off-by: jding-tlnd <jding@talend.com>
2020-08-04 11:28:47 +08:00
jiezhang-tlnd
39eee08210 Jzhang/feat/73/tup 27862 (#3480)
* feat(TUP-27862)Add possibility to customize pattern for dates when
retrieve table

* feat(TUP-27862)Add possibility to customize pattern for dates when
retrieve table

* feat(TUP-27862)Add possibility to customize pattern for dates when
retrieve table

* feat(TUP-27862)Add possibility to customize pattern for dates when
retrieve table

* feat(TUP-27862)Add possibility to customize pattern for dates when
retrieve table

* add junit

* add junits

* add junits
2020-08-03 09:40:57 +08:00
Chao MENG
1ab6486d9a fix(TUP-27953): tSalesforceInput component displays in-job (#3505)
tSalesforceConnection incorrectly
https://jira.talendforge.org/browse/TUP-27953
2020-07-31 11:11:20 +08:00
Jane Ding
aa7da99e0d feat(TUP-25566)All the recycle bin should not be build or executed (#3484)
* feat(TUP-25566)All the recycle bin should not be build or executed
https://jira.talendforge.org/browse/TUP-25566

* feat(TUP-25566)All the recycle bin should not be build or executed
https://jira.talendforge.org/browse/TUP-25566

* feat(TUP-25566)All the recycle bin should not be build or executed
https://jira.talendforge.org/browse/TUP-25566
2020-07-31 02:35:32 +08:00
Zhiwei Xue
a73f8621ed fix(TUP-27776):Can't build job from CI (missing jar dependency) (#3497) 2020-07-28 14:56:23 +08:00
kjwang
09cfc769da Fix:TUP-27879 Shared user can't write library index file library_data.index (#3474)
Fix:TUP-27879 Shared user can't write library index file
library_data.index
https://jira.talendforge.org/browse/TUP-27879
2020-07-28 09:14:46 +08:00
bhe-talendbj
2a1d017208 fix(TUP-27814): Skip file.exists() (#3459) 2020-07-27 16:25:05 +08:00
hzhao-talendbj
1189973653 fix miss dependency in assmble.xml with loop dependency (#3428)
Conflicts:
	main/plugins/org.talend.designer.maven/src/main/java/org/talend/designer/maven/tools/creator/CreateMavenJobPom.java
2020-07-24 11:14:36 +08:00
Jane Ding
c80a96768e fix(TUP-27590):Relationship.index might get really big (#3424)
* fix(TUP-27590):Relationship.index might get really big
https://jira.talendforge.org/browse/TUP-27590

* fix(TUP-27590):Relationship.index might get really big
https://jira.talendforge.org/browse/TUP-27590

* fix(TUP-27590)Relationship.index might get really big
https://jira.talendforge.org/browse/TUP-27590
relatedItems is empty should not add  as a record

* fix(TUP-27590):Relationship.index might get really big
https://jira.talendforge.org/browse/TUP-27590

* fix(TUP-27590)Relationship.index might get really big
https://jira.talendforge.org/browse/TUP-27590
2020-07-23 18:19:17 +08:00
bhe-talendbj
0e3957c3d7 bugfix(TUP-26138) Regenerate relationship.index (#3088) (#3473)
* fix(TUP-26138): Regenerate relationship index
2020-07-23 10:57:24 +08:00
hzhao-talendbj
e7399f9df5 TPS-4193 modify code mistake (#3488) 2020-07-21 09:36:44 +08:00
yyin
7f67aeaf0e Fix/yyin/tdq 18565 context check 73 (#3462)
* Fix TDQ-18565  Cannot save Hive metadata object with context variables

- if the analysis didnot use the current db, can pass
- if any analysis use this db, popup let the user select

* FIx TDQ-18565

* Fix TDQ-18565 backport to 73

Co-authored-by: root <root@LT-D9QV733>
2020-07-20 11:09:22 +08:00
msjian
d12826089a feat(TQD-18173):fix save buildin correctly (#3398) 2020-07-16 15:48:35 +08:00
apoltavtsev
2bb3e43bc6 feat(TESB-28826) Secure Password - Publish job with Password 2020-07-14 19:51:03 +02:00
Zhiwei Xue
55ff7cc279 fix(TUP-27610): Clean up the CI version everywhere and have a common (#3451)
place to setup in studio
2020-07-10 15:39:15 +08:00
AlixMetivier
56811e6ce4 fix(TBD-10881): fix lookup and reject flow (#3438) 2020-07-09 18:03:27 +02:00
pyzhou
e3701ceb7c fix(TDI-44472):Rename global variable (#3439)
* fix(TDI-44472):Rename global variable

* debug

* remove debug message
2020-07-09 10:35:45 +08:00
sbliu
bcebeb1e99 TUP-27416 Validate network, timeout value read from nexus timeout preference configuration . (#3430)
* TUP-27416 Validate network, timeout value read from nexus timeout preference configuration .
* TUP-27416 transmit timeout as a parameter to check nexus network validation.
* TUP-27416 Combine same get timeout function in different place.
* TUP-27416 Refactor , extract constant for reuse.
2020-07-07 16:37:53 +08:00
kjwang
6e12e77255 Fix: TUP-27544 Context update can not update to the first testcase if the job have more than one testcase. (#3427)
* Fix: TUP-27544 Context update can not update to the first testcase if
the job have more than one testcase.
https://jira.talendforge.org/browse/TUP-27544

* Improve the code
2020-07-07 10:25:58 +08:00
bhe-talendbj
a2a09fa98c fix(TUP-27586): fix test case failure (#3443)
* fix(TUP-27586): fix test case failure

* fix(TUP-27586): fix test case failure
2020-07-07 09:41:22 +08:00
vdrokov
a88b035f03 fix(TESB-29489): Compile error occurred in code if the route version is different with the routelet version (#3409) 2020-07-03 09:56:38 +03:00
bhe-talendbj
6173437d9b fix(TUP-27586): skip checking installed patches (#3410)
* fix(TUP-27586): skip checking installed patches

* fix(TUP-27586): Skip installed patches for patch installation

* fix(TUP-27586): skip installed patches
2020-07-03 10:06:20 +08:00
bhe-talendbj
69c2ecd88f fix(TUP-26810)if one jar used by two different components, it will (#3228) (#3432)
fix(TUP-26810)if one jar used by two different components, it will upload to nexus with two versions

Co-authored-by: hzhao-talendbj <49395568+hzhao-talendbj@users.noreply.github.com>
2020-07-03 09:52:31 +08:00
bhe-talendbj
78e7aae03e fix(TUP-26687): make Nexus3RepositoryHandler.dosearch thread safe (#3354) 2020-07-02 17:35:41 +08:00
jiezhang-tlnd
62ba9f8604 fix(TUP-27588)tCreateTable data types mapping in the schema editor is (#3420)
always Mysql after dragging and dropping from database Metadata
2020-07-02 17:28:58 +08:00
Zhiwei Xue
4f5c792187 chore(TUP-27463):Backport TUP-26304 to 7.3:Re-use (#3440)
talend.studio.parent.pom as a root studio bom for SE/EE product
2020-07-02 15:38:36 +08:00
Jane Ding
77ee82d889 bugfix(TUP-26059):tELTPostgresqlMap lost its "DB Type" column for which (#3075) (#3435)
bugfix(TUP-26059):tELTPostgresqlMap lost its "DB Type" column for which the value should be "BPCHAR"

Co-authored-by: hwang-talend <hwang@talend.com>
2020-07-02 14:48:13 +08:00
Chao MENG
8f81ff4534 fix(TUP-25835): Dynamic distribution cannot download libraries from (#3363) (#3414)
fix(TUP-25835): Dynamic distribution cannot download libraries from proxy Nexus
https://jira.talendforge.org/browse/TUP-25835
2020-06-23 14:13:13 +08:00
Zhiwei Xue
0a8f2e769e fix(TUP-27315): fix 7.3.2 ci-builder share to nexus issue. (#3408) 2020-06-17 17:19:14 +08:00
kjwang
28f8e109a6 Fix a NPE issue (#3404) 2020-06-16 16:55:17 +08:00
Zhiwei Xue
5d21d9d3ea fix(TUP-27530):move sync component m2 execution to logon project phase (#3390) 2020-06-12 16:10:54 +08:00
kjwang
7d223ecff8 TUP-26699 Enhance context propagation over reference project - Resolve (#3367)
* TUP-26699 Enhance context propagation over reference project - Resolve
link conflict with Git
https://jira.talendforge.org/browse/TUP-26699

* fix(TUP-27200):Detect update button can not detect the updated context
variable for testcase.
https://jira.talendforge.org/browse/TUP-27200

* TUP-26699 Enhance context propagation over reference project - Resolve
link conflict with Git
https://jira.talendforge.org/browse/TUP-26699

* fix(TUP-27275):studio update detection two times when change JSON file
context variable
https://jira.talendforge.org/browse/TUP-27275

* Fix can't merge remote context link file problem

* fix(TUP-27190):[Bug] DB connection use context in ref project can not (#3379)

find the link to context after export and imported in.
https://jira.talendforge.org/browse/TUP-27190

* Fix: TUP-27336 [Bug] Job get duplicated context var when use the context
var used by joblet is updated after migration
https://jira.talendforge.org/browse/TUP-27336

* fix(TUP-27522):[Bug] context var id in link file will be null after add (#3391)

a new context group for context and propagate to job.
https://jira.talendforge.org/browse/TUP-27522

* Improve the code find context parameter by name when can't by parameter
by id

Co-authored-by: jding-tlnd <jding@talend.com>
Co-authored-by: Jane Ding <35018295+jding-tlnd@users.noreply.github.com>
2020-06-12 15:57:58 +08:00
jiezhang-tlnd
1ff9877dce update mapping_sybase (#3381) 2020-06-11 16:58:36 +08:00
jzhao
75d51647fc chore: bump tcompV0 version to 0.28.5 (#3388) 2020-06-11 15:03:01 +08:00
hcyi
4f55385a9a feat(TUP-26669):Adapt HDInsight wizard for HDInsight 4.0 (#3385) 2020-06-10 21:57:50 +02:00
Mike Yan
c942bade7a fix(TESB-29315):P2 depoy failed for missing osgihelper-maven-plugin 2020-06-10 18:10:46 +02:00
wang wei
551eb69025 fix(TDI-44172): Observability: Create new "component execution" event and emit it frequently(#3357) 2020-06-10 16:35:55 +08:00
Laurent BOURGEOIS
c0b192f427 fix(TUP-25863): add databricks cloud provider choice in wizard (#3139) (#3378) 2020-06-09 12:02:36 +02:00
Roman
ccd1d6d1d5 fix(TDI-44128): delete axis2 jars (#3289) 2020-06-09 12:49:07 +03:00
hcyi
0d2e0c8149 Hwang/tup 27210 (#3316) (#3365)
* bugfix(TUP-27210):Version isn't correct in Help->"About Talend Studio"
after installing monthly patch

Co-authored-by: hwang-talend <hwang@talend.com>
2020-06-09 15:23:26 +08:00
jiezhang-tlnd
67a9b521c9 Jzhang/7.3/bugfix/tup 26896 (#3352)
* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables
https://jira.talendforge.org/browse/TUP-26896

* format code
2020-06-09 14:00:57 +08:00
Zhiwei Xue
4a8869304b fix(TUP-26812): Old plugin folders deletion failed after installed new (#3350) (#3373)
updatesite patch
2020-06-05 17:51:41 +08:00
jiezhang-tlnd
6118d69c3e feat(TUP-27259)Change default driver to Microsoft official for MSSql in (#3328)
Metadata
https://jira.talendforge.org/browse/TUP-27259
2020-06-05 09:22:47 +08:00
bhe-talendbj
2fecdf1ceb bugfix(TUP-27078): Fix parse response data get from artifactory which is runing with https (#3343) 2020-06-05 09:21:40 +08:00
pyzhou
60869a1240 feat(TDI-44216):Redshift partner tracker (#3366) 2020-06-04 17:18:07 +08:00
bhe-talendbj
332f6ff85b fix(TUP-27053): backport (#3360) 2020-06-04 11:20:57 +08:00
OleksiiNimych
45caecd7f2 fix(TDI-44169): remove xmlrpc_3.0 from studio (#3344) 2020-05-29 14:46:27 +03:00
Chao MENG
6e9daf05fb feat(TUP-26569): merge known conflicts automatically (#3347)
https://jira.talendforge.org/browse/TUP-26569
2020-05-29 10:59:18 +08:00
kjwang
3cfb30a9a0 Kjwang/feat tup 26288 enhance context b73 (#3335)
Fix TUP-26288 Enhance context propagation over reference project
https://jira.talendforge.org/browse/TUP-26288
2020-05-27 17:08:31 +08:00
jzhao
ea6595bab8 chore: bump tcompV0 version to 0.28.4 (#3327) 2020-05-25 15:09:31 +08:00
Zhiwei Xue
2454e6ba1c chore: Remove junit of Mojo version. (#3315) 2020-05-21 14:21:53 +08:00
hzhao-talendbj
c9600e040e fix(TUP-27072)_Unexpected behaviour occurred when context name is in (#3268) (#3311)
* fix(TUP-27072)_Unexpected behaviour occurred when context name is in
Japanese
2020-05-21 09:40:57 +08:00
pyzhou
6254945a6e fix(TDI-43717):backport cosmos to 7.3 (#3310) 2020-05-19 16:33:16 +08:00
hwang-talend
b54984ad2d Hwang/tup 26994 (#3282) (#3301)
* bugfix(TUP-26994):Usage data collector : change the way Studio Unique Id
is calculated
2020-05-19 16:15:05 +08:00
Jane Ding
59bb804cea Revert "fix(TUP-26990):Possible conflict in talend project (#3264) (#3271)" (#3306)
This reverts commit eafc630094.
2020-05-18 17:23:46 +08:00
jiezhang-tlnd
ba9a85f59f feat(TUP-26284)Upgrade AWS SDK for driver in metadata (#3300) 2020-05-18 12:08:38 +08:00
Zhiwei Xue
d7d0dcefb7 fix(TUP-27077): NoClassDefFoundException when using "independent process (#3286) (#3294)
to run subjob" and tAzureAdlsGen2Input
2020-05-15 12:01:22 +08:00
Zhiwei Xue
65a71ba142 fix(TUP-26961):When save/delete a test case, it might break the poms/CI (#3253) 2020-05-14 10:16:18 +08:00
hcyi
3f74eaa4d9 fix(TUP-27000):Talend Salesforce Einstein connector Repository (#3274)
connection issue in Talend 7.3
2020-05-14 10:06:30 +08:00
Jane Ding
dffac5bcb4 bugfix(TUP-26956):Update Studio top bar to reflect monthly deliveries (#3246) (#3280)
* bugfix(TUP-26956):Update Studio top bar to reflect monthly deliveries
for better understanding

* bugfix(TUP-26956):Update Studio top bar to reflect monthly deliveries
for better understanding

* bugfix(TUP-26956):Update Studio top bar to reflect monthly deliveries
for better understanding

* bugfix(TUP-26956):Update Studio top bar to reflect monthly deliveries
for better understanding

* bugfix(TUP-26956):Update Studio top bar to reflect monthly deliveries
for better understanding

Co-authored-by: hwang-talend <hwang@talend.com>
2020-05-12 09:21:53 +08:00
Jane Ding
d13cdc6349 fix(TUP-27003):Should disable the Commit button of Uncommitted files (#3273) (#3276)
found dialog when project is in MERGING state
https://jira.talendforge.org/browse/TUP-27003
2020-05-11 18:03:30 +08:00
Zhiwei Xue
1609837f67 chore(TUP-26710):update version (#3275)
* chore(TUP-26710):update version

* Set version to 7.3.1 PATCH

* chore(TUP-26710):update version for feature.xml

Co-authored-by: Jenkins Continuous Build server <jenkins@tal-rd02.talend.lan>
2020-05-11 17:03:05 +08:00
Jane Ding
eafc630094 fix(TUP-26990):Possible conflict in talend project (#3264) (#3271)
* fix(TUP-26990):Possible conflict in talend project
https://jira.talendforge.org/browse/TUP-26990

* fix(TUP-26990):Possible conflict in talend project
https://jira.talendforge.org/browse/TUP-26990
2020-05-09 14:59:20 +08:00
Jane Ding
ee68fe3be6 feat(TUP-16546)Prompt users for new password in Studio Connection when (#3119) (#3255)
* feat(TUP-16546)Prompt users for new password in Studio Connection when
AD/LDAP credentials change in TAC
https://jira.talendforge.org/browse/TUP-16546

* feat(TUP-16546)Prompt users for new password in Studio Connection when
AD/LDAP credentials change in TAC
https://jira.talendforge.org/browse/TUP-16546

* feat(TUP-16546)Prompt users for new password in Studio Connection when
AD/LDAP credentials change in TAC
https://jira.talendforge.org/browse/TUP-16546

* feat(TUP-16546)Prompt users for new password in Studio Connection when
AD/LDAP credentials change in TAC
https://jira.talendforge.org/browse/TUP-16546
2020-05-06 00:10:43 +08:00
Jane Ding
cfeb6118db fix(TUP-26639):Talend Cloud studio Issue -Changes to Context Parameter (#3249) (#3256)
* fix(TUP-26639):Talend Cloud studio Issue -Changes to Context Parameter
Names is not reflected on the Connection for Snowflake
https://jira.talendforge.org/browse/TUP-26639

* fix(TUP-26639):Talend Cloud studio Issue -Changes to Context Parameter
Names is not reflected on the Connection for Snowflake
https://jira.talendforge.org/browse/TUP-26639

* fix(TUP-26639):Talend Cloud studio Issue -Changes to Context Parameter
Names is not reflected on the Connection for Snowflake
https://jira.talendforge.org/browse/TUP-26639
2020-05-04 19:14:11 +08:00
jiezhang-tlnd
5c140eb8a2 fix(TUP-26896)Error create a Sybase connection in metadata and cannot (#3254)
retrieve tables (#3231)

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables
https://jira.talendforge.org/browse/TUP-26896

* fix(TUP-26896)retrieve schema on sybase 16 anywhere metadate get empry
value
https://jira.talendforge.org/browse/TUP-26896

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables
https://jira.talendforge.org/browse/TUP-26896

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables

* fix(TUP-26896)Error create a Sybase connection in metadata and cannot
retrieve tables
https://jira.talendforge.org/browse/TUP-26896

Conflicts:
	main/plugins/org.talend.metadata.managment/src/main/java/org/talend/metadata/managment/model/DBConnectionFillerImpl.java
2020-04-30 17:39:51 +08:00
Liu Xinquan
2f527b6195 fix(TDQ-18135) support context variable in tDataEncrypt (#3180) (#3207) (#3252) 2020-04-30 15:46:33 +08:00
Jane Ding
30119635cb fix(TUP-26639):Talend Cloud studio Issues - Group context and (#3233) (#3243)
connections
https://jira.talendforge.org/browse/TUP-26639
2020-04-27 23:20:59 +08:00
Zhiwei Xue
d50c690f42 fix(TUP-26809):Job zip should not contain jars from testcase only (#3237) 2020-04-27 18:05:28 +08:00
Emmanuel GALLOIS
10764112d7 feat(TCOMP-1681): Make ESB Studio job export TaCoKit compliant
- add TaCoKit dependency service (#3220)
2020-04-24 17:27:26 +02:00
hwang-talend
84b1dd3a01 Hwang/tup 26870 (#3214) (#3238)
* bugfix(TUP-26870):Incorrect sorting order
2020-04-23 14:17:36 +08:00
Zhiwei Xue
d8084ea4f0 fix(TUP-26876):NoClassDefFoundError when I run spark job with JobServer 2020-04-16 10:22:36 +08:00
Dmytro Sylaiev
8f2c264cc3 fix(TDI-44000): Bump locales version for maven.tos plugin (#3213) 2020-04-15 19:03:26 +03:00
hzhao-talendbj
8a24ecd296 fix missing db value (#3209) (#3210) 2020-04-15 09:50:56 +08:00
jiezhang-tlnd
14c79d9602 fix(TUP-26793)JDBC Redshift in context mode still asked for jars (#3205)
https://jira.talendforge.org/browse/TUP-26793
2020-04-13 14:16:51 +08:00
Zhiwei Xue
f682de08d2 fix(TUP-26728):fix regression on preview function. (#3197) 2020-04-09 16:04:20 +08:00
Zhiwei Xue
cec1999354 fix(TUP-26728):Missing spark dependencies when using test cases (#3194)
* fix(TUP-26728):The parent DI job misses to load some required libraries
from the Spark job

* fix(TUP-26728):Missing spark dependencies when using test cases
2020-04-09 16:03:44 +08:00
hzhao-talendbj
29b4de8ad7 fix(TUP-26388)Amazon Redshift Driver class not working with Implicit (#3181) (#3190)
* fix(TUP-26388)Amazon Redshift Driver class not working with Implicit
Context

* fix(TUP-26388)Amazon Redshift Driver class not working with Implicit
Context
2020-04-07 15:42:11 +08:00
hcyi
cc44671136 fix(TUP-26229):Dynamic Schema default Mapping can't be changed (#3143) (#3183) 2020-04-03 14:24:44 +08:00
Zhiwei Xue
2d4ce482ae fix(TUP-26233):update related extensions. (#3179) 2020-04-03 12:37:57 +08:00
bhe-talendbj
257d1aa94b fix(TUP-26539): Unassociate data from associateListeners (#3169) (#3176)
* fix(TUP-26539): Fix wrong tree node implmentation

* fix(TUP-26539): add test case

* fix(TUP-26539): Remove reference to itself

* fix(TUP-26539): Return root node

* fix(TUP-26539): Update test case

* fix(TUP-26539): update test case

* fix(TUP-26539): Unassociate unnecessary listeners

* fix(TUP-26539): Revert changes of RepositoryNode

* fix(TUP-26539): Add override annotation
2020-04-03 10:07:51 +08:00
Zhiwei Xue
c5d28b4480 fix(TUP-26233):[7.0.1] Sometimes , the ZIP file created by a commandline (#3168)
PublishJob is not correct, missing item files.
2020-03-31 18:27:33 +08:00
Liu Xinquan
1d0650170f fix(TDQ-18049) add the "transform" to avoid class conflict when shaded (#3085) (#3131)
Co-authored-by: qiongli <qiongli@talend.com>
2020-03-31 14:43:33 +08:00
hzhao-talendbj
28a9bf7542 fix(TUP-26596)Proxy of libraries not working when studio have no (#3165) (#3172)
* fix(TUP-26596)Proxy of libraries not working when studio have no
internet access

* fix(TUP-26596)Proxy of libraries not working when studio have no
internet access

* fix(TUP-26596)Proxy of libraries not working when studio have no
internet access

* fix(TUP-26596)Proxy of libraries not working when studio have no
internet access
2020-03-31 09:14:22 +08:00
sbliu
9a649d1c05 TMDM-14505 MDM connection in metadata randomly failed with error 'Failed to connect to MDM, please change MDM settings'
Moved interface IWebServiceHook from mdm bundle and renamed to IMDMWebServiceHook,re-use the implemented webservice hook in mdm for both mdm & di side to establish mdm connection token.
Add unit test to check presence of the required header that containing token.
2020-03-27 15:35:46 +08:00
hzhao-talendbj
8889b7f0e9 Hengzhao/backport73/tup 25889 display issue for the line between linker source and target on mac and ubuntu (#3166)
* fix(TUP-25889)Display issue for the line between Linker source and (#3103)

* fix(TUP-25889)Display issue for the line between Linker source and
target on Mac and Ubuntu

* fix(TUP-25889)Display issue for the line between Linker source and
target on Mac and Ubuntu

* fix column names are same issue (#3155)

* fix mac os display issue (#3160)
2020-03-26 19:22:32 +08:00
Ivan Gonchar
43e6cc4b99 chore: bump Components version to 0.28.4-SNAPSHOT (#3153) 2020-03-26 07:57:26 +08:00
Jane Ding
2735bef5ed fix(TUP-26576):Warning pops up cannot connect to the user libraries (#3154) (#3159)
artifact repository set in administrator
https://jira.talendforge.org/browse/TUP-26576
2020-03-25 09:21:11 +08:00
Zhiwei Xue
dfe11f5469 fix(TUP-26165):fix jar with classifier missing issue (#3152)
* fix(TUP-26165)jar referenced in bat or sh classpath missing in build ZIP (#3105)

* fix(TUP-26165)jar referenced in bat or sh classpath missing in build ZIP
file folder lib
https://jira.talendforge.org/browse/TUP-26165

* fix(TUP-26165)jar referenced in bat or sh classpath missing in build ZIP
file folder lib
https://jira.talendforge.org/browse/TUP-26165

* fix(TUP-26165)jar referenced in bat or sh classpath missing in build ZIP
file folder lib
https://jira.talendforge.org/browse/TUP-26165

* fix(TUP-26165)jar referenced in bat or sh classpath missing in build ZIP
file folder lib
https://jira.talendforge.org/browse/TUP-26165

* fix(TUP-26165)jar referenced in bat or sh classpath missing in build ZIP
file folder lib
https://jira.talendforge.org/browse/TUP-26165

* fix(TUP-26165):fix jar with classifier missing issue

Co-authored-by: Jane Ding <35018295+jding-tlnd@users.noreply.github.com>
2020-03-23 14:22:07 +08:00
Ivan Gonchar
cf96982dcf chore: bump TCK components version to 1.6.3-SNAPSHOT (#3150) 2020-03-20 11:06:13 +08:00
Ivan Gonchar
d7b24ab048 chore: bump Components version to 0.28.3-SNAPSHOT (#3148) 2020-03-20 10:53:50 +08:00
kjwang
ce527ba33e Fix TUP-26346 Files from custom component folders are uploaded to nexus multiple times (#3125) (#3144)
* Fix TUP-26346 Files from custom component folders are uploaded to nexus
multiple times
https://jira.talendforge.org/browse/TUP-26346

* Fix TUP-26346 Files from custom component folders are uploaded to nexus
multiple times
https://jira.talendforge.org/browse/TUP-26346

* Fix TUP-26346 Files from custom component folders are uploaded to nexus
multiple times
https://jira.talendforge.org/browse/TUP-26346
2020-03-20 09:43:59 +08:00
Zhiwei Xue
9b3037d3a8 update talend.properties 2020-03-19 09:56:00 +08:00
hcyi
49ae1fe789 fix(TUP-26155):improve for dataviewer if MongoDB with SSL (#3111) (#3130) 2020-03-16 12:37:34 +08:00
bhe-talendbj
e27dcbcef6 bugfix(TDQ-18070): Improve file path validation (#3095) (#3127)
* fix(TDQ-18070): Improve file path validation

* fix(TDQ-18070): Improve file path validation
2020-03-11 11:23:17 +08:00
kjwang
dd61f6d257 TUP-26308 Nexus 2 gets populated by different crypto-utils jar versions (#3116) (#3123)
https://jira.talendforge.org/browse/TUP-26308
2020-03-11 11:22:02 +08:00
bhe-talendbj
6c690a9314 bugfix(TUP-25965) Include subjob's test reports (#3055) (#3126)
* bugfix(TUP-25965) Synchronize test reports

* bugfix(TUP-25965) Ignore test failures and zip test reports

* bugfix(TUP-25965) Ignore test failures and zip test reports

* bugfix(TUP-25965) Ignore test failures and zip test reports

* bugfix(TUP-25965) Ignore test failures and zip test reports

* bugfix(TUP-25965) Ignore test failures

* bugfix(TUP-25965) Ignore test failures

* bugfix(TUP-25965) Skip tests when running job

* fix(TUP-25965): Call service to check is build job or not
2020-03-10 11:02:41 +08:00
Zhiwei Xue
a24e1fb363 fix(TUP-26344):Some job including customer component can't generate code (#3121)
migrated from 6.3.1 to 7.2.1
2020-03-10 10:47:17 +08:00
Chao MENG
0878fc8bac fix(TUP-26212): Share more than one car component to nexus3.19.1 will fail to generate the right index file (#3100) (#3120)
* fix(TUP-26212): Share more than one car component to nexus3.19.1 will
fail to generate the right index file

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

* fix(TUP-26212): Share more than one car component to nexus3.19.1 will
fail to generate the right index file

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

Co-authored-by: bhe-talendbj <52311292+bhe-talendbj@users.noreply.github.com>
2020-03-10 09:27:20 +08:00
kjwang
4375dcbc66 fix(TUP-26189): [7.2.1] snowflake metadata connection with proxy failure (#3101) (#3114)
* fix(TUP-26189): [7.2.1] snowflake metadata connection with proxy failure

https://jira.talendforge.org/browse/TUP-26189
2020-03-05 14:47:23 +08:00
Jenkins Continuous Build server
a1ee13acc5 Set version to 7.3.2 SNAPSHOT 2020-02-28 13:00:24 +01:00
382 changed files with 8749 additions and 3380 deletions

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.common.ui.runtime.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.runtime.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.repository.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.runtime.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip.edit.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.help.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.helpers.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.librariesmanager.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.librariesmanager.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.metadata.managment.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.metadata.managment.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.migrationTool.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.edit.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.migration.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.presentation.onboarding.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.rcp.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.registration.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.items.importexport.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.items.importexport.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.localprovider.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.mdm.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.metadata.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.view.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.resources.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.fragment.jars.common.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.help.di.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.help.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.jdt.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.libraries.jdbc.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.m2e.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.migration.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.rcp.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.update.p2.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.updates.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.utils.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.common.ui.runtime</artifactId>

View File

@@ -21,6 +21,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
@@ -38,6 +39,8 @@ public class ExceptionMessageDialog extends MessageDialog {
private String exceptionString = null;
private int[] diabledButtonIndex = new int[] {};
public ExceptionMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
int dialogImageType, String[] dialogButtonLabels, int defaultIndex, Throwable ex) {
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
@@ -147,4 +150,21 @@ public class ExceptionMessageDialog extends MessageDialog {
this.exceptionString = exceptionString;
}
public void setDisabledButtons(int[] index) {
this.diabledButtonIndex = index;
}
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
if (diabledButtonIndex == null) {
return;
}
for (int index : diabledButtonIndex) {
Button button = super.getButton(index);
button.setEnabled(false);
}
}
}

View File

@@ -13,7 +13,10 @@ Require-Bundle: org.apache.log4j;visibility:=reexport,
org.talend.libraries.apache,
com.ibm.icu,
org.apache.commons.io,
org.talend.utils
org.talend.utils,
org.eclipse.core.net,
org.eclipse.m2e.core,
org.eclipse.m2e.maven.runtime
Export-Package: org.talend.commons,
org.talend.commons.exception,
org.talend.commons.i18n,

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.runtime</artifactId>

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.talend</groupId>
<artifactId>org.talend.tos</artifactId>
<version>7.3.1</version>
<version>7.3.2-SNAPSHOT</version>
<relativePath>../pom_server.xml</relativePath>
</parent>

View File

@@ -17,6 +17,7 @@ import java.io.InputStream;
import java.net.URL;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.net.proxy.IProxyService;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -24,6 +25,7 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import org.talend.commons.exception.ExceptionService;
import org.talend.commons.runtime.debug.TalendDebugHandler;
import org.talend.commons.utils.system.EclipseCommandLine;
@@ -55,6 +57,8 @@ public class CommonsPlugin implements BundleActivator {
// TESB-17856: For commandline builds ESB Micorservice bundle
private static boolean isESBMicorservice = false;
private static ServiceTracker proxyTracker;
public static boolean isWorkbenchCreated() {
return isWorkbenchCreated;
}
@@ -107,7 +111,8 @@ public class CommonsPlugin implements BundleActivator {
}
public static boolean isDebugMode() {
return ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
return Boolean.getBoolean("talendDebug") //$NON-NLS-1$
|| ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
}
public static boolean isJUnitTest() {
@@ -179,4 +184,13 @@ public class CommonsPlugin implements BundleActivator {
return FileLocator.toFileURL(entry);
}
public static IProxyService getProxyService() {
if (proxyTracker == null) {
proxyTracker = new ServiceTracker(Platform.getBundle(PLUGIN_ID).getBundleContext(), IProxyService.class.getName(),
null);
proxyTracker.open();
}
return (IProxyService) proxyTracker.getService();
}
}

View File

@@ -0,0 +1,58 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.commons.exception;
public class ClientException extends PersistenceException {
private Integer httpCode;
public ClientException(String message) {
super(message);
}
public ClientException(Integer httpCode, String message) {
super(message);
this.httpCode = httpCode;
}
public ClientException(String message, Throwable cause) {
super(message, cause);
}
public ClientException(Integer httpCode, String message, Throwable cause) {
super(message, cause);
this.httpCode = httpCode;
}
public ClientException(Throwable cause) {
super(cause);
}
public ClientException(Integer httpCode, Throwable cause) {
super(cause);
this.httpCode = httpCode;
}
public Integer getHttpCode() {
return httpCode;
}
public void setHttpCode(Integer httpCode) {
this.httpCode = httpCode;
}
@Override
public String toString() {
return getLocalizedMessage();
}
}

View File

@@ -42,6 +42,8 @@ public interface ITaCoKitService {
boolean isNeedMigration(String componentName, Map<String, String> properties);
boolean isTaCoKitType(Object repoType);
public static ITaCoKitService getInstance() throws Exception {
BundleContext bc = FrameworkUtil.getBundle(ITaCoKitService.class).getBundleContext();
Collection<ServiceReference<ITaCoKitService>> tacokitServices = Collections.emptyList();

View File

@@ -0,0 +1,60 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.commons.utils;
import java.io.File;
import java.nio.file.Path;
import org.eclipse.m2e.core.MavenPlugin;
public enum MojoType {
CI_BUILDER("org.talend.ci", "builder-maven-plugin", "ci.builder.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
CLOUD_PUBLISHER("org.talend.ci", "cloudpublisher-maven-plugin", "cloud.publisher.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SIGNER("org.talend.ci", "signer-maven-plugin", "signer.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
OSGI_HELPER("org.talend.ci", "osgihelper-maven-plugin", "osgihelper.version"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
private String groupId;
private String artifactId;
private String versionKey;
private MojoType(String groupId, String artifactId, String versionKey) {
this.groupId = groupId;
this.artifactId = artifactId;
this.versionKey = versionKey;
}
public String getGroupId() {
return groupId;
}
public String getArtifactId() {
return artifactId;
}
public String getVersionKey() {
return versionKey;
}
public String getMojoArtifactIdFolder() {
Path basePath = new File(MavenPlugin.getMaven().getLocalRepositoryPath()).toPath();
return basePath.resolve(getGroupId().replaceAll("\\.", "/")).resolve(getArtifactId()).toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
public String getMojoGAV() {
return getGroupId() + ":" + getArtifactId() + ":" + getVersionKey(); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View File

@@ -15,15 +15,17 @@ package org.talend.commons.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Optional;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
@@ -262,24 +264,28 @@ public class VersionUtils {
return version;
}
public static String getMojoVersion(String mojoKey) {
String version = null;
public static String getMojoVersion(MojoType mojoType) {
String mojoKey = mojoType.getVersionKey();
String version = System.getProperty(mojoKey);
if (StringUtils.isNotBlank(version)) {
return version;
}
String talendVersion = getTalendVersion();
Properties properties = new Properties();
File file = new Path(Platform.getConfigurationLocation().getURL().getPath()).append("mojo_version.properties").toFile(); //$NON-NLS-1$
if (file.exists()) {
try (InputStream inStream = new FileInputStream(file)) {
properties.load(inStream);
version = properties.getProperty(mojoKey);
} catch (IOException e) {
ExceptionHandler.process(e);
}
if (version != null && !version.startsWith(talendVersion)) {
ExceptionHandler
.process(new Exception(
"Incompatible Mojo version:" + mojoKey + "[" + version + "], use default version.")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
version = null;
String majorVersion = StringUtils.substringBeforeLast(talendVersion, "."); //$NON-NLS-1$
String artifactIdFolder = mojoType.getMojoArtifactIdFolder();
Optional<File> optional = Stream.of(new File(artifactIdFolder).listFiles())
.filter(f -> f.isDirectory() && f.getName().startsWith(majorVersion))
.sorted((f1, f2) -> new DefaultArtifactVersion(f2.getName()).compareTo(new DefaultArtifactVersion(f1.getName())))
.findFirst();
if (optional.isPresent()) {
File latestArtifact = optional.get();
String fileName = mojoType.getArtifactId() + "-" + latestArtifact.getName(); //$NON-NLS-1$
if (Stream.of(latestArtifact.listFiles())
.filter(f -> f.getName().equals(fileName + ".jar") || f.getName().equals(fileName + ".pom")) //$NON-NLS-1$ //$NON-NLS-2$
.count() != 2) {
ExceptionHandler.process(new Exception("Can't find plugin artifact " + mojoType.getMojoGAV())); //$NON-NLS-1$
}
version = latestArtifact.getName();
}
// default version
if (StringUtils.isBlank(version)) {
@@ -293,6 +299,7 @@ public class VersionUtils {
version += "-" + revision; //$NON-NLS-1$
}
}
System.setProperty(mojoKey, version);
return version;
}
@@ -302,4 +309,5 @@ public class VersionUtils {
talendVersion = null;
}
}
}

View File

@@ -0,0 +1,121 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.commons.utils.database;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
/**
* created by qiongli on 2013-11-13 Detailled comment
*
*/
public class Sybase16SADatabaseMetaData extends SybaseDatabaseMetaData {
private static Logger log = Logger.getLogger(Sybase16SADatabaseMetaData.class);
/**
* DOC qiongli SybaseIQDatabaseMetaData constructor comment.
*
* @param connection
* @throws SQLException
*/
public Sybase16SADatabaseMetaData(Connection connection) throws SQLException {
super(connection);
}
public ResultSet getCatalogs(String login, String database) throws SQLException {
List<String[]> list = new ArrayList<String[]>();
List<String> catList = new ArrayList<String>();
if (!StringUtils.isEmpty(database)) {
catList.add(database);
}
for (String catalogName : catList) {
String sql = createSqlByLoginAndCatalog(login, catalogName);
ResultSet rs = null;
Statement stmt = null;
try {
stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) {
int temp = rs.getInt(1);
if (temp > 0) {
String[] r = new String[] { catalogName };
list.add(r);
}
}
} catch (SQLException e) {
log.error(e);
} finally {
try {
if (rs != null) {
rs.close();
}
if (stmt != null) {
stmt.close();
}
} catch (Exception e) {
log.error(e);
}
}
}
SybaseResultSet tableResultSet = new SybaseResultSet();
tableResultSet.setMetadata(new String[] { "TABLE_CAT" }); //$NON-NLS-1$
tableResultSet.setData(list);
return tableResultSet;
}
@Override
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
throws SQLException {
return super.getColumns(null, schemaPattern, tableNamePattern, columnNamePattern);
}
@Override
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
return super.getPrimaryKeys(null, schema, table);
}
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
throws SQLException {
return super.getTables(null, schemaPattern, tableNamePattern, types);
}
/**
*
* get a sql query by login name and catalog name.
*
* @param loginName
* @param catalogName
* @return
*/
protected String createSqlByLoginAndCatalog(String loginName, String catalogName) {
String sql = "select count(*) from " + catalogName
+ ".dbo.sysusers where suid in (select suid from "+catalogName+".dbo.syslogins where name = '" + loginName
+ "')";
return sql;
}
}

View File

@@ -0,0 +1,18 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.commons.utils.network;
public interface ITalendNexusPrefConstants {
public static final String NEXUS_TIMEOUT = "NEXUS_TIMEOUT"; //$NON-NLS-1$
}

View File

@@ -26,6 +26,9 @@ import java.util.Enumeration;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
/**
@@ -44,7 +47,17 @@ public class NetworkUtil {
private static final String HTTP_NETWORK_URL = "https://talend-update.talend.com";
private static final int DEFAULT_TIMEOUT = 4000;
private static final int DEFAULT_NEXUS_TIMEOUT = 20000;// same as preference value
public static final String ORG_TALEND_DESIGNER_CORE = "org.talend.designer.core"; //$NON-NLS-1$
public static boolean isNetworkValid() {
return isNetworkValid(DEFAULT_TIMEOUT);
}
public static boolean isNetworkValid(Integer timeout) {
String disableInternet = System.getProperty(TALEND_DISABLE_INTERNET);
if ("true".equals(disableInternet)) { //$NON-NLS-1$
return false;
@@ -55,8 +68,9 @@ public class NetworkUtil {
conn = (HttpURLConnection) url.openConnection();
conn.setDefaultUseCaches(false);
conn.setUseCaches(false);
conn.setConnectTimeout(4000);
conn.setReadTimeout(4000);
int conntimeout = timeout != null ? timeout.intValue() : DEFAULT_TIMEOUT;
conn.setConnectTimeout(conntimeout);
conn.setReadTimeout(conntimeout);
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
String strMessage = conn.getResponseMessage();
if (strMessage.compareTo("Not Found") == 0) { //$NON-NLS-1$
@@ -73,22 +87,23 @@ public class NetworkUtil {
return true;
}
public static boolean isNetworkValid(String url) {
public static boolean isNetworkValid(String url, Integer timeout) {
if (url == null) {
return isNetworkValid();
return isNetworkValid(timeout);
}
return checkValidWithHttp(url);
return checkValidWithHttp(url, timeout);
}
private static boolean checkValidWithHttp(String urlString) {
private static boolean checkValidWithHttp(String urlString, Integer timeout) {
HttpURLConnection conn = null;
try {
URL url = new URL(urlString);
conn = (HttpURLConnection) url.openConnection();
conn.setDefaultUseCaches(false);
conn.setUseCaches(false);
conn.setConnectTimeout(4000);
conn.setReadTimeout(4000);
int conntimeout = timeout != null ? timeout.intValue() : DEFAULT_TIMEOUT;
conn.setConnectTimeout(conntimeout);
conn.setReadTimeout(conntimeout);
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
conn.getResponseMessage();
} catch (Exception e) {
@@ -101,6 +116,18 @@ public class NetworkUtil {
return true;
}
public static int getNexusTimeout() {
int timeout = DEFAULT_NEXUS_TIMEOUT;
try {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ORG_TALEND_DESIGNER_CORE);
timeout = node.getInt(ITalendNexusPrefConstants.NEXUS_TIMEOUT, DEFAULT_NEXUS_TIMEOUT);
} catch (Throwable e) {
ExceptionHandler.process(e);
}
return timeout;
}
public static Authenticator getDefaultAuthenticator() {
try {
Field theAuthenticatorField = Authenticator.class.getDeclaredField("theAuthenticator");

View File

@@ -13,6 +13,8 @@
package org.talend.commons.utils.network;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
@@ -35,8 +37,14 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Priority;
import org.eclipse.core.internal.net.ProxyManager;
import org.eclipse.core.net.proxy.IProxyService;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.i18n.internal.Messages;
import org.talend.daikon.sandbox.properties.ClassLoaderIsolatedSystemProperties;
import sun.net.spi.DefaultProxySelector;
/**
* DOC cmeng class global comment. Detailled comment
@@ -51,9 +59,23 @@ public class TalendProxySelector extends ProxySelector {
private static final String PROP_ALLOW_PROXY_REDIRECT_EXCLUDE = "talend.studio.proxy.redirect.whiteList";
private static final String PROP_EXECUTE_CONNECTION_FAILED = "talend.studio.proxy.executeConnectionFailed";
private static final String PROP_UPDATE_SYSTEM_PROPERTIES_FOR_JRE = "talend.studio.proxy.jre.updateSystemProperties";
private static final String PROP_CHECK_PROXY = "talend.studio.proxy.checkProxy";
private static final String PROP_VALIDATE_URI = "talend.studio.proxy.validateUri";
private static final String PROP_PROXY_SELECTOR = "talend.studio.proxy.selector";
private static final String PROP_PROXY_SELECTOR_DEFAULT = "default";
private static final String PROP_PROXY_SELECTOR_JRE = "jre";
private static final String PROP_PROXY_HOST_MAP = "talend.studio.proxy.hostMap";
private static final String PROP_DISABLE_DEFAULT_SELECTOR = "talend.studio.proxy.disableDefaultSelector";
private static final String PROP_DISABLE_DEFAULT_SELECTOR_PROVIDER = "talend.studio.proxy.disableDefaultSelectorProvider";
/**
* Example: update.talend.com,socket:http,https:http;nexus.talend.com,socket,http;,socket:http
@@ -67,7 +89,20 @@ public class TalendProxySelector extends ProxySelector {
private static final String KEY_DEFAULT = ":default:";
private ProxySelector defaultSelector;
private static Field uriHostField;
private static Method proxyManagerUpdateSystemPropertiesFunc;
private static boolean checkProxy = Boolean.valueOf(System.getProperty(PROP_CHECK_PROXY, Boolean.TRUE.toString()));
/**
* Note: eclipse default selector may be different between TOS and TIS, TOS may use jre one, TIS may use egit one
*/
private ProxySelector eclipseDefaultSelector;
private ProxySelector jreDefaultSelector;
private EProxySelector eProxySelector;
final private Map<Object, Collection<IProxySelectorProvider>> selectorProviders;
@@ -83,15 +118,36 @@ public class TalendProxySelector extends ProxySelector {
private boolean allowProxyRedirect = false;
private boolean disableDefaultSelector = false;
private boolean disableDefaultSelectorProvider = false;
private TalendProxySelector(final ProxySelector defaultSelector) {
this.defaultSelector = defaultSelector;
private boolean validateUri = true;
private boolean executeConnectionFailed = true;
private boolean updateSystemPropertiesForJre = true;
private TalendProxySelector(final ProxySelector eclipseDefaultSelector) {
this.eclipseDefaultSelector = eclipseDefaultSelector;
this.jreDefaultSelector = new DefaultProxySelector();
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()));
disableDefaultSelectorProvider = Boolean
.valueOf(System.getProperty(PROP_DISABLE_DEFAULT_SELECTOR_PROVIDER, Boolean.FALSE.toString()));
printProxyLog = Boolean.valueOf(System.getProperty(PROP_PRINT_LOGS, Boolean.FALSE.toString()));
validateUri = Boolean.valueOf(System.getProperty(PROP_VALIDATE_URI, Boolean.TRUE.toString()));
executeConnectionFailed = Boolean.valueOf(System.getProperty(PROP_EXECUTE_CONNECTION_FAILED, Boolean.TRUE.toString()));
updateSystemPropertiesForJre = Boolean
.valueOf(System.getProperty(PROP_UPDATE_SYSTEM_PROPERTIES_FOR_JRE, Boolean.TRUE.toString()));
switch (System.getProperty(PROP_PROXY_SELECTOR, PROP_PROXY_SELECTOR_DEFAULT).toLowerCase()) {
case PROP_PROXY_SELECTOR_JRE:
this.eProxySelector = EProxySelector.jre;
break;
default:
this.eProxySelector = EProxySelector.eclipse_default;
break;
}
initHostMap();
initRedirectList();
@@ -176,6 +232,18 @@ public class TalendProxySelector extends ProxySelector {
synchronized (instanceLock) {
if (instance == null) {
instance = new TalendProxySelector(proxySelector);
try {
uriHostField = URI.class.getDeclaredField("host");
uriHostField.setAccessible(true);
} catch (Exception e) {
ExceptionHandler.process(e);
}
try {
proxyManagerUpdateSystemPropertiesFunc = ProxyManager.class.getDeclaredMethod("updateSystemProperties");
proxyManagerUpdateSystemPropertiesFunc.setAccessible(true);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
}
@@ -188,34 +256,72 @@ public class TalendProxySelector extends ProxySelector {
return null;
}
});
if (instance.getDefaultProxySelector() == null
if (instance.getEclipseDefaultSelector() == null
|| (proxySelector != null && proxySelector.getClass().getName().endsWith(ECLIPSE_PROXY_SELECTOR))) {
instance.setDefaultProxySelector(proxySelector);
instance.setEclipseDefaultSelector(proxySelector);
}
}
return instance;
}
public static void checkProxy() {
if (!checkProxy) {
return;
}
try {
TalendProxySelector.getInstance();
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
@Override
public List<Proxy> select(final URI uri) {
if (printProxyLog) {
ExceptionHandler.log("TalendProxySelector.select " + uri);
}
if (uri == null) {
return Collections.EMPTY_LIST;
}
URI validatedUri = validateUri(uri);
Set<Proxy> results = new LinkedHashSet<>();
try {
final Set<Proxy> resultFromProviders = getProxysFromProviders(uri);
final Set<Proxy> resultFromProviders = getProxysFromProviders(validatedUri);
if (resultFromProviders != null && !resultFromProviders.isEmpty()) {
results.addAll(resultFromProviders);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (printProxyLog) {
ExceptionHandler.log("TalendProxySelector.resultFromProviders " + results);
}
ProxySelector defaultProxySelector = getDefaultProxySelector();
if (printProxyLog) {
ExceptionHandler.log("TalendProxySelector.defaultProxySelector " + defaultProxySelector);
}
if (defaultProxySelector != null) {
URI newUri = getNewUri(uri);
List<Proxy> defaultProxys = defaultProxySelector.select(newUri);
/**
* don't validate uri here, so that we can know whether it is an issue uri
*/
URI newUri = getNewUri(validatedUri, false);
List<Proxy> defaultProxys = null;
if (validateUri && StringUtils.isBlank(newUri.getHost())) {
/**
* If host is blank, force to use jre proxy selector to avoid the eclipse proxy selector bug
*/
defaultProxys = getJreProxySelector().select(newUri);
} else {
defaultProxys = defaultProxySelector.select(newUri);
}
if (printProxyLog) {
ExceptionHandler.log("TalendProxySelector.defaultProxys " + defaultProxys);
}
try {
results.addAll(filterProxys(uri, defaultProxys));
results.addAll(filterProxys(validatedUri, defaultProxys));
} catch (Exception e) {
results.addAll(defaultProxys);
ExceptionHandler.process(e);
@@ -229,6 +335,54 @@ public class TalendProxySelector extends ProxySelector {
return new LinkedList<Proxy>(results);
}
private URI validateUri(URI uri) {
if (!validateUri) {
return uri;
}
URI validatedUri = null;
try {
/**
* DON'T use URI.create(), MUST use the conductor which requires authority
*/
validatedUri = new URI(uri.getScheme(), uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment());
/**
* Validate the host, if the host is empty, it will cause the eclipse selector to return dirrect
*/
if (StringUtils.isBlank(validatedUri.getHost())) {
String authority = validatedUri.getAuthority();
if (StringUtils.isNotBlank(authority)) {
// example: https://u:p@www.company.com:8081/path/a?param=b
String host = null;
int userInfoIndex = authority.indexOf('@');
if (0 <= userInfoIndex) {
authority = authority.substring(userInfoIndex + 1);
}
int portIndex = authority.lastIndexOf(':');
if (0 <= portIndex) {
host = authority.substring(0, portIndex);
}
try {
uriHostField.set(validatedUri, host);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
if (validatedUri == null) {
validatedUri = uri;
}
}
if (printProxyLog) {
ExceptionHandler.log("After validate: " + uri + " -> " + validatedUri);
}
return validatedUri;
}
private List<Proxy> filterProxys(final URI uri, List<Proxy> defaultProxys) {
List<Proxy> result = new ArrayList<>();
if (defaultProxys != null && !defaultProxys.isEmpty()) {
@@ -264,38 +418,48 @@ public class TalendProxySelector extends ProxySelector {
return result;
}
private URI getNewUri(URI uri) {
private URI getNewUri(URI uri, boolean validateUri) {
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);
}
try {
// get host before new URI, because the host may be set manually due to URI issue
String host = newUri.getHost();
newUri = new URI(newUri.getScheme(), newUri.getAuthority(), newUri.getPath(), newUri.getQuery(),
newUri.getFragment());
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);
}
if (protocolMap != null) {
String schema = newUri.getScheme();
if (schema != null) {
String lowercasedProtocol = schema.toLowerCase();
String preferedProtocol = protocolMap.get(lowercasedProtocol);
if (StringUtils.isNotBlank(preferedProtocol)) {
/**
* Note: MUST use the constructor which requires authority, because some uri may be illegal,
* then host info will be stored in authority field instead of host filed
*/
newUri = new URI(preferedProtocol, newUri.getAuthority(), newUri.getPath(), newUri.getQuery(),
newUri.getFragment());
}
}
}
} catch (URISyntaxException e) {
if (printProxyLog) {
ExceptionHandler.process(
new Exception(Messages.getString("TalendProxySelector.exception.proxySelectionError", uri), e),
Priority.WARN);
}
}
}
if (validateUri) {
newUri = validateUri(newUri);
}
return newUri;
}
@@ -395,11 +559,45 @@ public class TalendProxySelector extends ProxySelector {
}
public ProxySelector getDefaultProxySelector() {
return defaultSelector;
switch (eProxySelector) {
case jre:
return getJreProxySelector();
default:
return eclipseDefaultSelector;
}
}
public void setDefaultProxySelector(final ProxySelector selector) {
defaultSelector = selector;
private ProxySelector getJreProxySelector() {
try {
/**
* for tcompv0, daikon may create an isolated system properties for it, so proxies may be ignored in the new
* system properties; here we try to call the method to add proxies into the isolated system properties
*/
if (updateSystemPropertiesForJre && ClassLoaderIsolatedSystemProperties.getInstance()
.isIsolated(Thread.currentThread().getContextClassLoader())) {
if (printProxyLog) {
ExceptionHandler.log("Before update jre proxy system properties for the isolated classloader, http.proxyHost="
+ System.getProperty("http.proxyHost"));
}
IProxyService proxyService = CommonsPlugin.getProxyService();
proxyManagerUpdateSystemPropertiesFunc.invoke(proxyService);
if (printProxyLog) {
ExceptionHandler.log("After updated jre proxy system properties for the isolated classloader, http.proxyHost="
+ System.getProperty("http.proxyHost"));
}
}
} catch (Throwable e) {
ExceptionHandler.process(e);
}
return this.jreDefaultSelector;
}
public ProxySelector getEclipseDefaultSelector() {
return eclipseDefaultSelector;
}
public void setEclipseDefaultSelector(ProxySelector eclipseDefaultSelector) {
this.eclipseDefaultSelector = eclipseDefaultSelector;
}
@Override
@@ -413,21 +611,26 @@ public class TalendProxySelector extends ProxySelector {
});
}
ProxySelector defaultProxySelector = getDefaultProxySelector();
if (defaultProxySelector != null) {
defaultProxySelector.connectFailed(uri, sa, ioe);
if (executeConnectionFailed) {
/**
* Just try to make the behavior of jre proxy selector same like eclipse proxy selector
*/
ProxySelector defaultProxySelector = getDefaultProxySelector();
if (defaultProxySelector != null) {
defaultProxySelector.connectFailed(uri, sa, ioe);
}
}
}
public IProxySelectorProvider createDefaultProxySelectorProvider() {
if (disableDefaultSelector) {
if (disableDefaultSelectorProvider) {
return null;
}
return new DefaultProxySelectorProvider(Thread.currentThread());
}
public IProxySelectorProvider createDefaultProxySelectorProvider(String host) {
if (disableDefaultSelector) {
if (disableDefaultSelectorProvider) {
return null;
}
return new DefaultProxySelectorProvider(host);
@@ -445,6 +648,11 @@ public class TalendProxySelector extends ProxySelector {
return possibleKeys;
}
private enum EProxySelector {
eclipse_default,
jre
}
private class DefaultProxySelectorProvider extends AbstractProxySelectorProvider {
private Thread currentThread = null;
@@ -475,7 +683,7 @@ public class TalendProxySelector extends ProxySelector {
@Override
public boolean canHandle(URI uri) {
if (disableDefaultSelector) {
if (disableDefaultSelectorProvider) {
return false;
}
if (currentThread != null && Thread.currentThread() == currentThread) {

View File

@@ -19,15 +19,18 @@ import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.commons.io.FilenameUtils;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.runtime.service.ITaCoKitService;
@@ -58,8 +61,14 @@ public class UpdatesHelper {
public static final String COMPONENT_SUFFIX = "_java.xml";
public static final String COMPONENT_TEMPLATES = "templates";
public static final String NEW_COMPONENT_PREFIX = "installer$$";
public static final String PRE_TALEND_PATCH = "talend.patch";
public static final String RECORD_SEPERATOR = ",";
public static boolean existArtifacts(File base) {
return new File(base, FILE_ARTIFACTS).exists() || new File(base, FILE_JAR_ARTIFACTS).exists()
|| new File(base, FILE_XZ_ARTIFACTS).exists();
@@ -83,6 +92,9 @@ public class UpdatesHelper {
* will check that existed the plugins folder only.
*/
public static boolean isPlainUpdate(File file) {
if (skipPatchFile(file)) {
return false;
}
if (file != null && file.exists()) {
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
ZipFileStatus status = new ZipFileStatus(file);
@@ -110,6 +122,9 @@ public class UpdatesHelper {
* need check that contain "artifacts.xml", "content.xml" and "plugins" folder in same place.
*/
public static boolean isUpdateSite(File file) {
if (skipPatchFile(file)) {
return false;
}
if (file != null && file.exists()) {
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
@@ -171,7 +186,8 @@ public class UpdatesHelper {
}
private static void findUpdateBaseFile(Set<File> foundUpdateFiles, File baseFile) {
if (isPlainUpdate(baseFile) || isUpdateSite(baseFile) && !isComponentUpdateSite(baseFile)) {
if (isPlainUpdate(baseFile)
|| isUpdateSite(baseFile) && !isComponentUpdateSite(baseFile)) {
foundUpdateFiles.add(baseFile);
} else if (baseFile.isDirectory()) {
final File[] listFiles = baseFile.listFiles();
@@ -184,6 +200,10 @@ public class UpdatesHelper {
}
public static boolean isComponentUpdateSite(File file) {
if (skipPatchFile(file)) {
return false;
}
if (file != null && file.exists()) {
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
ZipFileStatus status = new ZipFileStatus(file) {
@@ -296,6 +316,9 @@ public class UpdatesHelper {
public static boolean isOldComponent(File f) {
if (f != null && f.exists() && f.isDirectory()) {
if (f.getName().equals(COMPONENT_TEMPLATES)) {
return true;
}
File[] listFiles = f.listFiles();
if (listFiles != null) {
for (File subFile : listFiles) {
@@ -307,4 +330,53 @@ public class UpdatesHelper {
}
return false;
}
public static File getProductFile() {
try {
return new File(Platform.getInstallLocation().getDataArea(FILE_ECLIPSE_PRODUCT).getPath());
} catch (IOException e) {
//
}
return null;
}
public static Properties loadProductProperties(File productFile) {
Properties prop = new Properties();
if (productFile != null && productFile.exists()) {
try (FileInputStream fis = new FileInputStream(productFile)) {
prop.load(fis);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return prop;
}
public static Set<String> getPatchesInstalled() {
Set<String> installed = new HashSet<String>();
File productFile = getProductFile();
Properties props = loadProductProperties(productFile);
props.forEach((k, v) -> {
String key = String.valueOf(k);
if (key.startsWith(PRE_TALEND_PATCH)) {
String val = String.valueOf(v);
String[] vals = val.split(RECORD_SEPERATOR);
if (vals.length > 1) {
installed.add(vals[1]);
} else {
installed.add(val);
}
}
});
return installed;
}
public static boolean skipPatchFile(File patchFile) {
Set<String> installedPathNames = getPatchesInstalled();
if (patchFile != null && patchFile.isFile()) {
String patchName = FilenameUtils.getBaseName(patchFile.getName());
return installedPathNames.contains(patchName);
}
return false;
}
}

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.ui</artifactId>

View File

@@ -104,7 +104,6 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
this.source = sourceTable;
dataToTableItemCache = new DataToTableItemCache(sourceTable);
}
protected IStyleLink getDefaultStyleLink() {
@@ -232,7 +231,7 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
int yStraight = sourceToCommonPoint.y + treeItemHeight / 2 + tableItemBounds.y;
pointEndStraight.x = sourceToCommonPoint.x + xStartBezierLink;
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
if (Platform.OS_MACOSX.equals(Platform.getOS()) || Platform.OS_LINUX.equals(Platform.getOS())) {
pointStartStraight.x = sourceToCommonPoint.x + tableItem.getParent().getBounds().width;
pointEndStraight.x = pointStartStraight.x;
} else {
@@ -311,10 +310,10 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
// Added by Marvin Wang on Nov. 28, 2012 for bug TDI-23378. This is not the best way to fix this issue,
// but till now I have not found the root cause.
if (Platform.OS_LINUX.equals(Platform.getOS())) {
pointEndCentralCurve.y = pointEndCentralCurve.y - tableItem.getBounds().height;
pointEndCentralCurve.y = pointEndCentralCurve.y - tableItem.getBounds().height - treeItemHeight / 2;
}
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
pointEndCentralCurve.y = pointEndCentralCurve.y + tableItem.getBounds(0).height;
pointEndCentralCurve.y = pointEndCentralCurve.y - tableItem.getBounds().height;
}
drawableLink.setPoint1(pointEndStraight);
drawableLink.setPoint2(pointEndCentralCurve);

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.repository</artifactId>

View File

@@ -117,6 +117,7 @@ public class JobAndNodesParametersRelationshipHandler implements IItemRelationsh
}
}
}
relationsMap.values().removeIf(value -> value.isEmpty());
return relationsMap;
}

View File

@@ -14,6 +14,7 @@ package org.talend.core.repository.handlers;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.talend.core.model.properties.Item;
@@ -43,8 +44,13 @@ public class JobRoutinesItemRelationshipHandler extends AbstractJobItemRelations
Set<Relation> relationSet = new HashSet<Relation>();
if (processType.getParameters() != null && processType.getParameters().getRoutinesParameter() != null) {
Map<String, String> currentSystemRoutinesMap = RelationshipItemBuilder.getInstance().getCurrentSystemRoutinesMap();
for (Object o : processType.getParameters().getRoutinesParameter()) {
RoutinesParameterType itemInfor = (RoutinesParameterType) o;
if (currentSystemRoutinesMap.containsValue(itemInfor.getName())) {
// exclude system routines relation
continue;
}
Relation addedRelation = new Relation();
addedRelation.setId(itemInfor.getName());

View File

@@ -70,6 +70,7 @@ import org.talend.commons.runtime.service.ITaCoKitService;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
import org.talend.commons.utils.data.container.RootContainer;
import org.talend.commons.utils.network.TalendProxySelector;
import org.talend.commons.utils.time.TimeMeasure;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.AbstractDQModelService;
@@ -107,6 +108,7 @@ import org.talend.core.model.properties.SpagoBiServer;
import org.talend.core.model.properties.Status;
import org.talend.core.model.properties.User;
import org.talend.core.model.properties.impl.FolderItemImpl;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.Folder;
import org.talend.core.model.repository.IRepositoryContentHandler;
@@ -122,6 +124,7 @@ import org.talend.core.repository.constants.Constant;
import org.talend.core.repository.constants.FileConstants;
import org.talend.core.repository.i18n.Messages;
import org.talend.core.repository.recyclebin.RecycleBinManager;
import org.talend.core.repository.utils.ProjectDataJsonProvider;
import org.talend.core.repository.utils.RepositoryPathProvider;
import org.talend.core.repository.utils.XmiResourceManager;
import org.talend.core.runtime.CoreRuntimePlugin;
@@ -129,6 +132,7 @@ import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.core.runtime.services.IMavenUIService;
import org.talend.core.runtime.util.ItemDateParser;
import org.talend.core.service.ICoreUIService;
import org.talend.core.service.IUpdateService;
import org.talend.cwm.helper.SubItemHelper;
import org.talend.cwm.helper.TableHelper;
import org.talend.designer.runprocess.IRunProcessService;
@@ -872,6 +876,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
}
this.repositoryFactoryFromProvider.deleteObjectPhysical(project, object, version, fromEmptyRecycleBin);
if (isFullLogonFinished()) {
fireRepositoryPropertyChange(ERepositoryActionName.AFTER_DELETE.getName(), null, object);
}
// i18n
// log.info("Physical deletion [" + objToDelete + "] by " + getRepositoryContext().getUser() + ".");
String str[] = new String[] { object.toString(), getRepositoryContext().getUser().toString() };
@@ -2034,6 +2041,11 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
TimeMeasure.begin("logOnProject"); //$NON-NLS-1$
try {
/**
* init/check proxy selector, in case default proxy selector is not registed yet
*/
TalendProxySelector.checkProxy();
System.getProperties().put("ReadOnlyUser", Boolean.FALSE.toString()); //$NON-NLS-1$
// remove the auto-build to enhance the build speed and application's use
@@ -2053,6 +2065,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
SubMonitor subMonitor = SubMonitor.convert(monitor, MAX_TASKS);
SubMonitor currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.logonInProgress"), 1); //$NON-NLS-1$
project.setReferenceProjectProvider(null);
getRepositoryContext().setProject(null);
initEmfProjectContent();
@@ -2071,6 +2084,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ProjectManager.getInstance().getBeforeLogonRecords().clear();
ProjectManager.getInstance().getUpdatedRemoteHandlerRecords().clear();
ProjectDataJsonProvider.checkAndRectifyRelationShipSetting(project.getEmfProject());
// init dynamic distirbution after `beforeLogon`, before loading libraries.
initDynamicDistribution(monitor);
@@ -2142,6 +2157,11 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
fireRepositoryPropertyChange(ERepositoryActionName.PROJECT_PREFERENCES_RELOAD.getName(), null, null);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IUpdateService.class)) {
IUpdateService updateService = GlobalServiceRegister.getDefault().getService(IUpdateService.class);
updateService.syncComponentM2Jars(currentMonitor);
}
IRunProcessService runProcessService = getRunProcessService();
if (runProcessService != null) {
runProcessService.initMavenJavaProject(monitor, project);
@@ -2230,6 +2250,11 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
tdqRepositoryService.initProxyRepository();
}
}
// regenerate relationship index
if (project.getEmfProject().getItemsRelations().isEmpty()) {
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
}
fullLogonFinished = true;
this.repositoryFactoryFromProvider.afterLogon(monitor);
} finally {
@@ -2409,9 +2434,14 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
@Override
@SuppressWarnings("unchecked")
public void executeRepositoryWorkUnit(RepositoryWorkUnit workUnit) {
checkProxySettings();
this.repositoryFactoryFromProvider.executeRepositoryWorkUnit(workUnit);
}
private void checkProxySettings() {
TalendProxySelector.checkProxy();
}
@Override
public void unloadResources(Property property) throws PersistenceException {
repositoryFactoryFromProvider.unloadResources(property);

View File

@@ -12,10 +12,14 @@
// ============================================================================
package org.talend.core.repository.model.dnd;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.SalesforceSchemaConnectionItem;
import org.talend.core.model.repository.ERepositoryObjectType;
@@ -28,6 +32,8 @@ import org.talend.repository.model.RepositoryNode;
*/
public class SalesforceComponentDndFilter extends DefaultRepositoryComponentDndFilter {
public static final String SALSEFORCE = "salesforce"; //$NON-NLS-1$
public static final String COMPONENT_T_SALSEFORCE_CONNECTION = "tSalesforceConnection"; //$NON-NLS-1$
public static final String COMPONENT_T_SALSEFORCE_WAVE_BULK_EXEC = "tSalesforceWaveBulkExec"; //$NON-NLS-1$
@@ -98,7 +104,16 @@ public class SalesforceComponentDndFilter extends DefaultRepositoryComponentDndF
}
}
}
}
if (item instanceof ConnectionItem && SALSEFORCE.equalsIgnoreCase(((ConnectionItem) item).getTypeName())) {
// Special for Javajet components: tSalesforceEinsteinBulkExec/tSalesforceEinsteinOutputBulkExec
IComponentsService service = GlobalServiceRegister.getDefault().getService(IComponentsService.class);
Collection<IComponent> componentAll = service.getComponentsFactory().readComponents();
for (IComponent component : componentAll) {
if (component.getName().startsWith("tSalesforceEinstein") && !components.contains(component)) { //$NON-NLS-1$
components.add(component);
}
}
}
return components;
}

View File

@@ -106,7 +106,8 @@ public class RecycleBinManager {
List<IRepositoryViewObject> deletedObjects = new ArrayList<IRepositoryViewObject>();
final EList<TalendItem> deletedItems = projectRecyclebins.get(project.getTechnicalLabel()).getDeletedItems();
List<TalendItem> notDeletedItems = new ArrayList<TalendItem>();
for (TalendItem deletedItem : deletedItems) {
List<TalendItem> dup_deletedItems = new ArrayList<>(deletedItems);
for (TalendItem deletedItem : dup_deletedItems) {
try {
final ERepositoryObjectType type = ERepositoryObjectType.getType(deletedItem.getType());
// ignore the generated doc in recycle bin
@@ -274,7 +275,8 @@ public class RecycleBinManager {
resource = createRecycleBinResource(project);
}
resource.getContents().clear();
recycleBin.setLastUpdate(new Date());
// set date to null to avoid timezone conflict
recycleBin.setLastUpdate(null);
resource.getContents().add(recycleBin);
EmfHelper.saveResource(resource);
lastSavedRecycleBinMap.put(recycleBin, EcoreUtil.copy(recycleBin));

View File

@@ -13,6 +13,8 @@
package org.talend.core.repository.ui.dialog;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -30,12 +32,14 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
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.IRepositoryObject;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.repository.utils.RepositoryNodeSortUtil;
import org.talend.core.ui.ITestContainerProviderService;
import org.talend.repository.model.RepositoryNode;
import org.talend.repository.model.IRepositoryNode.EProperties;
@@ -107,7 +111,8 @@ public class PastSelectorDialog extends Dialog {
modificationTime.setWidth(200);
modificationTime.setText("Modification Time");
for (IRepositoryViewObject object : versions) {
RepositoryNodeSortUtil util = new RepositoryNodeSortUtil();
for (IRepositoryViewObject object : util.getSortVersion(versions)) {
TableItem item = new TableItem(table, SWT.NONE);
item.setData(object);
item.setText(0, object.getVersion());
@@ -187,7 +192,7 @@ public class PastSelectorDialog extends Dialog {
});
return composite;
}
public Set<IRepositoryViewObject> getSelectedVersionItems() {
return this.selectedVersionItems;
}

View File

@@ -22,6 +22,7 @@ import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
@@ -32,6 +33,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.model.properties.ImplicitContextSettings;
@@ -43,6 +45,7 @@ import org.talend.core.model.properties.Project;
import org.talend.core.model.properties.StatAndLogsSettings;
import org.talend.core.model.properties.Status;
import org.talend.core.model.properties.impl.PropertiesFactoryImpl;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.repository.constants.FileConstants;
import org.talend.core.repository.recyclebin.RecycleBinManager;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
@@ -140,9 +143,10 @@ public class ProjectDataJsonProvider {
ProjectDataJsonProvider.loadProjectSettings(project, input);
}
IPath relationShipPath = settingFolderPath.append(FileConstants.RELATIONSHIP_FILE_NAME);
input = inputStreamProvider.getStream(relationShipPath);
if (input != null) {
ProjectDataJsonProvider.loadRelationShips(project, input);
try (InputStream is = inputStreamProvider.getStream(relationShipPath)) {
if (is != null) {
ProjectDataJsonProvider.loadRelationShips(project, is);
}
}
IPath migrationTaskPath = settingFolderPath.append(FileConstants.MIGRATION_TASK_FILE_NAME);
input = inputStreamProvider.getStream(migrationTaskPath);
@@ -184,10 +188,11 @@ public class ProjectDataJsonProvider {
private static void loadRelationShips(Project project, IPath projectFolderPath) throws PersistenceException {
File file = getLoadingConfigurationFile(projectFolderPath, FileConstants.RELATIONSHIP_FILE_NAME);
if (file != null && file.exists()) {
try {
loadRelationShips(project, new FileInputStream(file));
} catch (FileNotFoundException e) {
throw new PersistenceException(e);
try (FileInputStream fis = new FileInputStream(file)) {
loadRelationShips(project, fis);
} catch (Exception e) {
// ignore
ExceptionHandler.process(e);
}
}
}
@@ -206,11 +211,72 @@ public class ProjectDataJsonProvider {
project.getItemsRelations().add(json.toEmfObject());
}
}
} catch (Exception e) {
// ignore
ExceptionHandler.process(e);
}
}
public static void checkAndRectifyRelationShipSetting(Project project) throws PersistenceException {
File file = getSavingConfigurationFile(project.getTechnicalLabel(), FileConstants.RELATIONSHIP_FILE_NAME);
if (file == null || !file.exists()) {
return;
}
List<ItemRelationsJson> itemRelationsJsonsList = null;
TypeReference<List<ItemRelationsJson>> typeReference = new TypeReference<List<ItemRelationsJson>>() {
};
FileInputStream input = null;
try {
input = new FileInputStream(file);
itemRelationsJsonsList = new ObjectMapper().readValue(new FileInputStream(file), typeReference);
} catch (Exception e) {
throw new PersistenceException(e);
} finally {
closeInputStream(input);
}
if (itemRelationsJsonsList == null || itemRelationsJsonsList.isEmpty()) {
return;
}
Set<String> idVersionSet = new HashSet<String>();
List<ItemRelationsJson> relationJsonList = new ArrayList<ItemRelationsJson>();
Map<String, String> currentSystemRoutinesMap = RelationshipItemBuilder.getInstance().getCurrentSystemRoutinesMap();
boolean needModify = false;
for (ItemRelationsJson relationJson : itemRelationsJsonsList) {
ItemRelationJson baseItem = relationJson.getBaseItem();
String idversion = baseItem.getId() + ";" + baseItem.getVersion();
if (idVersionSet.contains(idversion)) {
// in case duplicate
needModify = true;
continue;
}
// remove system routines relation
int originalSize = relationJson.getRelatedItems().size();
relationJson.getRelatedItems()
.removeIf(relatedItem -> RelationshipItemBuilder.ROUTINE_RELATION.equals(relatedItem.getType())
&& currentSystemRoutinesMap.containsValue(relatedItem.getId()));
if (relationJson.getRelatedItems().size() != originalSize) {
needModify = true;
}
if (!relationJson.getRelatedItems().isEmpty()) {
relationJsonList.add(relationJson);
}
idVersionSet.add(idversion);
}
if (needModify) {
// re-load to project
if (relationJsonList != null && !relationJsonList.isEmpty()) {
project.getItemsRelations().clear();
for (ItemRelationsJson json : relationJsonList) {
project.getItemsRelations().add(json.toEmfObject());
}
}
// re-save relationship setting json file
saveRelationShips(project);
}
}
private static void loadMigrationTaskSetting(Project project, IPath projectFolderPath) throws PersistenceException {

View File

@@ -0,0 +1,47 @@
// ============================================================================
//
// 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.repository.utils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.talend.commons.utils.Version;
import org.talend.core.model.repository.IRepositoryViewObject;
/**
* @author hwang
*
*/
public class RepositoryNodeSortUtil {
public List<IRepositoryViewObject> getSortVersion(List<IRepositoryViewObject> versions) {
List<IRepositoryViewObject> temp = new ArrayList<IRepositoryViewObject>();
temp.addAll(versions);
Collections.sort(temp, new Comparator<IRepositoryViewObject>() {
@Override
public int compare(IRepositoryViewObject o1, IRepositoryViewObject o2) {
String version1 = o1.getVersion();
String version2 = o2.getVersion();
if(version1 != null && version2 != null) {
return new Version(version1).compareTo(new Version(version2));
}
return 0;
}
});
return temp;
}
}

View File

@@ -28,6 +28,7 @@ Export-Package: org.talend.commons.utils.generation,
org.talend.core.model.business,
org.talend.core.model.components,
org.talend.core.model.context,
org.talend.core.model.context.link,
org.talend.core.model.general,
org.talend.core.model.genhtml,
org.talend.core.model.metadata,

View File

@@ -40,7 +40,7 @@
<dbType type="SET" ignoreLen="true" ignorePre="true" />
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="false" />
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
<dbType type="TINYINT" ignorePre="true" />
<dbType type="TINYINT UNSIGNED" ignoreLen="true" ignorePre="true" />

View File

@@ -9,13 +9,14 @@
<dbType type="CHAR" defaultLength="50" ignorePre="true"/>
<dbType type="CHARACTER" ignoreLen="true" ignorePre="true" />
<dbType type="CHARACTER VARYING" ignoreLen="true" ignorePre="true" />
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
<dbType type="DATE" ignoreLen="true" ignorePre="true" defaultPattern="dd-MM-yyyy" />
<dbType type="DATETIME" ignoreLen="true" ignorePre="true" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
<dbType type="DOUBLE PRECISION" ignoreLen="true" ignorePre="true" />
<dbType type="UNSIGNED INT" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
<dbType type="INT" ignoreLen="true" ignorePre="true" />
<dbType type="INTEGER" defaultLength="10" ignorePre="false" />
<dbType type="NUMERIC" defaultLength="20" defaultPrecision="10"/>
<dbType type="REAL" />
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true" />
@@ -175,6 +176,11 @@
<talendType type="id_Short"/>
<talendType type="id_Long"/>
</dbType>
<dbType type="INTEGER">
<talendType type="id_Integer" default="true" />
<talendType type="id_Short"/>
<talendType type="id_Long"/>
</dbType>
<dbType type="NUMERIC">
<talendType type="id_Double"/>
<talendType type="id_Float"/>

View File

@@ -100,6 +100,11 @@
<xs:restriction base="xs:short"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="defaultPattern">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="default" type="xs:boolean"/>
</xs:complexType>
</xs:element>

View File

@@ -19,6 +19,7 @@
<extension-point id="hadoopConnectionCreator" name="Hadoop Connection Creator" schema="schema/hadoopConnectionCreator.exsd"/>
<extension-point id="artifact_handler" name="Artifact Repository Handler" schema="schema/artifact_handler.exsd"/>
<extension-point id="actionFilterDelegate" name="Action Filter delegate" schema="schema/actionFilterDelegate.exsd"/>
<extension-point id="saveItemContextLinkService" name="Save Item Context Link Service" schema="schema/saveItemContextLinkService.exsd"/>
<extension
point="org.talend.core.runtime.repositoryComponent_provider">
@@ -53,4 +54,28 @@
name="Talend">
</category>
</extension>
<extension
point="org.talend.core.runtime.service">
<Service
class="org.talend.core.model.update.RepositoryContextUpdateService"
serviceId="IRepositoryContextUpdateService">
</Service>
<Service
class="org.talend.core.model.update.GenericDbContextUpdateService"
serviceId="IRepositoryContextUpdateService">
</Service>
</extension>
<extension
point="org.talend.core.runtime.saveItemContextLinkService">
<creator
class="org.talend.core.model.context.link.ProcessItemContextLinkService">
</creator>
</extension>
<extension
point="org.talend.core.runtime.saveItemContextLinkService">
<creator
class="org.talend.core.model.context.link.ConnectionItemContextLinkService">
</creator>
</extension>
</plugin>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1</version>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.runtime</artifactId>

View File

@@ -0,0 +1,105 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.talend.core.runtime" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.talend.core.runtime" id="saveItemContextLinkService" name="Save Item Context Link Service"/>
</appinfo>
<documentation>
Save the context link data for item which contain ContextType object
The extension point must implements interface : org.talend.core.model.context.link.IItemContextLinkService
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="creator" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="creator">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":org.talend.core.model.context.link.IItemContextLinkService"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
7.4.1
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
boolean accept(Item item);
boolean saveItemLink(Item item);
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>

View File

@@ -254,6 +254,34 @@ public final class ResourceUtils {
}
}
/**
* Comment method "setFileContent".
*
* @param stream
* @param file
* @throws PersistenceException
*/
public static void setFileContent(InputStream stream, IFile file) throws PersistenceException {
try {
if (stream == null) {
String msg = Messages.getString("resources.file.notCreated", file.getName(), //$NON-NLS-1$
Messages.getString("ResourceUtils.streamNull")); //$NON-NLS-1$
throw new PersistenceException(msg);
}
file.setContents(stream, true, false, null);
} catch (CoreException e) {
String msg = Messages.getString("resources.file.notCreated", file.getName(), e.getMessage()); //$NON-NLS-1$
throw new PersistenceException(msg, e);
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (IOException e) {
CommonExceptionHandler.process(e);
}
}
}
/**
* Convenience method to delete a file.<br/>
*

View File

@@ -12,35 +12,49 @@
// ============================================================================
package org.talend.core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.talend.core.hadoop.repository.HadoopRepositoryUtil;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.runtime.services.IGenericDBService;
/**
* created by ldong on Mar 23, 2015 Detailled comment
*
*/
public class AbstractRepositoryContextUpdateService implements IRepositoryContextUpdateService {
@Override
public void updateRelatedContextVariable(Connection con, String oldValue, String newValue) {
}
public abstract class AbstractRepositoryContextUpdateService implements IRepositoryContextUpdateService {
protected IGenericDBService service = GlobalServiceRegister.getDefault().getService(IGenericDBService.class);
protected String updateHadoopProperties(List<Map<String, Object>> hadoopProperties, String oldValue, String newValue) {
String finalProperties = "";
String finalProperties = null;
boolean isModified = false;
if (!hadoopProperties.isEmpty()) {
for (Map<String, Object> propertyMap : hadoopProperties) {
String propertyValue = (String) propertyMap.get("VALUE");
if (propertyValue.equals(oldValue)) {
propertyMap.put("VALUE", newValue);
isModified = true;
}
}
finalProperties = HadoopRepositoryUtil.getHadoopPropertiesJsonStr(hadoopProperties);
if (isModified) {
finalProperties = HadoopRepositoryUtil.getHadoopPropertiesJsonStr(hadoopProperties);
}
}
return finalProperties;
}
protected boolean updateCompPropertiesContextParameter(Connection conn, String oldValue, String newValue) {
boolean isModified = false;
Map<String, String> oldToNewHM = new HashMap<String, String>();
oldToNewHM.put(oldValue, newValue);
String compProperties = conn.getCompProperties();
if (service != null && StringUtils.isNotBlank(compProperties)) {
service.updateCompPropertiesForContextMode(conn, oldToNewHM);
isModified = true;
}
return isModified;
}
}

View File

@@ -12,7 +12,9 @@
// ============================================================================
package org.talend.core;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
@@ -247,4 +249,29 @@ public class GlobalServiceRegister {
}
return null;
}
public List findAllService(Class klass) {
List serviceList = new ArrayList();
String key = klass.getName();
IConfigurationElement[] configElements = getConfigurationElements();
if (configElements != null) {
for (IConfigurationElement element : configElements) {
if (element.isValid()) {
String id = element.getAttribute("serviceId"); //$NON-NLS-1$
if (!key.endsWith(id)) {
continue;
}
try {
Object service = element.createExecutableExtension("class"); //$NON-NLS-1$
if (klass.isInstance(service)) {
serviceList.add(service);
};
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
}
return serviceList;
}
}

View File

@@ -20,5 +20,7 @@ import org.talend.core.model.metadata.builder.connection.Connection;
*/
public interface IRepositoryContextUpdateService extends IService {
public void updateRelatedContextVariable(Connection con, String oldValue, String newValue);
public boolean accept(Connection connection);
public boolean updateContextParameter(Connection conn, String oldValue, String newValue);
}

View File

@@ -214,5 +214,5 @@ public interface ITDQRepositoryService extends IService {
/**
* @param chooseContext the context name which want to swtich
*/
void popupSwitchContextFailedMessage(String chooseContext);
boolean popupSwitchContextFailedMessage(String chooseContext);
}

View File

@@ -53,6 +53,8 @@ public enum EDatabaseTypeName {
"IBM DB2 ZOS", "IBM DB2 ZOS", Boolean.TRUE, "IBM_DB2", "DB2", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
SYBASEASE(
"SybaseASE", "Sybase (ASE and IQ)", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SYBASEASE_SA(
"SybaseASE", "SQL Anywhere", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// this Sybase IQ not used.
SYBASEIQ(

View File

@@ -186,6 +186,10 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_HDI_PASSWORD = "CONN_PARA_KEY_HDI_PASSWORD"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE = "CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE_USE_TLS = "CONN_PARA_KEY_AZURE_HDINSIGHT_STORAGE_USE_TLS"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_AZURE_HOSTNAME = "CONN_PARA_KEY_AZURE_HOSTNAME"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_AZURE_CONTAINER = "CONN_PARA_KEY_AZURE_CONTAINER"; //$NON-NLS-1$
@@ -302,6 +306,8 @@ public class ConnParameterKeys {
/**DataBricks*/
public static final String CONN_PARA_KEY_DATABRICKS_ENDPOINT="CONN_PARA_KEY_DATABRICKS_ENDPOINT";
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";
public static final String CONN_PARA_KEY_DATABRICKS_TOKEN="CONN_PARA_KEY_DATABRICKS_TOKEN";

View File

@@ -166,9 +166,9 @@ public enum EDatabaseVersion4Drivers {
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
"redshift-jdbc42-no-awssdk-1.2.37.1061.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.37.1061.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$
new String[] { "redshift-jdbc42-no-awssdk-1.2.37.1061.jar", "aws-java-sdk-1.11.729.jar", "jackson-core-2.10.1.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackson-databind-2.10.1.jar", "jackson-annotations-2.10.1.jar", "httpcore-4.4.11.jar", "httpclient-4.5.9.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.11.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

@@ -114,6 +114,7 @@ public enum EHadoopProperties {
QUBOLE_S3_REGION,
DATABRICKS_ENDPOINT,
DATABRICKS_CLOUD_PROVIDER,
DATABRICKS_CLUSTER_ID,
DATABRICKS_TOKEN,
DATABRICKS_DBFS_DEP_FOLDER;

View File

@@ -0,0 +1,80 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.hadoop.version;
import java.util.ArrayList;
import java.util.List;
/**
* created by hcyi on May 27, 2020
* Detailled comment
*
*/
public enum EHdinsightStorage {
ADLS_GEN2("ADLS Gen2"), //$NON-NLS-1$
AZURE_STORAGE("Azure storage"); //$NON-NLS-1$
private String displayName;
EHdinsightStorage(String displayName) {
this.displayName = displayName;
}
public String getName() {
return name();
}
public String getDisplayName() {
return this.displayName;
}
public static List<String> getAllHdinsightStorageDisplayNames() {
return getAllHdinsightStorageNames(true);
}
public static List<String> getAllHdinsightStorageNames(boolean display) {
List<String> names = new ArrayList<String>();
EHdinsightStorage[] values = values();
for (EHdinsightStorage storage : values) {
if (display) {
names.add(storage.getDisplayName());
} else {
names.add(storage.getName());
}
}
return names;
}
public static EHdinsightStorage getHdinsightStoragenByDisplayName(String name) {
return getHdinsightStorageByName(name, true);
}
public static EHdinsightStorage getHdinsightStorageByName(String name, boolean display) {
if (name != null) {
for (EHdinsightStorage storage : values()) {
if (display) {
if (name.equalsIgnoreCase(storage.getDisplayName())) {
return storage;
}
} else {
if (name.equalsIgnoreCase(storage.getName())) {
return storage;
}
}
}
}
return null;
}
}

View File

@@ -113,6 +113,12 @@ public final class ComponentUtilities {
if (value != null) {
String replaceAll = value.replaceAll(oldName2, newName);
t.setValue(replaceAll);
if (!"UNIQUE_NAME".equals(t.getName())) {
if (replaceAll.contains(oldName)) {
replaceAll = replaceAll.replaceAll(oldName, newName);
t.setValue(replaceAll);
}
}
}
}
}

View File

@@ -23,6 +23,8 @@ public interface IMultipleComponentConnection {
public String getConnectionType();
public String getConnectorName();
public void setConnectionType(String connectionType);
public String getNameTarget();

View File

@@ -14,6 +14,8 @@ package org.talend.core.model.components;
import java.util.List;
import org.talend.core.model.process.INode;
/**
* DOC nrousseau class global comment. Detailled comment <br/>
*
@@ -33,4 +35,7 @@ public interface IMultipleComponentItem {
public String getComponent();
public void setComponent(String component);
public void updateNode(INode newNode, INode oldNode);
}

View File

@@ -50,4 +50,6 @@ public interface IMultipleComponentManager {
public boolean isLookupMode();
public String getParamSeperator();
}

View File

@@ -19,8 +19,10 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.talend.core.model.metadata.MetadataTalendType;
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
import org.talend.core.model.process.IContext;
@@ -30,6 +32,7 @@ import org.talend.core.model.process.IContextParameter;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.utils.ContextParameterUtils;
import org.talend.cwm.helper.ResourceHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
@@ -74,7 +77,7 @@ public class JobContextManager implements IContextManager {
*/
private Set<String> originalParamerters = new HashSet<String>();
private Map<ContextItem, Set<String>> newParametersMap = new HashMap<ContextItem, Set<String>>();
private Map<Item, Set<String>> newParametersMap = new HashMap<Item, Set<String>>();
/*
* for context group
@@ -251,73 +254,7 @@ public class JobContextManager implements IContextManager {
*/
@Override
public void saveToEmf(EList contextTypeList) {
if (contextTypeList == null) {
return;
}
if (listContext.isEmpty()) {
retrieveDefaultContext();
}
EList newcontextTypeList = new BasicEList();
for (int i = 0; i < listContext.size(); i++) {
IContext context = listContext.get(i);
String contextGroupName = renameGroupContext.get(context);
if (contextGroupName == null) {
contextGroupName = context.getName();
}
ContextType contextType = findContextType(contextTypeList, contextGroupName);
if (contextType == null) {
contextType = TalendFileFactory.eINSTANCE.createContextType();
}
contextType.setName(context.getName());
contextType.setConfirmationNeeded(context.isConfirmationNeeded());
newcontextTypeList.add(contextType);
EList contextTypeParamList = contextType.getContextParameter();
List<IContextParameter> contextParameterList = context.getContextParameterList();
EList newContextTypeParamList = new BasicEList();
if (contextParameterList != null) {
for (int j = 0; j < contextParameterList.size(); j++) {
IContextParameter contextParam = contextParameterList.get(j);
String contexParameterName = nameMap.get(contextParam.getName());
if (contexParameterName == null) {
contexParameterName = contextParam.getName();
}
ContextParameterType contextParamType = findContextParameterType(contextTypeParamList, contexParameterName);
if (contextParamType == null) {
contextParamType = TalendFileFactory.eINSTANCE.createContextParameterType();
}
newContextTypeParamList.add(contextParamType);
contextParamType.setName(contextParam.getName());
contextParamType.setPrompt(contextParam.getPrompt());
contextParamType.setType(contextParam.getType());
contextParamType.setRawValue(contextParam.getValue());
contextParamType.setPromptNeeded(contextParam.isPromptNeeded());
contextParamType.setComment(contextParam.getComment());
if (!contextParam.isBuiltIn()) {
Item item = ContextUtils.getRepositoryContextItemById(contextParam.getSource());
if (item != null) {
contextParamType.setRepositoryContextId(item.getProperty().getId());
} else {
String contextId = contextParam.getSource();
if (!IContextParameter.BUILT_IN.equals(contextId)) {
contextParamType.setRepositoryContextId(contextId);
}
}
}
}
contextTypeParamList.clear(); // remove old
contextTypeParamList.addAll(newContextTypeParamList);
}
}
contextTypeList.clear(); // clear old
contextTypeList.addAll(newcontextTypeList);
saveToEmf(contextTypeList, false);
}
private ContextType findContextType(EList contextTypeList, String contextName) {
@@ -384,6 +321,7 @@ public class JobContextManager implements IContextManager {
contextParam.setContext(context);
contextParam.setName(contextParamType.getName());
contextParam.setPrompt(contextParamType.getPrompt());
contextParam.setInternalId(contextParamType.getInternalId());
originalParamerters.add(contextParam.getName());
boolean exists = true;
try {
@@ -403,7 +341,8 @@ public class JobContextManager implements IContextManager {
String repositoryContextId = contextParamType.getRepositoryContextId();
String source = IContextParameter.BUILT_IN;
if (repositoryContextId != null && !"".equals(repositoryContextId)) { //$NON-NLS-1$
if (repositoryContextId != null && !"".equals(repositoryContextId) //$NON-NLS-1$
&& !IContextParameter.BUILT_IN.equals(repositoryContextId)) {
Item item = ContextUtils.getContextItemById(contextItemList, repositoryContextId);
if (item == null) {
item = ContextUtils.getRepositoryContextItemById(repositoryContextId);
@@ -486,16 +425,6 @@ public class JobContextManager implements IContextManager {
}
/**
*
* ggu Comment method "getLostParameters".
*
* @return
*/
public Set<String> getLostParameters() {
return this.lostParameters;
}
public Map<ContextItem, Map<String, String>> getRepositoryRenamedMap() {
return this.repositoryRenamedMap;
}
@@ -516,6 +445,16 @@ public class JobContextManager implements IContextManager {
}
/**
*
* ggu Comment method "getLostParameters".
*
* @return
*/
public Set<String> getLostParameters() {
return this.lostParameters;
}
public void addNewParameters(String param) {
newParameters.add(param);
}
@@ -540,11 +479,11 @@ public class JobContextManager implements IContextManager {
}
}
public Map<ContextItem, Set<String>> getNewParametersMap() {
public Map<Item, Set<String>> getNewParametersMap() {
return newParametersMap;
}
public void setNewParametersMap(Map<ContextItem, Set<String>> newParametersMap) {
public void setNewParametersMap(Map<Item, Set<String>> newParametersMap) {
this.newParametersMap = newParametersMap;
}
@@ -573,4 +512,99 @@ public class JobContextManager implements IContextManager {
public void setConfigContextGroup(boolean isConfigContextGroup) {
this.isConfigContextGroup = isConfigContextGroup;
}
@Override
public void saveToEmf(EList contextTypeList, boolean useInternalId) {
if (contextTypeList == null) {
return;
}
if (listContext.isEmpty()) {
retrieveDefaultContext();
}
EList newcontextTypeList = new BasicEList();
Map<String, Item> idToItemMap = new HashMap<String, Item>();
for (int i = 0; i < listContext.size(); i++) {
IContext context = listContext.get(i);
String contextGroupName = renameGroupContext.get(context);
if (contextGroupName == null) {
contextGroupName = context.getName();
}
ContextType contextType = findContextType(contextTypeList, contextGroupName);
if (contextType == null) {
contextType = TalendFileFactory.eINSTANCE.createContextType();
}
contextType.setName(context.getName());
contextType.setConfirmationNeeded(context.isConfirmationNeeded());
newcontextTypeList.add(contextType);
EList contextTypeParamList = contextType.getContextParameter();
List<IContextParameter> contextParameterList = context.getContextParameterList();
EList newContextTypeParamList = new BasicEList();
if (contextParameterList != null) {
for (int j = 0; j < contextParameterList.size(); j++) {
IContextParameter contextParam = contextParameterList.get(j);
String contexParameterName = nameMap.get(contextParam.getName());
if (contexParameterName == null) {
contexParameterName = contextParam.getName();
}
ContextParameterType contextParamType = findContextParameterType(contextTypeParamList, contexParameterName);
if (contextParamType == null) {
contextParamType = TalendFileFactory.eINSTANCE.createContextParameterType();
}
newContextTypeParamList.add(contextParamType);
contextParamType.setName(contextParam.getName());
contextParamType.setPrompt(contextParam.getPrompt());
contextParamType.setType(contextParam.getType());
contextParamType.setRawValue(contextParam.getValue());
contextParamType.setPromptNeeded(contextParam.isPromptNeeded());
contextParamType.setComment(contextParam.getComment());
if (!contextParam.isBuiltIn()) {
Item item = idToItemMap.get(contextParam.getSource());
if (item == null) {
item = ContextUtils.getRepositoryContextItemById(contextParam.getSource());
idToItemMap.put(contextParam.getSource(), item);
}
if (item != null) {
contextParamType.setRepositoryContextId(item.getProperty().getId());
if (item instanceof ContextItem) {
ContextType repoContextType = ContextUtils.getContextTypeByName(item, contextType.getName());
if (repoContextType != null) {
ContextParameterType repoContextParam = ContextUtils
.getContextParameterTypeByName(repoContextType, contextParam.getName());
if (repoContextParam != null) {
ResourceHelper.setUUid(contextParamType, ResourceHelper.getUUID(repoContextParam));
}
}
}
} else {
String contextId = contextParam.getSource();
if (!IContextParameter.BUILT_IN.equals(contextId)) {
contextParamType.setRepositoryContextId(contextId);
}
}
} else {
contextParamType.setRepositoryContextId(contextParam.getSource());
}
if (useInternalId) {
String internalId = contextParam.getInternalId();
if (StringUtils.isEmpty(internalId)) {
internalId = EcoreUtil.generateUUID();
contextParam.setInternalId(internalId);
}
contextParamType.setInternalId(internalId);
}
}
contextTypeParamList.clear(); // remove old
contextTypeParamList.addAll(newContextTypeParamList);
}
}
contextTypeList.clear(); // clear old
contextTypeList.addAll(newcontextTypeList);
}
}

View File

@@ -45,13 +45,14 @@ public class JobContextParameter implements IContextParameter, Cloneable {
String[] valueList;
String internalId;
/**
* change to save id always for bug 13184.
*/
String source = ""; //$NON-NLS-1$
public JobContextParameter() {
}
@Override
@@ -310,6 +311,14 @@ public class JobContextParameter implements IContextParameter, Cloneable {
this.promptNeeded = promptNeeded;
}
public String getInternalId() {
return internalId;
}
public void setInternalId(String internalId) {
this.internalId = internalId;
}
@Override
public IContextParameter clone() {
IContextParameter clonedContextParameter = null;

View File

@@ -0,0 +1,175 @@
package org.talend.core.model.context.link;
// ============================================================================
//
// 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
//
// ============================================================================
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.Item;
import org.talend.cwm.helper.ResourceHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.repository.model.IRepositoryService;
public abstract class AbstractItemContextLinkService implements IItemContextLinkService {
@Override
public boolean mergeItemLink(Item item, ItemContextLink backupContextLink, InputStream remoteLinkFileInput) throws PersistenceException {
ItemContextLink remoteContextLink = ContextLinkService.getInstance().doLoadContextLinkFromFile(remoteLinkFileInput);
List<ContextType> contextTypeList = ContextUtils.getAllContextType(item);
return saveContextLink(contextTypeList, item, backupContextLink, remoteContextLink);
}
public synchronized boolean saveContextLink(List<ContextType> contextTypeList, Item item,
ItemContextLink backupContextLink, ItemContextLink remoteContextLink)
throws PersistenceException {
boolean hasLinkFile = false;
String itemId = item.getProperty().getId();
ItemContextLink itemContextLink = new ItemContextLink();
itemContextLink.setItemId(itemId);
Map<String, Item> tempCache = new HashMap<String, Item>();
if (contextTypeList != null && contextTypeList.size() > 0) {
for (Object object : contextTypeList) {
if (object instanceof ContextType) {
ContextType jobContextType = (ContextType) object;
for (Object o : jobContextType.getContextParameter()) {
if (o instanceof ContextParameterType) {
ContextParameterType contextParameterType = (ContextParameterType) o;
String repositoryContextId = contextParameterType.getRepositoryContextId();
if (!ContextUtils.isBuildInParameter(contextParameterType)) {
ContextLink contextLink = itemContextLink
.findContextLink(contextParameterType.getRepositoryContextId(), jobContextType.getName());
if (contextLink == null) {
contextLink = new ContextLink();
contextLink.setContextName(jobContextType.getName());
contextLink.setRepoId(repositoryContextId);
}
ContextParamLink contextParamLink = createParamLink(repositoryContextId, jobContextType.getName(),
contextParameterType.getName(), contextParameterType.getInternalId(), tempCache,
backupContextLink, remoteContextLink);
if (contextParamLink != null) {
contextLink.getParameterList().add(contextParamLink);
}
if (contextLink.getParameterList().size() > 0
&& !itemContextLink.getContextList().contains(contextLink)) {
itemContextLink.getContextList().add(contextLink);
}
}
}
}
}
}
}
if (itemContextLink.getContextList().size() > 0) {
ContextLinkService.getInstance().saveContextLinkToJson(item, itemContextLink);
hasLinkFile = true;
} else {
ContextLinkService.getInstance().deleteContextLinkJsonFile(item);
}
return hasLinkFile;
}
public synchronized boolean saveContextLink(List<ContextType> contextTypeList, Item item) throws PersistenceException {
ItemContextLink backupContextLink = ContextLinkService.getInstance().loadContextLinkFromJson(item);
return saveContextLink(contextTypeList, item, backupContextLink, null);
}
private ContextParamLink createParamLink(String repositoryContextId, String contextName, String paramName, String internalId,
Map<String, Item> tempCache, ItemContextLink oldContextLink, ItemContextLink remoteContextLink) {
ContextParamLink contextParamLink = null;
if (StringUtils.isNotBlank(internalId)) {
contextParamLink = new ContextParamLink();
contextParamLink.setName(paramName);
contextParamLink.setId(internalId);
}
Item contextItem = tempCache.get(repositoryContextId);
if (contextItem == null) {
contextItem = ContextUtils.getRepositoryContextItemById(repositoryContextId);
tempCache.put(repositoryContextId, contextItem);
}
if (contextItem != null) {
ContextType contextType = ContextUtils.getContextTypeByName(contextItem, contextName);
ContextParameterType repoContextParameterType = ContextUtils.getContextParameterTypeByName(contextType, paramName);
if (repoContextParameterType != null && repoContextParameterType.eResource() == null) {
// processItem save before than contextItem, caused eResource null
IRepositoryService repositoryService = GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
try {
repositoryService.getProxyRepositoryFactory().save(contextItem, false);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
String uuID = null;
boolean isFromContextItem = (contextItem instanceof ContextItem);
if (repoContextParameterType != null) {
if (isFromContextItem) {
uuID = ResourceHelper.getUUID(repoContextParameterType);
} else if (repoContextParameterType.getInternalId() != null) {
uuID = repoContextParameterType.getInternalId();
}
}
if (repoContextParameterType == null && remoteContextLink != null) {
ContextParamLink remoteParamLink = remoteContextLink.findContextParamLinkByName(repositoryContextId, contextName,
paramName);
if (remoteParamLink != null && remoteParamLink.getId() != null) {
repoContextParameterType = findContextParamTypeById(contextType, isFromContextItem, remoteParamLink.getId());
uuID = remoteParamLink.getId();
}
}
if (repoContextParameterType == null && oldContextLink != null) {
ContextParamLink oldParamLink = oldContextLink.findContextParamLinkByName(repositoryContextId, contextName,
paramName);
if (oldParamLink != null) {
uuID = oldParamLink.getId();
}
}
if (StringUtils.isNotBlank(uuID)) {
contextParamLink = new ContextParamLink();
contextParamLink.setName(paramName);
contextParamLink.setId(uuID);
}
}
return contextParamLink;
}
protected ContextParameterType findContextParamTypeById(ContextType contextType, boolean isFromContextItem, String id) {
for (Object obj : contextType.getContextParameter()) {
if (obj instanceof ContextParameterType) {
ContextParameterType repoParam = (ContextParameterType) obj;
if (isFromContextItem && StringUtils.equals(id, ResourceHelper.getUUID(repoParam))) {
return repoParam;
}
if (!isFromContextItem && StringUtils.equals(id, repoParam.getInternalId())) {
return repoParam;
}
}
}
return null;
}
}

View File

@@ -0,0 +1,131 @@
// ============================================================================
//
// 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.model.context.link;
import java.io.InputStream;
import org.apache.commons.lang3.StringUtils;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.Item;
import org.talend.cwm.helper.ResourceHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
public class ConnectionItemContextLinkService extends AbstractItemContextLinkService {
@Override
public boolean accept(Item item) {
if (item instanceof ConnectionItem) {
return true;
}
return false;
}
@Override
public boolean saveItemLink(Item item) throws PersistenceException {
if (item instanceof ConnectionItem) {
ConnectionItem connectionItem = (ConnectionItem) item;
return saveContextLink(connectionItem.getConnection(), item, null, null);
}
return false;
}
@SuppressWarnings("unchecked")
private synchronized boolean saveContextLink(Connection connection, Item item, ItemContextLink backupContextLink,
ItemContextLink remoteContextLink) throws PersistenceException {
boolean hasLinkFile = false;
ItemContextLink itemContextLink = new ItemContextLink();
itemContextLink.setItemId(item.getProperty().getId());
if (connection.isContextMode()) {
String contextId = connection.getContextId();
if (StringUtils.isEmpty(contextId) || IContextParameter.BUILT_IN.equals(contextId)) {
return hasLinkFile;
}
ContextLink contextLink = new ContextLink();
contextLink.setContextName(connection.getContextName());
contextLink.setRepoId(contextId);
itemContextLink.getContextList().add(contextLink);
ContextItem contextItem = ContextUtils.getContextItemById2(contextId);
if (contextItem != null) {
ContextType contextType = ContextUtils.getContextTypeByName(contextItem.getContext(),
connection.getContextName());
if (contextType != null) {
for (Object o : contextType.getContextParameter()) {
if (o instanceof ContextParameterType) {
ContextParameterType contextParameterType = (ContextParameterType) o;
ContextParamLink contextParamLink = new ContextParamLink();
contextParamLink.setName(contextParameterType.getName());
contextParamLink.setId(ResourceHelper.getUUID(contextParameterType));
contextLink.getParameterList().add(contextParamLink);
}
}
}
}
// Because we don't know db connection using which values, we save all for merge operation
if (backupContextLink != null) {
for (ContextLink cl : backupContextLink.getContextList()) {
if (StringUtils.equals(cl.getRepoId(), contextId)
&& StringUtils.equals(cl.getContextName(), connection.getContextName())) {
for (ContextParamLink cpl : cl.getParameterList()) {
if (contextLink.getParamLinkByName(cpl.getName()) == null) {
contextLink.getParameterList().add(cpl);
}
}
}
}
}
if (remoteContextLink != null) {
for (ContextLink cl : remoteContextLink.getContextList()) {
if (StringUtils.equals(cl.getRepoId(), contextId)
&& StringUtils.equals(cl.getContextName(), connection.getContextName())) {
for (ContextParamLink cpl : cl.getParameterList()) {
if (contextLink.getParamLinkByName(cpl.getName()) == null) {
contextLink.getParameterList().add(cpl);
}
}
}
}
}
}
if (itemContextLink.getContextList().size() > 0) {
ContextLinkService.getInstance().saveContextLinkToJson(item, itemContextLink);
hasLinkFile = true;
} else {
ContextLinkService.getInstance().deleteContextLinkJsonFile(item);
}
return hasLinkFile;
}
public ItemContextLink loadItemLink(Item item) throws PersistenceException {
return ContextLinkService.getInstance().doLoadContextLinkFromJson(item);
}
@Override
public boolean mergeItemLink(Item item, ItemContextLink backupContextLink, InputStream remoteLinkFileInput)
throws PersistenceException {
if (item instanceof ConnectionItem) {
ConnectionItem connectionItem = (ConnectionItem) item;
ItemContextLink remoteContextLink = ContextLinkService.getInstance().doLoadContextLinkFromFile(remoteLinkFileInput);
return saveContextLink(connectionItem.getConnection(), item, backupContextLink, remoteContextLink);
}
return false;
}
}

View File

@@ -0,0 +1,85 @@
// ============================================================================
//
// 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.model.context.link;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ContextLink {
@JsonProperty("contextName")
private String contextName;
@JsonProperty("repoId")
private String repoId;
@JsonProperty("parameterList")
private List<ContextParamLink> parameterList = new ArrayList<ContextParamLink>();
public String getRepoId() {
return repoId;
}
public void setRepoId(String repoId) {
this.repoId = repoId;
}
public List<ContextParamLink> getParameterList() {
return parameterList;
}
public void setParameterList(List<ContextParamLink> parameterList) {
this.parameterList = parameterList;
}
public String getContextName() {
return contextName;
}
public void setContextName(String contextName) {
this.contextName = contextName;
}
public ContextParamLink getParamLinkByName(String paramName) {
for (ContextParamLink paramLink : parameterList) {
if (StringUtils.equals(paramLink.getName(), paramName)) {
return paramLink;
}
}
return null;
}
public ContextParamLink getParamLinkById(String id) {
for (ContextParamLink paramLink : parameterList) {
if (StringUtils.equals(paramLink.getId(), id)) {
return paramLink;
}
}
return null;
}
public ContextLink cloneObj() {
ContextLink obj = new ContextLink();
obj.setContextName(contextName);
obj.setRepoId(repoId);
for (ContextParamLink p : parameterList) {
obj.getParameterList().add(p.cloneObj());
}
return obj;
}
}

View File

@@ -0,0 +1,355 @@
// ============================================================================
//
// 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.model.context.link;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Project;
import org.talend.core.model.relationship.Relation;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.RepositoryConstants;
import com.fasterxml.jackson.databind.ObjectMapper;
public class ContextLinkService {
private static final Logger LOGGER = Logger.getLogger(ContextLinkService.class);
private static final String CREATOR_EXT_ID = "org.talend.core.runtime.saveItemContextLinkService"; //$NON-NLS-1$
public static final String LINKS_FOLDER_NAME = "links";
public static final String LINK_FILE_POSTFIX = ".link";
private static final List<IItemContextLinkService> registeredService = new ArrayList<IItemContextLinkService>();
private static ContextLinkService instance = new ContextLinkService();
private static final String CURRENT_PROJECT_LABEL = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
private ContextLinkService() {
initService();
}
public static ContextLinkService getInstance() {
return instance;
}
public synchronized boolean saveContextLink(Item item) throws PersistenceException {
for (IItemContextLinkService service : registeredService) {
if (service.accept(item)) {
return service.saveItemLink(item);
}
}
return false;
}
public synchronized boolean mergeContextLink(Item item, ItemContextLink backupContextLink, InputStream remoteLinkFile)
throws PersistenceException {
for (IItemContextLinkService service : registeredService) {
if (service.accept(item)) {
return service.mergeItemLink(item, backupContextLink, remoteLinkFile);
}
}
return false;
}
public boolean isSupportContextLink(Item item) {
for (IItemContextLinkService service : registeredService) {
if (service.accept(item)) {
return true;
}
}
return false;
}
public synchronized void saveContextLinkToJson(Item item, ItemContextLink itemContextLink) throws PersistenceException {
IFolder linksFolder = getLinksFolder(getItemProjectLabel(item));
if (!linksFolder.exists()) {
ResourceUtils.createFolder(linksFolder);
}
IFile linkFile = calContextLinkFile(item);
saveContextLinkToJson(linkFile, itemContextLink);
}
public synchronized void saveContextLinkToJson(IFile linkFile, ItemContextLink itemContextLink) throws PersistenceException {
ObjectMapper objectMapper = new ObjectMapper();
try {
String content = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(itemContextLink);
if (!linkFile.exists()) {
ResourceUtils.createFile(new ByteArrayInputStream(content.getBytes()), linkFile);
} else {
ResourceUtils.setFileContent(new ByteArrayInputStream(content.getBytes()), linkFile);
}
} catch (Exception e) {
throw new PersistenceException(e);
}
}
public synchronized boolean changeRepositoryId(Item item, Map<String, String> old2NewMap) throws PersistenceException {
boolean isModofied = false;
ItemContextLink itemContextLink = loadContextLinkFromJson(item);
if (itemContextLink != null) {
for (ContextLink contextLink : itemContextLink.getContextList()) {
if (old2NewMap.containsKey(contextLink.getRepoId())) {
contextLink.setRepoId(old2NewMap.get(contextLink.getRepoId()));
isModofied = true;
}
}
}
if (isModofied) {
this.saveContextLinkToJson(item, itemContextLink);
}
return isModofied;
}
public synchronized ItemContextLink loadContextLinkFromJson(Item item) throws PersistenceException {
for (IItemContextLinkService service : registeredService) {
if (service.accept(item)) {
return service.loadItemLink(item);
}
}
return doLoadContextLinkFromJson(item);
}
public synchronized ItemContextLink doLoadContextLinkFromJson(Item item) throws PersistenceException {
IFile linkFile = calContextLinkFile(item);
return doLoadContextLinkFromFile(linkFile);
}
public synchronized ItemContextLink doLoadContextLinkFromJson(String projectLabel, String id) throws PersistenceException {
IFile linkFile = calContextLinkFile(projectLabel, id);
return doLoadContextLinkFromFile(linkFile);
}
public synchronized ItemContextLink doLoadContextLinkFromFile(IFile linkFile) throws PersistenceException {
if (linkFile == null || !linkFile.exists()) {
return null;
}
ItemContextLink contextLink = null;
try {
contextLink = new ObjectMapper().readValue(linkFile.getLocation().toFile(), ItemContextLink.class);
} catch (IOException e) {
throw new PersistenceException(e);
}
return contextLink;
}
public synchronized ItemContextLink doLoadContextLinkFromFile(InputStream inputStream) throws PersistenceException {
if (inputStream == null) {
return null;
}
ItemContextLink contextLink = null;
try {
contextLink = new ObjectMapper().readValue(inputStream, ItemContextLink.class);
} catch (IOException e) {
throw new PersistenceException(e);
} finally {
try {
inputStream.close();
} catch (IOException e) {
LOGGER.info("Close input stream failed.");
}
}
return contextLink;
}
public synchronized void deleteContextLinkJsonFile(Item item) throws PersistenceException {
IFile linkFile = calContextLinkFile(item);
if (linkFile != null && linkFile.exists()) {
try {
linkFile.delete(true, null);
} catch (CoreException e) {
throw new PersistenceException(e);
}
}
}
public synchronized void updateRelatedContextParameterId(String sourceId, Map<String, String> repositoryIdChangedMap,
Map<String, Map<String, String>> changedContextParameterId) throws PersistenceException {
List<Relation> relationList = RelationshipItemBuilder.getInstance()
.getItemsHaveRelationWith(sourceId, RelationshipItemBuilder.LATEST_VERSION, false);
for (Relation relation : relationList) {
String id = relation.getId();
IFile linkFile = calContextLinkFile(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), id);
ItemContextLink itemContextLink = doLoadContextLinkFromFile(linkFile);
String newRepoId = null;
boolean isModified = false;
if (repositoryIdChangedMap != null && repositoryIdChangedMap.containsKey(sourceId)) {
newRepoId = repositoryIdChangedMap.get(sourceId);
}
if (itemContextLink != null) {
for (ContextLink contextLink : itemContextLink.getContextList()) {
for (String repoId : changedContextParameterId.keySet()) {
if (StringUtils.equals(repoId, contextLink.getRepoId())) {
Map<String, String> oldToNewId = changedContextParameterId.get(repoId);
for (String oldId : oldToNewId.keySet()) {
ContextParamLink paramLink = contextLink.getParamLinkById(oldId);
if (paramLink != null) {
paramLink.setId(oldToNewId.get(oldId));
isModified = true;
}
}
}
if (sourceId.equals(repoId) && newRepoId != null) {
isModified = true;
contextLink.setRepoId(newRepoId);
}
}
}
if (isModified) {
saveContextLinkToJson(linkFile, itemContextLink);
}
}
isModified = false;
if (newRepoId != null) {
Item relatedItem = ContextUtils.getRepositoryContextItemById(id);
if (relatedItem != null) {
List contextTypes = ContextUtils.getAllContextType(relatedItem);
if (contextTypes != null) {
for (Object object : contextTypes) {
if (object instanceof ContextType) {
ContextType context = (ContextType) object;
for (Object obj : context.getContextParameter()) {
if (obj instanceof ContextParameterType) {
ContextParameterType parameterType = (ContextParameterType) obj;
if (!ContextUtils.isBuildInParameter(parameterType)
&& sourceId.equals(parameterType.getRepositoryContextId())) {
parameterType.setRepositoryContextId(newRepoId);
isModified = true;
}
}
}
}
}
}
}
if (isModified) {
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
factory.save(relatedItem, false);
}
}
}
}
public static IFile calContextLinkFile(Item item) throws PersistenceException {
if (item == null) {
return null;
}
IFolder linksFolder = getLinksFolder(getItemProjectLabel(item));
return linksFolder.getFile(calLinkFileName(item.getProperty().getId()));
}
public static IFile calContextLinkFile(String projectLabel, String itemId) throws PersistenceException {
if (projectLabel == null || itemId == null) {
return null;
}
IFolder linksFolder = getLinksFolder(projectLabel);
return linksFolder.getFile(calLinkFileName(itemId));
}
public static String getItemProjectLabel(Item item) {
Project project = ProjectManager.getInstance().getProject(item);
if (project != null) {
return project.getTechnicalLabel();
}
return CURRENT_PROJECT_LABEL;
}
private static String calLinkFileName(String id) {
StringBuilder sb = new StringBuilder();
sb.append(id).append(LINK_FILE_POSTFIX);
return sb.toString();
}
public static IFile calLinksFile(IFolder projectFolder, String id) {
IFolder settingFolder = projectFolder.getFolder(RepositoryConstants.SETTING_DIRECTORY);
IFolder linksFolder = settingFolder.getFolder(LINKS_FOLDER_NAME);
return linksFolder.getFile(getLinkFileName(id));
}
public static String calLinksFilePath(String projectPath, String id) {
StringBuilder sb = new StringBuilder(projectPath);
sb.append(File.separator).append(RepositoryConstants.SETTING_DIRECTORY);
sb.append(File.separator).append(LINKS_FOLDER_NAME);
sb.append(File.separator).append(getLinkFileName(id));
return sb.toString();
}
public static IFile calLinksFile(IProject project, String id) {
IFolder settingFolder = project.getFolder(RepositoryConstants.SETTING_DIRECTORY);
IFolder linksFolder = settingFolder.getFolder(LINKS_FOLDER_NAME);
return linksFolder.getFile(getLinkFileName(id));
}
public static String getLinkFileName(String id) {
return id + LINK_FILE_POSTFIX;
}
private static IFolder getLinksFolder(String projectLabel) throws PersistenceException {
IProject iProject = ResourceUtils.getProject(projectLabel);
IFolder settingFolder = iProject.getFolder(RepositoryConstants.SETTING_DIRECTORY);
IFolder linksFolder = settingFolder.getFolder(LINKS_FOLDER_NAME);
return linksFolder;
}
private static void initService() {
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(CREATOR_EXT_ID);
if (extensionPoint != null) {
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] configurationElements = extension.getConfigurationElements();
for (IConfigurationElement configurationElement : configurationElements) {
try {
Object creator = configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
if (creator instanceof IItemContextLinkService) {
IItemContextLinkService service = (IItemContextLinkService) creator;
registeredService.add(service);
}
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
}
}
}

View File

@@ -0,0 +1,48 @@
// ============================================================================
//
// 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.model.context.link;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ContextParamLink {
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ContextParamLink cloneObj() {
ContextParamLink obj = new ContextParamLink();
obj.setId(id);
obj.setName(name);
return obj;
}
}

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