Compare commits

...

61 Commits

Author SHA1 Message Date
vdrokov
82bf612299 APPINT-32905: Issue with Rest service flow 2021-04-30 18:17:02 +03:00
kjwang
0c25678af9 Revert the commit of TUP-31096 to test tuj (#4255)
Co-authored-by: kjwang <kjwang@LT-B1Z2R73.talend.com>
2021-04-30 10:21:37 +08:00
jiezhang-tlnd
52339da247 fix(TUP-29866)CVE on maven-shared-utils-3.2.1.jar (#4230)
* fix(TUP-29866)CVE on maven-shared-utils-3.2.1.jar

* remove maven-shared-utils:jar:3.0.0

* exclude maven-shared-utils 3.2.1

* fix run job

* update m2

* exclude maven-shared-utils:jar:3.1.0
2021-04-29 14:27:50 +08:00
Jane Ding
d25966f7ca fix(TUP-31234):Build job fail with option "Execute tests" if any test (#4244) (#4251)
case fail
https://jira.talendforge.org/browse/TUP-31234
2021-04-28 18:04:59 +08:00
kjwang
3268b36046 Fix TUP-31096 Could not find or load main class error on the jobs (#4245) (#4250)
Fix TUP-31096 Could not find or load main class error on the jobs created on the Feature Branch which has #
https://jira.talendforge.org/browse/TUP-31096
2021-04-28 16:32:52 +08:00
hzhao-talendbj
f11cc1d442 fix(TUP-30524): Commandline login svn project tag fail (#4228) (#4249) 2021-04-28 12:10:19 +08:00
hzhao-talendbj
1352dd1657 chore(TUP-31155): change the way to check if it's CI mode (#4240) 2021-04-28 11:55:46 +08:00
jiezhang-tlnd
bf8573f1ff fix(TUP-30945)CVE: xstream-1.4.15.jar (#4243) 2021-04-25 14:13:26 +08:00
sbliu
491f07624b feat(TUP-30846) Unify studio version information & patch info in studio logs. 2021-04-25 10:57:11 +08:00
Xilai Dai
4666d74567 chore(APPINT-32624) upgrade xstream in maven-bundle-plugin-5-1-1 (#4236) 2021-04-23 14:49:27 +08:00
ypiel
13193d142c chore: bump to tck:1.32.0 2021-04-22 12:13:43 +02:00
bhe-talendbj
3fbfd1c490 Revert "chore(TUP-30992): revert unncessary changes (#4224)" (#4235)
This reverts commit 6ebf18bb43.
2021-04-22 11:07:20 +08:00
Jane Ding
c9a27e2f06 feat(TUP-30730):Remove SAS from metadata wizard. (#4229)
https://jira.talendforge.org/browse/TUP-30730
2021-04-21 19:39:16 +08:00
bhe-talendbj
6ebf18bb43 chore(TUP-30992): revert unncessary changes (#4224) 2021-04-20 16:27:12 +08:00
bhe-talendbj
1f8e1d768b chore(TUP-30992): remove junit-4.12 (#4218)
* chore(TUP-30992): remove junit-4.12

* chore(TUP-30992): fix junit
2021-04-19 14:18:04 +08:00
Zhiwei Xue
d3b47d3db1 fix(TUP-30187):rename maven property (#4217) 2021-04-16 15:36:38 +08:00
jiezhang-tlnd
cef1fdd721 fix(TUP-30992)force to use the 4.13.2 (#4195) 2021-04-15 16:14:50 +08:00
hzhao-talendbj
222764d85c fix(TUP-30921):Job fails with "Could not find the context Default" after (#4209)
migration 7.2.1 to 7.3.1 R2021-01
2021-04-15 15:13:36 +08:00
bhe-talendbj
fb257c0e5a bugfix(TUP-30203): Performance issue when logon project / switch branch (#4205)
* fix(TUP-30360): add an option to disable sharing libraries (#4089)

* bugfix(TUP-26346) backport (#3515)

* fix(TUP-24953): Kjwang/fix tup 24953 nexus 3 gets populated by crypto utils.jar (#2883) (#2908)

* Fix TUP-24953 Nexus 3 gets populated by crypto-utils.jar
https://jira.talendforge.org/browse/TUP-24953

* TUP-24953 Nexus 3 gets populated by crypto-utils.jar
https://jira.talendforge.org/browse/TUP-24953

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/Nexus3RepositoryHandler.java

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/ILibraryManagerService.java
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/routines/RoutineLibraryMananger.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/maven/ShareLibrareisHelper.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/ArtifacoryRepositoryHandler.java

* fix(TUP-25929):Studio re synchronizing jars with artifact repository
every time when logged into studio

* fix(TUP-23519): spark job can't run success when I select EMR58 as (#2534)

distribution
https://jira.talendforge.org/browse/TUP-23519

Conflicts:
	main/plugins/org.talend.designer.maven/src/main/java/org/talend/designer/maven/utils/PomUtil.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* fix(TUP-26346): Files from custom component folders are uploaded to nexus (#3145)

multiple times (#3125)

* 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

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* fix(TUP-26346): Add debug logs

* fix(TUP-26687): backport

* fix(TUP-26346): Add log message

* fix(TUP-26346): remove unused log message

* fix(TUP-26110):Jar missing when install user component. (#3073)

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* Fix TUP-26346 Files from custom component folders are uploaded to nexus (#3145)

multiple times (#3125)

* 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

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* fix(TUP-26810)if one jar used by two different components, it will (#… (#3465)

* fix(TUP-26810)if one jar used by two different components, it will (#3228)

fix(TUP-26810)if one jar used by two different components, it will upload to nexus with two versions

* TPS-4193  modify code mistake

* test github not pushed

* tps-4193

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/maven/ShareLibrareisHelper.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* TUP-26308 Nexus 2 gets populated by different crypto-utils jar versions (#3122)

(#3116)

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

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/Nexus2RepositoryHandler.java

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/maven/ShareLibrareisHelper.java

* fix(/TUP-26346): revert TUP-23519

* fix(TUP-26346): Fix switch nexus search hanlder

* fix(TUP-26346): deploy lib as release

* fix(TUP-26346): set release version for user cmodule

* fix(TUP-26346): set release version for module

Co-authored-by: kjwang <kjwang@talend.com>
Co-authored-by: Zhiwei Xue <zwxue@talend.com>
Co-authored-by: Chao MENG <cmeng@talend.com>
Co-authored-by: wchen-talend <wchen@talend.com>
Co-authored-by: hzhao-talendbj <49395568+hzhao-talendbj@users.noreply.github.com>

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/ILibraryManagerService.java
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/general/ModuleNeeded.java
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/routines/RoutineLibraryMananger.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/maven/ShareLibrareisHelper.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/ArtifacoryRepositoryHandler.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/Nexus3RepositoryHandler.java

* fix(TUP-30360): add an option to disable sharing libraries (#4040) (#4058)

* fix(TUP-30360): add an option to disable sharing libraries (#4040)

* fix(TUP-30360): add an option to disable sharing libraries

* fix(TUP-30360): add new preference to disable sharing libs at startup

* fix(TUP-30360): update log message

* fix(TUP-30360): install libfile

Conflicts:
	main/plugins/org.talend.commons.runtime/src/org/talend/commons/utils/network/NetworkUtil.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* fix(TUP-30360): fix sharing user components

* fix(TUP-30360): fix sharing jars

* fix(TUP-30360): fix sharing components

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/routines/RoutineLibraryMananger.java
	main/plugins/org.talend.librariesmanager.ui/src/main/java/org/talend/librariesmanager/ui/startup/ShareLibsSynchronizer.java
	main/plugins/org.talend.librariesmanager.ui/src/main/java/org/talend/librariesmanager/ui/startup/ShareMavenArtifactsOnStartup.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/maven/ShareLibrareisHelper.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/ArtifacoryRepositoryHandler.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/Nexus3RepositoryHandler.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/nexus/utils/ShareLibrariesUtil.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/prefs/LibrariesManagerUtils.java

* bugfix(TUP-30203): Search required groups only (#4174)

* fix(TUP-30203): only search required library groups

* fix(TUP-30203): only search required library groups, refactor

* fix(TUP-30203): only search required library groups, refactor

* fix(TUP-30203): exclude class file

* fix(TUP-30203): exclude class file

* fix(TUP-30203): share libs in background

* fix(TUP-30203): add i18n

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/service/LocalLibraryManager.java

* fix(TUP-30203): remove unncessary changes
2021-04-15 14:51:51 +08:00
hcyi
1d54b23c20 feat(TUP-30291):Add Suggestable support for Table options (List<Row> (#4199) 2021-04-15 12:04:45 +08:00
Zhiwei Xue
70df8da35f fix(TUP-30586):Routine/Bean custom jars dependency management issues left todo (#4206)
* fix(TUP-30782):Fail to run job if use a custom routine jar without inner
jar.

* fix(TUP-30791): fix test case run failure
2021-04-14 16:54:15 +08:00
hcyi
e60f193fe3 fix(TUP-27518):The download modules dialog take long time to list all jars avialable (#3780)
* fix(TUP-27518):The download modules dialog take long time to list all
jars avialable

* fix(TUP-27518):The download modules dialog take long time to list all
jars avialable
2021-04-14 11:12:37 +08:00
hzhao-talendbj
839e2f935c fix(TUP-30429): the job export from v6.5.1 can't be imported to v7.3.1 (#4180) (#4200) 2021-04-14 10:59:14 +08:00
mbasiuk-talend
930d119a0e chore(TDI-45894): prepare the next connectors iteration (#4191) 2021-04-13 13:33:52 +03:00
Jane Ding
c4a36bd77d Jding/tup 30849 improve build job performance (#4197) (#4198)
* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849



* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849
Signed-off-by: jding-tlnd <jding@talend.com>

* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849

Signed-off-by: jding-tlnd <jding@talend.com>

* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849

Signed-off-by: jding-tlnd <jding@talend.com>

* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849

Signed-off-by: jding-tlnd <jding@talend.com>

* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849

Signed-off-by: jding-tlnd <jding@talend.com>

* fix(TUP-30849):Improve build Job performance
https://jira.talendforge.org/browse/TUP-30849

Signed-off-by: jding-tlnd <jding@talend.com>

Conflicts:
	main/plugins/org.talend.core/src/main/java/org/talend/designer/runprocess/ProcessorUtilities.java
	test/plugins/org.talend.core.test/src/org/talend/designer/runprocess/ProcessorUtilitiesTest.java
2021-04-13 18:00:57 +08:00
jiezhang-tlnd
fd44bfb0ee feat(TUP-30381)Support greenplum driver for Greenplum Database in studio (#4196)
(#4138)

* feat(TUP-30381)Support greenplum driver for Greenplum Database in
studio
metadata
https://jira.talendforge.org/browse/TUP-30381

* add dbversion for greeenplu

* add dbversion

* update mapping_greenplum file

* update greenplum_mapping

* update greenplum mapping

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/database/EDatabase4DriverClassName.java
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/database/conn/template/EDatabaseConnTemplate.java
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/database/conn/version/EDatabaseVersion4Drivers.java
2021-04-13 16:46:07 +08:00
hzhao-talendbj
065b59df2c chore(TUP-30942): upgrade to httpclient-4.5.13.jar (#4192) 2021-04-13 11:30:40 +08:00
sbliu
c938a2edea feat(TUP-30953) record install additional packages. 2021-04-13 11:09:22 +08:00
Zhiwei Xue
04be4c0113 fix(TUP-30786):Avoid to click finish button more than once when do (#4185)
create custom routine jar/bean jar.
2021-04-08 18:43:32 +08:00
sbliu
cfd6efdb67 fix(TUP-30768): Can't reset performance_record if first patch use manual installation then the second use Software update 2021-04-08 17:28:01 +08:00
Xilai Dai
31e3ed4a36 chore(APPINT-32718) override httpclient in karaf-maven-plugin (#4183) 2021-04-08 16:24:55 +08:00
hzhao-talendbj
d58f6c2c6c chore(TUP-30942): upgrade httpclient to 4.5.13 (#4187) 2021-04-08 15:56:01 +08:00
pyzhou
4f81538e7b fix(TDI-45881):Update jackson mapper (#4186) 2021-04-08 15:27:07 +08:00
nrousseau
7a770d7cbf feat(TUP-30475): Test of lite studio (#4064)
* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

* Revert "feat(TUP-30475): Test of lite studio"

This reverts commit 5cd76c561e.

* Revert "feat(TUP-30475): Test of lite studio"

This reverts commit 90c877dd9d.

* Revert "feat(TUP-30475): Test of lite studio"

This reverts commit 883ad0cf5d.

* feat(TUP-30475): Test of lite studio

* feat(TUP-30475): Test of lite studio

Co-authored-by: Chao MENG <cmeng@talend.com>
2021-04-08 14:25:09 +08:00
hzhao-talendbj
2b84fe712c feat(TUP-30347): Remove the usage of ATL / EMF migration system (#4125)
* feat(TUP-30347) remove alt

* tup-30347 remove from pom

* TUP-30347 remove from feature

* TUP-30347 remove from feature

* TUP-30347
remove migration task

* feat(TUP-30347): remove atl from feature
2021-04-08 11:58:24 +08:00
bhe-talendbj
737a8d3a16 feat(TUP-30047): port TUP-30047 (#4169) 2021-04-07 16:45:22 +08:00
Zhiwei Xue
90a94da3c4 fix(TUP-30187):CI: Add options to disable compile error of (#4176)
routines/beans/codejars pom
2021-04-07 09:46:58 +08:00
vdrokov
2db5862dfd TESB-32416: Importing route from a zip file, imports all the other jobs (Clone TESB-32400) (#4149) 2021-04-06 14:59:56 +02:00
Zhiwei Xue
420b3c91f4 fix(TUP-30780):Only check used custom jars when run/build Job (#4175) 2021-04-06 15:53:07 +08:00
msjian
1185673fb0 fix(TDQ-19030): fix complier error (#4171) 2021-04-06 14:14:36 +08:00
Zhiwei Xue
0b1297e2ae fix(TUP-30977):test run map using custom routines and beans doesn't work (#4160)
after switch branch
2021-04-06 12:06:22 +08:00
bhe-talendbj
18a0a1bd6c fix(TUP-26813): remove unused dependency (#4052)
* fix(TUP-26813): remove unused dependency

* fix(TUP-26813): remove org.bouncycastle.bcprov plugin

* fix(TUP-26813): remove org.bouncycastle.bcprov plugin, add test

* fix(TUP-26813): remove org.bouncycastle.bcprov plugin

* fix(TUP-26813): add bouncycastle 1.68 plugin

* fix(TUP-26813): add test case

* fix(TUP-26813): remove unsed plugin
2021-04-02 18:18:33 +08:00
sbliu
2915789a37 fix(TUP-30685) Mvn package job use joblet in subref project fail to run the bat file correct. 2021-04-01 17:26:28 +08:00
Zhiwei Xue
a4d3daba9d fix(TUP-30813):Add Junits for dependency management feature (#4148) 2021-03-25 09:58:49 +08:00
Jane Ding
3e667e1718 fix(TUP-30216):Commandline install patch and login project throw NPE (#4114) (#4146)
https://jira.talendforge.org/browse/TUP-30216

Signed-off-by: jding-tlnd <jding@talend.com>
2021-03-25 09:30:18 +08:00
Emmanuel GALLOIS
b75083c0ce feat(TDI-45809): bump component-runtime to 1.31.0 (#4145) 2021-03-24 16:15:01 +01:00
jiezhang-tlnd
18fd262f03 feat(TUP-30381)Support greenplum driver for Greenplum Database in studio (#4136)
metadata
https://jira.talendforge.org/browse/TUP-30381
2021-03-24 18:14:56 +08:00
Zhiwei Xue
0a0da0f7d9 fix(TUP-30779):Custom jar resource unload issue after git pull&merge. (#4141) 2021-03-24 16:12:43 +08:00
jiezhang-tlnd
5a1ce3f8b9 fix(TUP-30277)Fail to download jar in remote project when tac set a (#4137)
wrong nexus url
https://jira.talendforge.org/browse/TUP-30277
2021-03-23 16:31:31 +08:00
Jane Ding
4bf4aaf3bc fix(TUP-30615):Schema Update Detection popping up everytime upon opening (#4135)
the job
https://jira.talendforge.org/browse/TUP-30615

Signed-off-by: jding-tlnd <jding@talend.com>
2021-03-23 11:30:53 +08:00
jiezhang-tlnd
bd7e9d1cf8 fix(TUP-29768)Studio won't release resource after cancel import (#4132)
https://jira.talendforge.org/browse/TUP-29768
2021-03-22 11:24:50 +08:00
sbliu
12a5b5d0b2 feat(TUP-30114) update copyright. 2021-03-18 09:44:28 +08:00
jiezhang-tlnd
8640a1eb59 fix(TUP-30277)Fail to download jar in remote project when tac set a (#4121)
* fix(TUP-30277)Fail to download jar in remote project when tac set a
wrong nexus url.
https://jira.talendforge.org/browse/TUP-30277

* fix nexus2 and artifactory

* check if custom nexus is available or not before deploy the jar

* catch MalformedURLException

* get nexus server
2021-03-17 10:46:40 +08:00
Zhiwei Xue
78a417eb56 feat(TUP-29014): bugfix 2021-03-16 (#4129) 2021-03-16 17:12:25 +08:00
Laurent BOURGEOIS
4903c81fde fix(TBD-11964): Different time zone for Standard jobs and BD Batch (#4082) (#4123) 2021-03-15 18:56:41 +01:00
hzhao-talendbj
6c3d649bf2 TUP-28242 Save impala component to repository get error (#4117) 2021-03-15 19:33:26 +08:00
Zhiwei Xue
304633c54d feat(TUP-29014): bugfix 2021-03-11 (#4116) (#4120)
* feat(TUP-29014):init custom jar cache before migration tasks

* feat(TUP-29014): bugfix 2021-03-11
2021-03-15 16:27:32 +08:00
Chao MENG
3d5f2d1785 item(TUP-30180): Studio slowness on merge operation (#4063)
* fix(TUP-30103): [7.1.1] Studio somtimes hangs for 20 seconds
https://jira.talendforge.org/browse/TUP-30103
2021-03-11 13:58:32 +08:00
Zhiwei Xue
0a8e341ca2 feat(TUP-29014):fix junit failure (#4113) 2021-03-10 11:43:03 +08:00
sbliu
8fc97f156c feat(TUP-30338) Data Collector improvement step 1
* log action activation, log perspective switch.
* reset performance record after install patch, read/write info from/to new performance file location.
* set default DATA_COLLECTOR_UPLOAD_PERIOD to 5.
* don't send data when closing studio.
* When there is no action or dialog popped , check data collector enable, network enable, data send period, if need sent, try to send data.
2021-03-10 10:33:34 +08:00
hzhao-talendbj
f31141669c TUP-30558 (#4111) 2021-03-10 10:21:09 +08:00
266 changed files with 2863 additions and 281921 deletions

View File

@@ -42,6 +42,6 @@ Feel free to share your Talend components on [Talend Exchange](http://www.talend
## License
Copyright (c) 2006-2019 Talend
Copyright (c) 2006-2021 Talend
Licensed under the Apache V2 License

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="class"/>
</classpath>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.talend.model.migration.nl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -1,6 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Nl
Bundle-SymbolicName: org.talend.model.migration.nl
Bundle-Version: 7.4.1.qualifier
Fragment-Host: org.talend.model.migration

View File

@@ -1 +0,0 @@
jarprocessor.exclude.children=true

View File

@@ -1,13 +0,0 @@
source.. = src/
output.. = class/
bin.includes = META-INF/,\
.\
,plugin_ru.properties\
,plugin_en.properties\
,plugin_hr.properties\
,plugin_fr.properties\
,plugin_el.properties\
,plugin_ja.properties\
,plugin_it.properties\
,plugin_de.properties\
,plugin_swtbot.properties

View File

@@ -1 +0,0 @@
providerName=www.beispiel.de

View File

@@ -1,2 +0,0 @@
pluginName=Migration Model
providerName=www.example.org

View File

@@ -1,2 +0,0 @@
pluginName=Mod\u00E8le de migration
providerName=www.example.org

View File

@@ -1 +0,0 @@
providerName=www.example.org

View File

@@ -1,2 +0,0 @@
pluginName=\u79FB\u884C\u30E2\u30C7\u30EB
providerName=www.example.org

View File

@@ -1 +0,0 @@
providerName=www.example.org

View File

@@ -1,2 +0,0 @@
pluginName = Migration Model
providerName = www.example.org

View File

@@ -1,2 +0,0 @@
pluginName=\u8FC1\u79FB\u6A21\u578B
providerName=www.example.org

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.4.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.migration.nl</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View File

@@ -1,2 +0,0 @@
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=error while loading the Transformation file : {0}
TosMetadataMigrationFrom400to410_tos_error_log=error while loading the Transformation file : {0}

View File

@@ -1,2 +0,0 @@
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=error mientras se cargaba el fichero de Transformaci\u00F3n: {0}
TosMetadataMigrationFrom400to410_tos_error_log=error mientras se cargaba el fichero de Transformaci\u00F3n: {0}

View File

@@ -1,2 +0,0 @@
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=erreur lors du chargement du fichier de transformation : {0}
TosMetadataMigrationFrom400to410_tos_error_log=Erreur lors du chargement du fichier de transformation : {0}

View File

@@ -1,2 +0,0 @@
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=\u5909\u63DB\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\uFF1A{0}
TosMetadataMigrationFrom400to410_tos_error_log=\u5909\u63DB\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\uFF1A{0}

View File

@@ -1,2 +0,0 @@
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=error while loading the Transformation file : {0}
TosMetadataMigrationFrom400to410_tos_error_log=error while loading the Transformation file : {0}

View File

@@ -1,2 +0,0 @@
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=\u52A0\u8F7D\u8F6C\u6362\u6587\u4EF6\u65F6\u51FA\u9519\uFF1A{0}
TosMetadataMigrationFrom400to410_tos_error_log=\u52A0\u8F7D\u8F6C\u6362\u6587\u4EF6\u65F6\u51FA\u9519\uFF1A{0}

View File

@@ -4,5 +4,5 @@ Version: {1}
Build id: {0}
(c) Copyright 2006-2020 Talend Inc. All rights reserved.
(c) Copyright 2006-2021 Talend Inc. All rights reserved.
Visit {3}

View File

@@ -4,5 +4,5 @@ Version: {1}
Build id: {0}
(c) Copyright 2006-2020 Talend Inc. All rights reserved.
(c) Copyright 2006-2021 Talend Inc. All rights reserved.
Visit {3}

View File

@@ -8,7 +8,6 @@
<discovery label="Talend web site" url="http://www.talend.com"/>
</url>
<requires>
<import feature="org.talend.model.migration.feature" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.9.8" match="greaterOrEqual"/>
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>

View File

@@ -38,7 +38,6 @@
<import plugin="org.apache.httpcomponents.httpcore" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.compare" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.compare.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2m.atl.emftvm.trace" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.ops4j.pax.url.mvn" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.talend.core" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
@@ -66,8 +65,6 @@
<plugin id="org.talend.model" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.model.edit" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.model.edit.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.talend.model.migration" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.model.migration.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.talend.model.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.talend.osgi.lib.loader" download-size="0" install-size="0" version="0.0.0" unpack="false" fragment="true"/>
<plugin id="org.talend.resources" download-size="0" install-size="0" version="0.0.0"/>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.talend.model.migration.feature</name>
<name>org.talend.help.di.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -1,36 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.talend.jdt.feature"
label="Feature"
version="7.4.1.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<requires>
<import plugin="org.eclipse.jdt" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.annotation" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.apt.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.apt.pluggable.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.apt.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.compiler.apt" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.compiler.tool" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.16.0.xx-201903290056-e1812-RELEASE" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core.manipulation" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.debug" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.debug.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.launching" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.hamcrest.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.groovy.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.codehaus.groovy" version="2.4.16" match="equivalent"/>
</requires>
<plugin
id="org.eclipse.jdt.launching.macosx"
os="macosx"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.jdt.launching.ui.macosx"
os="macosx"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<feature id="org.talend.jdt.feature" label="Feature" version="7.4.1.qualifier">
<description url="http://www.example.com/description">[Enter Feature Description here.]</description>
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<!-- bonita requires org.codehaus.groovy version 2.4.16.xx-201903290056-e1812-RELEASE -->
<import plugin="org.codehaus.groovy" version="2.4.16.xx-201903290056-e1812-RELEASE" match="perfect"/>
<import plugin="org.eclipse.ant.launching" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ant.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.annotation" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.apt.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.apt.pluggable.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.apt.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.compiler.apt" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.compiler.tool" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.16.0.xx-201903290056-e1812-RELEASE" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core.manipulation" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.debug" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.debug.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.doc.user" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.groovy.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.junit" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.junit.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.junit.runtime" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.junit4.runtime" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.launching" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.hamcrest.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.eclipse.jdt.launching.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.eclipse.jdt.launching.ui.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
</feature>

View File

@@ -1 +0,0 @@
bin.includes = feature.xml

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.talend.model.migration.feature"
label="model Migration feature"
version="7.4.1.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<requires>
<import feature="org.eclipse.m2m.atl" version="0.0.0" match="greaterOrEqual"/>
<import feature="org.talend.utils.feature" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.objectweb.asm" version="0.0.0" match="greaterOrEqual"/>
</requires>
</feature>

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.4.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.migration.feature</artifactId>
<packaging>eclipse-feature</packaging>
</project>

View File

@@ -18,7 +18,7 @@
<import plugin="org.apache.commons.lang3" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.log4j" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.servicemix.bundles.avro" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.commons.configuration" version="2.0.0" match="greaterOrEqual"/>
</requires>

View File

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

View File

@@ -15,6 +15,7 @@ package org.talend.commons.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Optional;
@@ -352,6 +353,12 @@ public class VersionUtils {
}
}
public static File getStudioConfigFile() throws Exception {
URL configLocation = new URL("platform:/config/config.ini"); //$NON-NLS-1$
URL fileUrl = FileLocator.toFileURL(configLocation);
return URIUtil.toFile(new URI(fileUrl.getProtocol(), fileUrl.getPath(), fileUrl.getQuery()));
}
public static String getSimplifiedPatchName(String projectPatchName) {
if (projectPatchName != null) {

View File

@@ -13,13 +13,13 @@
package org.talend.commons.utils.time;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Properties;
import java.util.Random;
import java.util.concurrent.TimeUnit;
@@ -82,7 +82,7 @@ public class PerformanceStatisticUtil {
public static void recordStartupEpapsedTime(double elapsedTimeInSeconds) {
File file = getRecordingFile();
Properties props = read(file, true);
Properties props = PropertiesFileUtil.read(file, true);
String propCount = props.getProperty(StatisticKeys.STARTUP_COUNT.get(), "0");
String propMax = props.getProperty(StatisticKeys.STARTUP_MAX.get(), "0");
String propAverage = props.getProperty(StatisticKeys.STARTUP_AVERAGE.get(), "0");
@@ -99,7 +99,7 @@ public class PerformanceStatisticUtil {
props.setProperty(StatisticKeys.STARTUP_MAX.get(), "" + iPropMax);
props.setProperty(StatisticKeys.STARTUP_AVERAGE.get(), "" + iPropAverage);
store(file, props);
PropertiesFileUtil.store(file, props);
}
public static File getRecordingFile() {
@@ -108,75 +108,41 @@ public class PerformanceStatisticUtil {
}
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
File file = new File(configurationLocation + "/" + recordingFileName);
File file = new File(configurationLocation + "/data_collector/" + recordingFileName);
File oldFile = new File(configurationLocation + "/" + recordingFileName);
if(oldFile.exists()) {
if(!file.exists()) {
if(!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
try {
Files.move(Paths.get(oldFile.toURI()), Paths.get(file.toURI()), StandardCopyOption.ATOMIC_MOVE);
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
}
}
try {
Files.deleteIfExists(Paths.get(oldFile.toURI()));
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
}
}
return file;
}
public static void setRecordingFile(File _recordingFile) {
recordingFile = _recordingFile;
}
public static synchronized Properties read(File recordFile, boolean createIfNotExist) {
Properties props = new Properties();
if (recordFile != null && exist(recordFile, createIfNotExist)) {
FileInputStream inStream = null;
try {
inStream = new FileInputStream(recordFile);
props.load(inStream);
} catch (Exception e) {
CommonExceptionHandler.log(e.getMessage());
} finally {
if (inStream != null) {
try {
inStream.close();
} catch (IOException e) {//
}
}
}
public static void reset() {
File _recordingFile = getRecordingFile();
try {
Files.deleteIfExists(Paths.get(_recordingFile.toURI()));
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
}
return props;
}
public static synchronized void store(File recordFile, Properties props) {
if (props == null) {
return;
}
if (recordFile != null && exist(recordFile, true)) {
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(recordFile);
props.store(outputStream, "");
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
} finally {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
//
}
}
}
}
}
private static boolean exist(File recordFile, boolean createIfNotExist) {
boolean exists = recordFile.exists();
if (!exists && createIfNotExist) {
try {
exists = recordFile.createNewFile();
if (!exists) {
throw new FileNotFoundException(recordFile.getName());
}
} catch (Exception e) {
CommonExceptionHandler.log(e.getMessage());
return false;
}
}
return exists;
}
private static Lock lock = new ReentrantLock();
@@ -210,7 +176,7 @@ public class PerformanceStatisticUtil {
private static void _measureIO() {
File file = getRecordingFile();
Properties props = read(file, true);
Properties props = PropertiesFileUtil.read(file, true);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
File workspace = root.getLocation().makeAbsolute().toFile();
@@ -221,7 +187,7 @@ public class PerformanceStatisticUtil {
measureWrite(props, testFile);
measureRead(props, testFile);
store(file, props);
PropertiesFileUtil.store(file, props);
}
}

View File

@@ -0,0 +1,55 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.time;
import java.io.File;
import java.util.Properties;
import org.eclipse.core.runtime.Platform;
public class PropertiesCollectorUtil {
private static final String ROOT_NODE = "additional_packages_records"; // additional packages
private static final String PREF_ADDITIONAL_PACKAGES = "AdditionalPackages"; // preference node
private static final String ADDITONAL_PACKAGE_FILE = "additionalPackages";
public static String getAdditionalPackageRecording() {
File file = getRecordFile(ADDITONAL_PACKAGE_FILE);
Properties props = PropertiesFileUtil.read(file, true);
String records = props.getProperty(ROOT_NODE, "");
return records;
}
public static void storeAdditionalPackageRecording(String records) {
File file = getRecordFile(ADDITONAL_PACKAGE_FILE);
Properties props = PropertiesFileUtil.read(file, false);
props.setProperty(ROOT_NODE, records);
PropertiesFileUtil.store(file, props);
}
private static File getRecordFile(String fileName) {
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
File file = new File(configurationLocation + "/data_collector/" + fileName);
return file;
}
public static String getAdditionalPackagePreferenceNode() {
return PREF_ADDITIONAL_PACKAGES;
}
}

View File

@@ -0,0 +1,93 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.time;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
import org.talend.commons.exception.CommonExceptionHandler;
/**
* DOC sbliu class global comment. Detailled comment
*/
public class PropertiesFileUtil {
public static synchronized Properties read(File recordFile, boolean createIfNotExist) {
Properties props = new Properties();
if (recordFile != null && exist(recordFile, createIfNotExist)) {
FileInputStream inStream = null;
try {
inStream = new FileInputStream(recordFile);
props.load(inStream);
} catch (Exception e) {
CommonExceptionHandler.log(e.getMessage());
} finally {
if (inStream != null) {
try {
inStream.close();
} catch (IOException e) {//
}
}
}
}
return props;
}
public static synchronized void store(File recordFile, Properties props) {
if (props == null) {
return;
}
if (recordFile != null && exist(recordFile, true)) {
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(recordFile);
props.store(outputStream, "");
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
} finally {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
//
}
}
}
}
}
public static boolean exist(File recordFile, boolean createIfNotExist) {
boolean exists = recordFile.exists();
if (!exists && createIfNotExist) {
try {
if(!recordFile.getParentFile().exists()) {
recordFile.getParentFile().mkdirs();
}
exists = recordFile.createNewFile();
if (!exists) {
throw new FileNotFoundException(recordFile.getName());
}
} catch (Exception e) {
CommonExceptionHandler.log(e.getMessage());
return false;
}
}
return exists;
}
}

View File

@@ -280,7 +280,7 @@
</appInfo>
<documentation>
Talend Community Edition&lt;br&gt;
Copyright (C) 2006-2019 Talend - www.talend.com
Copyright (C) 2006-2021 Talend - www.talend.com
</documentation>
</annotation>

View File

@@ -123,6 +123,7 @@ import org.talend.core.model.repository.LockInfo;
import org.talend.core.model.repository.RepositoryContentManager;
import org.talend.core.model.repository.RepositoryObject;
import org.talend.core.model.repository.RepositoryViewObject;
import org.talend.core.model.routines.CodesJarInfo;
import org.talend.core.repository.CoreRepositoryPlugin;
import org.talend.core.repository.constants.Constant;
import org.talend.core.repository.constants.FileConstants;
@@ -1368,21 +1369,15 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
}
@Override
public List<IRepositoryViewObject> getAllInnerCodes(ERepositoryObjectType codesJarType, Property jarProperty)
throws PersistenceException {
return getAllInnerCodes(projectManager.getCurrentProject(), codesJarType, jarProperty);
}
@Override
public List<IRepositoryViewObject> getAllInnerCodes(Project project, ERepositoryObjectType codesJarType, Property jarProperty)
throws PersistenceException {
public List<IRepositoryViewObject> getAllInnerCodes(CodesJarInfo info) throws PersistenceException {
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(info.getProjectTechName());
// empty folder won't be commit in git, create if not exist
IFolder folder = ResourceUtils.getProject(project).getFolder(ERepositoryObjectType.getFolderName(codesJarType))
.getFolder(jarProperty.getLabel());
IFolder folder = ResourceUtils.getProject(project).getFolder(ERepositoryObjectType.getFolderName(info.getType()))
.getFolder(info.getLabel());
if (!folder.exists()) {
ResourceUtils.createFolder(folder);
}
return repositoryFactoryFromProvider.getAll(project, codesJarType, false, false, folder);
return repositoryFactoryFromProvider.getAll(project, info.getType(), false, false, folder);
}
@Override
@@ -2245,6 +2240,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ExceptionHandler.process(e);
}
CodesJarResourceCache.initCodesJarCache();
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask("Execute before logon migrations tasks", 1); //$NON-NLS-1$
ProjectManager.getInstance().getMigrationRecords().clear();
@@ -2311,8 +2308,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.synch.repo.items"), 1); //$NON-NLS-1$
CodesJarResourceCache.initCodesJarCache();
if (!isCommandLineLocalRefProject) {
try {
coreService.syncAllRoutines();

View File

@@ -523,10 +523,10 @@ public class CopyObjectAction {
if (isInnerCode) {
CodesJarInfo info = CodesJarResourceCache.getCodesJarByInnerCode(item);
if (info.getProperty() != null) {
if (info != null) {
IDesignerMavenService designerMavenService = IDesignerMavenService.get();
if (designerMavenService != null) {
designerMavenService.updateCodeJarMavenProject(info.getProperty(), false);
designerMavenService.updateCodeJarMavenProject(info, false);
}
}
}

View File

@@ -81,6 +81,12 @@ public class ProjectDataJsonProvider {
return strBuilder.toString();
}
public static String getMigrationTaskIndexPath() {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(FileConstants.SETTINGS_FOLDER_NAME).append("/").append(FileConstants.MIGRATION_TASK_FILE_NAME); //$NON-NLS-1$
return strBuilder.toString();
}
public static void saveProjectData(Project project) throws PersistenceException {
saveProjectData(project, CONTENT_ALL);
}

View File

@@ -26,7 +26,6 @@ import org.apache.oro.text.regex.Util;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.repository.ERepositoryObjectType;
@@ -48,27 +47,34 @@ public final class RoutineUtils {
public static void changeRoutinesPackage(Item item) {
List<ERepositoryObjectType> allowedTypes = new ArrayList<ERepositoryObjectType>();
allowedTypes.add(ERepositoryObjectType.ROUTINES);
doChangeRoutinesPackage(item, DEFAULT_PACKAGE_REGEX, DEFAULT_PACKAGE_STRING, allowedTypes, false);
doChangeRoutinesPackage(item, DEFAULT_PACKAGE_REGEX, DEFAULT_PACKAGE_STRING, allowedTypes, false, true);
}
public static void changeInnerCodePackage(Item item, boolean avoidSave) {
if (item instanceof RoutineItem
&& GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMavenService.class)) {
IDesignerMavenService service = GlobalServiceRegister.getDefault().getService(IDesignerMavenService.class);
if (service != null) {
RoutineItem routineItem = (RoutineItem) item;
String codesJarPackageByInnerCode = service.getCodesJarPackageByInnerCode(routineItem);
if (StringUtils.isNotBlank(codesJarPackageByInnerCode)) {
String newPackageString = "package " + StringUtils.replace(codesJarPackageByInnerCode, "/", ".") + ";";
doChangeRoutinesPackage(item, INNER_ROUTINES_PACKAGE_REGEX, newPackageString,
ERepositoryObjectType.getAllTypesOfCodes(), avoidSave);
changeInnerCodePackage(item, avoidSave, true);
}
public static void changeInnerCodePackage(Item item, boolean avoidSave, boolean commitMode) {
IDesignerMavenService service = IDesignerMavenService.get();
if (service != null && item instanceof RoutineItem) {
RoutineItem routineItem = (RoutineItem) item;
String codesJarPackageByInnerCode = service.getCodesJarPackageByInnerCode(routineItem);
if (StringUtils.isNotBlank(codesJarPackageByInnerCode)) {
String newPackageString = "package " + StringUtils.replace(codesJarPackageByInnerCode, "/", ".") + ";";
if (!routineItem.isBuiltIn()) {
String routineContent = new String(routineItem.getContent().getInnerContent());
if (routineContent != null && routineContent.contains(newPackageString)) {
return;
}
}
doChangeRoutinesPackage(item, INNER_ROUTINES_PACKAGE_REGEX, newPackageString,
ERepositoryObjectType.getAllTypesOfCodes(), avoidSave, commitMode);
}
}
}
public static void doChangeRoutinesPackage(Item item, String packageRegex, String newPackage,
List<ERepositoryObjectType> allowedTypes, boolean avoidSave) {
List<ERepositoryObjectType> allowedTypes, boolean avoidSave, boolean commitMode) {
if (item == null) {
return;
}
@@ -94,7 +100,12 @@ public final class RoutineUtils {
ProxyRepositoryFactory repFactory = ProxyRepositoryFactory.getInstance();
if (!avoidSave) {
repFactory.save(rItem);
if (commitMode) {
repFactory.save(rItem);
} else {
// avoid deadlock in git pull event listener
new XmiResourceManager().saveResource(rItem.eResource());
}
}
// }
}

View File

@@ -95,6 +95,7 @@ Export-Package: org.talend.commons.utils.generation,
org.talend.repository.documentation.generation,
org.talend.repository.model,
org.talend.repository.model.nodes,
org.talend.repository.token,
org.talend.repository.ui.actions,
org.talend.repository.ui.dialog,
org.talend.repository.ui.login.connections,

View File

@@ -12,17 +12,26 @@
<dbType type="BPCHAR" ignoreLen="true" ignorePre="true" />
<dbType type="BYTEA" ignoreLen="true" ignorePre="true" />
<dbType type="CHAR" defaultLength="50" ignorePre="true"/>
<dbType type="CHARACTER" defaultLength="50" ignorePre="true"/>
<dbType type="CID" ignoreLen="true" ignorePre="true" />
<dbType type="CIDR" ignoreLen="true" ignorePre="true" />
<dbType type="CIRCLE" ignoreLen="true" ignorePre="true" />
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT4" ignoreLen="true" ignorePre="true" />
<dbType type="REAL" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT8" ignoreLen="true" ignorePre="true" />
<dbType type="DOUBLE PRECISION" ignoreLen="true" ignorePre="true" />
<dbType type="INET" ignoreLen="true" ignorePre="true" />
<dbType type="INT2" ignoreLen="true" ignorePre="true" />
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true" />
<dbType type="INT2VECTOR" ignoreLen="true" ignorePre="true" />
<dbType type="INT4" ignoreLen="true" ignorePre="true" />
<dbType type="INT8" ignoreLen="true" ignorePre="true" />
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
<dbType type="CHARACTER VARYING" ignoreLen="true" ignorePre="true" />
<dbType type="BOOLEAN" ignoreLen="true" ignorePre="true" />
<dbType type="BIGINT" ignoreLen="true" ignorePre="true" />
<dbType type="BIT VARYING" ignoreLen="true" ignorePre="true" />
<dbType type="INTERVAL" ignorePre="true" />
<dbType type="LINE" ignoreLen="true" ignorePre="true" />
<dbType type="LSEG" ignoreLen="true" ignorePre="true" />
@@ -30,6 +39,7 @@
<dbType type="MONEY" ignoreLen="true" ignorePre="true" />
<dbType type="NAME" ignoreLen="true" ignorePre="true" />
<dbType type="NUMERIC" defaultLength="20" defaultPrecision="10"/>
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10"/>
<dbType type="OID" ignoreLen="true" ignorePre="true" />
<dbType type="OIDVECTOR" ignoreLen="true" ignorePre="true" />
<dbType type="PATH" ignoreLen="true" ignorePre="true" />
@@ -110,16 +120,19 @@
<talendToDbTypes><!-- Adviced mappings -->
<talendType type="id_List"/>
<talendType type="id_Boolean">
<dbType type="BOOL" default="true" />
<dbType type="BOOL" default="true" />
<dbType type="BOOLEAN" />
</talendType>
<talendType type="id_Byte">
</talendType>
<talendType type="id_byte[]">
<dbType type="BIT" default="true" />
<dbType type="VARBIT" />
<dbType type="VARBIT" />
<dbType type="BIT VARYING" />
</talendType>
<talendType type="id_Character">
<dbType type="CHAR" default="true" />
<dbType type="CHARACTER" />
<dbType type="BPCHAR" />
<dbType type="VARCHAR" />
<dbType type="TEXT" />
@@ -136,33 +149,47 @@
<dbType type="RELTIME" />
</talendType>
<talendType type="id_BigDecimal">
<dbType type="NUMERIC" default="true" />
<dbType type="NUMERIC" default="true" />
<dbType type="DECIMAL" />
<dbType type="FLOAT4" />
<dbType type="REAL" />
<dbType type="FLOAT8"/>
<dbType type="DOUBLE PRECISION"/>
</talendType>
<talendType type="id_Double">
<dbType type="FLOAT4" />
<dbType type="REAL" />
<dbType type="FLOAT8" default="true" />
<dbType type="NUMERIC" />
<dbType type="NUMERIC" />
<dbType type="DECIMAL" />
<dbType type="DOUBLE PRECISION"/>
</talendType>
<talendType type="id_Float">
<dbType type="FLOAT4" default="true" />
<dbType type="FLOAT8" />
<dbType type="NUMERIC" />
<dbType type="REAL" />
<dbType type="NUMERIC" />
<dbType type="DECIMAL" />
<dbType type="DOUBLE PRECISION"/>
</talendType>
<talendType type="id_Integer">
<dbType type="INT2" />
<dbType type="SMALLINT" />
<dbType type="INT4" default="true" />
<dbType type="SERIAL" />
<dbType type="INT8" />
<dbType type="BIGSERIAL" />
<dbType type="BIGINT" />
<dbType type="BIGSERIAL" />
<dbType type="INTEGER" />
</talendType>
<talendType type="id_Long">
<dbType type="INT2" />
<dbType type="INT4" />
<dbType type="SERIAL" />
<dbType type="INT8" default="true" />
<dbType type="BIGSERIAL" />
<dbType type="BIGINT" />
<dbType type="BIGSERIAL" />
<dbType type="SMALLINT" />
</talendType>
<talendType type="id_Object">
<dbType type="_POINT" />
@@ -209,18 +236,26 @@
<dbType type="_ABSTIME" />
<dbType type="_ACLITEM" />
<dbType type="_INT8" />
<dbType type="BIGINT" />
<dbType type="BIT VARYING" />
<dbType type="_VARBIT" />
<dbType type="_BIT" />
<dbType type="_BOOL" />
<dbType type="BOOLEAN" />
<dbType type="BOX" />
<dbType type="_BOX" />
<dbType type="_BYTEA" />
<dbType type="_VARCHAR" />
<dbType type="CHARACTER VARYING" />
<dbType type="CHARACTER" />
<dbType type="INTEGER" />
<dbType type="REAL" />
<dbType type="_BPCHAR" />
<dbType type="_CID" />
<dbType type="_CIDR" />
<dbType type="_CIRCLE" />
<dbType type="_DATE" />
<dbType type="DOUBLE PRECISION"/>
<dbType type="_FLOAT8" />
<dbType type="_INET" />
<dbType type="INT2VECTOR" />
@@ -236,6 +271,7 @@
<dbType type="NAME" />
<dbType type="_NAME" />
<dbType type="_NUMERIC" />
<dbType type="DECIMAL" />
<dbType type="_OID" />
<dbType type="OIDVECTOR" />
<dbType type="_OIDVECTOR" />
@@ -247,26 +283,44 @@
<dbType type="INT4" />
<dbType type="SERIAL" />
<dbType type="INT8" />
<dbType type="BIGSERIAL" />
<dbType type="BIGINT" />
<dbType type="BIGSERIAL" />
<dbType type="SMALLINT" />
</talendType>
<talendType type="id_String">
<dbType type="BPCHAR" />
<dbType type="VARCHAR" default="true" />
<dbType type="CHARACTER VARYING" />
<dbType type="TEXT" />
</talendType>
</talendToDbTypes>
<dbToTalendTypes>
<dbType type="INT2" >
<talendType type="id_Short" default="true" />
</dbType>
<dbType type="SMALLINT" >
<talendType type="id_Short" default="true" />
</dbType>
<dbType type="INT4" >
<talendType type="id_Integer" default="true" />
</dbType>
</dbType>
<dbType type="INTEGER" >
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="CHARACTER VARYING" >
<talendType type="id_String" default="true" />
</dbType>
<dbType type="BOOLEAN" >
<talendType type="id_Boolean" default="true" />
</dbType>
<dbType type="SERIAL" >
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="INT8" >
<talendType type="id_Long" default="true" />
</dbType>
<dbType type="BIGINT" >
<talendType type="id_Long" default="true" />
</dbType>
<dbType type="BIGSERIAL" >
<talendType type="id_Long" default="true" />
@@ -274,14 +328,26 @@
<dbType type="FLOAT4" >
<talendType type="id_Float" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
</dbType>
<dbType type="REAL" >
<talendType type="id_Float" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="FLOAT8" >
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="DOUBLE PRECISION" >
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="NUMERIC">
<talendType type="id_Double"/>
<talendType type="id_BigDecimal" default="true" />
</dbType>
<dbType type="DECIMAL">
<talendType type="id_Double"/>
<talendType type="id_BigDecimal" default="true" />
</dbType>
<dbType type="BOOL" >
<talendType type="id_Boolean" default="true" />
@@ -291,9 +357,15 @@
</dbType>
<dbType type="VARBIT" >
<talendType type="id_byte[]" default="true" />
</dbType>
</dbType>
<dbType type="BIT VARYING" >
<talendType type="id_byte[]" default="true" />
</dbType>
<dbType type="CHAR" >
<talendType type="id_String" default="true" />
</dbType>
<dbType type="CHARACTER" >
<talendType type="id_String" default="true" />
</dbType>
<dbType type="BPCHAR" >
<talendType type="id_String" default="true" />

View File

@@ -110,7 +110,7 @@
</appInfo>
<documentation>
Talend Community Edition&lt;br&gt;
Copyright (C) 2006-2019 Talend - www.talend.com
Copyright (C) 2006-2021 Talend - www.talend.com
</documentation>
</annotation>

View File

@@ -1,34 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core;
import org.talend.core.model.properties.Item;
import org.talend.migration.IMigrationTask.ExecutionResult;
/**
* DOC bZhou class global comment. Detailled comment
*/
public interface IMigrateDIMetadataItemService extends IService {
/**
* DOC bZhou Comment method "migrateDIItems".
*
* This method to invode the migration task in DI to do migration when import items from DQ perspective.
*
* It should be removed after merge the migrate mechanism.
*
* @param item
* @return
*/
ExecutionResult migrateDIItems(Item item);
}

View File

@@ -12,13 +12,19 @@
// ============================================================================
package org.talend.core;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
/**
* This class can check whether some specific plugins are loaded or not. <br/>
@@ -62,6 +68,8 @@ public class PluginChecker {
private static final String PREVIEW_PLUGIN_ID = "org.talend.designer.component.preview"; //$NON-NLS-1$
private static final String REMOTE_PROVIDER_PLUGIN_ID = "org.talend.repository.remoteprovider"; //$NON-NLS-1$
private static final String SVN_PROVIDER_PLUGIN_ID = "org.talend.repository.svnprovider"; //$NON-NLS-1$
private static final String GIT_PROVIDER_PLUGIN_ID = "org.talend.repository.gitprovider"; //$NON-NLS-1$
@@ -140,6 +148,10 @@ public class PluginChecker {
public static final String APACHE_CXF_PLUGIN_ID = "org.talend.libraries.apache.cxf"; //$NON-NLS-1$
public static final String SWTBOT_PLUGIN_ID = "org.eclipse.swtbot.eclipse.core"; //$NON-NLS-1$
private static Boolean isStudioLite;
/**
* Check if specific plug-in is loaded.
*
@@ -158,6 +170,23 @@ public class PluginChecker {
return isJobLetPluginLoaded();
}
public static boolean isStudioLite() {
if (isStudioLite == null) {
try {
File studioConfigFile = VersionUtils.getStudioConfigFile();
Properties props = new Properties();
try (BufferedReader reader = Files.newBufferedReader(studioConfigFile.toPath())) {
props.load(reader);
}
isStudioLite = Boolean.valueOf(props.getProperty("talend.studio.lite"));
} catch (Exception e) {
isStudioLite = false;
ExceptionHandler.process(e);
}
}
return isStudioLite;
}
public static boolean isRefProjectLoaded() {
return isPluginLoaded(REF_PROJECT_PLUGIN_ID);
}
@@ -259,6 +288,10 @@ public class PluginChecker {
return isPluginLoaded(PREVIEW_PLUGIN_ID);
}
public static boolean isRemoteProviderPluginLoaded() {
return isPluginLoaded(REMOTE_PROVIDER_PLUGIN_ID);
}
public static boolean isSVNProviderPluginLoaded() {
return isPluginLoaded(SVN_PROVIDER_PLUGIN_ID);
}
@@ -372,6 +405,10 @@ public class PluginChecker {
return isPluginLoaded(BD_ROUTINE_PLUGIN_ID);
}
public static boolean isSWTBotLoaded() {
return isPluginLoaded(SWTBOT_PLUGIN_ID);
}
public static String getBundlePath(String bundleName) {
String bundlePath = ""; //$NON-NLS-1$
Bundle refBundle = Platform.getBundle(bundleName);

View File

@@ -67,8 +67,8 @@ public enum EDatabase4DriverClassName {
// if change the order, it might break the audit for PSQL.
PSQL(EDatabaseTypeName.PSQL, "org.postgresql.Driver"), //$NON-NLS-1$
PLUSPSQL(EDatabaseTypeName.PLUSPSQL, "org.postgresql.Driver"), //$NON-NLS-1$
GREENPLUM(EDatabaseTypeName.GREENPLUM, "org.postgresql.Driver"), //$NON-NLS-1$
GREENPLUM(EDatabaseTypeName.GREENPLUM, "com.pivotal.jdbc.GreenplumDriver"), //$NON-NLS-1$
GREENPLUM_PSQL(EDatabaseTypeName.GREENPLUM, "org.postgresql.Driver"), //$NON-NLS-1$
SAS(EDatabaseTypeName.SAS, "com.sas.rio.MVADriver"), //$NON-NLS-1$
SAPHana(EDatabaseTypeName.SAPHana, "com.sap.db.jdbc.Driver"), //$NON-NLS-1$
SQLITE(EDatabaseTypeName.SQLITE, "org.sqlite.JDBC"), //$NON-NLS-1$

View File

@@ -336,10 +336,19 @@ public enum EDatabaseTypeName {
.getProjectPreferenceManager()
.getBoolean(IProjectSettingPreferenceConstants.METADATA_DBCONNECTION_ODBC_ENABLE);
isSupport = isSupportODBC;
} else if (EDatabaseTypeName.SAS == this) {
isSupport = false;
}
return isSupport;
}
public static boolean isDeprecateDbType(String dbType) {
if (EDatabaseTypeName.SAS.getXmlName().equals(dbType)) {
return true;
}
return false;
}
/**
* Getter for dbType.

View File

@@ -114,6 +114,13 @@ public class DatabaseConnStrUtil {
&& EDatabaseVersion4Drivers.SYBASEIQ_16_SA.getVersionValue().equals(dbVersion)) {
connStr = EDatabaseConnTemplate.SYBASEASE_16_SA;
}
if (EDatabaseTypeName.GREENPLUM.getDisplayName().equals(dbType)) {
if (EDatabaseVersion4Drivers.GREENPLUM.getVersionValue().equals(dbVersion)) {
connStr = EDatabaseConnTemplate.GREENPLUM;
}else if(EDatabaseVersion4Drivers.GREENPLUM_PSQL.getVersionValue().equals(dbVersion)) {
connStr = EDatabaseConnTemplate.GREENPLUM_PSQL;
}
}
EDatabaseVersion4Drivers version = EDatabaseVersion4Drivers.indexOfByVersion(dbVersion);
if (connStr != null) {
String s = connStr.getUrlTemplate(version);

View File

@@ -54,6 +54,11 @@ public enum EDatabaseConnTemplate {
"5432")), //$NON-NLS-1$
GREENPLUM(new DbConnStr(EDatabaseTypeName.GREENPLUM, //
"jdbc:pivotal:greenplum://<host>:<port>;;DatabaseName=<sid>;<property>", //$NON-NLS-1$
"5432")), //$NON-NLS-1$
GREENPLUM_PSQL(new DbConnStr(EDatabaseTypeName.GREENPLUM, //
"jdbc:postgresql://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
"5432")), //$NON-NLS-1$

View File

@@ -99,8 +99,8 @@ public enum EDatabaseVersion4Drivers {
VERTICA_3(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 3 (Deprecated)", "VERTICA_3", "vertica_3.0_jdk_5.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// for bug 0017930
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM, "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.14.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

View File

@@ -53,7 +53,7 @@ public class BigDataBasicUtil {
private static IDynamicDistributionManager getDynamicDistributionManager(IProgressMonitor monitor) throws Exception {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopDistributionService.class)) {
IHadoopDistributionService hdService = (IHadoopDistributionService) GlobalServiceRegister.getDefault()
IHadoopDistributionService hdService = GlobalServiceRegister.getDefault()
.getService(IHadoopDistributionService.class);
if (hdService != null) {
return hdService.getDynamicDistributionManager();

View File

@@ -27,8 +27,8 @@ import org.talend.core.model.process.IElement;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.Problem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.routines.CodesJarInfo;
import org.talend.designer.codegen.PigTemplate;
/**
@@ -120,7 +120,7 @@ public interface ILibrariesService extends IService {
Set<ModuleNeeded> getAllCodesJarModuleNeededs();
Set<ModuleNeeded> getCodesJarModuleNeededs(Property property);
Set<ModuleNeeded> getCodesJarModuleNeededs(CodesJarInfo info);
List<ModuleNeeded> getModuleNeeded(String id, boolean isGroup);

View File

@@ -191,6 +191,23 @@ public class ModuleToInstall {
}
}
@Override
public ModuleToInstall clone() {
ModuleToInstall module = new ModuleToInstall();
module.setName(this.name);
module.setRequired(this.required);
module.setContext(this.context);
module.setDescription(this.description);
module.setDistribution(this.distribution);
module.setFromCustomNexus(this.fromCustomNexus);
module.setLicenseType(this.licenseType);
module.setLicenseUrl(this.licenseUrl);
module.setMavenUri(this.mavenUri);
module.setUrl_description(this.url_description);
module.setUrl_download(this.url_download);
return module;
}
public static String removeAuthenrizationInfo(String mavenUri) throws Exception {
MavenArtifact ma = MavenUrlHelper.parseMvnUrl(mavenUri);
ma.setUsername(""); //$NON-NLS-1$

View File

@@ -125,6 +125,10 @@ public interface IMetadataColumn {
public void setCustom(boolean custom);
public boolean isIgnoreCustomSort();
public void setIgnoreCustomSort(boolean ignoreCustomSort);
public void setCustomId(int customId); // only for custom columns to sort them
public int getCustomId(); // only for custom columns to sort them

View File

@@ -53,6 +53,8 @@ public class MetadataColumn implements IMetadataColumn, Cloneable {
private boolean custom = false;
private boolean ignoreCustomSort = false;
private boolean readOnly = false;
private int customId = 0;
@@ -574,6 +576,24 @@ public class MetadataColumn implements IMetadataColumn, Cloneable {
this.custom = custom;
}
/**
* Getter for ignoreCustomSort.
*
* @return the ignoreCustomSort
*/
public boolean isIgnoreCustomSort() {
return ignoreCustomSort;
}
/**
* Sets the ignoreCustomSort.
*
* @param ignoreCustomSort the ignoreCustomSort to set
*/
public void setIgnoreCustomSort(boolean ignoreCustomSort) {
this.ignoreCustomSort = ignoreCustomSort;
}
/**
* Getter for readOnly.
*

View File

@@ -365,7 +365,7 @@ public class MetadataTable implements IMetadataTable, Cloneable {
for (int i = 0; i < listColumns.size(); i++) {
IMetadataColumn column = listColumns.get(i);
if (column.isCustom()) {
if (column.isCustom() && !column.isIgnoreCustomSort()) {
customColumns.add(column);
}
}

View File

@@ -32,6 +32,8 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -492,18 +494,55 @@ public final class MetadataTalendType {
}
}
private static String getSha1OfFile(File file) {
String sha1 = null;
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(file);
sha1 = DigestUtils.shaHex(fileInputStream);
} catch (Exception e) {
ExceptionHandler.process(e);
} finally {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e) {
e.printStackTrace(); // Just print the exception for debug.
}
}
}
return sha1;
}
public static void copyFile(File in, IFile out) throws CoreException, IOException {
FileInputStream fis = new FileInputStream(in);
if (out.exists()) {
out.setContents(fis, true, false, null);
} else {
out.create(fis, true, null);
}
fis.close();
}
public static void syncNewMappingFileToProject() throws SystemException {
try {
File sysMappingFiles = new File(MetadataTalendType.getSystemForderURLOfMappingsFile().getPath());
IFolder projectMappingFolder = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject())
.getFolder(MetadataTalendType.PROJECT_MAPPING_FOLDER);
File projectMappingFiles = projectMappingFolder.getFullPath().toFile();
if (sysMappingFiles.list().length == new File(projectMappingFolder.getLocationURI()).list().length) {
File projectMappingFiles = new File(projectMappingFolder.getLocationURI());
if (!sysMappingFiles.exists() || !projectMappingFiles.exists()) {
return;
}
for (File sysMapping : sysMappingFiles.listFiles()) {
IFile projectMapping = projectMappingFolder.getFile(sysMapping.getName());
if (projectMapping.exists() && StringUtils.equals(sysMapping.getName(), "mapping_Greenplum.xml")) {
String sha1OfFile = DigestUtils.shaHex(projectMapping.getContents());
String shalOfOldSystem = "8431f19215dacb3caa126778ae695954552cce2a";
if (StringUtils.equals(sha1OfFile, shalOfOldSystem)) {
copyFile(sysMapping, projectMapping);
}
}
if (!projectMapping.exists()) {
FileInputStream fis = null;
try {

View File

@@ -25,8 +25,10 @@ import org.apache.avro.SchemaBuilder.FieldAssembler;
import org.apache.avro.SchemaBuilder.FieldBuilder;
import org.apache.avro.SchemaBuilder.PropBuilder;
import org.apache.avro.SchemaBuilder.RecordBuilder;
import org.apache.avro.SchemaParseException;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
@@ -49,6 +51,10 @@ import orgomg.cwm.objectmodel.core.TaggedValue;
*/
public final class MetadataToolAvroHelper {
private static Logger LOGGER = Logger.getLogger(MetadataToolAvroHelper.class);
private static final String COLUMN = "Column";
private static final String TALEND_DB_COLUMN_NAME = "talend.field.dbColumnName";
/**
* @return An Avro schema with enriched properties from the incoming metadata table.
@@ -66,7 +72,7 @@ public final class MetadataToolAvroHelper {
dynamicPosition = i;
dynColumn = column;
} else {
fa = convertToAvro(fa, column);
fa = convertToAvro(fa, column, i);
}
i++;
}
@@ -137,7 +143,7 @@ public final class MetadataToolAvroHelper {
* Build a field into a schema using enriched properties from the incoming column.
*/
private static FieldAssembler<Schema> convertToAvro(FieldAssembler<Schema> fa,
org.talend.core.model.metadata.builder.connection.MetadataColumn in) {
org.talend.core.model.metadata.builder.connection.MetadataColumn in, int i) {
ICoreService coreService = (ICoreService) GlobalServiceRegister.getDefault().getService(ICoreService.class);
String label = in.getLabel();
if (label != null && coreService != null) {
@@ -237,7 +243,27 @@ public final class MetadataToolAvroHelper {
}
type = in.isNullable() ? AvroUtils.wrapAsNullable(type) : type;
return defaultValue == null ? fb.type(type).noDefault() : fb.type(type).withDefault(defaultValue);
FieldAssembler<Schema> returnResult = null;
try {
if (defaultValue == null) {
returnResult = fb.type(type).noDefault();
} else {
returnResult = fb.type(type).withDefault(defaultValue);
}
} catch (SchemaParseException e) {
// if validation not pass from avro ,then generate a new name like Column0 to pass the validation, but
// actually the display name of schema and the column name is using TALEND_DB_COLUMN_NAME
String genColumn = COLUMN + i;
FieldBuilder<Schema> fbNew = fa.name(genColumn);
copyColumnProperties(fbNew, in);
if (defaultValue == null) {
returnResult = fbNew.type(type).noDefault();
} else {
returnResult = fbNew.type(type).withDefault(defaultValue);
}
LOGGER.info(e.getMessage() + ", use " + genColumn + " instead");
}
return returnResult;
}
private static Schema getLogicalTypeSchema(org.talend.core.model.metadata.builder.connection.MetadataColumn column) {

View File

@@ -647,6 +647,7 @@ public final class MetadataToolHelper {
target.getListColumns().remove(targetColumn);
newTargetColumn.setCustom(targetColumn.isCustom());
newTargetColumn.setCustomId(targetColumn.getCustomId());
newTargetColumn.setIgnoreCustomSort(targetColumn.isIgnoreCustomSort());
columnsTAdd.add(newTargetColumn);
}
}
@@ -806,6 +807,7 @@ public final class MetadataToolHelper {
target.getListColumns().remove(targetColumn);
newTargetColumn.setCustom(targetColumn.isCustom());
newTargetColumn.setCustomId(targetColumn.getCustomId());
newTargetColumn.setIgnoreCustomSort(targetColumn.isIgnoreCustomSort());
columnsTAdd.add(newTargetColumn);
}
}

View File

@@ -607,6 +607,12 @@ public class ComponentToRepositoryProperty {
}
// SAX
// can not find corresponding component. also not exist in EDatabaseType.java.
// impala
else if (EDatabaseTypeName.IMPALA.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
connection.setDatabaseType(EDatabaseTypeName.IMPALA.getDisplayName());
connection.setProductId(EDatabaseTypeName.IMPALA.getProduct());
}
}
/**
@@ -708,6 +714,18 @@ public class ComponentToRepositoryProperty {
connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_ADDITIONAL_JDBC_SETTINGS, value);
}
}
if ("DISTRIBUTION".equals(param.getRepositoryValue())) {
String value = getParameterValue(connection, node, param);
if (value != null) {
connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION, value);
}
}
if ("IMPALA_VERSION".equals(param.getRepositoryValue())) {
String value = getParameterValue(connection, node, param);
if (value != null) {
connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION, value);
}
}
if (connection.getDatabaseType().equals(EDatabaseTypeName.ORACLEFORSID.getDisplayName())) {
setDatabaseValueForOracleSid(connection, node, param);

View File

@@ -1067,7 +1067,10 @@ public class RepositoryToComponentProperty {
return dbVersionString;
} else if (EDatabaseTypeName.SYBASEASE.getDisplayName().equals(databaseType)) {
return dbVersionString;
} else {
} else if (EDatabaseTypeName.GREENPLUM.getDisplayName().equals(databaseType)) {
return dbVersionString;
}else {
String driverValue = EDatabaseVersion4Drivers.getDriversStr(databaseType, dbVersionString);
if (EDatabaseConnTemplate.ORACLE_OCI.getDBDisplayName().equals(databaseType)
|| EDatabaseConnTemplate.ORACLE_CUSTOM.getDBDisplayName().equals(databaseType)

View File

@@ -146,7 +146,7 @@ public abstract class AbstractItemMigrationTask extends AbstractMigrationTask im
* this returns all type handled by this migration task even the extended type that could benefit from this
* migrations
* */
List<ERepositoryObjectType> getAllTypes() {
protected List<ERepositoryObjectType> getAllTypes() {
List<ERepositoryObjectType> declaredTypes = getTypes();
ArrayList<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>(declaredTypes.size());
allTypes.addAll(declaredTypes);

View File

@@ -124,6 +124,7 @@ public enum EParameterFieldType {
TACOKIT_BUTTON,
TACOKIT_SUGGESTABLE_TABLE,
TACOKIT_VALUE_SELECTION,
TACOKIT_TABLE,
TACOKIT_TEXT_AREA_SELECTION;
public String getName() {

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.core.model.process;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -133,4 +134,8 @@ public interface IProcess extends IElement {
public String getComponentsType();
public INode getNodeByUniqueName(String uniqueName);
default List<? extends INode> getProcessNodes() {
return new ArrayList<INode>();
}
}

View File

@@ -67,6 +67,8 @@ public class JobInfo {
private boolean needUnloadProcessor;
private int includeESBFlag = 0;
public JobInfo(String jobId, String contextName, String version) {
this.jobId = jobId;
this.contextName = contextName;
@@ -572,4 +574,13 @@ public class JobInfo {
public boolean isNeedUnloadProcessor() {
return this.needUnloadProcessor;
}
public int getIncludeESBFlag() {
return includeESBFlag;
}
public void setIncludeESBFlag(int includeESBFlag) {
this.includeESBFlag = includeESBFlag;
}
}

View File

@@ -119,7 +119,7 @@ public final class RepositoryManager {
}
public static void syncUserComponents() {
if (PluginChecker.isSVNProviderPluginLoaded()) {
if (PluginChecker.isRemoteProviderPluginLoaded()) {
IComponentsService codeGenService = (IComponentsService) GlobalServiceRegister.getDefault().getService(
IComponentsService.class);
if (codeGenService != null) {

View File

@@ -12,9 +12,23 @@
// ============================================================================
package org.talend.core.model.routines;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.Assert;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.properties.Property;
import org.talend.core.model.properties.RoutinesJarItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.cwm.helper.ResourceHelper;
import org.talend.designer.core.model.utils.emf.component.IMPORTType;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryService;
/**
* Could get most of codesjar's attribute in EMF model but some are lost when model is unloaded. Store those attributes
@@ -23,7 +37,7 @@ import org.talend.repository.ProjectManager;
public class CodesJarInfo {
private Property property;
private static final String EMPTY_DATE;
private String projectTechName;
@@ -35,24 +49,47 @@ public class CodesJarInfo {
private ERepositoryObjectType type;
private CodesJarInfo() {
private List<IMPORTType> imports;
private String modifiedDate;
static {
Calendar c = Calendar.getInstance();
c.setTimeInMillis(0);
EMPTY_DATE = ResourceHelper.dateFormat().format(c.getTime());
}
private CodesJarInfo() {
imports = new ArrayList<>();
}
public static CodesJarInfo create(Property property) {
Assert.isTrue(property.getItem() instanceof RoutinesJarItem);
CodesJarInfo info = new CodesJarInfo();
info.property = property;
info.projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
info.id = property.getId();
info.label = property.getLabel();
info.version = property.getVersion();
info.type = ERepositoryObjectType.getItemType(property.getItem());
if (((RoutinesJarItem) property.getItem()).getRoutinesJarType() != null) {
info.imports.addAll(((RoutinesJarItem) property.getItem()).getRoutinesJarType().getImports());
}
String modifiedDate = (String) property.getAdditionalProperties().get(ItemProductKeys.DATE.getModifiedKey());
info.modifiedDate = StringUtils.isNotBlank(modifiedDate) ? modifiedDate : EMPTY_DATE;
return info;
}
public Property getProperty() {
return property;
}
try {
IRepositoryViewObject obj = IProxyRepositoryService.get().getProxyRepositoryFactory().getLastVersion(id);
if (obj != null) {
return obj.getProperty();
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
return null;
}
public String getProjectTechName() {
return projectTechName;
@@ -74,6 +111,14 @@ public class CodesJarInfo {
return type;
}
public List<IMPORTType> getImports() {
return imports;
}
public String getModifiedDate() {
return modifiedDate;
}
public boolean isInCurrentMainProject() {
return projectTechName.equals(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel());
}
@@ -82,36 +127,42 @@ public class CodesJarInfo {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((projectTechName == null) ? 0 : projectTechName.hashCode());
result = prime * result + ((property == null) ? 0 : property.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((label == null) ? 0 : label.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((version == null) ? 0 : version.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
if (this == obj)
return true;
}
if (obj == null) {
if (obj == null)
return false;
}
if (getClass() != obj.getClass()) {
if (getClass() != obj.getClass())
return false;
}
CodesJarInfo other = (CodesJarInfo) obj;
if (projectTechName == null && other.projectTechName != null) {
return false;
} else if (!projectTechName.equals(other.projectTechName)) {
return false;
}
if (property == null && other.property != null) {
return false;
} else if (property != null && other.property != null) {
if (!property.getId().equals(other.property.getId()) || !property.getLabel().equals(other.property.getLabel())
|| !property.getVersion().equals(other.property.getVersion())) {
if (id == null) {
if (other.id != null)
return false;
}
}
} else if (!id.equals(other.id))
return false;
if (label == null) {
if (other.label != null)
return false;
} else if (!label.equals(other.label))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
if (version == null) {
if (other.version != null)
return false;
} else if (!version.equals(other.version))
return false;
return true;
}

View File

@@ -418,6 +418,52 @@ public class NodeUtil {
return conns;
}
/**
* DOC
* <p>
* The method searches for the incoming node connections of type
* on a processing path and returns the first ones only
* </p>
*
* @param node
* @param type - node type to look for
* @return
*/
public static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, String type) {
if (type == null)
return new ArrayList<IConnection>();
Set<String> uniqueNamesDone = new HashSet<String>();
List<? extends IConnection> allIncomingConnections = getFirstIncomingLineConnectionsOfType(node, uniqueNamesDone, type);
return allIncomingConnections;
}
private static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, Set<String> uniqueNamesDone, String type) {
List<IConnection> conns = new ArrayList<IConnection>();
List<? extends IConnection> incomingConnections = node.getIncomingConnections();
if (incomingConnections != null) {
for (int i = 0; i < incomingConnections.size(); i++) {
IConnection connection = incomingConnections.get(i);
INode nextNode = connection.getSource();
if (!uniqueNamesDone.contains(nextNode.getUniqueName())) {
uniqueNamesDone.add(nextNode.getUniqueName());
if (type.equals((String)nextNode.getElementParameter("COMPONENT_NAME").getValue())) {
conns.add(connection);
} else {
conns.addAll(getFirstIncomingLineConnectionsOfType(nextNode, uniqueNamesDone, type)); // follow this way
}
}
}
}
return conns;
}
public static INode getFirstMergeNode(INode node) {
INode mergeNode = null;
for (IConnection connection : node.getOutgoingConnections()) {

View File

@@ -16,8 +16,10 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -97,6 +99,8 @@ public class NexusServerUtils {
}
final boolean status[] = { false };
try {
URI uri = new URI(nexusURL);
uri.toURL();
NullProgressMonitor monitor = new NullProgressMonitor();
new HttpClientTransport(nexusURL, username, password) {
@@ -142,6 +146,8 @@ public class NexusServerUtils {
}
final List<HttpResponse> httpResponse = new ArrayList<>();
try {
URI uri = new URI(nexusURL);
uri.toURL();
NullProgressMonitor monitor = new NullProgressMonitor();
new HttpClientTransport(nexusURL, username, password) {
@@ -160,6 +166,7 @@ public class NexusServerUtils {
} catch (Exception e) {
ExceptionHandler.process(e);
return null;
}
return httpResponse.get(0);
}

View File

@@ -114,7 +114,7 @@ public interface ITalendCorePrefConstants {
public static final String DATA_COLLECTOR_PREVIEW = "data_collector_preview"; //$NON-NLS-1$
public static final String DATA_COLLECTOR = "data_collector"; //$NON-NLS-1$
public static final String EXCHANGE_CHECK_TIS_VERSION = "exchange_check_tis_version"; //$NON-NLS-1$
public static final String EXCHANGE_DOWNLOADED_CHECK_UPDATES = "exchange_downloaded_check_updates"; //$NON-NLS-1$

View File

@@ -36,6 +36,8 @@ public interface MavenConstants {
static final String DEFAULT_GROUP_ID = "org.talend";
static final String APACHE_GROUP_ID = "org.apache";
static final String DEFAULT_VERSION = "6.0.0";
static final String SNAPSHOT = "-SNAPSHOT";

View File

@@ -80,4 +80,13 @@ public interface TalendProcessOptionConstants {
*/
public static final int MODULES_WITH_CODESJAR = 1 << 6;
/**
* flag for check if is ESB job
*/
public static final int ISESB_CHECKED = 1;
public static final int ISESB_CHILDREN_INCLUDE = 1 << 1;
public static final int ISESB_CURRENT_INCLUDE = 1 << 2;
}

View File

@@ -14,17 +14,16 @@ package org.talend.core.runtime.services;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.routines.CodesJarInfo;
public interface IDesignerMavenService extends IService {
String getCodesJarPackageByInnerCode(RoutineItem innerCodeItem);
String getImportGAVPackageForCodesJar(String projectTechName, Item codesJarItem);
String getImportGAVPackageForCodesJar(CodesJarInfo info);
void updateCodeJarMavenProject(Property codeJarProperty, boolean needReSync) throws Exception;
void updateCodeJarMavenProject(CodesJarInfo info, boolean needReSync) throws Exception;
public static IDesignerMavenService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMavenService.class)) {

View File

@@ -47,4 +47,6 @@ public interface ICoreUIService extends IService {
String getPreferenceValue(String key);
void loadComponentsFromProviders(ERepositoryObjectType type);
void resetDataCollectorData();
}

View File

@@ -147,4 +147,6 @@ public interface IJobletProviderService extends IService {
public void updateJobleModifiedRelated(Item item, String oldName, String newName);
public IProcess getJobletGEFProcessFromNode(INode node);
}

View File

@@ -39,10 +39,11 @@ public class CodesJarResourceCache {
List<Project> allProjects = new ArrayList<>();
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects(true));
allProjects.add(ProjectManager.getInstance().getCurrentProject());
IProxyRepositoryFactory factory = IProxyRepositoryService.get().getProxyRepositoryFactory();
try {
for (Project project : allProjects) {
for (ERepositoryObjectType codesJarType : ERepositoryObjectType.getAllTypesOfCodesJar()) {
List<IRepositoryViewObject> objects = getProxyRepositoryFactory().getAllCodesJars(project, codesJarType);
List<IRepositoryViewObject> objects = factory.getAllCodesJars(project, codesJarType);
for (IRepositoryViewObject obj : objects) {
CACHE.add(CodesJarInfo.create(obj.getProperty()));
}
@@ -63,8 +64,7 @@ public class CodesJarResourceCache {
public static CodesJarInfo getCodesJarById(String id) {
synchronized (LOCK) {
Optional<CodesJarInfo> optional = CACHE.stream().filter(info -> info.getProperty().getId().equals(id))
.findFirst();
Optional<CodesJarInfo> optional = CACHE.stream().filter(info -> info.getId().equals(id)).findFirst();
if (optional.isPresent()) {
return optional.get();
}
@@ -75,13 +75,12 @@ public class CodesJarResourceCache {
public static CodesJarInfo getCodesJarByLabel(ERepositoryObjectType type, String projectTechName, String label) {
synchronized (LOCK) {
Optional<CodesJarInfo> optional = CACHE.stream().filter(
info -> ERepositoryObjectType.getItemType(info.getProperty().getItem()) == type
&& info.getProperty().getLabel().equals(label) && info.getProjectTechName().equals(projectTechName))
.findFirst();
Optional<CodesJarInfo> optional = CACHE.stream().filter(info -> info.getType() == type
&& info.getLabel().equals(label) && info.getProjectTechName().equals(projectTechName)).findFirst();
if (optional.isPresent()) {
return optional.get();
}
ExceptionHandler.process(new Exception("Codes jar [" + label + "] is not found!")); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
}
@@ -89,19 +88,23 @@ public class CodesJarResourceCache {
public static CodesJarInfo getCodesJarByInnerCode(RoutineItem routineItem) throws PersistenceException {
String codesJarName = RoutinesUtil.getCodesJarLabelByInnerCode(routineItem);
String projectTechName = ProjectManager.getInstance().getProject(routineItem).getTechnicalLabel();
return getAllCodesJars().stream()
.filter(info -> info.getProperty().getLabel().equals(codesJarName)
&& info.getProjectTechName().equals(projectTechName))
.findFirst().get();
Optional<CodesJarInfo> optional = getAllCodesJars().stream()
.filter(info -> info.getLabel().equals(codesJarName) && info.getProjectTechName().equals(projectTechName))
.findFirst();
if (optional.isPresent()) {
return optional.get();
}
ExceptionHandler.process(new Exception("Codes jar [" + routineItem.getProperty().getLabel() + "] is not found!")); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
public static void addToCache(Property newProperty) {
synchronized (LOCK) {
Iterator<CodesJarInfo> iterator = CACHE.iterator();
while (iterator.hasNext()) {
Property oldProperty = iterator.next().getProperty();
if (newProperty.getId().equals(oldProperty.getId()) && newProperty.getLabel().equals(oldProperty.getLabel())
&& newProperty.getVersion().equals(oldProperty.getVersion())) {
CodesJarInfo oldInfo = iterator.next();
if (newProperty.getId().equals(oldInfo.getId()) && newProperty.getLabel().equals(oldInfo.getLabel())
&& newProperty.getVersion().equals(oldInfo.getVersion())) {
iterator.remove();
}
}
@@ -113,10 +116,9 @@ public class CodesJarResourceCache {
synchronized (LOCK) {
Iterator<CodesJarInfo> iterator = CACHE.iterator();
while (iterator.hasNext()) {
Property oldProperty = iterator.next().getProperty();
if ((oldId == null || (oldId != null && oldId.equals(oldProperty.getId())))
&& oldLabel.equals(oldProperty.getLabel())
&& oldVersion.equals(oldProperty.getVersion())) {
CodesJarInfo oldInfo = iterator.next();
if ((oldId == null || (oldId != null && oldId.equals(oldInfo.getId()))) && oldLabel.equals(oldInfo.getLabel())
&& oldVersion.equals(oldInfo.getVersion())) {
iterator.remove();
}
}
@@ -128,22 +130,15 @@ public class CodesJarResourceCache {
synchronized (LOCK) {
Iterator<CodesJarInfo> iterator = CACHE.iterator();
while (iterator.hasNext()) {
Property oldProperty = iterator.next().getProperty();
if (oldProperty.getId().equals(property.getId()) && oldProperty.getLabel().equals(property.getLabel())
&& oldProperty.getVersion().equals(property.getVersion())) {
CodesJarInfo oldInfo = iterator.next();
if (oldInfo.getId().equals(property.getId()) && oldInfo.getLabel().equals(property.getLabel())
&& oldInfo.getVersion().equals(property.getVersion())) {
iterator.remove();
}
}
}
}
private static IProxyRepositoryFactory getProxyRepositoryFactory() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
return GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class).getProxyRepositoryFactory();
}
return null;
}
public static void addCodesJarChangeListener() {
if (!isListenerAdded) {
synchronized (LOCK) {

View File

@@ -271,14 +271,10 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
protected void syncInnerCodeItems(boolean forceUpdate) throws SystemException {
IProxyRepositoryFactory factory = getRepositoryService().getProxyRepositoryFactory();
for (CodesJarInfo info : CodesJarResourceCache.getAllCodesJars()) {
Property property = info.getProperty();
String projectTechName = info.getProjectTechName();
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(projectTechName);
ERepositoryObjectType codesJarType = ERepositoryObjectType.getItemType(property.getItem());
List<IRepositoryViewObject> innerCodesObjects = factory.getAllInnerCodes(project, codesJarType, property);
List<IRepositoryViewObject> innerCodesObjects = factory.getAllInnerCodes(info);
for (IRepositoryViewObject codesObj : innerCodesObjects) {
RoutineItem codeItem = (RoutineItem) codesObj.getProperty().getItem();
syncRoutine(codeItem, projectTechName, true, forceUpdate);
syncRoutine(codeItem, info.getProjectTechName(), true, forceUpdate);
}
}
}
@@ -295,11 +291,8 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
return;
}
CodesJarInfo info = CodesJarResourceCache.getCodesJarByInnerCode(routineItem);
Property codesJarProperty = info.getProperty();
IFolder innerCodeFolder = ResourceUtils.getFolder(ResourceUtils.getProject(info.getProjectTechName()),
ERepositoryObjectType.getFolderName(ERepositoryObjectType.getItemType(codesJarProperty.getItem())) + "/"
+ codesJarProperty.getLabel(),
true);
ERepositoryObjectType.getFolderName(info.getType()) + "/" + info.getLabel(), true);
IFile innerCodeFile = innerCodeFolder
.getFile(routineItem.getProperty().getLabel() + "_" + routineItem.getProperty().getVersion() + ".item");
if (innerCodeFile.exists()) {

View File

@@ -192,7 +192,7 @@ public interface IRunProcessService extends IService {
@Deprecated
public void buildJavaProject();
public void buildCodesJavaProject(IProgressMonitor monitor);
public void buildCodesJavaProject(IProgressMonitor monitor, Set<CodesJarInfo> toUpdate);
/**
* @deprecated use {@link IRunProcessService#getTalendJobJavaProject(Property)} instead

View File

@@ -186,7 +186,7 @@ public final class ProjectManager {
Set<String> resolvedProjectLabels, boolean force) {
if (p != null) {
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(p);
if (parentBranch != null || force) {
if ((!p.isLocal() || parentBranch != null) || force) {
resolvedProjectLabels.add(p.getTechnicalLabel());
for (ProjectReference pr : new Project(p).getProjectReferenceList()) {
if (ProjectManager.validReferenceProject(p, pr)

View File

@@ -43,6 +43,7 @@ import org.talend.core.model.repository.Folder;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.repository.IRepositoryWorkUnitListener;
import org.talend.core.model.repository.LockInfo;
import org.talend.core.model.routines.CodesJarInfo;
import org.talend.repository.RepositoryWorkUnit;
/**
@@ -317,11 +318,7 @@ public interface IProxyRepositoryFactory {
public abstract List<IRepositoryViewObject> getAllCodesJars(Project project, ERepositoryObjectType type)
throws PersistenceException;
public abstract List<IRepositoryViewObject> getAllInnerCodes(ERepositoryObjectType codesJarType, Property jarProperty)
throws PersistenceException;
public abstract List<IRepositoryViewObject> getAllInnerCodes(Project project, ERepositoryObjectType codesJarType,
Property jarProperty) throws PersistenceException;
public abstract List<IRepositoryViewObject> getAllInnerCodes(CodesJarInfo info) throws PersistenceException;
public abstract List<String> getFolders(ERepositoryObjectType type) throws PersistenceException;

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.repository.model;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
/**
@@ -20,4 +21,11 @@ import org.talend.core.IService;
public interface IProxyRepositoryService extends IService {
public IProxyRepositoryFactory getProxyRepositoryFactory();
public static IProxyRepositoryService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
return GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
}
return null;
}
}

View File

@@ -0,0 +1,57 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.repository.token;
import java.io.File;
import java.util.Properties;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.utils.time.PropertiesFileUtil;
/**
* DOC sbliu class global comment. Detailled comment
*/
public class RepositoryActionLogger {
private static String recordingFileName = "actions";
private static File recordingFile;
public static final String PREFIX_PERSPECITVE = "perspective.";
public static final String PREFIX_ACTION = "action.";
public static File getRecordingFile() {
if (recordingFile == null) {
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
recordingFile = new File(configurationLocation + "/data_collector/" + recordingFileName);
}
return recordingFile;
}
private static void log(String action) {
new Thread(() -> {
Properties props = PropertiesFileUtil.read(getRecordingFile(), false);
int count = Integer.parseInt(props.getProperty(action, "0"));
props.put(action, count + 1 + "");
PropertiesFileUtil.store(getRecordingFile(), props);
}).start();
}
public static void logPerspective(String perspective) {
log(PREFIX_PERSPECITVE + perspective);
}
public static void logAction(String action) {
log(PREFIX_ACTION + action);
}
}

View File

@@ -65,6 +65,7 @@ import org.talend.repository.model.IRepositoryNode.ENodeType;
import org.talend.repository.model.IRepositoryNode.EProperties;
import org.talend.repository.model.RepositoryConstants;
import org.talend.repository.model.RepositoryNode;
import org.talend.repository.token.RepositoryActionLogger;
import org.talend.repository.ui.views.IJobSettingsView;
import org.talend.repository.ui.views.IRepositoryView;
@@ -638,6 +639,7 @@ public abstract class AContextualAction extends Action implements ITreeContextua
@Override
public void run() {
String name = "User action : " + getText(); //$NON-NLS-1$
RepositoryActionLogger.logAction(getClass().getName());
oldItem = null;
// if (node == null) {

View File

@@ -30,6 +30,18 @@
id="org.talend.core.ui.token.PerformanceProvider"
name="performance">
</provider>
<provider
collector="org.talend.core.ui.token.RepositroyActionsTokenCollector"
description="collect DI/DQ actions/numbers of action done, also collect perspective switch"
id="org.talend.core.ui.token.RepositroyActionsTokenCollector"
name="actions">
</provider>
<provider
collector="org.talend.core.ui.token.AdditionalPackagesTokenCollector"
description="installed addtional package, old iems, amc"
id="org.talend.core.ui.token.AdditionalPackageTokenCollector"
name="addtional package">
</provider>
</extension>
<extension

View File

@@ -27,6 +27,7 @@ import org.talend.core.ui.component.ComponentPaletteUtilities;
import org.talend.core.ui.component.ComponentsFactoryProvider;
import org.talend.core.ui.services.IDesignerCoreUIService;
import org.talend.core.ui.services.IRulesProviderService;
import org.talend.core.ui.token.TokenCollectorFactory;
/**
* DOC ggu class global comment. Detailled comment
@@ -107,4 +108,9 @@ public class CoreUIService implements ICoreUIService {
designerCoreUIService.loadComponentsFromProviders(type);
}
}
@Override
public void resetDataCollectorData() {
TokenCollectorFactory.getFactory().reset();
}
}

View File

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

View File

@@ -31,8 +31,7 @@ public class TalendDataCollectorPreferenceInitializer extends AbstractPreference
public void initializeDefaultPreferences() {
IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD, 10);
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD, 5);
}
}

View File

@@ -0,0 +1,40 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.ui.token;
import org.talend.commons.utils.time.PropertiesCollectorUtil;
import us.monoid.json.JSONObject;
public class AdditionalPackagesTokenCollector extends AbstractTokenCollector {
public AdditionalPackagesTokenCollector() {
// TODO Auto-generated constructor stub
}
@Override
public JSONObject collect() throws Exception {
String records = PropertiesCollectorUtil.getAdditionalPackageRecording();
JSONObject allRecords;
try {
allRecords = new JSONObject(records);
} catch (Exception e) {
// the value is not set, or is empty
allRecords = new JSONObject();
allRecords.put(PropertiesCollectorUtil.getAdditionalPackagePreferenceNode(), new JSONObject());
}
return allRecords;
}
}

View File

@@ -34,4 +34,9 @@ public interface ITokenCollector {
* collect the values from different provider.
*/
public JSONObject collect() throws Exception;
/**
* reset cached collected data
*/
public default void reset() {}
}

View File

@@ -17,6 +17,7 @@ import java.util.Properties;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.utils.time.PerformanceStatisticUtil;
import org.talend.commons.utils.time.PerformanceStatisticUtil.StatisticKeys;
import org.talend.commons.utils.time.PropertiesFileUtil;
import oshi.SystemInfo;
import oshi.hardware.Baseboard;
@@ -60,7 +61,7 @@ public class PerformanceTokenCollector extends AbstractTokenCollector {
//
JSONObject jsonObjectIOInfo = new JSONObject();
Properties props = PerformanceStatisticUtil.read(PerformanceStatisticUtil.getRecordingFile(),false);
Properties props = PropertiesFileUtil.read(PerformanceStatisticUtil.getRecordingFile(),false);
jsonObjectIOInfo.put(StatisticKeys.STARTUP_AVERAGE.get(), props.getProperty(StatisticKeys.STARTUP_AVERAGE.get()));
jsonObjectIOInfo.put(StatisticKeys.STARTUP_MAX.get(), props.getProperty(StatisticKeys.STARTUP_MAX.get()));
jsonObjectIOInfo.put(StatisticKeys.IO_R_MB_SEC.get(), props.getProperty(StatisticKeys.IO_R_MB_SEC.get()));
@@ -79,5 +80,10 @@ public class PerformanceTokenCollector extends AbstractTokenCollector {
CommonExceptionHandler.log(e.getMessage());
}
}
@Override
public void reset() {
PerformanceStatisticUtil.reset();
}
}

View File

@@ -0,0 +1,52 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.ui.token;
import java.util.Map.Entry;
import java.util.Properties;
import org.talend.commons.utils.time.PropertiesFileUtil;
import org.talend.repository.token.RepositoryActionLogger;
import us.monoid.json.JSONObject;
/**
* DOC sbliu class global comment. Detailled comment
*/
public class RepositroyActionsTokenCollector extends AbstractTokenCollector {
@Override
public JSONObject collect() throws Exception {
JSONObject tokenStudioObject = new JSONObject();
//
JSONObject jsonObjectActionInfo = new JSONObject();
JSONObject jsonObjectPerspectiveInfo = new JSONObject();
Properties props = PropertiesFileUtil.read(RepositoryActionLogger.getRecordingFile(), false);
if(!props.isEmpty()) {
for(Entry<Object, Object> entry: props.entrySet()) {
String key = (String)entry.getKey();
if(key.startsWith(RepositoryActionLogger.PREFIX_ACTION)) {
key = key.substring(RepositoryActionLogger.PREFIX_ACTION.length());
jsonObjectActionInfo.put(key, entry.getValue());
} else if(key.startsWith(RepositoryActionLogger.PREFIX_PERSPECITVE)) {
key = key.substring(RepositoryActionLogger.PREFIX_PERSPECITVE.length());
jsonObjectPerspectiveInfo.put(key, entry.getValue());
}
}
}
tokenStudioObject.put("actions", jsonObjectActionInfo);
tokenStudioObject.put("perspectives", jsonObjectPerspectiveInfo);
return tokenStudioObject;
}
}

View File

@@ -28,6 +28,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.zip.GZIPOutputStream;
import org.apache.commons.lang3.StringUtils;
@@ -64,6 +65,7 @@ import org.talend.commons.utils.network.NetworkUtil;
import org.talend.commons.utils.network.TalendProxySelector;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.branding.IBrandingService;
@@ -110,7 +112,7 @@ public final class TokenCollectorFactory {
idWithPluginMap.put(id, pluginName);
} else {
log.log(Priority.WARN, "there is id: " + id + " to have been existed in plugin:" + idWithPluginMap.get(id) //$NON-NLS-1$ //$NON-NLS-2$
+ " current plugin is:" + pluginName + " will ignore this extension."); //$NON-NLS-1$ //$NON-NLS-2$
+ " (current plugin is:" + pluginName + "), will ignore this extension."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -126,7 +128,72 @@ public final class TokenCollectorFactory {
public TokenInforProvider[] getProviders() {
return providers.values().toArray(new TokenInforProvider[0]);
}
private final int magic_mainthreadStackTraceNum = 28;
private Thread monitorSendThread = new Thread(new Runnable() {
public void run() {
while (true) {
try {
long millis = 12 * 60 * 60 * 1000L;//check every half day
millis = Long.getLong("studio.token.send", millis);
if (dataCollectorEnabled()) {
if (isTimeToSend()) {//need send
if(studioInIdle()) {
//if free, send in background
send(true);
} else {
Thread.sleep(10000L);
continue;
}
}
}
Thread.sleep(millis);
} catch (InterruptedException e) {
ExceptionHandler.process(e);
} catch(Exception e) {
ExceptionHandler.process(e);
}
}
}
});
private boolean studioInIdle() {
ProxyRepositoryFactory repoFactory = ProxyRepositoryFactory.getInstance();
boolean repositoryBusy = repoFactory.isRepositoryBusy();
boolean threadIdle = false;
Map<Thread, StackTraceElement[]> allStackTraces = Thread.getAllStackTraces();
if (allStackTraces != null) {
Optional<Thread> mainThread = allStackTraces.keySet().stream()
.filter(t -> t.isAlive() && !t.isDaemon() && t.getName().equalsIgnoreCase("main")).findFirst();
if (mainThread.isPresent()) {
threadIdle = (magic_mainthreadStackTraceNum >= mainThread.get().getStackTrace().length);
}
}
return !repositoryBusy && threadIdle;
}
private boolean isTimeToSend() {
Date lastDate = lastSendDate();
final IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
int days = preferenceStore.getInt(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD);
Date curDate = new Date();
Date expectedSendDate = curDate;
if (days > 0 && lastDate != null) {
expectedSendDate = TokenInforUtil.getDateAfter(lastDate, days);
}
if (expectedSendDate.compareTo(curDate) < 0) {
return true;
}
return false;
}
public void monitor() {
monitorSendThread.start();
}
public void priorCollect() throws Exception {
if (isActiveAndValid(false)) { //
for (TokenInforProvider tip : getProviders()) {
@@ -162,31 +229,22 @@ public final class TokenCollectorFactory {
}
private boolean isActiveAndValid(boolean timeExpired) {
final IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
if (preferenceStore.getBoolean(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED)) {
String last = preferenceStore.getString(ITalendCorePrefConstants.DATA_COLLECTOR_LAST_TIME);
int days = preferenceStore.getInt(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD);
long syncNb = preferenceStore.getLong(DefaultTokenCollector.COLLECTOR_SYNC_NB);
if (syncNb < 15) {
days = 2;
}
Date lastDate = null;
if (last != null && !"".equals(last.trim())) { //$NON-NLS-1$
// parse the last date;
try {
lastDate = DATE_FORMAT.parse(last);
} catch (ParseException ee) {
//
}
}
Date curDate = new Date();
Date addedDate = curDate;
if (days > 0 && lastDate != null) {
addedDate = TokenInforUtil.getDateAfter(lastDate, days);
}
if (dataCollectorEnabled()) {
//
if (timeExpired) {
Date lastDate = lastSendDate();
final IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
int days = preferenceStore.getInt(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD);
long syncNb = preferenceStore.getLong(DefaultTokenCollector.COLLECTOR_SYNC_NB);
if (syncNb < 15) {
days = 2;
}
Date curDate = new Date();
Date addedDate = curDate;
if (days > 0 && lastDate != null) {
addedDate = TokenInforUtil.getDateAfter(lastDate, days);
}
if (addedDate.compareTo(curDate) <= 0) {
return true;
}
@@ -197,6 +255,26 @@ public final class TokenCollectorFactory {
return false;
}
private boolean dataCollectorEnabled() {
final IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
return preferenceStore.getBoolean(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED);
}
private Date lastSendDate() {
final IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
String last = preferenceStore.getString(ITalendCorePrefConstants.DATA_COLLECTOR_LAST_TIME);
Date lastDate = null;
if (last != null && !"".equals(last.trim())) { //$NON-NLS-1$
// parse the last date;
try {
lastDate = DATE_FORMAT.parse(last);
} catch (ParseException ee) {
//
}
}
return lastDate;
}
public boolean process() {
boolean result = false;
@@ -378,5 +456,18 @@ public final class TokenCollectorFactory {
}
}
}
public void reset() {
for (TokenInforProvider tip : getProviders()) {
ITokenCollector collector = tip.getCollector();
if (collector != null) {
try {
collector.reset();
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
}
}

View File

@@ -113,7 +113,7 @@
</appInfo>
<documentation>
Talend Community Edition&lt;br&gt;
Copyright (C) 2006-2019 Talend - www.talend.com
Copyright (C) 2006-2021 Talend - www.talend.com
</documentation>
</annotation>

View File

@@ -96,7 +96,7 @@
</appInfo>
<documentation>
Talend Community Edition&lt;br&gt;
Copyright (C) 2006-2019 Talend - www.talend.com
Copyright (C) 2006-2021 Talend - www.talend.com
</documentation>
</annotation>

View File

@@ -164,7 +164,7 @@
</appInfo>
<documentation>
Talend Community Edition&lt;br&gt;
Copyright (C) 2006-2019 Talend - www.talend.com
Copyright (C) 2006-2021 Talend - www.talend.com
</documentation>
</annotation>

View File

@@ -104,7 +104,7 @@
</appinfo>
<documentation>
Talend Community Edition&lt;br&gt;
Copyright (C) 2006-2019 Talend - www.talend.com
Copyright (C) 2006-2021 Talend - www.talend.com
</documentation>
</annotation>

View File

@@ -14,6 +14,7 @@ package org.talend.core.model.repository;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.IllegalPluginConfigurationException;
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
import org.talend.core.model.process.IExternalNode;
@@ -35,7 +36,8 @@ public class ExternalNodesFactory {
try {
listComponents = ExtensionImplementationProvider.getInstance(ExtensionPointFactory.EXTERNAL_COMPONENT, extensionId);
} catch (IllegalPluginConfigurationException e) {
throw new RuntimeException("plugin:" + extensionId + " not found", e); //$NON-NLS-1$ //$NON-NLS-2$
ExceptionHandler.process(new Exception("plugin:" + extensionId + " not found", e)); //$NON-NLS-1$ //$NON-NLS-2$
return null; //temporary
}
return listComponents.get(0);
}

View File

@@ -32,7 +32,6 @@ import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.i18n.Messages;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.model.properties.Item;
@@ -79,6 +78,9 @@ public class ContextOrderProperties extends Properties {
@Override
public Object put(Object key, Object value) {
keys.add(key);
if (value == null) {
return super.remove(key);
}
return super.put(key, value);
}

View File

@@ -19,9 +19,11 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.eclipse.core.resources.IFolder;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.CorePlugin;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.language.LanguageManager;
@@ -36,6 +38,7 @@ import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.routines.CodesJarInfo;
import org.talend.core.runtime.services.IDesignerMavenService;
import org.talend.core.ui.ITestContainerProviderService;
import org.talend.core.utils.CodesJarResourceCache;
@@ -151,9 +154,9 @@ public final class CodeGeneratorRoutine {
}
if (routinesParameterTypes != null) {
routinesParameterTypes.stream().filter(r -> r.getType() != null)
.map(r -> CodesJarResourceCache.getCodesJarById(r.getId())).filter(info -> info != null)
.forEach(info -> neededCodesJars.add(designerMavenService.getImportGAVPackageForCodesJar(
info.getProjectTechName(), info.getProperty().getItem())));
.map(r -> CodesJarResourceCache.getCodesJarById(r.getId()))
.filter(info -> info != null && hasInnerCodes(info))
.forEach(info -> neededCodesJars.add(designerMavenService.getImportGAVPackageForCodesJar(info)));
}
});
}
@@ -161,6 +164,18 @@ public final class CodeGeneratorRoutine {
return neededCodesJars;
}
private static boolean hasInnerCodes(CodesJarInfo info) {
try {
IFolder folder = ResourceUtils
.getProject(ProjectManager.getInstance().getProjectFromProjectTechLabel(info.getProjectTechName()))
.getFolder(ERepositoryObjectType.getFolderName(info.getType())).getFolder(info.getLabel());
return folder.exists() && folder.members().length > 0;
} catch (Exception e) {
ExceptionHandler.process(e);
}
return false;
}
/**
*
* Deprecate for won't use pigudf any more

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