Compare commits

...

48 Commits

Author SHA1 Message Date
bhe-talendbj
51f1f1ebd2 bugfix(TUP-28978): Add migration and make module name consistent (#3753)
* fix(TUP-28978): search local support other type and strip snapshot version

* fix(TUP-28978): Fix strip timestamp

* fix(TUP-2897): search remote dll, strip timestamp

* fix(TUP-28978): search local filtering timestamp

* fix(TUP-28978): Revert unnecessary changed files
2020-10-29 18:06:06 +08:00
Zhiwei Xue
e4f1b8a6fd fix(TUP-28846): Export Type Dropdown is empty when publishing Big Data (#3765)
Batch jobs job into Artifact Repository for Talend Studio 7.2 and 7.3
2020-10-28 10:21:38 +08:00
kjwang
fafa0e3086 Fix can't sync shared studio library in patch because the modify of (#3759)
TUP-27924
2020-10-28 10:13:46 +08:00
hzhao-talendbj
cf0477ac20 fix(TUP-26713): fix jar relations between mdm plugin and cxf (#3734)
* fix some issues in TUP-26713
and also code for tup-28971

* remove bundle version

* remove manifest and classpath
remove plugin.xml

* try remove plugin.xml

* remove build.properties

* move mdm to cxf

* remove mistake package name SoapBindingFactory

* add some package

* fix some no class def issues

* modify with nic

* new commit with nic

* not yet syc the jar version

* remove require bundle version

* remove wrong requre bundle

* remove dup classpath

* syc version

* lib/jakarta.annotation-api-1.3.5.jar,

* activation upgrade to 1.2.2
2020-10-26 10:25:56 +08:00
Jane Ding
d680891e66 fix(TUP-28952):TOS: NPE when delete items to recycle bin (#3737) (#3744)
https://jira.talendforge.org/browse/TUP-28952

Signed-off-by: jding-tlnd <jding@talend.com>
2020-10-20 11:13:50 +08:00
hcyi
6b682f21b6 fix(TUP-28943):Fail to generate stat&logs in teradata db. (#3733) 2020-10-20 10:18:30 +08:00
hcyi
4e26cc4131 fix(TUP-28983):Can't switch to another version on Impala connection (#3741) 2020-10-20 10:17:21 +08:00
bhe-talendbj
23016a2da5 feat(TUP-25246) Automatically detect custom maven URI for external dependencies (#3732)
* feat(TUP-25246): Automatically detect custom maven URI for external jars (#3636)

* feat(TUP-25246): Automatically detect custom maven URI for external dependencies

* feat(TUP-25246): add Jar detector

* feat(TUP-25246): fix NPE

* feat(TUP-25246): fix NPE

* feat(TUP-25246): refactor

* feat(TUP-25246): fix error selections

* feat(TUP-25246): set default value for custom uri

* feat(TUP-25246): call LibManagerUiPlugin.getDefault().getLibrariesService() to deploy jar

* feat(TUP-25246): fix customuri for tLibraryload

* feat(TUP-25246): autofill custom uri if detected

* feat(TUP-25246): autofill default uri if detected

* feat(TUP-25246): Update metadata driver jar

* feat(TUP-25246): hide remote search if no remote repositoris

* feat(TUP-28342):Save maven url for components with parameter MODULE_LIST

* feat(TUP-25246): Fix dialog and moduleNeed

* feat(TUP-25246): set error message if module was already installed

* feat(TUP-25246): remove error message if module is already installed

* feat(TUP-25246): Fix metadata driver path

* feat(TUP-25246): add check for copy

* feat(TUP-25246): Fix cConfig and UI

* feat(TUP-25246): TUP-28910

* feat(TUP-25246): fix retrieve jar

* feat(TUP-25246): add migration

* feat(TUP-25246): fix diaglog behavior

* feat(TUP-25246): Fix jar path inside context

* feat(TUP-25246): remove quotes for jar

* feat(): Fix config dialog and revert TalendLibsServerManager

* feat(TUP-25246): fix configdialog

* feat(TUP-25246): remove nl plugin

* feat(TUP-25246): fix resolve local jar

* feat(TUP-25246): fix resolve local jar

Co-authored-by: Zhiwei Xue <zwxue@talend.com>

Conflicts:
	main/plugins/org.talend.librariesmanager.ui/src/main/java/org/talend/librariesmanager/ui/dialogs/ConfigModuleDialog.java
	main/plugins/org.talend.metadata.managment/src/main/java/org/talend/core/model/metadata/builder/database/ExtractMetaDataUtils.java

* feat(TUP-25246): add NL

* feat(TUP-25246): resolve conflicts
2020-10-19 17:09:08 +08:00
bhe-talendbj
036ed3c6ca fix(TUP-28659): Update verson of crypto-utils (#3735) 2020-10-19 14:05:37 +08:00
Jane Ding
28cecad34c feat(TUP-28640):Improve JDBC database support framework to load (#3686) (#3717)
* feat(TUP-28640):Improve JDBC database support framework to load
supported DBs and components automatically
https://jira.talendforge.org/browse/TUP-28640

* feat(TUP-28640):Improve JDBC database support framework to load
supported DBs and components automatically
https://jira.talendforge.org/browse/TUP-28640
2020-10-19 09:30:12 +08:00
Jane Ding
955761f1a1 fix(TUP-28618):[Bug] db type dont show Delta in impact page. (#3676) (#3716)
https://jira.talendforge.org/browse/TUP-28618
2020-10-16 17:14:43 +08:00
bhe-talendbj
4672d438f0 fix(TUP-28659): Remove snapshot version of jars (#3664) (#3731) 2020-10-16 16:36:10 +08:00
sbliu
3099932e4c TUP-28944 Issue with performance tracking with french locale (#3722)
* TUP-28944 fix the number format problem introduced by different locale.

* TUP-28944 make format method suitable to test.

* TUP-28944 add unit test for format a number.

* TUP-28944 fix the unit test.
2020-10-16 10:44:39 +08:00
jiezhang-tlnd
10d41d2fde feat(TUP-28758)Add a warning when we login to a project and if there is (#3724)
(#3675)

* feat(TUP-28758)Add a warning when we login to a project and if there
is
migration to do

* feat(TUP-28758)Add a warning when we login to a project and if there
is
migration to do

* update warning info

* format code

* Add a warning when we login to a project and if there is migration to
do

* collect warnings in one dialog

* remove nexus warning dialog

* update login info

* adjust warning content

* adjust warning content

* adjust warning content

* remove useless cases

* add junits

* update method and junits

* modify the text

* get right monthly patch name

* modify project patch version name

* remove Talend word in warning message

Conflicts:
	main/plugins/org.talend.commons.runtime/src/org/talend/commons/utils/VersionUtils.java
	test/plugins/org.talend.commons.runtime.test/src/org/talend/commons/utils/VersionUtilsTest.java
2020-10-16 10:19:37 +08:00
sbliu
fb4fce2409 TUP-28564 Fix talend cloud website can't access problem. (#3708) 2020-10-16 09:07:04 +08:00
hzhao-talendbj
11f2a77064 code changes (#3725)
* code changes

* remove plugin.xml from build properties

* change to offcial mvn
2020-10-15 22:52:00 +08:00
Jane Ding
b97e1fc955 fix(TUP-28924):Export JDBC connection(which create by "Save the property (#3715)
to metadata" in component view) to context mode, throw many errors
https://jira.talendforge.org/browse/TUP-28924
2020-10-15 16:18:23 +08:00
msjian
3a33128bdd fix(TUP-27438): fix compiler error (#3720) 2020-10-14 18:18:45 +08:00
Chao MENG
1d1c0a9551 fix(TUP-28903): NPE exception when clicking on context (#3710)
https://jira.talendforge.org/browse/TUP-28903
2020-10-14 11:40:27 +08:00
kjwang
4b99767b6a Kjwang/feat tup 27762 new version of ci (#3656) (#3706)
* TUP-28274 Shared Studio: Can't find EMR 5.29 option in Hadoop Cluster
wizard after enable shared studio mode
https://jira.talendforge.org/browse/TUP-28274
2020-10-13 14:29:29 +08:00
chmyga
5a8ef4838a Dchmyga/tdi 44962 backport to master (#3704)
* Revert "fix(TDI-44826): Missing line in Resume log (#3640)" (#3691)

This reverts commit cf52e1e004.

Co-authored-by: Dmytro Chmyga <dmytro.chmyga@synapse.com>

* fix(TDI-44962): fix stream closed exception (#3692)

* Recreate FileWriter with append after writing header

* Add csv writer to shared writer map

Co-authored-by: Dmytro Chmyga <dmytro.chmyga@synapse.com>

Co-authored-by: Dmytro Chmyga <dmytro.chmyga@synapse.com>
2020-10-12 14:30:39 +03:00
jiezhang-tlnd
f815b15476 fix(TUP-28839)NPE when retrieve schema for JDBC connection of postgresql (#3700)
https://jira.talendforge.org/browse/TUP-28839
2020-10-12 16:47:33 +08:00
hzhao-talendbj
c362cc49a9 change to filter CI case (#3696) 2020-10-12 12:46:50 +08:00
hzhao-talendbj
ea8eedc571 remove some jars (#3630)
* remove some jars

* add commons-codec to lib when build studio

* add back httpcore and httpclient

* modify pom structure

* add fluent-hc to pom

* add common-cli

* add jar commons-cli-2.0-SANPSHOT back

* fix junit error

* add asm plugin into apache common

* add new pom,  add plugin.xml

* fix pom artifact id

* change relativePath to ../../

* add repositories/studio-auto-test-libs-releases/

* remove jars that can't be downloaded
2020-10-12 12:17:44 +08:00
Zhiwei Xue
3ee3097e32 fix(TUP-28656): Run restclient job get error 'Error: Could not find or (#3684)
load main class' when using jdk11
2020-10-12 10:28:58 +08:00
wang wei
470175ccf6 fix(TDI-44937): TalendDate.formatDateLocale()gives random value for FR country code in java 11.(#3679) 2020-10-12 10:15:12 +08:00
Chao MENG
93f4ff36ee fix(TUP-27076): Unable to connect to codecommit GIT after the first (#3672)
login.
https://jira.talendforge.org/browse/TUP-27076
2020-10-10 10:42:56 +08:00
jiezhang-tlnd
80273d36e1 feat(TUP-28811)update color for login page (#3699)
https://jira.talendforge.org/browse/TUP-28811
2020-10-10 10:12:29 +08:00
hzhao-talendbj
61493a76a4 remove exception log (#3687) 2020-10-09 11:10:38 +08:00
hzhao-talendbj
afb9b3ff0c tup-26713 (#3553)
* tup-26713

* add include groupids

* remove jars

* remove all jars and modify pom

* add extentions

* modify org.talendlibraries.mdm

* keep only three jars

* add new cxf pom

* remove pom

* add module

* add javax.ws.rs-api-2.0-m10

* try add javax.ws.rs-api to manifest and classpath

* try add to pom and copy during build

* modify plugin.xml

* try rename jar to javax.ws.rs-api-2.0-m10-6.0.0.jar

* add stripVersion , add cxf-core

* add back dependencies to pom but not in build properties

* change to copy-dependencies

* add to pom

* remove stripVersion because it will strip all jars version

* modify mistake cxf-rt-frontend-simple
2020-10-09 10:14:54 +08:00
hzhao-talendbj
56f428c944 tup 28319 remove jdbc plugins (#3563)
* tup 28319  remove jdbc plugins

* fix pom
2020-10-09 09:27:36 +08:00
vyu-talend
16fc19571c fix(TDI-44726):add some necessary annotation. (#3666) (#3682) 2020-09-27 16:14:50 +08:00
kjwang
a68463d184 Fix TUP-28603 'Export item' missing signature (#3643) (#3678)
* Fix TUP-28603 'Export item' missing signature
https://jira.talendforge.org/browse/TUP-28603
2020-09-27 15:34:29 +08:00
Jane Ding
d04f7db182 feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE (#3592) (#3667)
* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE (#3592)

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
https://jira.talendforge.org/browse/TUP-27654

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
https://jira.talendforge.org/browse/TUP-27654

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

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
https://jira.talendforge.org/browse/TUP-27654

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

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
TUP-28615:[Bug] Save the property to metadata will change Delta Lake to
JDBC.
https://jira.talendforge.org/browse/TUP-27654

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
https://jira.talendforge.org/browse/TUP-27654

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
https://jira.talendforge.org/browse/TUP-27654

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE
https://jira.talendforge.org/browse/TUP-27654

* feat(TUP-27654):Databricks Delta Lake - Support ELT & MERGE (#3670)

https://jira.talendforge.org/browse/TUP-27654
2020-09-24 09:12:47 +08:00
sbliu
dd201ac7fa feat(TUP-28434) fix the test failure. 2020-09-23 10:03:01 +08:00
bhe-talendbj
7ce1c256dd feat(TUP-28666): Extract TalendTextUtils (#3648)
* feat(TUP-28666): Extract TalendTextUtils

* feat(TUP-28666): call new TalendTextUtils

* feat(TUP-28666): fix removeQuotesIfExist

* feat(TUP-28666): rename TalendTextUtils
2020-09-22 21:32:23 +08:00
Jane Ding
199f4dde6e fix(TUP-28519):Update org.talend.libraries.apache.google jars (#3631)
remove org.talend.libraries.apache.google plugin
https://jira.talendforge.org/browse/TUP-28519
2020-09-22 15:10:56 +08:00
Zhiwei Xue
c029f53402 feat(TUP-28323):Improve the maven build time spent during login project (#3649) 2020-09-21 15:17:16 +08:00
Chao MENG
8aea05339a Cmeng/workitem/tup 28063 improve start (#3565)
* workitem(TUP-28063): Improve studio bundles reloading logic
https://jira.talendforge.org/browse/TUP-28063

* workitem(TUP-28063): Improve studio bundles reloading logic
https://jira.talendforge.org/browse/TUP-28063

* workitem(TUP-28063): Improve studio bundles reloading logic
https://jira.talendforge.org/browse/TUP-28063

* workitem(TUP-28063): Improve studio bundles reloading logic
https://jira.talendforge.org/browse/TUP-28063

* workitem(TUP-28063): Improve studio bundles reloading logic
https://jira.talendforge.org/browse/TUP-28063
2020-09-21 14:12:47 +08:00
wang wei
cf19586e10 fix(TDI-44745): FileInputDelimited fails to properly consume CipherInputStream(#3590) (#3661) 2020-09-18 15:10:03 +08:00
wang wei
c68419a4e2 fix(TDI-44623): [OBSERVABILITY] : add PID and (Thread-ID OR UUID) information (#3614) (#3662)
* fix(TDI-44623): [OBSERVABILITY] : add PID and (Thread-ID OR UUID)
information

* decrease the expensive call number for getting pid

* fix(TDI-44807): Observability: initialize moment only when necessary

* fix(TDI-44806): Observability: Add customization for event frequency
2020-09-18 15:06:44 +08:00
Chao MENG
819477f327 fix(TUP-26413): Be able to compare metadata connection conflicts (#3658)
https://jira.talendforge.org/browse/TUP-26413
2020-09-18 12:27:18 +08:00
hzhao-talendbj
eab0938fb0 update PSQL_V9_X to 42.2.14 (#3617) 2020-09-17 16:10:29 +08:00
hcyi
40da0e6196 feat(TUP-23827): Runtime Lineage (#3646)
* feat(TUP-23827):Runtime Lineage for studio.

* fix(TUP-28635):[bug] output path always be changed when path contains
2020-09-17 14:55:09 +08:00
sbliu
8264ddedf8 feature(TUP-28405) Collect hardware info. also add function to measure performance( IO speed, startup time), show them in preference..
performance data show in preference won't show unit.
2020-09-17 14:37:48 +08:00
Chao MENG
b76af1a75a fix(TUP-28682): Connection info missing when create dataset for tck (#3654)
components

https://jira.talendforge.org/browse/TUP-28682
2020-09-17 11:06:29 +08:00
hcyi
eecc3eff20 fix(TUP-27518):revert the code since get some error log . (#3650) 2020-09-16 18:33:34 +08:00
Haiting Yin
b8293db502 TMDM-12594 [Component] Legacy 5 version is no more supported (#3647) 2020-09-16 15:27:13 +08:00
299 changed files with 4580 additions and 2116 deletions

View File

@@ -111,6 +111,13 @@ ConfigModuleDialog.findExistByNameBtn=Find by name
ConfigModuleDialog.findExistByURIBtn=Find by Maven URI
ConfigModuleDialog.moduleName.error=Please input a valid file name.
ConfigModuleDialog.jarNotInstalled.error=This jar is not installed in the artifact repository, please install it !
ConfigModuleDialog.moduleName=Module Name
ConfigModuleDialog.shareInfo=The library can't be shared to remote artifact repository if the repository does not allow redeployment, continue to share ?
ConfigModuleDialog.searchLocalBtn=Search Local
ConfigModuleDialog.searchRemoteBtn=Search Remote
ConfigModuleDialog.error.missingName=Please input a module name!
ConfigModuleDialog.error.missingModule=Please select a module!
ConfigModuleDialog.search.noModules=No modules found for search of: {0} !
ImportCustomSettingsAction.title=Import custom settings
ImportCustomSettingsAction.warning=Are you sure to overwrite the custom mvn uri settings with the selected file ?
ExportCustomSettingsAction.title=Export custom settings

View File

@@ -4,14 +4,7 @@
<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>
<plugin id="org.talend.libraries.jdbc.access" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.as400" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.exasol" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.h2" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.hsql" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.ingres" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.mysql" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.paraccel" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.sqlite3" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.libraries.jdbc.teradata" download-size="0" install-size="0" version="0.0.0"/>
</feature>

View File

@@ -24,11 +24,11 @@ public interface ColorConstants {
static final Color GREY_COLOR = new Color(null, 215, 215, 215);
static final Color YELLOW_GREEN_COLOR = new Color(null, 138, 188, 0);// 143, 163, 35
static final Color YELLOW_GREEN_COLOR = new Color(null, 88,153,24);// 143, 163, 35
static final Color YELLOW_COLOR = new Color(null, 255, 173, 37);// 254, 182, 84
static final Color RED_COLOR = new Color(null, new RGB(240, 0, 0));// 255
static final Color RED_COLOR = new Color(null, new RGB(204,87,89));// 255
static final Color VERTICAL_SEPERATOR_LINE_COLOR = new Color(null, 162, 179, 195);

View File

@@ -16,7 +16,8 @@ Require-Bundle: org.apache.log4j;visibility:=reexport,
org.talend.utils,
org.eclipse.core.net,
org.eclipse.m2e.core,
org.eclipse.m2e.maven.runtime
org.eclipse.m2e.maven.runtime,
org.eclipse.core.resources
Export-Package: org.talend.commons,
org.talend.commons.exception,
org.talend.commons.i18n,
@@ -53,7 +54,6 @@ Export-Package: org.talend.commons,
org.talend.commons.utils.scalability,
org.talend.commons.utils.system,
org.talend.commons.utils.threading,
org.talend.commons.utils.threading.lockerbykey,
org.talend.commons.utils.time,
org.talend.commons.utils.tracer,
org.talend.commons.utils.workbench.extensions,

View File

@@ -242,6 +242,28 @@ public class VersionUtils {
if (localProductVersion == null) {
localProductVersion = getInternalVersion();
}
if (skipCheckingNightlyBuilds(localProductVersion, remoteFullProductVersion)) {
return false;
}
return localProductVersion.compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) < 0;
}
public static boolean productVersionIsNewer(String remoteFullProductVersion) {
String localProductVersion = getInternalVersion();
return productVersionIsNewer(localProductVersion, remoteFullProductVersion);
}
protected static boolean productVersionIsNewer(String localProductVersion, String remoteFullProductVersion) {
if (remoteFullProductVersion == null) {
return false;
}
if (skipCheckingNightlyBuilds(localProductVersion, remoteFullProductVersion)) {
return false;
}
return localProductVersion.compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) > 0;
}
private static boolean skipCheckingNightlyBuilds(String localProductVersion, String remoteFullProductVersion) {
String separator = "-"; //$NON-NLS-1$
String localSuffix = StringUtils.substringAfterLast(localProductVersion, separator);
@@ -253,10 +275,9 @@ public class VersionUtils {
if ((localSuffix.equals(nightly) || localSuffix.startsWith(milestone))
&& (remoteSuffix.equals(nightly) || remoteSuffix.startsWith(milestone))) {
// skip checking between nightly/milestone build.
return false;
return true;
}
return localProductVersion.compareTo(remoteProductVersion) < 0;
return false;
}
public static String getTalendVersion(String productVersion) {
@@ -331,4 +352,24 @@ public class VersionUtils {
}
}
public static String getSimplifiedPatchName(String projectPatchName) {
if (projectPatchName != null) {
String result = null;
if (projectPatchName.contains("_") && projectPatchName.split("_").length >= 3) {
result = projectPatchName.split("_")[2];
if (!result.startsWith("R")) {
return null;
}
}
if (projectPatchName.contains("-")) {
String[] split = projectPatchName.split("-");
if (split != null && split.length > 0) {
return result + "-" + split[split.length - 1];
}
}
}
return null;
}
}

View File

@@ -150,6 +150,28 @@ public class NetworkUtil {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
String httpProxyHost = System.getProperty("http.proxyHost"); //$NON-NLS-1$
String httpProxyPort = System.getProperty("http.proxyPort"); //$NON-NLS-1$
String httpsProxyHost = System.getProperty("https.proxyHost"); //$NON-NLS-1$
String httpsProxyPort = System.getProperty("https.proxyPort"); //$NON-NLS-1$
String requestingHost = getRequestingHost();
int requestingPort = getRequestingPort();
String proxyHost = null;
String proxyPort = null;
boolean isHttp = false;
if ("http".equalsIgnoreCase(getRequestingScheme())) {
isHttp = true;
}
if (isHttp && StringUtils.isNotBlank(httpProxyHost)) {
proxyHost = httpProxyHost;
proxyPort = httpProxyPort;
} else {
proxyHost = httpsProxyHost;
proxyPort = httpsProxyPort;
}
if (!StringUtils.equals(proxyHost, requestingHost) || !StringUtils.equals(proxyPort, "" + requestingPort)) {
return null;
}
String httpProxyUser = System.getProperty("http.proxyUser"); //$NON-NLS-1$
String httpProxyPassword = System.getProperty("http.proxyPassword"); //$NON-NLS-1$
String httpsProxyUser = System.getProperty("https.proxyUser"); //$NON-NLS-1$
@@ -167,7 +189,11 @@ public class NetworkUtil {
proxyPassword = httpsProxyPassword.toCharArray();
}
}
return new PasswordAuthentication(proxyUser, proxyPassword);
if (StringUtils.isBlank(proxyUser)) {
return null;
} else {
return new PasswordAuthentication(proxyUser, proxyPassword);
}
}
});

View File

@@ -49,11 +49,17 @@ public class EclipseCommandLine {
*/
static public final String TALEND_PROJECT_TYPE_COMMAND = "-talendProjectType"; //$NON-NLS-1$
static public final String TALEND_LICENCE_PATH = "talend.licence.path"; //$NON-NLS-1$
static public final String ARG_TALEND_LICENCE_PATH = "-" + TALEND_LICENCE_PATH; //$NON-NLS-1$
/**
* for relaunch of the plugins when relaunching the Studio
*/
static public final String TALEND_RELOAD_COMMAND = "-talendReload"; //$NON-NLS-1$
static public final String LOGIN_ONLINE_UPDATE = "--loginOnlineUpdate";
static public final String ARG_TALEND_BUNDLES_CLEANED = "-talend.studio.bundles.cleaned"; //$NON-NLS-1$
static public final String PROP_TALEND_BUNDLES_DO_CLEAN = "-talend.studio.bundles.doclean"; //$NON-NLS-1$

View File

@@ -0,0 +1,371 @@
// ============================================================================
//
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.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.util.Properties;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.CommonExceptionHandler;
/**
* DOC sbliu class global comment. Detailled comment
*/
public class PerformanceStatisticUtil {
private static final int MEGABYTE = 1024 * 1024;// MB = 1024*1024 byte
private static final int KILOBYTE = 1024;// kb=1024 byte
private static final int numOfBlocks = 256;
private static final int blockSizeKb = 512;
private static final String dataFile = "testio.data";
private static String recordingFileName = "performance_record";
private static File recordingFile = null;
private static enum BlockSequence {
SEQUENTIAL,
RANDOM;
}
public static enum StatisticKeys {
IO_COUNT("I/O.count"), // io count
IO_W_MB_SEC("I/O.write"), // write speed MB
IO_R_MB_SEC("I/O.read"), // read speed MB
IO_W_AVERAGE_MB_SEC("I/O.write.average"), // average speed of write MB
IO_R_AVERAGE_MB_SEC("I/O.read.average"), // average speed of read
STARTUP_AVERAGE("startup.average"),
STARTUP_MAX("startup.max"),
STARTUP_COUNT("startup.count");
private String key;
StatisticKeys(String _key) {
key = _key;
}
public String get() {
return key;
}
}
public static void recordStartupEpapsedTime(double elapsedTimeInSeconds) {
File file = getRecordingFile();
Properties props = 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");
int iPropCount = Integer.parseInt(propCount);
double iPropMax = Double.parseDouble(propMax);
double iPropAverage = Double.parseDouble(propAverage);
iPropMax = iPropMax > elapsedTimeInSeconds ? iPropMax : elapsedTimeInSeconds;
iPropAverage = (iPropAverage * iPropCount + elapsedTimeInSeconds) / (iPropCount + 1);
iPropCount++;
props.setProperty(StatisticKeys.STARTUP_COUNT.get(), "" + iPropCount);
props.setProperty(StatisticKeys.STARTUP_MAX.get(), "" + iPropMax);
props.setProperty(StatisticKeys.STARTUP_AVERAGE.get(), "" + iPropAverage);
store(file, props);
}
public static File getRecordingFile() {
if (recordingFile != null) {
return recordingFile;
}
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
File file = new File(configurationLocation + "/" + recordingFileName);
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) {//
}
}
}
}
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();
private static Condition condition = lock.newCondition();
private static boolean measureIOFinished = true;
public static void waitUntilFinish() throws InterruptedException {
lock.lock();
try {
if(!measureIOFinished) {
condition.await(20, TimeUnit.SECONDS);
}
} finally {
lock.unlock();
}
}
public static void measureIO() {
new Thread() {
public void run() {
measureIOFinished = false;
try {
_measureIO();
} finally {
measureIOFinished = true;
}
}
}.start();
}
private static void _measureIO() {
File file = getRecordingFile();
Properties props = read(file, true);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
File workspace = root.getLocation().makeAbsolute().toFile();
File locationDir = new File(workspace, "temp"); // here is workspace/temp dir
File testFile = detectTestDataFile(locationDir);
if (testFile != null) {
measureWrite(props, testFile);
measureRead(props, testFile);
store(file, props);
}
}
private static void measureWrite(Properties props, File testFile) {
int blockSize = blockSizeKb * KILOBYTE;
long startTime = System.nanoTime();
long totalBytesWrittenInMark = writeIO(numOfBlocks, BlockSequence.RANDOM, blockSize, testFile);
totalBytesWrittenInMark = totalBytesWrittenInMark + writeIO(numOfBlocks, BlockSequence.SEQUENTIAL, blockSize, testFile);
long endTime = System.nanoTime();
long elapsedTimeNs = endTime - startTime;
double sec = (double) elapsedTimeNs / (double) 1000000000;
double mbWritten = (double) totalBytesWrittenInMark / (double) MEGABYTE;
double bwMbSec = mbWritten / sec;
String ioCount = props.getProperty(StatisticKeys.IO_COUNT.get(), "0");
String ioWAverageMbSec = props.getProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), "0");
String ioWMbSec = props.getProperty(StatisticKeys.IO_W_MB_SEC.get(), "0");
int digital_ioCount = Integer.parseInt(ioCount);
double digital_ioWAverageMbSec = Double.parseDouble(ioWAverageMbSec);
double digital_ioWMbSec = Double.parseDouble(ioWMbSec);
digital_ioWAverageMbSec = (digital_ioWAverageMbSec * digital_ioCount + bwMbSec) / (digital_ioCount + 1);
digital_ioWMbSec = bwMbSec;
props.setProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), format(digital_ioWAverageMbSec));
props.setProperty(StatisticKeys.IO_W_MB_SEC.get(), format(digital_ioWMbSec));
}
private static long writeIO(int numOfBlocks, BlockSequence blockSequence, int blockSize, File testFile) {
byte[] blockArr = new byte[blockSize];
for (int b = 0; b < blockArr.length; b++) {
if (b % 2 == 0) {
blockArr[b] = (byte) 0xFF;
}
}
String mode = "rwd";// "rwd"
long totalBytesWrittenInMark = 0;
try {
try (RandomAccessFile rAccFile = new RandomAccessFile(testFile, mode)) {
for (int b = 0; b < numOfBlocks; b++) {
if (blockSequence == BlockSequence.RANDOM) {
int rLoc = randInt(0, numOfBlocks - 1);
rAccFile.seek(rLoc * blockSize);
} else {
rAccFile.seek(b * blockSize);
}
rAccFile.write(blockArr, 0, blockSize);
totalBytesWrittenInMark += blockSize;
}
}
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
}
return totalBytesWrittenInMark;
}
private static File detectTestDataFile(File location) {
if (!location.exists()) {
location.mkdirs();
}
File testFile = null;
try {
testFile = new File(location.getAbsolutePath() + File.separator + dataFile);
testFile.deleteOnExit();
testFile.createNewFile();
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
}
return testFile;
}
public static void measureRead(Properties props, File testFile) {
int blockSize = blockSizeKb * KILOBYTE;
long startTime = System.nanoTime();
long totalBytesReadInMark = readIO(numOfBlocks, BlockSequence.RANDOM, blockSize, testFile);
totalBytesReadInMark = totalBytesReadInMark + readIO(numOfBlocks, BlockSequence.SEQUENTIAL, blockSize, testFile);
long endTime = System.nanoTime();
long elapsedTimeNs = endTime - startTime;
double sec = (double) elapsedTimeNs / (double) 1000000000;
double mbRead = (double) totalBytesReadInMark / (double) MEGABYTE;
double bwMbSec = mbRead / sec;
String ioCount = props.getProperty(StatisticKeys.IO_COUNT.get(), "0");
String ioRAverageMbSec = props.getProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), "0");
String ioRMbSec = props.getProperty(StatisticKeys.IO_R_MB_SEC.get(), "0");
int digital_ioCount = Integer.parseInt(ioCount);
double digital_ioRAverageMbSec = Double.parseDouble(ioRAverageMbSec);
double digital_ioRMbSec = Double.parseDouble(ioRMbSec);
digital_ioRAverageMbSec = (digital_ioRAverageMbSec * digital_ioCount + bwMbSec) / (digital_ioCount + 1);
digital_ioRMbSec = bwMbSec;
digital_ioCount++;
props.setProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), format(digital_ioRAverageMbSec));
props.setProperty(StatisticKeys.IO_R_MB_SEC.get(), format(digital_ioRMbSec));
props.setProperty(StatisticKeys.IO_COUNT.get(), "" + digital_ioCount);
}
public static String format(double dvalue) {
return BigDecimal.valueOf(dvalue).setScale(2, RoundingMode.HALF_UP).toString();
}
private static long readIO(int numOfBlocks, BlockSequence blockSequence, int blockSize, File testFile) {
long totalBytesReadInMark = 0;
byte[] blockArr = new byte[blockSize];
for (int b = 0; b < blockArr.length; b++) {
if (b % 2 == 0) {
blockArr[b] = (byte) 0xFF;
}
}
try {
try (RandomAccessFile rAccFile = new RandomAccessFile(testFile, "r")) {
for (int b = 0; b < numOfBlocks; b++) {
if (blockSequence == BlockSequence.RANDOM) {
int rLoc = randInt(0, numOfBlocks - 1);
rAccFile.seek(rLoc * blockSize);
} else {
rAccFile.seek(b * blockSize);
}
rAccFile.readFully(blockArr, 0, blockSize);
totalBytesReadInMark += blockSize;
}
}
} catch (IOException e) {
CommonExceptionHandler.log(e.getMessage());
}
return totalBytesReadInMark;
}
private static int randInt(int min, int max) {
// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
int randomNum = new Random().nextInt((max - min) + 1) + min;
return randomNum;
}
}

View File

@@ -23,10 +23,14 @@ public class TimeMeasurePerformance extends TimeMeasure{
static private Logger logger;
private static HashMap<String, TimeStack> timers;
private static long startTime = -1L;
private static int indent = 0;
public static void begin(String idTimer) {
startTime = System.nanoTime();
init();
if (timers.containsKey(idTimer)) {
log(indent(indent) + "Warning (start): timer " + idTimer + " already exists"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -103,4 +107,10 @@ public class TimeMeasurePerformance extends TimeMeasure{
throw new RuntimeException("Error while initializing log properties.", e);
}
}
public static void afterStartup() {
double elapsedTimeInSeconds = (double)(System.nanoTime() - startTime)/1000000000;
PerformanceStatisticUtil.recordStartupEpapsedTime(elapsedTimeInSeconds);
PerformanceStatisticUtil.measureIO();
}
}

View File

@@ -838,7 +838,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
if (serializableAllVersion.isEmpty()) {
// look in all folders for this item type
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true, true);
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
}
int size = serializableAllVersion.size();

View File

@@ -132,6 +132,7 @@ import org.talend.core.repository.utils.RepositoryPathProvider;
import org.talend.core.repository.utils.XmiResourceManager;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.core.runtime.services.IGenericWizardService;
import org.talend.core.runtime.services.IMavenUIService;
import org.talend.core.runtime.util.ItemDateParser;
import org.talend.core.service.ICoreUIService;
@@ -2139,6 +2140,14 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ProjectDataJsonProvider.checkAndRectifyRelationShipSetting(project.getEmfProject());
// load additional jdbc
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
IGenericWizardService service = GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
if (service != null) {
service.loadAdditionalJDBC();
}
}
// init dynamic distirbution after `beforeLogon`, before loading libraries.
initDynamicDistribution(monitor);
@@ -2281,6 +2290,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
// set the project mappings url
System.setProperty("talend.mappings.url", url.toString()); // $NON-NLS-1$
}
// for new added mapping file, sync to project mapping folder
MetadataTalendType.syncNewMappingFileToProject();
} catch (SystemException e) {
// ignore
ExceptionHandler.process(e);

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<mapping>
<dbms product="DATABRICKS_DELTA_LAKE" id="databricks_delta_lake_id" label="Mapping Databricks Delta Lake" default="true">
<dbms product="DATABRICKS_DELTA_LAKE" id="databricks_delta_lake_id" label="Mapping Delta Lake" default="true">
<dbTypes>
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
<dbType type="FLOAT" ignoreLen="true" ignorePre="true"/>

View File

@@ -130,7 +130,7 @@ public class DatabaseConnStrUtil {
s = getStringReplace(s, EDatabaseConnVar.PORT.getVariable(), port, supportContext);
}
if (EDatabaseConnTemplate.TERADATA.equals(connStr)) {
if (StringUtils.isNotBlank(sid)) {
if (StringUtils.isNotBlank(TalendQuoteUtils.removeQuotesIfExist(sid))) {
s = getStringReplace(s, EDatabaseConnVar.SID.getVariable(), DATABASE_STRING + sid, supportContext);
} else {
s = getStringReplace(s, EDatabaseConnVar.SID.getVariable() + ",", sid, supportContext); //$NON-NLS-1$

View File

@@ -23,6 +23,7 @@ import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.runtime.services.IGenericDBService;
import org.talend.core.runtime.services.IGenericWizardService;
/**
* cli class global comment. Detailled comment
@@ -326,6 +327,16 @@ public enum EDatabaseConnTemplate {
databaseType.add(typeName);
}
}
// add additional jdbc (actually JDBC RepositoryObjectType)
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
IGenericWizardService service = GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
if (service != null) {
List<String> allAdditionalJDBCTypes = service.getAllAdditionalJDBCTypes();
if (!allAdditionalJDBCTypes.isEmpty()) {
databaseType.addAll(allAdditionalJDBCTypes);
}
}
}
if (sort) {
String[] sortedArray = databaseType.toArray(new String[0]);
Arrays.sort(sortedArray, new Comparator<String>() {

View File

@@ -102,7 +102,7 @@ public enum EDatabaseVersion4Drivers {
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM, "postgresql-8.4-703.jdbc4.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.9.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
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$
PLUSPSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL,

View File

@@ -28,6 +28,7 @@ import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.utils.TalendQuoteUtils;
/**
* This bean is use to manage needed moduless (perl) and libraries (java).<br/>
@@ -110,6 +111,15 @@ public class ModuleNeeded {
}
public static ModuleNeeded newInstance(String context, String value, String informationMsg, boolean required) {
String val = TalendQuoteUtils.removeQuotesIfExist(value);
if (val.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
return new ModuleNeeded(context, informationMsg, required, val);
}
// won't do migration for old MODULE_LIST but still make it compatible
return new ModuleNeeded(context, val, informationMsg, required);
}
/**
* DOC smallet ModuleNeeded constructor comment.
*

View File

@@ -13,6 +13,7 @@
package org.talend.core.model.metadata;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
@@ -31,8 +32,11 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -488,6 +492,42 @@ public final class MetadataTalendType {
}
}
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) {
return;
}
for (File sysMapping : sysMappingFiles.listFiles()) {
IFile projectMapping = projectMappingFolder.getFile(sysMapping.getName());
if (!projectMapping.exists()) {
FileInputStream fis = null;
try {
fis = new FileInputStream(sysMapping);
projectMapping.create(fis, true, null);
} catch (CoreException coreExc) {
throw new SystemException(coreExc);
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException ioExc) {
throw new SystemException(ioExc);
}
}
}
}
}
} catch (Exception e) {
throw new SystemException(e);
}
}
/**
*
* Load db types and mapping with the current activated language (Java, Perl, ...).

View File

@@ -18,6 +18,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
@@ -30,6 +31,7 @@ import org.talend.core.database.conn.ConnParameterKeys;
import org.talend.core.database.conn.DatabaseConnStrUtil;
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
import org.talend.core.model.components.EComponentType;
import org.talend.core.model.metadata.Dbms;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.MetadataTalendType;
import org.talend.core.model.metadata.builder.ConvertionHelper;
@@ -71,6 +73,7 @@ import org.talend.core.model.utils.ContextParameterUtils;
import org.talend.core.model.utils.IDragAndDropServiceHandler;
import org.talend.core.runtime.i18n.Messages;
import org.talend.core.runtime.services.IGenericDBService;
import org.talend.core.runtime.services.IGenericWizardService;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.cwm.helper.ConnectionHelper;
import org.talend.cwm.helper.PackageHelper;
@@ -153,6 +156,17 @@ public class ComponentToRepositoryProperty {
conn.setDbmsId(mapping);
}
}
// set default mapping for additional jdbc
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
IGenericWizardService service = GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
if (service != null) {
Dbms dbms4AdditionalJDBC = service.getDbms4AdditionalJDBC(conn.getProductId());
if (dbms4AdditionalJDBC != null) {
conn.setDbmsId(dbms4AdditionalJDBC.getId());
}
}
}
}
for (IElementParameter param : node.getElementParameters()) {
String repositoryValue = param.getRepositoryValue();
@@ -366,6 +380,20 @@ public class ComponentToRepositoryProperty {
if (para.getRepositoryValue().endsWith(EDatabaseTypeName.GENERAL_JDBC.getProduct())) {
connection.setDatabaseType(EDatabaseTypeName.GENERAL_JDBC.getProduct());
connection.setProductId(EDatabaseTypeName.GENERAL_JDBC.getProduct());
// additional JDBC e.g. Delta Lake
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
IGenericWizardService service = GlobalServiceRegister.getDefault()
.getService(IGenericWizardService.class);
if (service != null) {
String database = service.getDatabseNameByNode(node);
if (StringUtils.isNotBlank(database) && service.getIfAdditionalJDBCDBType(database)) {
connection.setProductId(database);
}
}
}
}
// vertica output component have no TYPE ElementParameter .
if (para.getRepositoryValue().endsWith(EDatabaseTypeName.VERTICA.getProduct())) {

View File

@@ -813,13 +813,7 @@ public class RepositoryToComponentProperty {
* @return
*/
private static Object getMDMValue(MDMConnection connection, String value, IMetadataTable table) {
if ("MDM_VERSION".equals(value)) {//$NON-NLS-1$
if (connection.getVersion() == null || "".equals(connection.getVersion())) {
return MDMVersions.MDM_S56.getKey();
} else {
return connection.getVersion();
}
} else if ("MDMURL".equals(value)) { //$NON-NLS-1$
if ("MDMURL".equals(value)) { //$NON-NLS-1$
if (isContextMode(connection, connection.getServerUrl())) {
return connection.getServerUrl();
} else {

View File

@@ -1419,12 +1419,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
return null;
}
public static List<ERepositoryObjectType> getAllTypesOfProcess() {
public static List<ERepositoryObjectType> getAllTypesOfBigDataProcess() {
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
if (ERepositoryObjectType.PROCESS != null) {
allTypes.add(ERepositoryObjectType.PROCESS);
}
if (ERepositoryObjectType.PROCESS_MR != null) {
allTypes.add(ERepositoryObjectType.PROCESS_MR);
}
@@ -1437,6 +1433,17 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
if (ERepositoryObjectType.PROCESS_SPARKSTREAMING != null) {
allTypes.add(ERepositoryObjectType.PROCESS_SPARKSTREAMING);
}
return allTypes;
}
public static List<ERepositoryObjectType> getAllTypesOfProcess() {
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
allTypes.addAll(getAllTypesOfBigDataProcess());
if (ERepositoryObjectType.PROCESS != null) {
allTypes.add(ERepositoryObjectType.PROCESS);
}
if (ERepositoryObjectType.PROCESS_ROUTE != null) {
allTypes.add(ERepositoryObjectType.PROCESS_ROUTE);
}

View File

@@ -46,7 +46,11 @@ import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.INodeConnector;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Property;
import org.talend.core.runtime.IAdditionalInfo;
import org.talend.core.runtime.projectsetting.RuntimeLineageManager;
import org.talend.designer.core.ICamelDesignerCoreService;
/**
@@ -866,6 +870,170 @@ public class NodeUtil {
}
throw new IllegalArgumentException();
}
public static String getRuntimeParameterValue(INode node, IElementParameter ep) {
if (EParameterFieldType.TABLE.equals(ep.getFieldType())) {
Map<String, IElementParameter> types = new HashMap<String, IElementParameter>();
Object[] itemsValue = ep.getListItemsValue();
if (itemsValue != null) {
for (Object o : itemsValue) {
IElementParameter cep = (IElementParameter) o;
if (cep.isShow(node.getElementParameters())) {
types.put(cep.getName(), cep);
}
}
}
List<Map<String, String>> lines = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node,
"__" + ep.getName() + "__");
StringBuilder value = new StringBuilder();
// implement List & Map toString(), different is the value of Map
Iterator<Map<String, String>> linesIter = lines.iterator();
if (!linesIter.hasNext()) {
return "\"[]\"";
}
value.append("new StringBuilder().append(\"[");
for (;;) {
Map<String, String> columns = linesIter.next();
Iterator<Entry<String, String>> columnsIter = columns.entrySet().iterator();
value.append("{");
Entry<String, String> column = null;
boolean printedColumnExist = false;
while (columnsIter.hasNext()) {
column = columnsIter.next();
if (types.get(column.getKey()) == null) {
continue;
}
printedColumnExist = true;
value.append(column.getKey());
value.append("=\").append(");
value.append(getRuntimeParameterValue(column.getValue(), types.get(column.getKey()), true));
value.append(").append(\"");
if (columnsIter.hasNext()) {
value.append(", ");
}
}
if (printedColumnExist && column != null && (types.get(column.getKey()) == null)) {
value.setLength(value.length() - 2);
}
value.append("}");
if (!linesIter.hasNext()) {
return value.append("]\").toString()").toString();
}
value.append(",").append(" ");
}
} else {
String value = ElementParameterParser.getValue(node, "__" + ep.getName() + "__");
if (EParameterFieldType.TABLE_BY_ROW.equals(ep.getFieldType())) {
value = ep.getValue().toString();
}
return getRuntimeParameterValue(value, ep, false);
}
}
private static String getRuntimeParameterValue(String value, IElementParameter ep, boolean itemFromTable) {
if (value == null) {
value = "";
}
value = value.trim();
boolean isMemo = false;
List<EParameterFieldType> needRemoveCRLFList = Arrays.asList(EParameterFieldType.MEMO, EParameterFieldType.MEMO_JAVA,
EParameterFieldType.MEMO_SQL, EParameterFieldType.MEMO_IMPORT, EParameterFieldType.MEMO_MESSAGE);
if (needRemoveCRLFList.contains(ep.getFieldType())) {
isMemo = true;
value = value.replaceAll("[\r\n]", " ");
}
List<EParameterFieldType> needQuoteList = Arrays.asList(EParameterFieldType.CLOSED_LIST,
EParameterFieldType.COMPONENT_LIST, EParameterFieldType.COLUMN_LIST, EParameterFieldType.PREV_COLUMN_LIST,
EParameterFieldType.CONNECTION_LIST, EParameterFieldType.LOOKUP_COLUMN_LIST,
EParameterFieldType.CONTEXT_PARAM_NAME_LIST, EParameterFieldType.PROCESS_TYPE, EParameterFieldType.COLOR,
EParameterFieldType.TABLE_BY_ROW, EParameterFieldType.HADOOP_JARS_DIALOG, EParameterFieldType.UNIFIED_COMPONENTS);
List<EParameterFieldType> needQuoteListForItem = itemFromTable ? Arrays.asList(EParameterFieldType.SCHEMA_TYPE,
EParameterFieldType.SAP_SCHEMA_TYPE, EParameterFieldType.MODULE_LIST) : new ArrayList<EParameterFieldType>();
// TODO: add RAW attribute when SCHEMA_COLUMN generated by BASED_ON_SCHEMA
List<String> needQuoteListByName = Arrays.asList("SCHEMA_COLUMN");// SCHEMA_COLUMN for BASED_ON_SCHEMA="true"
if (needQuoteList.contains(ep.getFieldType()) || needQuoteListForItem.contains(ep.getFieldType())
|| needQuoteListByName.contains(ep.getName()) || ep.isRaw()) {
value = value.replaceAll("\\\\", "\\\\\\\\");
value = value.replaceAll("\\\"", "\\\\\\\"");
return "\"" + value + "\"";
}
if (itemFromTable) {
if ("*".equals(value)) {
return "\"" + value + "\"";
}
if (value.endsWith(";")) {
value = value.substring(0, value.length() - 1);
}
}
if("".equals(value) || "\"\"".equals(value)) {
return "\"\"";
} else if("null".equals(value)) {
return "(Object)null";
}
// copied it from Log4jFileUtil.javajet but need more comment for this script
if ("\"\\n\"".equals(value) || "\"\\r\"".equals(value) || "\"\\r\\n\"".equals(value)) {
// for the value is "\n" "\r" "\r\n"
return value.replaceAll("\\\\", "\\\\\\\\");
} else if ("\"\"\"".equals(value)) {
return "\"" + "\\" + "\"" + "\"";
} else if ("\"\"\\r\\n\"\"".equals(value)) {
return "\"\\\\r\\\\n\"";
} else if ("\"\"\\r\"\"".equals(value)) {
return "\"\\\\r\"";
} else if ("\"\"\\n\"\"".equals(value)) {
return "\"\\\\n\"";
}
// ftom 20141008 - patch to fix javajet compilation errors due to hard-coded studio TableEditor mechanism
// linked to BUILDIN properties checks, this item is a boolean set to TRUE or FALSE
// fix is just transforming into true or false to make logging OK
else if ("BUILDIN".equals(ep.getName())) {
return value.toLowerCase();
}
//suppose all memo fields are processed well already, no need to go though this with dangerous
if (!isMemo && !org.talend.core.model.utils.ContextParameterUtils.isDynamic(value)) {
if(value.length() > 1 && value.startsWith("\"") && value.endsWith("\"")) {
if(itemFromTable && "ARGS".equals(ep.getName())) {
value = value.substring(1, value.length());
value = value.substring(0, value.length() - 1);
return "\"" + checkStringQuotationMarks(value) + "\"";
} else {
//do nothing
return value;
}
} else {
return "\"" + checkStringQuotationMarks(value) + "\"";
}
}
//TODO remove it
if (value.endsWith("*")) {
return value.substring(0, value.length() - 1) + "\"*\"";
}
return value;
}
private static String checkStringQuotationMarks(String str) {
String result = str;
if (result.contains("\"")) {
result = result.replace("\"", "\\\"");
}
return result;
}
public static String getNormalizeParameterValue(INode node, IElementParameter ep) {
if (EParameterFieldType.TABLE.equals(ep.getFieldType())) {
@@ -1189,7 +1357,7 @@ public class NodeUtil {
} else if (ComponentCategory.CATEGORY_4_CAMEL.getName().equals(node.getComponent().getType())) {
INodeConnector tmp = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
ICamelDesignerCoreService camelService = (ICamelDesignerCoreService) GlobalServiceRegister.getDefault()
ICamelDesignerCoreService camelService = GlobalServiceRegister.getDefault()
.getService(ICamelDesignerCoreService.class);
tmp = node.getConnectorFromType(camelService.getTargetConnectionType(node));
} else {
@@ -1232,4 +1400,37 @@ public class NodeUtil {
return true;
}
public static boolean isJobUsingRuntimeLineage(IProcess process) {
// Just support DI jobs now
boolean isSupport = isStandardJob(process) && !ProcessUtils.isTestContainer(process) && !isGuessSchemaJob(process);
if (!isSupport) {
return false;
}
RuntimeLineageManager runtimeLineageManager = new RuntimeLineageManager();
if (runtimeLineageManager.isUseRuntimeLineageAll()) {
return true;
}
if (runtimeLineageManager.getSelectedJobIds().isEmpty()) {
runtimeLineageManager.load();
}
return runtimeLineageManager.isRuntimeLineageSetting(process.getId());
}
public static boolean isStandardJob(IProcess process) {
if (process != null && process instanceof IProcess2) {
Property property = ((IProcess2) process).getProperty();
return property != null && property.getItem() != null
&& ComponentCategory.CATEGORY_4_DI.getName().equals(process.getComponentsType());
}
return false;
}
public static boolean isGuessSchemaJob(IProcess process) {
if (process != null && process instanceof IProcess2) {
Property property = ((IProcess2) process).getProperty();
return property != null && "ID".equals(property.getId()) && "Mock_job_for_Guess_schema".equals(property.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
}
return false;
}
}

View File

@@ -15,6 +15,7 @@ package org.talend.core.model.utils;
import java.util.ArrayList;
import java.util.List;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.designerproperties.RepositoryToComponentProperty;
@@ -23,6 +24,7 @@ import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.update.UpdatesConstants;
import org.talend.core.runtime.services.IGenericWizardService;
/**
* ggu class global comment. Detailled comment
@@ -47,6 +49,14 @@ public final class UpdateRepositoryHelper {
if (connection instanceof DatabaseConnection) {
String currentDbType = (String) RepositoryToComponentProperty.getValue(connection, UpdatesConstants.TYPE,
null);
String productId = ((DatabaseConnection) connection).getProductId();
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
IGenericWizardService service = GlobalServiceRegister.getDefault()
.getService(IGenericWizardService.class);
if (service != null && service.getIfAdditionalJDBCDBType(productId)) {
currentDbType = productId;
}
}
aliasName += " (" + currentDbType + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
if (repositoryObjectType.getType().equals("SERVICES")) {

View File

@@ -73,4 +73,6 @@ public interface IRepositoryArtifactHandler {
public String resolveRemoteSha1(MavenArtifact artifact, boolean fromRelease) throws Exception;
public List<MavenArtifact> search(String name, boolean fromSnapshot) throws Exception;
}

View File

@@ -370,4 +370,37 @@ public class NexusServerUtils {
}
public static List<MavenArtifact> search(String nexusUrl, String userName, String password, String repositoryId, String name)
throws Exception {
List<MavenArtifact> artifacts = new ArrayList<MavenArtifact>();
int totalCount = 0;
String service = NexusConstants.SERVICES_SEARCH + getSearchQuery(repositoryId, null, null, null, 0, MAX_SEARCH_COUNT)
+ "&q=" + name;
URI requestURI = getSearchURI(nexusUrl, service);
Document document = downloadDocument(requestURI, userName, password);
if (document != null) {
Node countNode = document.selectSingleNode("/searchNGResponse/totalCount");
if (countNode != null) {
try {
totalCount = Integer.parseInt(countNode.getText());
} catch (NumberFormatException e) {
totalCount = 0;
}
}
int searchDone = readDocument(document, artifacts);
while (searchDone < totalCount) {
service = NexusConstants.SERVICES_SEARCH
+ getSearchQuery(repositoryId, null, null, null, searchDone, MAX_SEARCH_COUNT) + "&q=" + name;
requestURI = getSearchURI(nexusUrl, service);
document = downloadDocument(requestURI, userName, password);
searchDone = searchDone + readDocument(document, artifacts);
}
}
return artifacts;
}
}

View File

@@ -174,7 +174,7 @@ public class MavenUrlHelper {
if (jarName != null && jarName.length() > 0) {
String artifactId = jarName;
String type = null;
if (jarName.endsWith(MavenConstants.TYPE_JAR)) { // remove the extension .jar
if (jarName.endsWith("." + MavenConstants.TYPE_JAR)) { // remove the extension .jar
artifactId = jarName.substring(0, jarName.lastIndexOf(MavenConstants.TYPE_JAR) - 1);
if (withPackage) {
type = MavenConstants.TYPE_JAR;
@@ -380,4 +380,14 @@ public class MavenUrlHelper {
}
return buffer.toString();
}
public static String getSNAPSHOTVersion(String rVersion) {
if (rVersion == null) {
return rVersion;
}
if (rVersion.contains("-")) {
return rVersion.substring(0, rVersion.indexOf("-") + 1) + MavenUrlHelper.VERSION_SNAPSHOT;
}
return rVersion;
}
}

View File

@@ -0,0 +1,156 @@
// ============================================================================
//
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.runtime.projectsetting;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.RepositoryConstants;
import org.talend.repository.model.RepositoryNode;
import org.talend.utils.json.JSONObject;
import us.monoid.json.JSONArray;
/**
* created by hcyi on Jul 27, 2020
* Detailled comment
*
*/
public class RuntimeLineageManager {
public static final String RUNTIMELINEAGE_RESOURCES = "org.talend.runtimelineage"; //$NON-NLS-1$
public static final String RUNTIMELINEAGE_ALL = "runtimelineage.all"; //$NON-NLS-1$
public static final String RUNTIMELINEAGE_SELECTED = "runtimelineage.selected"; //$NON-NLS-1$
public static final String JOB_ID = "id"; //$NON-NLS-1$
public static final String RUNTIMELINEAGE_OUTPUT_PATH = "-Druntime.lineage.outputpath="; //$NON-NLS-1$
public static final String OUTPUT_PATH = "output.path"; //$NON-NLS-1$
private List<String> selectedJobIds = new ArrayList<String>();
private ProjectPreferenceManager prefManager = null;
private boolean useRuntimeLineageAll = false;
private String outputPath = null;
public RuntimeLineageManager() {
if (prefManager == null) {
prefManager = new ProjectPreferenceManager(RUNTIMELINEAGE_RESOURCES, true);
}
useRuntimeLineageAll = prefManager.getBoolean(RUNTIMELINEAGE_ALL);
outputPath = prefManager.getValue(OUTPUT_PATH);
}
public void load() {
try {
String jobsJsonStr = prefManager.getValue(RUNTIMELINEAGE_SELECTED);
if (StringUtils.isNotBlank(jobsJsonStr)) {
JSONArray jobsJsonArray = new JSONArray(jobsJsonStr);
for (int i = 0; i < jobsJsonArray.length(); i++) {
Object jobJsonObj = jobsJsonArray.get(i);
JSONObject jobJson = new JSONObject(String.valueOf(jobJsonObj));
Iterator sortedKeys = jobJson.sortedKeys();
String jobId = null;
while (sortedKeys.hasNext()) {
String key = (String) sortedKeys.next();
if (JOB_ID.equals(key)) {
jobId = jobJson.getString(key);
}
}
if (jobId != null) {
selectedJobIds.add(jobId);
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
public void save(List<RepositoryNode> checkedObjects, boolean all) {
try {
JSONArray jobsJson = new JSONArray();
if (!all) {
for (RepositoryNode node : checkedObjects) {
JSONObject jobJson = new JSONObject();
if (!jobsJson.toString().contains(node.getId())) {
jobJson.put(JOB_ID, node.getId());
jobsJson.put(jobJson);
}
}
}
prefManager.setValue(RUNTIMELINEAGE_ALL, all);
prefManager.setValue(RUNTIMELINEAGE_SELECTED, jobsJson.toString());
prefManager.setValue(OUTPUT_PATH, outputPath);
prefManager.save();
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
public boolean isRuntimeLineageSetting(String id) {
return selectedJobIds.contains(id);
}
public boolean isRuntimeLineagePrefsExist() {
try {
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
IFolder prefSettingFolder = ResourceUtils.getFolder(project, RepositoryConstants.SETTING_DIRECTORY, false);
IFile presRuntimeLineageFile = prefSettingFolder.getFile(RUNTIMELINEAGE_RESOURCES + ".prefs"); //$NON-NLS-1$
if (presRuntimeLineageFile.exists()) {
return true;
}
} catch (PersistenceException e) {
e.printStackTrace();
}
return false;
}
public boolean isUseRuntimeLineageAll() {
return this.useRuntimeLineageAll;
}
public ProjectPreferenceManager getPrefManager() {
return this.prefManager;
}
public List<String> getSelectedJobIds() {
return this.selectedJobIds;
}
public void setSelectedJobIds(List<String> selectedJobIds) {
this.selectedJobIds = selectedJobIds;
}
public String getOutputPath() {
return this.outputPath;
}
public void setOutputPath(String outputPath) {
this.outputPath = outputPath;
}
}

View File

@@ -18,6 +18,7 @@ import java.util.Map;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.process.INode;
@@ -46,6 +47,8 @@ public interface IGenericService extends IService {
public boolean isTcompv0(IComponent component);
public void validateGenericConnection(Connection conn) throws Exception;
public static IGenericService getService() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericService.class)) {
return GlobalServiceRegister.getDefault().getService(IGenericService.class);

View File

@@ -20,11 +20,14 @@ import org.eclipse.swt.widgets.Composite;
import org.talend.commons.ui.swt.actions.ITreeContextualAction;
import org.talend.components.api.properties.ComponentProperties;
import org.talend.core.IService;
import org.talend.core.model.metadata.Dbms;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.process.EComponentCategory;
import org.talend.core.model.process.Element;
import org.talend.core.model.process.IElement;
import org.talend.core.model.process.INode;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
@@ -146,4 +149,19 @@ public interface IGenericWizardService extends IService {
* @return the default action which will be invoked when double click the node.
*/
public ITreeContextualAction getDefaultAction(RepositoryNode node);
public void loadAdditionalJDBC();
public List<String> getAllAdditionalJDBCTypes();
public boolean getIfAdditionalJDBCDBType(String dbType);
public void initAdditonalJDBCConnectionValue(DatabaseConnection connection, Composite dynamicForm, String dbType,
String propertyId);
public String getDefinitionName4AdditionalJDBC(IElement element);
public String getDatabseNameByNode(IElement node);
public Dbms getDbms4AdditionalJDBC(String typeName);
}

View File

@@ -0,0 +1,83 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.runtime.util;
import java.io.File;
import java.io.IOException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.service.IUpdateService;
import org.talend.utils.io.FilesUtils;
public class SharedStudioUtils {
public static final String FILE_EXTRA_FEATURE_INDEX = "extra_feature.index"; //$NON-NLS-1$
public static final String SIGNATURE_FILE_NAME_SUFFIX = ".sig"; //$NON-NLS-1$
public static boolean updateExtraFeatureFile() {
File userConfigFolder = new File(Platform.getConfigurationLocation().getURL().getPath());
File studioConfigFolder = new File(Platform.getInstallLocation().getURL().getPath(), "configuration");//$NON-NLS-1$
if (!userConfigFolder.getAbsolutePath().equals(studioConfigFolder.getAbsolutePath())) {
File studioExtraFile = new File(studioConfigFolder, FILE_EXTRA_FEATURE_INDEX);
File studioExtraSignFile = new File(studioConfigFolder, FILE_EXTRA_FEATURE_INDEX + SIGNATURE_FILE_NAME_SUFFIX);
File userExtraFile = new File(userConfigFolder, FILE_EXTRA_FEATURE_INDEX);
File userExtraSignFile = new File(userConfigFolder, FILE_EXTRA_FEATURE_INDEX + SIGNATURE_FILE_NAME_SUFFIX);
boolean isNeedUpdate = false;
if (!studioExtraSignFile.exists() && userExtraSignFile.exists()) {
userExtraSignFile.delete();
if (userExtraFile.exists()) {
userExtraFile.delete();
}
return true;
} else if (studioExtraSignFile.exists()) {
isNeedUpdate = true;
}
if (isNeedUpdate) {
try {
FilesUtils.copyFile(studioExtraFile, userExtraFile);
FilesUtils.copyFile(studioExtraSignFile, userExtraSignFile);
} catch (IOException ex) {
ExceptionHandler.process(ex);
}
return true;
}
}
return false;
}
public static boolean isSharedStudioMode() {
File configFolder = new File (Platform.getConfigurationLocation().getURL().getFile());
File studioFolder = new File (Platform.getInstallLocation().getURL().getFile());
if (configFolder != null && studioFolder != null && configFolder.getParentFile() != null
&& configFolder.getParentFile().getAbsolutePath().equals(studioFolder.getAbsolutePath())) {
return false;
}
return true;
}
public static boolean installedPatch() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IUpdateService.class)) {
IUpdateService updateService = GlobalServiceRegister.getDefault().getService(IUpdateService.class);
try {
return updateService.syncSharedStudioLibraryInPatch(new NullProgressMonitor());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return false;
}
}

View File

@@ -12,10 +12,12 @@
// ============================================================================
package org.talend.core.service;
import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.core.IService;
public interface IUpdateService extends IService {
boolean checkComponentNexusUpdate();
public boolean syncSharedStudioLibraryInPatch(IProgressMonitor monitor) throws Exception;
}

View File

@@ -13,6 +13,7 @@
package org.talend.core.ui;
import org.talend.core.IService;
import org.talend.core.runtime.maven.MavenArtifact;
/**
* @author hwang
@@ -21,5 +22,7 @@ import org.talend.core.IService;
public interface IInstalledPatchService extends IService {
public String getLatestInstalledVersion(boolean isBar);
public MavenArtifact getLastIntalledP2Patch();
}

View File

@@ -0,0 +1,60 @@
package org.talend.core.utils;
import java.util.Arrays;
import java.util.List;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.talend.commons.CommonsPlugin;
public class DialogUtils {
private static ELoginInfoCase finalCase;
public static void setWarningInfo(ELoginInfoCase warnningInfo) {
finalCase = warnningInfo;
}
public static void syncOpenWarningDialog(String title) {
if (CommonsPlugin.isHeadless() || DialogUtils.finalCase == null) {
return;
}
int dialogType = DialogUtils.finalCase.getDialogType();
String[] contents = DialogUtils.finalCase.getContents();
List<String> asList = Arrays.asList(contents);
StringBuffer sb = new StringBuffer();
asList.forEach(w -> {
sb.append(w);
sb.append("\n");// $NON-NLS-1$
});
int[] selectIndex = new int[1];
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
String[] dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL, };
if (dialogType == MessageDialog.ERROR) {
dialogButtonLabels = new String[] { IDialogConstants.CANCEL_LABEL };
}
int open = MessageDialog.open(dialogType, Display.getDefault().getActiveShell(), title, sb.toString(), SWT.NONE,
dialogButtonLabels);
selectIndex[0] = open;
}
});
DialogUtils.finalCase = null;
if (dialogType == MessageDialog.ERROR) {
throw new OperationCanceledException(""); //$NON-NLS-1$
}
if (1 == selectIndex[0]) {
throw new OperationCanceledException(""); //$NON-NLS-1$
}
}
}

View File

@@ -0,0 +1,40 @@
package org.talend.core.utils;
import org.eclipse.jface.dialogs.MessageDialog;
public enum ELoginInfoCase {
STUDIO_LOWER_THAN_PROJECT(MessageDialog.ERROR),
STUDIO_HIGHER_THAN_PROJECT(MessageDialog.WARNING);
private int dialogType;
private String[] contents;
ELoginInfoCase(int dialogType) {
this.dialogType = dialogType;
}
ELoginInfoCase(int dialogType, String[] contents) {
this.dialogType = dialogType;
this.contents = contents;
}
public int getDialogType() {
return dialogType;
}
public void setDialogType(int dialogType) {
this.dialogType = dialogType;
}
public String[] getContents() {
return contents;
}
public void setContents(String[] contents) {
this.contents = contents;
}
}

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/jna-platform.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jna.jar"/>
<classpathentry exported="true" kind="lib" path="lib/oshi-core.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>

View File

@@ -33,7 +33,8 @@ Require-Bundle: org.apache.commons.lang,
org.talend.core,
org.apache.commons.io,
org.apache.httpcomponents.httpcore,
org.apache.httpcomponents.httpclient
org.apache.httpcomponents.httpclient,
org.slf4j.api
Import-Package: org.eclipse.jdt.internal.ui.workingsets
Export-Package: org.talend.core.ui,
org.talend.core.ui.actions,
@@ -81,3 +82,7 @@ Bundle-Vendor: .Talend SA.
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.talend.core.ui.CoreUIPlugin
Bundle-Localization: plugin
Bundle-ClassPath: lib/jna-platform.jar,
lib/jna.jar,
lib/oshi-core.jar,
.

View File

@@ -5,4 +5,7 @@ bin.includes = .,\
icons/,\
plugin.properties,\
schema/,\
META-INF/
META-INF/,\
lib/jna-platform.jar,\
lib/jna.jar,\
lib/oshi-core.jar

View File

@@ -24,6 +24,12 @@
id="org.talend.core.runtime.defaultProvider"
name="default">
</provider>
<provider
collector="org.talend.core.ui.token.PerformanceTokenCollector"
description="collect such as hardware info, I/O info, startup time"
id="org.talend.core.ui.token.PerformanceProvider"
name="performance">
</provider>
</extension>
<extension

View File

@@ -9,4 +9,42 @@
</parent>
<artifactId>org.talend.core.ui</artifactId>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>5.2.5</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -501,7 +501,11 @@ public class ContextTreeTable {
int max = 0;
String text = "";
for (int i = 0; i < dataLayer.getPreferredRowCount(); i++) {
text = dataLayer.getDataValueByPosition(colPos, i).toString();
Object dataValueByPosition = dataLayer.getDataValueByPosition(colPos, i);
if (dataValueByPosition == null) {
continue;
}
text = dataValueByPosition.toString();
Point size = gc.textExtent(text, SWT.DRAW_MNEMONIC);
int temp = size.x;
if (temp > max) {

View File

@@ -20,7 +20,6 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.DialogCellEditor;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -37,7 +36,8 @@ import org.talend.core.model.process.IElement;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess2;
import org.talend.core.runtime.services.IGenericDBService;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.process.IGEFProcess;
import org.talend.core.ui.services.IDesignerCoreUIService;
@@ -171,7 +171,7 @@ public class ModuleListCellEditor extends DialogCellEditor {
ILibraryManagerUIService.class);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(cellEditorWindow.getShell(), "\"newLine\"".equals(value) ? "" : value);
if (dialog.open() == IDialogConstants.OK_ID) {
String selecteModule = dialog.getModuleName();
String selecteModule = dialog.getMavenURI();
if (selecteModule != null && (value == null || !value.equals(selecteModule))) {
setModuleValue(selecteModule, null, null);
return selecteModule;
@@ -200,6 +200,15 @@ public class ModuleListCellEditor extends DialogCellEditor {
updateComponentsParam.setValue(Boolean.TRUE);
}
}
// cConfig
if (!isNotCConfig) {
if (newValue.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
MavenArtifact art = MavenUrlHelper.parseMvnUrl(newValue);
newValue = art.getFileName();
}
}
//
executeCommand(new ModelChangeCommand(tableParam, param.getName(), newValue, index));

View File

@@ -81,7 +81,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
jsonObject.put("os.arch", System.getProperty("os.arch"));
jsonObject.put("os.version", System.getProperty("os.version"));
tokenStudioObject.put(OS.getKey(), jsonObject);
final IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
long syncNb = preferenceStore.getLong(COLLECTOR_SYNC_NB);
tokenStudioObject.put(SYNC_NB.getKey(), syncNb);
@@ -91,6 +91,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
} else {
tokenStudioObject.put(STOP_COLLECTOR.getKey(), "0"); //$NON-NLS-1$
}
return tokenStudioObject;
}
}

View File

@@ -0,0 +1,83 @@
// ============================================================================
//
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.ui.token;
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 oshi.SystemInfo;
import oshi.hardware.Baseboard;
import oshi.hardware.CentralProcessor;
import oshi.hardware.CentralProcessor.ProcessorIdentifier;
import oshi.hardware.ComputerSystem;
import oshi.hardware.GlobalMemory;
import oshi.hardware.HardwareAbstractionLayer;
import us.monoid.json.JSONObject;
/**
* DOC sbliu class global comment. Detailled comment
*/
public class PerformanceTokenCollector extends AbstractTokenCollector {
/* (non-Javadoc)
* @see org.talend.core.ui.token.AbstractTokenCollector#collect()
*/
@Override
public JSONObject collect() throws Exception {
checkAndWait();
JSONObject tokenStudioObject = new JSONObject();
//
JSONObject jsonObjectHDInfo = new JSONObject();
SystemInfo si = new SystemInfo();
HardwareAbstractionLayer hal = si.getHardware();
CentralProcessor processor = hal.getProcessor();
ProcessorIdentifier processorIdentifier = processor.getProcessorIdentifier();
ComputerSystem cs = hal.getComputerSystem();//computer system
Baseboard baseboard = cs.getBaseboard();//motherboard
GlobalMemory memory = hal.getMemory();
jsonObjectHDInfo.put("computer vendor", cs.getManufacturer());
jsonObjectHDInfo.put("board vendor", baseboard.getManufacturer());
jsonObjectHDInfo.put("board version", baseboard.getVersion());
jsonObjectHDInfo.put("processor", processorIdentifier.getName());
jsonObjectHDInfo.put("physical memory", Math.ceil((memory.getTotal() /(1024d*1024*1024))) + "GB");
tokenStudioObject.put("hardware", jsonObjectHDInfo);
//
JSONObject jsonObjectIOInfo = new JSONObject();
Properties props = PerformanceStatisticUtil.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()));
jsonObjectIOInfo.put(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), props.getProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get()));
jsonObjectIOInfo.put(StatisticKeys.IO_W_MB_SEC.get(), props.getProperty(StatisticKeys.IO_W_MB_SEC.get()));
jsonObjectIOInfo.put(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), props.getProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get()));
tokenStudioObject.put("performance", jsonObjectIOInfo);
return tokenStudioObject;
}
private void checkAndWait() {
try {
PerformanceStatisticUtil.waitUntilFinish();
} catch (InterruptedException e) {
CommonExceptionHandler.log(e.getMessage());
}
}
}

View File

@@ -462,19 +462,25 @@ public class TalendTextUtils {
return TalendQuoteUtils.removeQuotes(text);
}
/**
* @Deprecated use org.talend.utils.string.StudioContextUtils.removeQuotesIfExist instead
*/
@Deprecated
public static String removeQuotesIfExist(String text) {
return TalendQuoteUtils.removeQuotesIfExist(text);
return org.talend.utils.string.StudioContextUtils.removeQuotesIfExist(text,
org.talend.utils.string.StudioContextUtils.QUOTATION_MARK);
}
/**
* qzhang Comment method "removeQuotes".
* @Deprecated use org.talend.utils.string.StudioContextUtils.removeQuotes
*
* @param text
* @param quotation_mark2
* @return
*/
@Deprecated
public static String removeQuotes(String text, String quotation) {
return TalendQuoteUtils.removeQuotes(text, quotation);
return org.talend.utils.string.StudioContextUtils.removeQuotes(text, quotation);
}
public static boolean isEnclosed(String text) {
@@ -489,41 +495,12 @@ public class TalendTextUtils {
return TalendQuoteUtils.getStringDeclare();
}
/**
* @Deprecated use org.talend.utils.string.StudioContextUtils.encodeValue instead
*/
@Deprecated
public static String trimParameter(String value) {
if (value == null) {
return null;
}
int length = value.length();
String result = removeQuotes(value);
if (length > 1
&& (((value.startsWith("\"") && value.endsWith("\""))) || (value.startsWith("\'") && value.endsWith("\'")))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
result = value.substring(1, length - 1);
if (result.contains("\\")) { //$NON-NLS-1$
result = result.replaceAll("\\\\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
result = result.replaceAll("\\\\b", "\b"); //$NON-NLS-1$ //$NON-NLS-2$
result = result.replaceAll("\\\\f", "\f"); //$NON-NLS-1$ //$NON-NLS-2$
result = result.replaceAll("\\\\r", "\r"); //$NON-NLS-1$ //$NON-NLS-2$
result = result.replaceAll("\\\\t", "\t"); //$NON-NLS-1$ //$NON-NLS-2$
result = result.replaceAll("\\\\\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$
result = result.replaceAll("\\\\\\\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
// handle unicode
if (result.contains("\\u")) {
for (int indexStart = 0; result.indexOf("\\u", indexStart) >= 0; indexStart = result.indexOf("\\u", indexStart)) {
if (result.indexOf("\\u", indexStart) + 5 <= result.length()) { //$NON-NLS-1$
int unicodeStart = result.indexOf("\\u"); //$NON-NLS-1$
int unicodeEnd = unicodeStart + 5;
result = result.substring(0, Math.max(0, unicodeStart))
+ StringEscapeUtils.unescapeJava(result.substring(unicodeStart, unicodeEnd + 1))
+ result.substring(Math.min(unicodeEnd + 1, result.length()), result.length());
}
}
}
}
}
return result;
return org.talend.utils.string.StudioContextUtils.encodeValue(value);
}
public static String getQuoteChar() {

View File

@@ -23,9 +23,11 @@ import org.eclipse.emf.common.util.URI;
import org.osgi.service.prefs.BackingStoreException;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.exception.SystemException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.INode;
import org.talend.core.model.properties.Property;
import org.talend.core.runtime.maven.MavenArtifact;
/**
@@ -78,4 +80,18 @@ public interface ICoreTisService extends IService {
Set<String> getComponentBlackList();
public void afterImport (Property property) throws PersistenceException;
boolean hasNewPatchInPatchesFolder();
boolean isDefaultLicenseAndProjectType();
void refreshPatchesFolderCache();
static ICoreTisService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreTisService.class)) {
return GlobalServiceRegister.getDefault().getService(ICoreTisService.class);
}
return null;
}
}

View File

@@ -16,7 +16,7 @@
<module>tacokit/pom.xml</module>
<module>tcompv1/pom.xml</module>
<module>surefire/pom.xml</module>
<module>zip/pom.xml</module>
<module>zip/pom.xml</module>
</modules>
<properties>
<m2.fasterxml.jackson.version>2.10.1</m2.fasterxml.jackson.version>

View File

@@ -19,6 +19,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -56,6 +57,7 @@ import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProjectReference;
@@ -170,9 +172,18 @@ public class AggregatorPomsHelper {
@Override
protected void run() {
updateCodeProject(monitor, ERepositoryObjectType.ROUTINES, forceBuild);
if (ProcessUtils.isRequiredBeans(null)) {
updateCodeProject(monitor, ERepositoryObjectType.valueOf("BEANS"), forceBuild); //$NON-NLS-1$
Project currentProject = ProjectManager.getInstance().getCurrentProject();
for (ERepositoryObjectType codeType : ERepositoryObjectType.getAllTypesOfCodes()) {
try {
if (CodeM2CacheManager.needUpdateCodeProject(currentProject, codeType)) {
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
CodeM2CacheManager.updateCodeProjectCache(currentProject, codeType);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
};
@@ -180,16 +191,6 @@ public class AggregatorPomsHelper {
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}
private void updateCodeProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean forceBuild) {
try {
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
public void updateCodeProjectPom(IProgressMonitor monitor, ERepositoryObjectType type, IFile pomFile)
throws Exception {
if (type != null) {
@@ -210,27 +211,15 @@ public class AggregatorPomsHelper {
}
public static void updateAllCodesProjectNeededModules(IProgressMonitor monitor) {
updateCodesProjectNeededModulesByType(ERepositoryObjectType.ROUTINES, monitor);
if (ProcessUtils.isRequiredBeans(null)) {
updateCodesProjectNeededModulesByType(ERepositoryObjectType.valueOf("BEANS"), monitor); //$NON-NLS-1$
}
}
private static void updateCodesProjectNeededModulesByType(ERepositoryObjectType codeType,
IProgressMonitor monitor) {
Set<ModuleNeeded> neededModules = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
ILibrariesService librariesService =
(ILibrariesService) GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
neededModules = librariesService.getCodesModuleNeededs(codeType);
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
ILibraryManagerService repositoryBundleService =
(ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerService.class);
if (neededModules != null && !neededModules.isEmpty()) {
repositoryBundleService.installModules(neededModules, monitor);
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)
&& GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
Set<ModuleNeeded> neededModules = new HashSet<>();
ILibrariesService librariesService = GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
ERepositoryObjectType.getAllTypesOfCodes()
.forEach(c -> neededModules.addAll(librariesService.getCodesModuleNeededs(c)));
ILibraryManagerService repositoryBundleService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
repositoryBundleService.installModules(neededModules, monitor);
}
}
@@ -267,7 +256,7 @@ public class AggregatorPomsHelper {
if (install) {
Map<String, Object> argumentsMap = new HashMap<>();
argumentsMap.put(TalendProcessArgumentConstant.ARG_GOAL, TalendMavenConstants.GOAL_INSTALL);
argumentsMap.put(TalendProcessArgumentConstant.ARG_PROGRAM_ARGUMENTS, "-Dmaven.main.skip=true"); //$NON-NLS-1$
argumentsMap.put(TalendProcessArgumentConstant.ARG_PROGRAM_ARGUMENTS, TalendMavenConstants.ARG_MAIN_SKIP);
codeProject.buildModules(monitor, null, argumentsMap);
BuildCacheManager.getInstance().updateCodeLastBuildDate(codeType);
}

View File

@@ -0,0 +1,109 @@
// ============================================================================
//
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.designer.maven.tools;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.m2e.core.MavenPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.cwm.helper.ResourceHelper;
import org.talend.designer.maven.utils.PomIdsHelper;
public class CodeM2CacheManager {
private static final String KEY_SEPERATOR = "|"; //$NON-NLS-1$
public static boolean needUpdateCodeProject(Project project, ERepositoryObjectType codeType) {
try {
String projectTechName = project.getTechnicalLabel();
File cacheFile = getCacheFile(projectTechName, codeType);
if (!cacheFile.exists()) {
return true;
}
Properties cache = new Properties();
cache.load(new FileInputStream(cacheFile));
List<IRepositoryViewObject> allCodes = ProxyRepositoryFactory.getInstance().getAll(project, codeType, false);
// check A/D
if (allCodes.size() != cache.size()) {
return true;
}
// check M
for (IRepositoryViewObject codeItem : allCodes) {
Property property = codeItem.getProperty();
String key = getCacheKey(projectTechName, property);
String cachedTimestamp = cache.getProperty(key);
if (cachedTimestamp != null) {
Date currentDate = ResourceHelper.dateFormat().parse(getCacheDate(projectTechName, property));
Date cachedDate = ResourceHelper.dateFormat().parse(cachedTimestamp);
if (currentDate.compareTo(cachedDate) != 0) {
return true;
}
}
}
} catch (PersistenceException | IOException | ParseException e) {
ExceptionHandler.process(e);
// if any exception, still update in case breaking build job
return true;
}
return false;
}
public static void updateCodeProjectCache(Project project, ERepositoryObjectType codeType) {
String projectTechName = project.getTechnicalLabel();
File cacheFile = getCacheFile(projectTechName, codeType);
try (OutputStream out = new FileOutputStream(cacheFile)) {
List<IRepositoryViewObject> allCodes = ProxyRepositoryFactory.getInstance().getAll(project, codeType, false);
Properties cache = new Properties();
for (IRepositoryViewObject codeItem : allCodes) {
Property property = codeItem.getProperty();
String key = getCacheKey(projectTechName, property);
String value = getCacheDate(projectTechName, property);
cache.put(key, value);
}
cache.store(out, StringUtils.EMPTY);
} catch (PersistenceException | IOException e) {
ExceptionHandler.process(e);
}
}
private static File getCacheFile(String projectTechName, ERepositoryObjectType codeType) {
String cacheFileName = PomIdsHelper.getProjectGroupId(projectTechName) + "." + codeType.name().toLowerCase() + "-" //$NON-NLS-1$ //$NON-NLS-2$
+ PomIdsHelper.getCodesVersion(projectTechName) + ".cache"; // $NON-NLS-1$
return new File(MavenPlugin.getMaven().getLocalRepositoryPath(), cacheFileName);
}
private static String getCacheKey(String projectTechName, Property property) {
return projectTechName + KEY_SEPERATOR + property.getId() + KEY_SEPERATOR + property.getVersion(); // $NON-NLS-1$
}
private static String getCacheDate(String projectTechName, Property property) {
return (String) property.getAdditionalProperties().get(ItemProductKeys.DATE.getModifiedKey());
}
}

View File

@@ -101,12 +101,11 @@ public class ProcessorDependenciesManager {
Dependency dependency = PomUtil.createModuleDependency(mavenUri);
if (dependency != null) {
((SortableDependency) dependency).setAssemblyOptional(optional);
if (module.isExcludeDependencies()) {
Exclusion exclusion = new Exclusion();
exclusion.setGroupId("*"); //$NON-NLS-1$
exclusion.setArtifactId("*"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
}
Exclusion exclusion = new Exclusion();
exclusion.setGroupId("*"); //$NON-NLS-1$
exclusion.setArtifactId("*"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
neededDependencies.add(dependency);
}
}

View File

@@ -20,6 +20,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.PluginChecker;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.properties.Property;
@@ -346,7 +347,9 @@ public class PomIdsHelper {
if (!preferenceManager.exist()
&& StringUtils.isBlank(preferenceStore.getString(MavenConstants.EXCLUDE_DELETED_ITEMS))) {
// for new project, set EXCLUDE_DELETED_ITEMS=true as default
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, true);
if (PluginChecker.isTIS()) {
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, true);
}
}
preferenceManager.save();
preferenceManagers.put(projectTechName, preferenceManager);

View File

@@ -1,12 +1,4 @@
output.. = bin/
bin.includes = META-INF/,\
lib/,\
lib/commons-lang-2.6.jar,\
lib/commons-codec-1.6.jar,\
lib/commons-cli-2.0-SNAPSHOT.jar,\
lib/commons-digester-2.1.jar,\
lib/commons-math3-3.3.jar,\
lib/commons-validator-1.5.1.jar,\
lib/commons-pool2-2.4.2.jar,\
lib/commons-text-1.1.jar,\
lib/commons-beanutils-1.9.4.jar
lib/

View File

@@ -9,6 +9,14 @@
</parent>
<artifactId>org.talend.libraries.apache.common</artifactId>
<packaging>eclipse-plugin</packaging>
<repositories>
<repository>
<id>talend-update</id>
<url>https://talend-update.talend.com/nexus/content/repositories/libraries/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
@@ -26,9 +34,29 @@
<outputDirectory>${project.basedir}/lib</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
</artifactItem>
<artifactItem>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.3</version>
</artifactItem>
<artifactItem>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.5.1</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.4.2</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -1,21 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-1.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-api-1.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-1.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-api-1.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.bind-api-2.3.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.3.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/javax.annotation-api-1.3.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/stax2-api-3.1.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-6.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.annotation-api-1.3.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/stax2-api-4.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/neethi-3.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.ws.rs-api-2.1.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.ws.rs-api-2.1.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.3.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxws-api-2.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/javax.ws.rs-api-2.0-m10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.bind-api-2.3.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.2.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.3.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.jws-api-2.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/istack-commons-runtime-3.0.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.soap-api-1.4.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>

View File

@@ -6,31 +6,90 @@ Bundle-Version: 7.4.1.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
lib/neethi-3.1.1.jar,
lib/stax2-api-3.1.4.jar,
lib/stax2-api-4.2.1.jar,
lib/javax.activation-1.2.0.jar,
lib/jaxws-api-2.3.1.jar,
lib/cxf-core-3.3.4.jar,
lib/cxf-rt-bindings-xml-3.3.4.jar,
lib/cxf-rt-frontend-jaxrs-3.3.4.jar,
lib/cxf-rt-rs-client-3.3.4.jar,
lib/cxf-rt-transports-http-3.3.4.jar,
lib/cxf-rt-wsdl-3.3.4.jar,
lib/jakarta.ws.rs-api-2.1.5.jar,
lib/javax.annotation-api-1.3.2.jar,
lib/woodstox-core-asl-4.4.1.jar,
lib/jakarta.xml.bind-api-2.3.2.jar,
lib/jaxb-runtime-2.3.2.jar,
lib/jakarta.activation-api-1.2.1.jar,
lib/jakarta.activation-1.2.1.jar
Export-Package: javax.ws.rs,
lib/cxf-core-3.3.6.jar,
lib/cxf-rt-bindings-xml-3.3.6.jar,
lib/cxf-rt-frontend-jaxrs-3.3.6.jar,
lib/cxf-rt-rs-client-3.3.6.jar,
lib/cxf-rt-transports-http-3.3.6.jar,
lib/cxf-rt-wsdl-3.3.6.jar,
lib/cxf-rt-bindings-soap-3.3.6.jar,
lib/cxf-rt-databinding-jaxb-3.3.6.jar,
lib/cxf-rt-features-clustering-3.3.6.jar,
lib/cxf-rt-frontend-jaxws-3.3.6.jar,
lib/cxf-rt-frontend-simple-3.3.6.jar,
lib/cxf-rt-security-3.3.6.jar,
lib/cxf-rt-security-saml-3.3.6.jar,
lib/cxf-rt-ws-addr-3.3.6.jar,
lib/cxf-rt-ws-policy-3.3.6.jar,
lib/cxf-rt-ws-security-3.3.6.jar,
lib/jakarta.ws.rs-api-2.1.6.jar,
lib/jakarta.annotation-api-1.3.5.jar,
lib/woodstox-core-6.2.1.jar,
lib/jakarta.xml.bind-api-2.3.3.jar,
lib/jakarta.activation-api-1.2.2.jar,
lib/jakarta.activation-1.2.2.jar,
lib/javax.ws.rs-api-2.0-m10.jar,
lib/xmlschema-core-2.2.5.jar,
lib/jaxb-runtime-2.3.3.jar,
lib/jakarta.jws-api-2.1.0.jar,
lib/istack-commons-runtime-3.0.11.jar,
lib/jakarta.xml.soap-api-1.4.2.jar
Export-Package: com.sun.istack,
com.sun.istack.localization,
com.sun.istack.logging,
com.sun.xml.bind,
com.sun.xml.bind.annotation,
com.sun.xml.bind.api,
com.sun.xml.bind.api.impl,
com.sun.xml.bind.marshaller,
com.sun.xml.bind.unmarshaller,
com.sun.xml.bind.util,
com.sun.xml.bind.v2,
com.sun.xml.bind.v2.bytecode,
com.sun.xml.bind.v2.model.annotation,
com.sun.xml.bind.v2.model.core,
com.sun.xml.bind.v2.model.impl,
com.sun.xml.bind.v2.model.nav,
com.sun.xml.bind.v2.model.runtime,
com.sun.xml.bind.v2.model.util,
com.sun.xml.bind.v2.runtime,
com.sun.xml.bind.v2.runtime.output,
com.sun.xml.bind.v2.runtime.property,
com.sun.xml.bind.v2.runtime.reflect,
com.sun.xml.bind.v2.runtime.reflect.opt,
com.sun.xml.bind.v2.runtime.unmarshaller,
com.sun.xml.bind.v2.schemagen,
com.sun.xml.bind.v2.schemagen.episode,
com.sun.xml.bind.v2.schemagen.xmlschema,
com.sun.xml.bind.v2.util,
javax.jws,
javax.ws.rs,
javax.ws.rs.client,
javax.ws.rs.container,
javax.ws.rs.core,
javax.ws.rs.ext,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.bind.annotation.adapters,
javax.xml.bind.attachment,
javax.xml.bind.helpers,
javax.xml.bind.util,
javax.xml.ws,
javax.xml.ws.handler,
javax.xml.ws.handler.soap,
javax.xml.ws.http,
javax.xml.ws.soap,
javax.xml.ws.spi,
javax.xml.ws.spi.http,
javax.xml.ws.wsaddressing,
org.apache.cxf,
org.apache.cxf.annotations,
org.apache.cxf.attachment,
org.apache.cxf.binding,
org.apache.cxf.binding.soap,
org.apache.cxf.binding.xml,
org.apache.cxf.binding.xml.interceptor,
org.apache.cxf.binding.xml.wsdl11,
@@ -95,6 +154,8 @@ Export-Package: javax.ws.rs,
org.apache.cxf.jaxrs.utils,
org.apache.cxf.jaxrs.utils.multipart,
org.apache.cxf.jaxrs.utils.schemas,
org.apache.cxf.jaxws.spi,
org.apache.cxf.jaxws22.spi,
org.apache.cxf.logging,
org.apache.cxf.management,
org.apache.cxf.management.annotation,
@@ -130,9 +191,16 @@ Export-Package: javax.ws.rs,
org.apache.cxf.ws.addressing.v200403,
org.apache.cxf.ws.addressing.v200408,
org.apache.cxf.ws.addressing.wsdl,
org.apache.cxf.ws.policy,
org.apache.cxf.ws.policy.mtom,
org.apache.cxf.wsdl,
org.apache.cxf.wsdl.binding,
org.apache.cxf.wsdl.http,
org.apache.cxf.wsdl11
org.apache.cxf.wsdl.service.factory,
org.apache.cxf.wsdl11,
org.apache.log4j,
org.apache.neethi,
org.apache.neethi.builders
Require-Bundle: javax.wsdl;bundle-version="1.6.2",
org.apache.log4j
Eclipse-BundleShape: dir

View File

@@ -1,29 +1,4 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
lib/stax2-api-3.1.4.jar,\
lib/woodstox-core-asl-4.4.1.jar,\
lib/xmlschema-core-2.2.1.jar,\
lib/commons-codec-1.10.jar,\
lib/wss4j-bindings-2.1.4.jar,\
lib/wss4j-policy-2.1.4.jar,\
lib/wss4j-ws-security-common-2.1.4.jar,\
lib/wss4j-ws-security-dom-2.1.4.jar,\
lib/wss4j-ws-security-policy-stax-2.1.4.jar,\
lib/wss4j-ws-security-stax-2.1.4.jar,\
lib/javax.activation-1.2.0.jar,\
lib/jaxws-api-2.3.1.jar,\
lib/cxf-core-3.3.4.jar,\
lib/cxf-rt-bindings-xml-3.3.4.jar,\
lib/cxf-rt-frontend-jaxrs-3.3.4.jar,\
lib/cxf-rt-rs-client-3.3.4.jar,\
lib/cxf-rt-transports-http-3.3.4.jar,\
lib/jakarta.ws.rs-api-2.1.5.jar,\
lib/neethi-3.1.1.jar,\
lib/javax.annotation-api-1.3.2.jar,\
lib/jaxb-runtime-2.3.2.jar,\
lib/jakarta.xml.bind-api-2.3.2.jar,\
lib/jakarta.activation-api-1.2.1.jar,\
lib/cxf-rt-wsdl-3.3.4.jar,\
lib/jakarta.activation-1.2.1.jar
lib/

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