Compare commits

...

59 Commits

Author SHA1 Message Date
kjwang
c57d0ba772 TUP-36748 Studio send request to wrong data center when token invalid (#5633)
* TUP-36748 Studio send request to wrong data center when token invalid
https://jira.talendforge.org/browse/TUP-36748

* TUP-36748 Studio send request to wrong data center when token invalid
https://jira.talendforge.org/browse/TUP-36748
2022-09-23 19:37:13 +08:00
kjwang
b390f938c8 Fix TUP-36740 When open tmc login page, we should encode all the (#5631)
parameters in URL
https://jira.talendforge.org/browse/TUP-36740
2022-09-22 20:32:39 +08:00
Samuel ANTOINE
c9d5fda28b feat(TBD-13810): add dynamic schema on tFileInputDelimited (release (#5622)
feat(TBD-13810): add dynamic schema on tFileInputDelimited
2022-09-22 11:34:19 +02:00
sbliu
4a04edee4a feat(TUP-36340) fix problem that still show missing orai18n jar . (#5615)
fix problem that after select 'Support NLS' checkbox and press finish button show missing orai18n jar .
2022-09-21 17:12:01 +08:00
kjwang
2047bf8b13 Fix TUP-36723 can not list project when use old way to fetch from token (#5613)
Fix TUP-36723 can not list project when use old way to fetch from token
https://jira.talendforge.org/browse/TUP-36723
2022-09-21 17:03:28 +08:00
kjwang
96fc7eb574 kjwang/Fix TUP-36721 Only display SSO page for Talend Studio (#5611)
kjwang/Fix TUP-36721 Only display SSO page for Talend Studio
https://jira.talendforge.org/browse/TUP-36721
2022-09-21 14:57:17 +08:00
kjwang
7d361371d2 Fix: TUP-36714 Improve the code for SSO feature (#5608)
* Fix: TUP-36714 Improve the code for SSO feature
https://jira.talendforge.org/browse/TUP-36714
2022-09-20 18:15:31 +08:00
zshen-talend
4e0527d80c fix(TDQ-19700):snowflake type don't should show on the combo list of DB wizard (#5606) 2022-09-19 17:56:43 +08:00
kjwang
e0eb2d5356 TUP-32606 Support SSO on Studio
TUP-32606 Support SSO on Studio
https://jira.talendforge.org/browse/TUP-32606
2022-09-16 15:37:54 +08:00
Emmanuel GALLOIS
9479f25100 feat(TDI-48418): Bump component-runtime to 1.48 (#5593) 2022-09-15 11:42:52 +02:00
zshen-talend
fc7cae42bf fix(TDQ-19700): fix the bug about second time switch change original value(#5595) 2022-09-15 12:19:23 +08:00
jiezhang-tlnd
c8dcf3e70e Add localized files (#5585) (#5589)
Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: jzhangbj <jzhang@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
2022-09-09 17:52:07 +08:00
jiezhang-tlnd
3b7f69525c Add localized files (#5583) (#5587)
Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: tsasada-talend <51699524+tsasada-talend@users.noreply.github.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
2022-09-09 17:18:33 +08:00
AlixMetivier-zz
996d2ee452 feat(TBD-13647): allow switch from transient to interactive cluster (#5424)
Co-authored-by: unknown <ametivier@talend.com>
2022-09-08 16:35:11 +02:00
sbliu
a695e44d7f feat(TUP-36340) oracle add support of orai18n.jar (#5528)
orai18n jar version using 19, same as ojdbc version of oracle 18,
   support nls feature only apply to oracle 18
2022-09-08 10:41:39 +08:00
Liu Xinquan
f77aadd99f Xqliu/tdq 20610 lucene core 8.0 (#5566) 2022-09-06 17:19:27 +08:00
sbieliaievl
e1743f86d3 Revert "Route and data services features versions behave differently in Talend Runtime (#5531)" (#5575)
This reverts commit c88e5002b3.
2022-09-06 11:13:24 +03:00
hzhao
5ef866743b fix(TUP-36593): Nexus proxy password is stored in clear text in project (#5562) 2022-09-05 23:34:20 +08:00
zshen-talend
656987c139 feat(TDQ-19700): add condition to avoid junit failed (#5573) 2022-09-05 22:12:38 +08:00
zshen-talend
e8902f55cc Zshen/feat/tdq 19700 3support switch context for snowflake jdbc (#5567) 2022-09-02 15:57:46 +08:00
sbliu
024bd7bf5c fix junit failure on 8.0 (#5559) 2022-09-02 09:32:00 +08:00
msjian
5e1d06edf6 chore(TDQ-20612): a wording issue (#5561) 2022-09-01 16:35:54 +08:00
sbieliaievl
73699ce3c1 Version in Cloud Artifact tab is not updated (#5538)
* fix(APPINT-34899) - added new constants for cloud publish event

* fix(APPINT-34899) - added cloud name constant for cloud version event
2022-09-01 10:52:03 +03:00
Oleksandr Zhelezniak
b218688c82 fix(TDI-48431): synchronize flush resumeutil (#5552) 2022-09-01 10:08:17 +03:00
bhe-talendbj
5fb4b545f4 feat(TUP-36373): Delete .m2 with UI option when apply a monthly update (#5549)
* feat(TUP-36373): initial impl

* feat(TUP-36373): delete m2 during startup

* feat(TUP-36373): delete m2 during startup
2022-09-01 10:10:58 +08:00
sbliu
4d9fa8adee chore(TUP-36502) upgrade org.postgresql:postgresql:42.2.25 to 42.2.26 (#5545) 2022-08-31 09:34:14 +08:00
hcyi
75c8efe0f0 fix(TUP-36483):Code generation fails with xmlmap. (#5540) 2022-08-30 17:56:58 +08:00
jiezhang-tlnd
cfc2a29f92 fix(TUP-35898)Studio does not display an error message when importing (#5397)
* fix(TUP-35898)Studio does not display an error message when importing
bad zip job archive

* format code
2022-08-30 09:32:17 +08:00
bhe-talendbj
3c2ccf0f38 feat(TUP-35886): add new method to rename tck component name (#5436)
* feat(TUP-35886): add new method to rename tck component name

* feat(TUP-35886): add junit

* feat(TUP-35886): add junit

* feat(TUP-35886): refactor name

* feat(TUP-35886): fix junit

* feat(TUP-35886): fix junit

* feat(TUP-35886): refactor and update doc
2022-08-29 17:45:27 +08:00
Jane Ding
48905f03a9 feat(TUP-35712):Track item signature with Pendo (#5499)
* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712

* feat(TUP-35712):Track item signature with Pendo
https://jira.talendforge.org/browse/TUP-35712
2022-08-29 09:35:15 +08:00
sbieliaievl
c88e5002b3 Route and data services features versions behave differently in Talend Runtime (#5531)
* fix(APPINT-34581) - added try take cloud version

* fix(APPINT-34581) - removed version hardcode

* fix(APPINT-34581) - added version for features

* fix(APPINT-34962) - added bundle version to feature

* fix(APPINT-34581)
2022-08-26 11:27:13 +03:00
AlixMetivier
af3ca0c30d Revert "feat(TBD-13810): add dynamic schema on thdfsinputformat components (#5442)" (#5544)
This reverts commit a5df51204e.
2022-08-17 17:15:55 +02:00
jiezhang-tlnd
dc687f1a50 Revert "feat(TUP-35808)Generate module name from maven url (#5425)" (#5536)
This reverts commit 4c0b9c6f91.
2022-08-11 15:03:30 +08:00
hzhao-talendbj
14a610a72b fix(TUP-36341): Unable to run DQ reports with subjob+joblet on a cloud (#5517)
* fix(TUP-36341): Unable to run DQ reports with subjob+joblet on a cloud

* fix(TUP-36341): Unable to run DQ reports with subjob+joblet on a cloud

* (TUP-36341): Unable to run DQ reports with subjob+joblet on a cloud
2022-08-09 16:21:30 +08:00
zyuan-talend
153a831b0b fix(TUP-35909):add missed context items for demo. (#5518) 2022-08-09 11:12:08 +08:00
hcyi
2bcc470833 fix(TUP-36012):CVE:com.h2database:h2:2.1.210 (#5454) 2022-08-09 11:00:19 +08:00
ypiel
88d10b08ec Chore: bump tck 1.47.0 on maintenance 8.0 (#5491)
* bump to component-runtime 1.47.1

Co-authored-by: Emmanuel GALLOIS <egallois@talend.com>
2022-08-08 13:42:28 +02:00
jiezhang-tlnd
5687315bd2 fix(TUP-36127)Upgrade commons-configuration to 2.8.0 (#5514)
* fix(TUP-36127)Upgrade commons-configuration to 2.8.0

* exclude commons-configuration2

* chore(TUP-36127) exclude commons-configuration2

* add dependency commons-text
2022-08-08 14:09:34 +08:00
wang wei
7cfce8de2a fix(TDI-48203): fix for microservice case (#5526) 2022-08-05 15:05:42 +08:00
Jane Ding
da7f173be2 feat(TUP-35644):tMap - possible simplified metrics to send to Pendo (#5524)
https://jira.talendforge.org/browse/TUP-35644
2022-08-05 10:08:26 +08:00
jiezhang-tlnd
f5a6347377 Add localized files (#5520) (#5523)
Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: Alexiane Yvonet <ayvonet@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
2022-08-04 17:17:37 +08:00
Zhiwei Xue
e7ba1d5016 fix(TUP-36175):align bcprov-jdk15on to 1.70 (#5461) 2022-08-02 10:23:42 +08:00
zyuan-talend
ba1ee02e4e Add localized files (#5507)
* Add localized files (#5505)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

* Add localized files (#5506)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: jzhangbj <jzhang@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
Co-authored-by: tsasada-talend <51699524+tsasada-talend@users.noreply.github.com>
2022-07-29 15:51:09 +08:00
Samuel ANTOINE
a5df51204e feat(TBD-13810): add dynamic schema on thdfsinputformat components (#5442)
* feat(TBD-13810): add dynamic schema on thdfsinputformat components
2022-07-29 07:26:46 +02:00
kjwang
dfe132d87e TUP-36242 jobs changing Hadoop metadata distribution after changing (#5484)
TUP-36242 jobs changing Hadoop metadata distribution after changing project/branch
https://jira.talendforge.org/browse/TUP-36242
2022-07-28 16:03:38 +08:00
jiezhang-tlnd
4c0b9c6f91 feat(TUP-35808)Generate module name from maven url (#5425)
* feat(TUP-35808)Generate module name from maven url

* handle for component and plugin.xml

* handle for component

* move to moduleNeeded.java

* format code

* feat(TUP-35808)Generate module name from maven url

* feat(TUP-35808)Generate module name from maven url

* add junits

* feat(TUP-35808)Generate module name from maven url

* add warning for incorrect module name

* add warning log for module name

* Use MODULE (name in plugin.xml) to build MVN_URI

* handle log

* handle mssql metedata
2022-07-27 18:38:21 +08:00
sbliu
16b6699cc9 feat(TUP-29393) replace nexus connection timeout with default connection timeout (#5475) 2022-07-27 17:42:01 +08:00
jiezhang-tlnd
3f57a592d1 fix(TUP-35446)CVE: org.apache.maven:maven-core:3.8.3 (#5446) 2022-07-27 11:25:19 +08:00
wang wei
74bc5ee66f fix(TDI-48203): [CVE]: routines.system.JSONObject(Object bean) use reflect to call method invoke, that's dangerous for evil script inject (#5426) 2022-07-27 09:29:03 +08:00
sbliu
6a0c96627f fix(TUP-36252) fix NPE for tos studio build job (#5482) 2022-07-26 14:25:12 +08:00
sbliu
ecf339a6ca chore(TUP-35865) upgrade wstx-asl-3.2.9.jar with wstx-core-asl-4.4.1 and stax2-api-4.2.1 (#5438) 2022-07-22 17:28:02 +08:00
Zhiwei Xue
dc5c3d0ec9 fix(TUP-18979):fix junit failure (#5492) 2022-07-22 16:15:34 +08:00
Jane Ding
503924aa75 Jding/add localized files 2022 07 21 (#5488)
* Add localized files (#5486)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

* Add localized files (#5487)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: Alexiane Yvonet <ayvonet@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
Co-authored-by: tsasada-talend <51699524+tsasada-talend@users.noreply.github.com>
2022-07-21 17:43:39 +08:00
hzhao-talendbj
4ed461840a fix jackson cve (#5480) 2022-07-19 20:37:51 +08:00
hzhao-talendbj
cafa72f52a Revert "chore(TUP-35265): upgrade 'crypto-utils' jar in low level (#5372)" (#5476)
This reverts commit aed39722eb.
2022-07-19 16:25:28 +08:00
pyzhou
af62f01007 fix(TDI-48024): ResumeUtil performance issue (#5458)
* fix(TDI-48024): ResumeUtil performance issue

* NPE
2022-07-19 12:01:41 +08:00
zyuan-talend
5e4b9311a9 fix(TUP-36231,TUP31721): deploy libs from custom component. (#5468) (#5473) 2022-07-19 10:07:24 +08:00
Zhiwei Xue
a6164bf006 fix(TUP-18979):fix sync mapping file error of job project (#5470) 2022-07-18 16:55:14 +08:00
sbliu
24622068ec chore(TUP-35863) remove lower version of maven-settings (#5419)
* chore(TUP-35863) remove lower version of maven-settings
2022-07-18 09:44:36 +08:00
167 changed files with 6051 additions and 834 deletions

View File

@@ -5,7 +5,7 @@
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import plugin="org.bouncycastle.bcprov" version="1.69.0" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="1.70.0" match="greaterOrEqual"/>
<import plugin="com.cedarsoftware.json-io" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-annotations" version="2.9.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.9.8" match="greaterOrEqual"/>

View File

@@ -55,6 +55,11 @@ public class NetworkUtil {
private static final int DEFAULT_NEXUS_TIMEOUT = 20000;// same as preference value
public static final String ORG_TALEND_DESIGNER_CORE = "org.talend.designer.core"; //$NON-NLS-1$
/*
* see ITalendCorePrefConstants.PERFORMANCE_TAC_READ_TIMEOUT
*/
private static final String PERFORMANCE_TAC_READ_TIMEOUT = "PERFORMANCE_TAC_READ_TIMEOUT"; //$NON-NLS-1$
private static final String PROP_DISABLEDSCHEMES_USE_DEFAULT = "talend.studio.jdk.http.auth.tunneling.disabledSchemes.useDefault";
@@ -149,10 +154,10 @@ public class NetworkUtil {
}
public static int getNexusTimeout() {
int timeout = DEFAULT_NEXUS_TIMEOUT;
int timeout = Integer.getInteger("nexus.timeout.min", DEFAULT_NEXUS_TIMEOUT);
try {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ORG_TALEND_DESIGNER_CORE);
timeout = node.getInt(ITalendNexusPrefConstants.NEXUS_TIMEOUT, DEFAULT_NEXUS_TIMEOUT);
timeout = Math.max(timeout, node.getInt(PERFORMANCE_TAC_READ_TIMEOUT, 0) * 1000);
} catch (Throwable e) {
ExceptionHandler.process(e);
}

View File

@@ -88,13 +88,17 @@ public class EclipseCommandLine {
static public final String TALEND_CONTINUE_LOGON = "-talendContinueLogon";
static public final String TALEND_CONTINUE_UPDATE = "-talendContinueUpdate";
static public final String TALEND_CLEAN_M2 = "-talendCleanM2";
static public final String TALEND_CLEAN_UNINSTALLED_BUNDLES = "-talendCleanUninstalledBundles";
static public final String PROP_KEY_PROFILE_ID = "eclipse.p2.profile";
static public final String ARG_BRANCH = "-branch";
static public final String ARG_PROJECT = "-project";
static public final String LOGIN_ONLINE_UPDATE = "--loginOnlineUpdate";
static public final String ARG_TALEND_BUNDLES_CLEANED = "-talend.studio.bundles.cleaned"; //$NON-NLS-1$

View File

@@ -39,6 +39,19 @@ public final class Constant {
*/
public static final String ITEM_EVENT_PROPERTY_KEY = "item"; //$NON-NLS-1$
/**
* key used to get/set the property of an event related to an item (REPOSITORY_ITEM_EVENT_PREFIX). The value is the
* cloudVersion string.
*/
public static final String VERSION_EVENT_CLOUD_KEY = "cloudVersion"; //$NON-NLS-1$
/**
* key used to get/set the property of an event related to an item (REPOSITORY_ITEM_EVENT_PREFIX). The value is the
* cloudName string.
*/
public static final String VERSION_EVENT_CLOUD_NAME = "cloudName"; //$NON-NLS-1$
/**
* key used to get/set the property of an event related to a list of files modified in the repository
* (REPOSITORY_ITEM_EVENT_PREFIX). The value is the Collection of String (list of all files modified).
@@ -56,6 +69,11 @@ public final class Constant {
*/
public static final String PROJECT_RELOAD_EVENT_SUFFIX = "project"; //$NON-NLS-1$
/**
* suffix used when issuing an event on the OSGI event bus when published to cloud.
*/
public static final String CLOUD_PUBLISH_EVENT_SUFFIX = "cloud"; //$NON-NLS-1$
/**
* key used to get/set the property of an event related to a list of files modified in the repository

View File

@@ -0,0 +1,280 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.repository.model;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.ICoreService;
import org.talend.core.PluginChecker;
import org.talend.core.model.properties.Property;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.properties.SQLPatternItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.pendo.PendoItemSignatureUtil;
import org.talend.core.pendo.PendoItemSignatureUtil.SignatureStatus;
import org.talend.core.pendo.PendoItemSignatureUtil.TOSProdNameEnum;
import org.talend.core.pendo.PendoItemSignatureUtil.ValueEnum;
import org.talend.core.pendo.PendoTrackDataUtil;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoSignLogonProperties;
import org.talend.utils.migration.MigrationTokenUtil;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoItemSignatureManager {
private PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
private static PendoItemSignatureManager manager;
private static boolean isTrackAvailable;
static {
manager = new PendoItemSignatureManager();
try {
isTrackAvailable = PluginChecker.isTIS() && PendoTrackSender.getInstance().isTrackSendAvailable();
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
}
private PendoItemSignatureManager() {
}
public static PendoItemSignatureManager getInstance() {
return manager;
}
private Set<String> signByLoginMigrationItems = new HashSet<String>();
public void countItemSignByMigration(String file) {
if (!isTrackAvailable) {
return;
}
if (!ProxyRepositoryFactory.getInstance().isFullLogonFinished()) {
signByLoginMigrationItems.add(file);
}
}
public void collectProperties() {
ICoreService coreService = ICoreService.get();
if (coreService == null || !isTrackAvailable) {
return;
}
try {
itemSignProperties.setSignByMigration(signByLoginMigrationItems.size());
String seperator = "@";
Map<String, Integer> tosUnsignItemMap = new HashMap<String, Integer>();
Map<String, Integer> invalidItemVersionMap = new HashMap<String, Integer>();
Set<String> checkedItem = new HashSet<String>();
ProxyRepositoryFactory proxyRepositoryFactory = ProxyRepositoryFactory.getInstance();
ERepositoryObjectType[] types = (ERepositoryObjectType[]) ERepositoryObjectType.values();
for (ERepositoryObjectType type : types) {
List<IRepositoryViewObject> allObjectList = proxyRepositoryFactory.getAll(type);
for (IRepositoryViewObject repositoryObject : allObjectList) {
Property property = repositoryObject.getProperty();
if (property == null || property.eResource() == null) {
continue;
}
String itemKey = repositoryObject.getRepositoryObjectType() + seperator + property.getId() + seperator
+ property.getVersion();
if (isBuiltInItem(repositoryObject) || checkedItem.contains(itemKey)) {
continue;
}
checkedItem.add(itemKey);
Integer verifyResult = null;
try {
verifyResult = coreService.getSignatureVerifyResult(property, null, false);
if (verifyResult != null) {
switch (verifyResult) {
case SignatureStatus.V_VALID:
itemSignProperties.setValidItems(itemSignProperties.getValidItems() + 1);
break;
case SignatureStatus.V_UNSIGNED:
String itemProductName = PendoItemSignatureUtil
.getItemProductName(property);
if (StringUtils.isNotBlank(itemProductName)) {
String tosCategory = TOSProdNameEnum.getTOSCategoryByProdName(itemProductName);
if (StringUtils.isBlank(tosCategory)) {
itemSignProperties.setUnsignEEItems(itemSignProperties.getUnsignEEItems() + 1);
} else {
if (tosUnsignItemMap.get(tosCategory) == null) {
tosUnsignItemMap.put(tosCategory, 0);
}
tosUnsignItemMap.put(tosCategory, tosUnsignItemMap.get(tosCategory) + 1);
}
}
addInvalidItemVersion(property, invalidItemVersionMap);
break;
default:
addInvalidItemVersion(property, invalidItemVersionMap);
itemSignProperties.setInvalidSignItems(itemSignProperties.getInvalidSignItems() + 1);
}
}
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
if (verifyResult == null) {
// exception during verify
addInvalidItemVersion(property, invalidItemVersionMap);
itemSignProperties.setInvalidSignItems(itemSignProperties.getInvalidSignItems() + 1);
}
}
}
}
itemSignProperties.setInvalidItemSourceVersion(getSortInvalidItems(invalidItemVersionMap));
itemSignProperties.setUnsignSEItems(getSortTOSUnsignItems(tosUnsignItemMap));
itemSignProperties.setStudioVersion(PendoItemSignatureUtil.getStudioVersion());
if (coreService.isInValidGP()) {
itemSignProperties.setGracePeriod(ValueEnum.YES.getDisplayValue());
} else {
itemSignProperties.setGracePeriod(ValueEnum.NO.getDisplayValue());
}
String prodDate = PendoItemSignatureUtil.formatDate(System.getProperty(PendoItemSignatureUtil.PROD_DATE_ID),
"yyyy-MM-dd");
itemSignProperties.setInstallDate(prodDate);
String projectCreateDate = PendoItemSignatureUtil.getCurrentProjectCreateDate();
itemSignProperties.setProjectCreateDate(PendoItemSignatureUtil.formatDate(projectCreateDate, "yyyy-MM-dd"));
String value = System.getProperty(PendoItemSignatureUtil.MIGRATION_TOKEN_KEY);
Map<String, Date> tokenTime = MigrationTokenUtil.getMigrationTokenTime(value);
if (tokenTime == null || tokenTime.isEmpty()) {
itemSignProperties.setValidMigrationToken(ValueEnum.NOT_APPLICATE.getDisplayValue());
} else {
String customer = coreService.getLicenseCustomer();
Date tokenDate = tokenTime.get(customer);
Date currentDate = new Date();
if (tokenDate != null && tokenDate.after(currentDate)) {
itemSignProperties.setValidMigrationToken(ValueEnum.YES.getDisplayValue());
} else {
itemSignProperties.setValidMigrationToken(ValueEnum.NO.getDisplayValue());
}
}
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
}
private void addInvalidItemVersion(Property property, Map<String, Integer> invalidItemVersionMap) {
String itemProductVersion = PendoItemSignatureUtil.getItemProductVersion(property);
if (StringUtils.isNotBlank(itemProductVersion)) {
if (invalidItemVersionMap.get(itemProductVersion) == null) {
invalidItemVersionMap.put(itemProductVersion, 0);
}
invalidItemVersionMap.put(itemProductVersion, invalidItemVersionMap.get(itemProductVersion) + 1);
}
}
private boolean isBuiltInItem(IRepositoryViewObject repositoryObject) {
if (repositoryObject.getProperty().getItem() instanceof SQLPatternItem) {
SQLPatternItem sqlPatternItem = (SQLPatternItem) repositoryObject.getProperty().getItem();
if (sqlPatternItem.isSystem()) {
return true;
}
}
if (repositoryObject.getProperty().getItem() instanceof RoutineItem) {
RoutineItem routineItem = (RoutineItem) repositoryObject.getProperty().getItem();
if (routineItem.isBuiltIn()) {
return true;
}
}
return false;
}
private String getSortTOSUnsignItems(Map<String, Integer> tosUnsignItemMap) {
List<Map.Entry<String, Integer>> resultMapList = new ArrayList<Map.Entry<String, Integer>>(tosUnsignItemMap.entrySet());
Collections.sort(resultMapList, new Comparator<Map.Entry<String, Integer>>() {
@Override
public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) {
List<TOSProdNameEnum> categoryList = Arrays.asList(TOSProdNameEnum.values());
TOSProdNameEnum category1 = TOSProdNameEnum.valueOf(o1.getKey());
TOSProdNameEnum category2 = TOSProdNameEnum.valueOf(o2.getKey());
return categoryList.indexOf(category1) - categoryList.indexOf(category2);
}
});
Map<String, Integer> tosUnsignMap = new LinkedHashMap<String, Integer>();
resultMapList.forEach(entry -> {
tosUnsignMap.put(entry.getKey(), entry.getValue());
});
return PendoTrackDataUtil.convertEntityJsonString(tosUnsignMap);
}
private String getSortInvalidItems(Map<String, Integer> invalidItemVersionMap) {
List<Map.Entry<String, Integer>> resultMapList = new ArrayList<Map.Entry<String, Integer>>(
invalidItemVersionMap.entrySet());
Collections.sort(resultMapList, new Comparator<Map.Entry<String, Integer>>(){
@Override
public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) {
return o1.getKey().compareTo(o2.getKey());
}
});
Map<String, Integer> invalidMap = new LinkedHashMap<String, Integer>();
resultMapList.forEach(entry -> {
invalidMap.put(entry.getKey(), entry.getValue());
});
return PendoTrackDataUtil.convertEntityJsonString(invalidMap);
}
public void sendTrackToPendo() {
if (!isTrackAvailable) {
return;
}
Job job = new Job("send pendo track") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
collectProperties();
PendoTrackSender.getInstance().sendTrackData(TrackEvent.ITEM_SIGNATURE, itemSignProperties);
} catch (Exception e) {
// warning only
ExceptionHandler.process(e, Level.WARN);
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
}

View File

@@ -93,6 +93,7 @@ import org.talend.core.context.CommandLineContext;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.exception.TalendInternalPersistenceException;
import org.talend.core.hadoop.BigDataBasicUtil;
import org.talend.core.hadoop.IHadoopDistributionService;
import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.general.ILibrariesService;
@@ -2209,6 +2210,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ExceptionHandler.process(e);
}
// init dynamic distirbution after `beforeLogon`, before loading libraries.
initDynamicDistribution(monitor);
// need to set m2
LoginTaskRegistryReader loginTaskRegistryReader = new LoginTaskRegistryReader();
ILoginTask[] allLoginTasks = loginTaskRegistryReader.getAllCommandlineTaskListInstance();
@@ -2315,6 +2319,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
if (monitor != null && monitor.isCanceled()) {
throw new OperationCanceledException(""); //$NON-NLS-1$
}
PendoItemSignatureManager.getInstance().sendTrackToPendo();
boolean isCommandLineLocalRefProject = false;
CommandLineContext commandLineContext = (CommandLineContext) CoreRuntimePlugin.getInstance().getContext()
@@ -2404,6 +2409,18 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
throw e;
}
}
private void initDynamicDistribution(IProgressMonitor monitor) {
try {
if (BigDataBasicUtil.isDynamicDistributionLoaded(monitor)) {
BigDataBasicUtil.reloadAllDynamicDistributions(monitor);
} else {
BigDataBasicUtil.loadDynamicDistribution(monitor);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
// to fix the ops4j and m2e.core maven handler conflict issue TUP-31484
private void unregisterM2EServiceBeforeLogon() {

View File

@@ -1,125 +1,127 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.repository.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.swt.events.SelectionListener;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
import org.talend.commons.utils.workbench.extensions.ExtensionPointLimiterImpl;
import org.talend.commons.utils.workbench.extensions.IExtensionPointLimiter;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ui.branding.IBrandingService;
/**
* Provides, using extension points, implementation of many factories.
*
* <ul>
* <li>IProcessFactory</li>
* </ul>
*
* $Id: RepositoryFactoryProvider.java 38013 2010-03-05 14:21:59Z mhirt $
*/
public class RepositoryFactoryProvider {
private static List<IRepositoryFactory> list = null;
public static final IExtensionPointLimiter REPOSITORY_PROVIDER = new ExtensionPointLimiterImpl(
"org.talend.core.repository.repository_provider", //$NON-NLS-1$
"RepositoryFactory", 1, -1); //$NON-NLS-1$
public static List<IRepositoryFactory> getAvailableRepositories() {
if (list == null) {
list = new ArrayList<IRepositoryFactory>();
List<IConfigurationElement> extension = ExtensionImplementationProvider.getInstanceV2(REPOSITORY_PROVIDER);
String hiddenRepos = System.getProperty("hidden.repositories"); //$NON-NLS-1$
String hiddenRepository[] = new String[]{};
if (hiddenRepos != null) {
hiddenRepository = hiddenRepos.split(";"); //$NON-NLS-1$
}
boolean isPoweredByTalend = false;
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault()
.getService(IBrandingService.class);
isPoweredByTalend = brandingService.isPoweredbyTalend();
for (IConfigurationElement current : extension) {
try {
String only4TalendStr = current.getAttribute("only4Talend"); //$NON-NLS-1$
if (Boolean.valueOf(only4TalendStr) && !isPoweredByTalend) {
continue;
}
String only4OemStr = current.getAttribute("only4Oem"); //$NON-NLS-1$
if (Boolean.valueOf(only4OemStr) && isPoweredByTalend) {
continue;
}
IRepositoryFactory currentAction = (IRepositoryFactory) current.createExecutableExtension("class"); //$NON-NLS-1$
currentAction.setId(current.getAttribute("id")); //$NON-NLS-1$
currentAction.setName(current.getAttribute("name")); //$NON-NLS-1$
currentAction.setAuthenticationNeeded(new Boolean(current.getAttribute("authenticationNeeded"))); //$NON-NLS-1$
currentAction.setDisplayToUser(new Boolean(current.getAttribute("displayToUser")).booleanValue()); //$NON-NLS-1$
// Getting dynamic login fields:
for (IConfigurationElement currentLoginField : current.getChildren("loginField")) { //$NON-NLS-1$
DynamicFieldBean key = new DynamicFieldBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
currentLoginField.getAttribute("defaultValue"), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("required")), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("password")), //$NON-NLS-1$
Boolean.valueOf(currentLoginField.getAttribute("readonly"))); //$NON-NLS-1$
currentAction.getFields().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("button")) { //$NON-NLS-1$
DynamicButtonBean key = new DynamicButtonBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
(SelectionListener) currentLoginField.createExecutableExtension("selectionListener")); //$NON-NLS-1$
currentAction.getButtons().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("choiceField")) { //$NON-NLS-1$
DynamicChoiceBean key = new DynamicChoiceBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name")); //$NON-NLS-1$
for (IConfigurationElement currentChoice : currentLoginField.getChildren("choice")) { //$NON-NLS-1$
String value = currentChoice.getAttribute("value"); //$NON-NLS-1$
String label = currentChoice.getAttribute("label"); //$NON-NLS-1$
key.addChoice(value, label);
}
currentAction.getChoices().add(key);
}
if (ArrayUtils.contains(hiddenRepository, currentAction.getId())) {
continue;
}
list.add(currentAction);
} catch (CoreException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
}
return list;
}
public static IRepositoryFactory getRepositoriyById(String id) {
for (IRepositoryFactory current : getAvailableRepositories()) {
if (current.getId().equals(id)) {
return current;
}
}
return null;
}
}
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.repository.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.swt.events.SelectionListener;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
import org.talend.commons.utils.workbench.extensions.ExtensionPointLimiterImpl;
import org.talend.commons.utils.workbench.extensions.IExtensionPointLimiter;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ui.branding.IBrandingService;
/**
* Provides, using extension points, implementation of many factories.
*
* <ul>
* <li>IProcessFactory</li>
* </ul>
*
* $Id: RepositoryFactoryProvider.java 38013 2010-03-05 14:21:59Z mhirt $
*/
public class RepositoryFactoryProvider {
private static List<IRepositoryFactory> list = null;
public static final IExtensionPointLimiter REPOSITORY_PROVIDER = new ExtensionPointLimiterImpl(
"org.talend.core.repository.repository_provider", //$NON-NLS-1$
"RepositoryFactory", 1, -1); //$NON-NLS-1$
public static synchronized List<IRepositoryFactory> getAvailableRepositories() {
if (list == null) {
list = new ArrayList<IRepositoryFactory>();
List<IConfigurationElement> extension = ExtensionImplementationProvider.getInstanceV2(REPOSITORY_PROVIDER);
String hiddenRepos = System.getProperty("hidden.repositories"); //$NON-NLS-1$
String hiddenRepository[] = new String[]{};
if (hiddenRepos != null) {
hiddenRepository = hiddenRepos.split(";"); //$NON-NLS-1$
}
boolean isPoweredByTalend = false;
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault()
.getService(IBrandingService.class);
isPoweredByTalend = brandingService.isPoweredbyTalend();
for (IConfigurationElement current : extension) {
try {
String only4TalendStr = current.getAttribute("only4Talend"); //$NON-NLS-1$
if (Boolean.valueOf(only4TalendStr) && !isPoweredByTalend) {
continue;
}
String only4OemStr = current.getAttribute("only4Oem"); //$NON-NLS-1$
if (Boolean.valueOf(only4OemStr) && isPoweredByTalend) {
continue;
}
IRepositoryFactory currentAction = (IRepositoryFactory) current.createExecutableExtension("class"); //$NON-NLS-1$
currentAction.setId(current.getAttribute("id")); //$NON-NLS-1$
currentAction.setName(current.getAttribute("name")); //$NON-NLS-1$
currentAction.setAuthenticationNeeded(new Boolean(current.getAttribute("authenticationNeeded"))); //$NON-NLS-1$
currentAction.setDisplayToUser(new Boolean(current.getAttribute("displayToUser")).booleanValue()); //$NON-NLS-1$
// Getting dynamic login fields:
for (IConfigurationElement currentLoginField : current.getChildren("loginField")) { //$NON-NLS-1$
DynamicFieldBean key = new DynamicFieldBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
currentLoginField.getAttribute("defaultValue"), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("required")), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("password")), //$NON-NLS-1$
Boolean.valueOf(currentLoginField.getAttribute("readonly"))); //$NON-NLS-1$
currentAction.getFields().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("button")) { //$NON-NLS-1$
DynamicButtonBean key = new DynamicButtonBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
(SelectionListener) currentLoginField.createExecutableExtension("selectionListener")); //$NON-NLS-1$
currentAction.getButtons().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("choiceField")) { //$NON-NLS-1$
DynamicChoiceBean key = new DynamicChoiceBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name")); //$NON-NLS-1$
for (IConfigurationElement currentChoice : currentLoginField.getChildren("choice")) { //$NON-NLS-1$
String value = currentChoice.getAttribute("value"); //$NON-NLS-1$
String label = currentChoice.getAttribute("label"); //$NON-NLS-1$
key.addChoice(value, label);
}
currentAction.getChoices().add(key);
}
if (ArrayUtils.contains(hiddenRepository, currentAction.getId())) {
continue;
}
list.add(currentAction);
} catch (CoreException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
}
return list;
}
public static IRepositoryFactory getRepositoriyById(String id) {
for (IRepositoryFactory current : getAvailableRepositories()) {
if (current.getId().equals(id)) {
return current;
}
}
ExceptionHandler.log("Can't find repository factory for: " + id);
return null;
}
}

View File

@@ -129,7 +129,8 @@ Require-Bundle: org.eclipse.jdt.core,
jackson-core-asl,
org.talend.libraries.jackson,
org.eclipse.m2e.core,
org.talend.libraries.apache.common
org.talend.libraries.apache.common,
org.talend.signon.util
Bundle-Activator: org.talend.core.runtime.CoreRuntimePlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,

View File

@@ -31,6 +31,7 @@ import org.talend.core.model.metadata.ColumnNameChanged;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
@@ -134,6 +135,12 @@ public interface ICoreService extends IService {
*/
void installComponents(IProgressMonitor monitor);
Integer getSignatureVerifyResult(Property property, IPath resourcePath, boolean considerGP) throws Exception;
String getLicenseCustomer();
boolean isInValidGP();
public static ICoreService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
return GlobalServiceRegister.getDefault().getService(ICoreService.class);

View File

@@ -156,6 +156,8 @@ public interface ILibraryManagerService extends IService {
public void clearCache();
public void clearCache(boolean cleanIndex);
public void deployLibsFromCustomComponents();
@Deprecated
public Set<String> list(boolean withComponent, IProgressMonitor... monitorWrap);

View File

@@ -15,8 +15,10 @@ package org.talend.core.context;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.User;
import org.talend.core.service.ICloudSignOnService;
/**
* DOC smallet class global comment. Detailled comment <br/>
@@ -139,6 +141,14 @@ public class RepositoryContext {
* @return the clearPassword
*/
public String getClearPassword() {
try {
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
return ICloudSignOnService.get().getLatestToken().getAccessToken();
}
}catch (Exception ex) {
ExceptionHandler.process(ex);
}
return clearPassword;
}

View File

@@ -147,8 +147,15 @@ public enum EDatabaseTypeName {
MAPRDB(
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true),//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SNOWFLAKE(
"SNOWFLAKE","SNOWFLAKE",Boolean.TRUE,"SNOWFLAKE",EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.None);
"SNOWFLAKE",
"SNOWFLAKE",
Boolean.TRUE,
"SNOWFLAKE",
EDatabaseSchemaOrCatalogMapping.None,
EDatabaseSchemaOrCatalogMapping.None,
true);
// displayName is used in Java code.
private String displayName;

View File

@@ -351,11 +351,19 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_TYPE = "CONN_PARA_KEY_DATABRICKS_CLUSTER_TYPE";
public static final String CONN_PARA_KEY_DATABRICKS_RUN_MODE = "CONN_PARA_KEY_DATABRICKS_RUN_MODE";
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";
public static final String CONN_PARA_KEY_DATABRICKS_TOKEN="CONN_PARA_KEY_DATABRICKS_TOKEN";
public static final String CONN_PARA_KEY_DATABRICKS_NODE_TYPE="CONN_PARA_KEY_DATABRICKS_NODE_TYPE";
public static final String CONN_PARA_KEY_DATABRICKS_DRIVER_NODE_TYPE="CONN_PARA_KEY_DATABRICKS_DRIVER_NODE_TYPE";
public static final String CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION="CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION";
public static final String CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER="CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER";

View File

@@ -207,7 +207,13 @@ public enum EDatabaseConnTemplate {
"2181")), //$NON-NLS-1$
MAPRDB(new DbConnStr(EDatabaseTypeName.MAPRDB, "127.0.0.1", //$NON-NLS-1$
"5181")); //$NON-NLS-1$
"5181")), //$NON-NLS-1$
SNOWFLAKE(
new DbConnStr(EDatabaseTypeName.SNOWFLAKE, //
"jdbc:snowflake://<host>:<port>/?<property>",
"3306" //$NON-NLS-1$
)); // $NON-NLS-1$
private DbConnStr connStr;

View File

@@ -56,14 +56,14 @@ public enum EDatabaseVersion4Drivers {
HSQLDB_SERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_SERVER, "hsqldb.jar")), //$NON-NLS-1$
HSQLDB_WEBSERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_WEBSERVER, "hsqldb.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-2.1.210.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-2.1.214.jar")), //$NON-NLS-1$
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlitejdbc-v056.jar")), //$NON-NLS-1$
FIREBIRD(new DbVersion4Drivers(EDatabaseTypeName.FIREBIRD, "jaybird-full-2.1.1.jar")), //$NON-NLS-1$
TERADATA(new DbVersion4Drivers(EDatabaseTypeName.TERADATA,
new String[] { "terajdbc4-17.10.00.27.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "terajdbc4-17.10.00.27.jar" })), //$NON-NLS-1$
JAVADB_DERBYCLIENT(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_DERBYCLIENT, "derbyclient.jar")), //$NON-NLS-1$
NETEZZA(new DbVersion4Drivers(EDatabaseTypeName.NETEZZA, "nzjdbc.jar")), //$NON-NLS-1$
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
@@ -95,12 +95,12 @@ public enum EDatabaseVersion4Drivers {
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.25.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.26.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,
"Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IBMDB2(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
"db2jcc_license_cisuz.jar" })), //$NON-NLS-1$
IBMDB2ZOS(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2ZOS, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$

View File

@@ -154,6 +154,14 @@ public enum EHadoopProperties {
DATABRICKS_DBFS_DEP_FOLDER,
DATABRICKS_NODE_TYPE,
DATABRICKS_DRIVER_NODE_TYPE,
DATABRICKS_RUNTIME_VERSION,
DATABRICKS_CLUSTER_TYPE,
UNIV_STANDALONE_MASTER,
UNIV_STANDALONE_EXEC_MEMORY,

View File

@@ -17,10 +17,14 @@ import java.util.Iterator;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.runtime.i18n.Messages;
import org.talend.repository.model.RepositoryConstants;
import org.talend.signon.util.TMCRepositoryUtil;
import org.talend.signon.util.TokenMode;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
@@ -58,12 +62,14 @@ public class ConnectionBean implements Cloneable {
private static final String TOKEN = "token"; //$NON-NLS-1$
private static final String URL = "url"; //$NON-NLS-1$
private static final String STORECREDENTIALS = "storeCredentials"; //$NON-NLS-1$
private String credentials = ""; //$NON-NLS-1$
public static final String CLOUD_TOKEN_ID ="cloud_token"; //$NON-NLS-1$
private static final String LOGIN_VIA_CLOUD = "login_via_cloud"; //$NON-NLS-1$
/**
* DOC smallet ConnectionBean constructor comment.
*/
@@ -89,6 +95,24 @@ public class ConnectionBean implements Cloneable {
newConnection.setPassword(""); //$NON-NLS-1$
return newConnection;
}
public static ConnectionBean getDefaultCloudConnectionBean(String dataCenter) {
ConnectionBean newConnection = new ConnectionBean();
newConnection.setName(Messages.getString("ConnectionBean.Cloud.name", TMCRepositoryUtil.getDisplayNameByDatacenter(dataCenter))); //$NON-NLS-1$
newConnection.setDescription(Messages.getString("ConnectionBean.CloudConnection.description", TMCRepositoryUtil.getDisplayNameByDatacenter(dataCenter))); //$NON-NLS-1$
newConnection.setRepositoryId(TMCRepositoryUtil.getRepositoryId(dataCenter));
newConnection.setToken(true);
newConnection.setStoreCredentials(true);
newConnection.setComplete(true);
newConnection.setLoginViaCloud(true);
newConnection.setWorkSpace(getRecentWorkSpace());
return newConnection;
}
protected static String getRecentWorkSpace() {
String filePath = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath();
return filePath;
}
/**
* Getter for ID.
@@ -184,11 +208,16 @@ public class ConnectionBean implements Cloneable {
*/
public String getPassword() {
try {
if (conDetails.has(PASSWORD)) {
if (isStoreCredentials() && credentials != null) {
return this.credentials;
}
return conDetails.getString(PASSWORD);
} else if (conDetails.has(CLOUD_TOKEN_ID)){
String object = conDetails.getString(CLOUD_TOKEN_ID);
TokenMode token = TokenMode.parseFromJson(object, null);
return token.getAccessToken();
}
} catch (JSONException e) {
ExceptionHandler.process(e);
@@ -215,7 +244,7 @@ public class ConnectionBean implements Cloneable {
* @return the user
*/
public String getUser() {
try {
try {
if (conDetails.has(USER)) {
String user = conDetails.getString(USER);
if (isToken()) {
@@ -226,7 +255,7 @@ public class ConnectionBean implements Cloneable {
}
}
return user;
}
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
@@ -320,6 +349,25 @@ public class ConnectionBean implements Cloneable {
ExceptionHandler.process(e);
}
}
public boolean isLoginViaCloud() {
try {
if (conDetails.has(LOGIN_VIA_CLOUD)) {
return (Boolean) conDetails.get(LOGIN_VIA_CLOUD);
}
} catch (JSONException e) {
// do nothing
}
return false;
}
public void setLoginViaCloud(boolean isLoginViaCloud) {
try {
conDetails.put(LOGIN_VIA_CLOUD, isLoginViaCloud);
} catch (JSONException e) {
// do nothing
}
}
@Override
public ConnectionBean clone() throws CloneNotSupportedException {
@@ -418,14 +466,21 @@ public class ConnectionBean implements Cloneable {
public String getUrl() {
try {
if (conDetails.has(URL)) {
return conDetails.getString(URL);
if (dynamicFields.containsKey(RepositoryConstants.REPOSITORY_URL)) {
return dynamicFields.get(RepositoryConstants.REPOSITORY_URL);
}
if (conDetails.has(RepositoryConstants.REPOSITORY_URL)) {
return conDetails.getString(RepositoryConstants.REPOSITORY_URL);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
public void setUrl(String url) {
dynamicFields.put(RepositoryConstants.REPOSITORY_URL, url);
}
public boolean isStoreCredentials() {
try {
@@ -453,4 +508,27 @@ public class ConnectionBean implements Cloneable {
public void setCredentials(String credentials) {
this.credentials = credentials;
}
public TokenMode getConnectionToken() {
try {
if (conDetails.has(CLOUD_TOKEN_ID)) {
String object = conDetails.getString(CLOUD_TOKEN_ID);
return TokenMode.parseFromJson(object, null);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return null;
}
public void setConnectionToken(TokenMode connectionToken) {
try {
conDetails.put(CLOUD_TOKEN_ID, TokenMode.writeToJson(connectionToken));
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
}

View File

@@ -194,6 +194,10 @@ public interface IMetadataConnection extends IMetadata {
public String getContextName();
public void setContextName(String contextName);
public boolean isSupportNLS();
public void setSupportNLS(boolean newSupportNLS);
/**
* Returns the value that you stored in the data collection by the key. Normally, it is like this key-value. For

View File

@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -515,14 +516,15 @@ public final class MetadataTalendType {
try {
Map<String, File> targetFileMap = Stream.of(arr).collect(Collectors.toMap(File::getName, Function.identity()));
Map<String, File> workingFileMap = getWorkingMappingFiles().stream()
.collect(Collectors.toMap(File::getName, Function.identity()));
.collect(Collectors.toMap(f -> getTargetName(f, rename), Function.identity(), (f1, f2) -> f1));
targetFileMap.entrySet().stream().filter(entry -> !workingFileMap.containsKey(entry.getKey()))
.forEach(entry -> entry.getValue().delete());
for (File workingMappingFile : workingFileMap.values()) {
for (Entry<String, File> entry : workingFileMap.entrySet()) {
String targetName = entry.getKey();
File workingMappingFile = entry.getValue();
boolean needUpdate = false;
String targetName = getTargetName(workingMappingFile, rename);
File targetMappingFile = targetFileMap.get(targetName);
if (targetMappingFile == null) {
targetMappingFile = new File(target, targetName);

View File

@@ -16,7 +16,10 @@ public class SparkBatchMetadataTalendTypeFilter extends SparkMetadataTalendTypeF
"tFileInputParquet",
"tFileOutputParquet",
"tJDBCInput",
"tJDBCOutput", "tLogRow", "tSqlRow"
"tJDBCOutput",
"tLogRow",
"tSqlRow",
"tFileInputDelimited"
);
public SparkBatchMetadataTalendTypeFilter(INode node) {

View File

@@ -260,6 +260,7 @@ public final class ConvertionHelper {
result.setContentModel(connection.isContextMode());
result.setContextId(sourceConnection.getContextId());
result.setContextName(sourceConnection.getContextName());
result.setSupportNLS(sourceConnection.isSupportNLS());
// handle oracle database connnection of general_jdbc.
result.setSchema(getMeataConnectionSchema(result));
convertOtherParameters(result, connection);

View File

@@ -113,6 +113,7 @@ public class MetadataConnection implements IMetadataConnection {
private String contextName;
private boolean supportNLS = false;
// ~
private String comment;
@@ -729,6 +730,14 @@ public class MetadataConnection implements IMetadataConnection {
public void setContextName(String contextName) {
this.contextName = contextName;
}
public boolean isSupportNLS() {
return supportNLS;
}
public void setSupportNLS(boolean supportNLS) {
this.supportNLS = supportNLS;
}
/*
* (non-Javadoc)

View File

@@ -1250,6 +1250,11 @@ public class RepositoryToComponentProperty {
return value2;
}
if(value.equals("SUPPORT_NLS")) {
return connection.isSupportNLS();
}
if (value.equals("CDC_TYPE_MODE")) { //$NON-NLS-1$
return new Boolean(CDCTypeMode.LOG_MODE.getName().equals(connection.getCdcTypeMode()));
}

View File

@@ -24,6 +24,7 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.PasswordEncryptUtil;
import org.talend.commons.utils.generation.CodeGenerationUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.language.LanguageManager;
import org.talend.core.model.metadata.types.JavaType;
@@ -37,6 +38,7 @@ import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.utils.JavaResourcesHelper;
import org.talend.core.model.utils.SQLPatternUtils;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.service.IDesignerXMLMapperService;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
@@ -293,8 +295,7 @@ public final class ElementParameterParser {
List<IElementParameter> params = (List<IElementParameter>) element.getElementParametersWithChildrens();
if (params != null && !params.isEmpty()) {
for (int i = 0; i < params.size(); i++) {
IElementParameter param = params.get(i);
for (IElementParameter param : params) {
if (text.indexOf(param.getVariableName()) != -1
|| (param.getVariableName() != null && param.getVariableName().contains(text))) {
if (param.getFieldType() == EParameterFieldType.TABLE) {
@@ -422,8 +423,8 @@ public final class ElementParameterParser {
}
IElementParameter param;
for (int i = 0; i < element.getElementParameters().size(); i++) {
param = element.getElementParameters().get(i);
for (IElementParameter element2 : element.getElementParameters()) {
param = element2;
if (text.indexOf(param.getVariableName()) != -1) {
if (param.getFieldType() == EParameterFieldType.TABLE) {
return createTableValuesXML((List<Map<String, Object>>) param.getValue(), param);
@@ -483,7 +484,21 @@ public final class ElementParameterParser {
if (element instanceof INode) {
INode node = (INode) element;
if (node.getExternalNode() != null) {
return EcoreUtil.copy(node.getExternalNode().getExternalEmfData());
Object obj = null;
if (node.isVirtualGenerateNode()) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerXMLMapperService.class)) {
final IDesignerXMLMapperService service = GlobalServiceRegister.getDefault()
.getService(IDesignerXMLMapperService.class);
if (service != null) {
obj = service.rebuildXmlMapData(node.getExternalNode());
}
}
}
if (obj != null) {
return obj;
} else {
return EcoreUtil.copy(node.getExternalNode().getExternalEmfData());
}
}
}
return null;
@@ -496,8 +511,8 @@ public final class ElementParameterParser {
}
IElementParameter param;
newText = text;
for (int i = 0; i < element.getElementParameters().size(); i++) {
param = element.getElementParameters().get(i);
for (IElementParameter element2 : element.getElementParameters()) {
param = element2;
if (newText.contains(param.getVariableName())) {
String value = getDisplayValue(param);
newText = newText.replace(param.getVariableName(), value);

View File

@@ -37,7 +37,7 @@ public abstract class AbstractJobParameterInRepositoryRelationshipHandler extend
Set<Relation> relationSet = new HashSet<Relation>();
for (ElementParameterType paramType : parametersMap.values()) {
if (paramType.getName().endsWith(":" + getRepositoryTypeName())) { //$NON-NLS-1$
if (paramType.getName() != null && paramType.getName().endsWith(":" + getRepositoryTypeName())) { //$NON-NLS-1$
String name = paramType.getName().split(":")[0]; //$NON-NLS-1$
ElementParameterType repositoryTypeParam = parametersMap.get(name + ":" //$NON-NLS-1$
+ getRepositoryTypeName());

View File

@@ -27,6 +27,7 @@ import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.core.service.IRemoteService;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.RepositoryConstants;
import org.talend.utils.security.StudioEncryption;
/**
* created by wchen on 2015年6月16日 Detailled comment
@@ -255,7 +256,7 @@ public class TalendLibsServerManager {
if (enableProxyFlag) {
serverBean.setServer(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_URL));
serverBean.setUserName(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_USERNAME));
serverBean.setPassword(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_PASSWORD));
serverBean.setPassword(StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_PASSWORD)));
serverBean.setRepositoryId(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_REPOSITORY_ID));
serverBean.setType(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_TYPE));
}

View File

@@ -0,0 +1,161 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// 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.pendo;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.util.EMap;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Property;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.core.runtime.util.EmfResourceUtil;
import org.talend.repository.ProjectManager;
import org.talend.utils.security.CryptoMigrationUtil;
import org.talend.utils.security.StudioEncryption;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoItemSignatureUtil {
public static final String MIGRATION_TOKEN_KEY = "force_import_unsupported_job";
public static final String REPOSITORY_PLUGIN_ID = "org.talend.repository";
public static final String PROJ_DATE_ID = "repository.project.id";
public static final String PROD_DATE_ID = "product.date.id";
public static String getCurrentProjectCreateDate() {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
ProjectPreferenceManager projectPrefManager = new ProjectPreferenceManager(
PendoItemSignatureUtil.REPOSITORY_PLUGIN_ID, false);
String projDate = projectPrefManager.getValue(PendoItemSignatureUtil.PROJ_DATE_ID);
if (StringUtils.isNotBlank(projDate)) {
String decrypt = null;
if (StudioEncryption.hasEncryptionSymbol(projDate)) {
decrypt = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.MIGRATION_TOKEN)
.decrypt(projDate);
} else {
decrypt = CryptoMigrationUtil.decrypt(projDate);
}
return decrypt;
}
}
return null;
}
public static String getStudioVersion() {
String studioVersion = VersionUtils.getDisplayVersion();
String patchInstalledVersion = PendoTrackDataUtil.getLatestPatchInstalledVersion();
if (StringUtils.isNotBlank(patchInstalledVersion)) {
studioVersion = patchInstalledVersion;
}
return studioVersion;
}
public static String getItemProductVersion(Property property) {
String productVersion = null;
EMap additionalProperties = property.getAdditionalProperties();
if (additionalProperties.get("modified_product_version") != null) {
productVersion = additionalProperties.get("modified_product_version").toString();
} else if (additionalProperties.get("created_product_version") != null) {
productVersion = additionalProperties.get("created_product_version").toString();
}
if (StringUtils.isNotBlank(productVersion)) {
productVersion = VersionUtils.getTalendPureVersion(productVersion);
}
return productVersion;
}
public static String getItemProductName(Property property) {
String productName = null;
EMap additionalProperties = property.getAdditionalProperties();
if (additionalProperties.get("modified_product_fullname") != null) {
productName = additionalProperties.get("modified_product_fullname").toString();
} else if (additionalProperties.get("created_product_fullname") != null) {
productName = additionalProperties.get("created_product_fullname").toString();
}
return productName;
}
public static String formatDate(String dateString, String pattern) {
String formattedDate = "";
if (StringUtils.isNotBlank(dateString)) {
Date date = new Date(Long.parseLong(dateString));
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
formattedDate = sdf.format(date);
}
return formattedDate;
}
public interface SignatureStatus {
public static final int V_VALID = 0;
public static final int V_INVALID = EmfResourceUtil.V_INVALID << 0;
public static final int V_UNSIGNED = V_INVALID << 1;
}
public enum TOSProdNameEnum {
TOS_DI("Talend Open Studio for Data Integration"),
TOS_BD("Talend Open Studio for Big Data"),
TOS_ESB("Talend Open Studio for ESB"),
TOS_TOP("Talend Open Studio for Data Quality");
private String prodName;
TOSProdNameEnum(String prodName) {
this.prodName = prodName;
}
public String getProdName() {
return prodName;
}
public static String getTOSCategoryByProdName(String prodName) {
String category = null;
for (TOSProdNameEnum tosProdNameEnum : TOSProdNameEnum.values()) {
if (tosProdNameEnum.getProdName().equals(prodName)) {
category = tosProdNameEnum.name();
break;
}
}
return category;
}
}
public enum ValueEnum {
YES("Y"),
NO("N"),
NOT_APPLICATE("N/A");
private String displayValue;
ValueEnum(String displayValue) {
this.displayValue = displayValue;
}
public String getDisplayValue() {
return displayValue;
}
}
}

View File

@@ -25,6 +25,7 @@ import org.talend.core.model.general.Project;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.properties.PendoLoginProperties;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.service.IStudioLiteP2Service;
import org.talend.core.ui.IInstalledPatchService;
import org.talend.repository.ProjectManager;
@@ -61,11 +62,7 @@ public class PendoTrackDataUtil {
}
public static IPendoDataProperties getLoginEventProperties() {
String studioPatch = null;
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
if (installedPatchService != null) {
studioPatch = installedPatchService.getLatestInstalledPatchVersion();
}
String studioPatch = getLatestPatchInstalledVersion();
PendoLoginProperties loginEvent = new PendoLoginProperties();
IStudioLiteP2Service studioLiteP2Service = IStudioLiteP2Service.get();
try {
@@ -85,6 +82,10 @@ public class PendoTrackDataUtil {
loginEvent.setEnabledFeatures(enabledFeatures);
}
setUpRefProjectsStructure(loginEvent);
loginEvent.setIsOneClickLogin(Boolean.FALSE.toString());
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
loginEvent.setIsOneClickLogin(Boolean.TRUE.toString());
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
@@ -93,6 +94,15 @@ public class PendoTrackDataUtil {
return loginEvent;
}
public static String getLatestPatchInstalledVersion() {
String studioPatch = "";
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
if (installedPatchService != null) {
studioPatch = installedPatchService.getLatestInstalledVersion(true);
}
return studioPatch;
}
private static void setUpRefProjectsStructure(PendoLoginProperties loginEvent) {
ProjectManager projectManager = ProjectManager.getInstance();
Project currentProject = projectManager.getCurrentProject();
@@ -162,7 +172,9 @@ public class PendoTrackDataUtil {
OPEN_IN_APITester("Open in API Tester"),
OPEN_API_DOCUMENTATION("Open API Documentation"),
AUTOMAP("tMap Automap"),
TMAP("Studio tMap");
TMAP("tMap"),
ITEM_IMPORT("Import items"),
ITEM_SIGNATURE("Item Signature");
private String event;

View File

@@ -55,9 +55,9 @@ import org.talend.utils.json.JSONObject;
*/
public class PendoTrackSender {
private static final String PROP_PENDO_LOCAL_CHECK = "talend.pendo.localDebug";
public static final String PROP_PENDO_LOCAL_CHECK = "talend.pendo.localDebug";
private static final String PROP_PENDO_LOG_DATA = "talend.pendo.logRuntimeData";
public static final String PROP_PENDO_LOG_DATA = "talend.pendo.logRuntimeData";
private static final String PREFIX_API = "api";
@@ -79,13 +79,18 @@ public class PendoTrackSender {
private static String pendoInfo;
public PendoTrackSender() {
private PendoTrackSender() {
}
static {
instance = new PendoTrackSender();
RepositoryContext repositoryContext = getRepositoryContext();
if (repositoryContext != null) {
adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
}
}
public static PendoTrackSender getInstance() {
if (instance == null) {
instance = new PendoTrackSender();
}
if (StringUtils.isBlank(adminUrl)) {
RepositoryContext repositoryContext = getRepositoryContext();
if (repositoryContext != null) {
@@ -118,7 +123,7 @@ public class PendoTrackSender {
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
if (isPendoLocalDebug()) {
ExceptionHandler.log(PendoTrackDataUtil.convertEntityJsonString(properties));
ExceptionHandler.log(event.getEvent() + ":" + PendoTrackDataUtil.convertEntityJsonString(properties));
return;
}
DefaultHttpClient client = null;

View File

@@ -36,6 +36,9 @@ public class PendoLoginProperties implements IPendoDataProperties {
@JsonProperty("referenced_projects")
private List<String> refProjectList;
@JsonProperty("one_click_login")
private String isOneClickLogin;
/**
* Getter for studio_version.
*
@@ -126,4 +129,22 @@ public class PendoLoginProperties implements IPendoDataProperties {
this.refProjectList = refProjectList;
}
/**
* Getter for isOneClickLogin.
*
* @return the isOneClickLogin
*/
public String getIsOneClickLogin() {
return isOneClickLogin;
}
/**
* Sets the isOneClickLogin.
*
* @param isOneClickLogin the isOneClickLogin to set
*/
public void setIsOneClickLogin(String isOneClickLogin) {
this.isOneClickLogin = isOneClickLogin;
}
}

View File

@@ -0,0 +1,211 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// 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.pendo.properties;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoSignImportProperties implements IPendoDataProperties {
@JsonProperty("source_version")
private List<String> sourceVersion;
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("valid_items")
private int validItems;
@JsonProperty("unsigned_items_from_SE")
private String unsignSEItems;
@JsonProperty("unsigned_items_from_EE")
private int unsignEEItems;
@JsonProperty("grace_period")
private String gracePeriod;
@JsonProperty("installed_date")
private String installDate;
@JsonProperty("project_creation_date")
private String projectCreateDate;
@JsonProperty("valid_migration_token")
private String validMigrationToken;
/**
* Getter for sourceVersion.
* @return the sourceVersion
*/
public List<String> getSourceVersion() {
return sourceVersion;
}
/**
* Sets the sourceVersion.
* @param sourceVersion the sourceVersion to set
*/
public void setSourceVersion(List<String> sourceVersion) {
this.sourceVersion = sourceVersion;
}
/**
* Getter for studioVersion.
*
* @return the studioVersion
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studioVersion.
*
* @param studioVersion the studioVersion to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for validItems.
*
* @return the validItems
*/
public int getValidItems() {
return validItems;
}
/**
* Sets the validItems.
*
* @param validItems the validItems to set
*/
public void setValidItems(int validItems) {
this.validItems = validItems;
}
/**
* Getter for unsignSEItems.
* @return the unsignSEItems
*/
public String getUnsignSEItems() {
return unsignSEItems;
}
/**
* Sets the unsignSEItems.
* @param unsignSEItems the unsignSEItems to set
*/
public void setUnsignSEItems(String unsignSEItems) {
this.unsignSEItems = unsignSEItems;
}
/**
* Getter for unsignEEItems.
*
* @return the unsignEEItems
*/
public int getUnsignEEItems() {
return unsignEEItems;
}
/**
* Sets the unsignEEItems.
*
* @param unsignEEItems the unsignEEItems to set
*/
public void setUnsignEEItems(int unsignEEItems) {
this.unsignEEItems = unsignEEItems;
}
/**
* Getter for gracePeriod.
*
* @return the gracePeriod
*/
public String getGracePeriod() {
return gracePeriod;
}
/**
* Sets the gracePeriod.
*
* @param gracePeriod the gracePeriod to set
*/
public void setGracePeriod(String gracePeriod) {
this.gracePeriod = gracePeriod;
}
/**
* Getter for installDate.
*
* @return the installDate
*/
public String getInstallDate() {
return installDate;
}
/**
* Sets the installDate.
*
* @param installDate the installDate to set
*/
public void setInstallDate(String installDate) {
this.installDate = installDate;
}
/**
* Getter for projectCreateDate.
*
* @return the projectCreateDate
*/
public String getProjectCreateDate() {
return projectCreateDate;
}
/**
* Sets the projectCreateDate.
*
* @param projectCreateDate the projectCreateDate to set
*/
public void setProjectCreateDate(String projectCreateDate) {
this.projectCreateDate = projectCreateDate;
}
/**
* Getter for validMigrationToken.
*
* @return the validMigrationToken
*/
public String getValidMigrationToken() {
return validMigrationToken;
}
/**
* Sets the validMigrationToken.
*
* @param validMigrationToken the validMigrationToken to set
*/
public void setValidMigrationToken(String validMigrationToken) {
this.validMigrationToken = validMigrationToken;
}
}

View File

@@ -0,0 +1,251 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// 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.pendo.properties;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoSignLogonProperties implements IPendoDataProperties {
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("valid_items")
private int validItems;
@JsonProperty("signature_invalid_items")
private int invalidSignItems;
@JsonProperty("unsigned_items_from_SE")
private String unsignSEItems;
@JsonProperty("unsigned_items_from_EE")
private int unsignEEItems;
@JsonProperty("invalid_item_source_version")
private String invalidItemSourceVersion;
@JsonProperty("signed_by_migration")
private int signByMigration;
@JsonProperty("grace_period")
private String gracePeriod;
@JsonProperty("installed_date")
private String installDate;
@JsonProperty("project_creation_date")
private String projectCreateDate;
@JsonProperty("valid_migration_token")
private String validMigrationToken;
/**
* Getter for studioVersion.
*
* @return the studioVersion
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studioVersion.
*
* @param studioVersion the studioVersion to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for validItems.
*
* @return the validItems
*/
public int getValidItems() {
return validItems;
}
/**
* Sets the validItems.
*
* @param validItems the validItems to set
*/
public void setValidItems(int validItems) {
this.validItems = validItems;
}
/**
* Getter for invalidSignItems.
*
* @return the invalidSignItems
*/
public int getInvalidSignItems() {
return invalidSignItems;
}
/**
* Sets the invalidSignItems.
*
* @param invalidSignItems the invalidSignItems to set
*/
public void setInvalidSignItems(int invalidSignItems) {
this.invalidSignItems = invalidSignItems;
}
/**
* Getter for unsignSEItems.
* @return the unsignSEItems
*/
public String getUnsignSEItems() {
return unsignSEItems;
}
/**
* Sets the unsignSEItems.
* @param unsignSEItems the unsignSEItems to set
*/
public void setUnsignSEItems(String unsignSEItems) {
this.unsignSEItems = unsignSEItems;
}
/**
* Getter for unsignEEItems.
*
* @return the unsignEEItems
*/
public int getUnsignEEItems() {
return unsignEEItems;
}
/**
* Sets the unsignEEItems.
*
* @param unsignEEItems the unsignEEItems to set
*/
public void setUnsignEEItems(int unsignEEItems) {
this.unsignEEItems = unsignEEItems;
}
/**
* Getter for invalidItemSourceVersion.
*
* @return the invalidItemSourceVersion
*/
public String getInvalidItemSourceVersion() {
return invalidItemSourceVersion;
}
/**
* Sets the invalidItemSourceVersion.
*
* @param invalidItemSourceVersion the invalidItemSourceVersion to set
*/
public void setInvalidItemSourceVersion(String invalidItemSourceVersion) {
this.invalidItemSourceVersion = invalidItemSourceVersion;
}
/**
* Getter for signByMigration.
*
* @return the signByMigration
*/
public int getSignByMigration() {
return signByMigration;
}
/**
* Sets the signByMigration.
*
* @param signByMigration the signByMigration to set
*/
public void setSignByMigration(int signByMigration) {
this.signByMigration = signByMigration;
}
/**
* Getter for gracePeriod.
*
* @return the gracePeriod
*/
public String getGracePeriod() {
return gracePeriod;
}
/**
* Sets the gracePeriod.
*
* @param gracePeriod the gracePeriod to set
*/
public void setGracePeriod(String gracePeriod) {
this.gracePeriod = gracePeriod;
}
/**
* Getter for installDate.
*
* @return the installDate
*/
public String getInstallDate() {
return installDate;
}
/**
* Sets the installDate.
*
* @param installDate the installDate to set
*/
public void setInstallDate(String installDate) {
this.installDate = installDate;
}
/**
* Getter for projectCreateDate.
*
* @return the projectCreateDate
*/
public String getProjectCreateDate() {
return projectCreateDate;
}
/**
* Sets the projectCreateDate.
*
* @param projectCreateDate the projectCreateDate to set
*/
public void setProjectCreateDate(String projectCreateDate) {
this.projectCreateDate = projectCreateDate;
}
/**
* Getter for validMigrationToken.
*
* @return the validMigrationToken
*/
public String getValidMigrationToken() {
return validMigrationToken;
}
/**
* Sets the validMigrationToken.
*
* @param validMigrationToken the validMigrationToken to set
*/
public void setValidMigrationToken(String validMigrationToken) {
this.validMigrationToken = validMigrationToken;
}
}

View File

@@ -12,8 +12,6 @@
// ============================================================================
package org.talend.core.prefs;
import org.talend.commons.utils.network.ITalendNexusPrefConstants;
/**
* Core preferences. Detailled comment <br/>
*
@@ -187,8 +185,6 @@ public interface ITalendCorePrefConstants {
public static final String PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT = "PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT"; //$NON-NLS-1$
public static final String NEXUS_TIMEOUT = ITalendNexusPrefConstants.NEXUS_TIMEOUT;
public static final String NEXUS_REFRESH_FREQUENCY = "NEXUS_REFRESH_FREQUENCY"; //$NON-NLS-1$
/**

View File

@@ -449,7 +449,7 @@ repository.rulesSql=SQL
repository.rulesParser=Parser
repository.rulesMatcher=Match
repository.systemIndicators=System Indicators
repository.userDefineIndicators=User Defined Indicators
repository.userDefineIndicators=User-defined Indicators
repository.userDefineIndicators.lib=lib
repository.systemIndicators.advancedStatistics=Advanced Statistics
repository.systemIndicators.businessRules=Business Rules
@@ -552,6 +552,8 @@ BusinessAppearanceComposite.textAlignment.vertical.centre=Centre
ConnectionBean.Local=Local
ConnectionBean.Remote=Remote
ConnectionBean.DefaultConnection=Default connection
ConnectionBean.Cloud.name=Signed in: Cloud ({0})
ConnectionBean.CloudConnection.description=Remote connection to Cloud - Signed in: Cloud ({0})
InegerCellEditorListener.NegativeNumberMessage=The value of {0} can't be set by negative number.
InegerCellEditorListener.NumeralMessage=The value of {0} should be numeral.
OpenXSDFileDialog.cancel=Cancel

View File

@@ -402,7 +402,7 @@ repository.SAPIDoc=SAP iDoc
repository.SAPTable=SAP\u30C6\u30FC\u30D6\u30EB
repository.metadataSQLPatterns=SQL\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8
repository.metadataSQLPatterns.alias=SQLTemplates
repository.metadataFileDelimited=\u533A\u5207\u308A\u6587\u5B57\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited=\u533A\u5207\u308A\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited.alias=DELIM
repository.metadataTable=\u30E1\u30BF\u30C7\u30FC\u30BF\u30B9\u30AD\u30FC\u30DE
repository.metadataColumn=\u30E1\u30BF\u30C7\u30FC\u30BF\u30AB\u30E9\u30E0
@@ -449,7 +449,7 @@ repository.rulesSql=SQL
repository.rulesParser=\u30D1\u30FC\u30B5\u30FC
repository.rulesMatcher=\u4E00\u81F4
repository.systemIndicators=\u30B7\u30B9\u30C6\u30E0\u30A4\u30F3\u30C7\u30A3\u30B1\u30FC\u30BF\u30FC
repository.userDefineIndicators=\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u30A4\u30F3\u30B8\u30B1\u30FC\u30BF\u30FC
repository.userDefineIndicators=\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u306E\u30A4\u30F3\u30B8\u30B1\u30FC\u30BF\u30FC
repository.userDefineIndicators.lib=lib
repository.systemIndicators.advancedStatistics=\u8A73\u7D30\u7D71\u8A08
repository.systemIndicators.businessRules=\u30D3\u30B8\u30CD\u30B9\u30EB\u30FC\u30EB

View File

@@ -48,6 +48,10 @@ public interface TalendProcessOptionConstants {
public static final int GENERATE_POM_NOT_CLEAR_CACHE = 1 << 11;
/**
* for DQ clean item
*/
public static final int GENERATE_NO_RESET_DQ = 1 << 12;
/**
* clean options
*/

View File

@@ -0,0 +1,58 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.signon.util.TokenMode;
import org.talend.signon.util.listener.LoginEventListener;
public interface ICloudSignOnService extends IService {
TokenMode getToken(String authCode, String codeVerifier, String dataCenter) throws Exception;
void startHeartBeat() throws Exception;
void stopHeartBeat();
String generateCodeVerifier();
String getCodeChallenge(String seed) throws Exception;
boolean hasValidToken() throws Exception;
String getTokenUser(String url, TokenMode token) throws Exception;
void signonCloud(LoginEventListener listener) throws Exception;
TokenMode getLatestToken() throws Exception;
public boolean refreshToken() throws Exception;
boolean isSignViaCloud();
boolean isNeedShowSSOPage();
public void showReloginDialog();
public boolean isReloginDialogRunning();
public void reload();
public static ICloudSignOnService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICloudSignOnService.class)) {
return GlobalServiceRegister.getDefault().getService(ICloudSignOnService.class);
}
return null;
}
}

View File

@@ -30,4 +30,6 @@ public interface IDesignerXMLMapperService extends IService {
*/
public boolean isVirtualComponent(final INode node);
public Object rebuildXmlMapData(final INode node);
}

View File

@@ -128,6 +128,12 @@ public interface IStudioLiteP2Service extends IService {
void setupTmcUpdate(IProgressMonitor monitor, IStudioUpdateConfig updateConfig) throws Exception;
boolean removeM2() throws Exception;
void saveRemoveM2(boolean remove) throws Exception;
void cleanM2(IProgressMonitor monitor);
public static IStudioLiteP2Service get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IStudioLiteP2Service.class)) {
return GlobalServiceRegister.getDefault().getService(IStudioLiteP2Service.class);

View File

@@ -32,6 +32,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.ConnectionBean;
import org.talend.core.service.ICloudSignOnService;
import org.talend.utils.json.JSONArray;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
@@ -158,6 +159,8 @@ public class ConnectionUserPerReader {
}
if (cons == null || cons.size() == 0) {
proper.remove("connection.users");//$NON-NLS-1$
proper.remove("connection.define");//$NON-NLS-1$
proper.remove("connection.lastConnection");//$NON-NLS-1$
} else {
JSONArray usersJsonArray = new JSONArray();
for (ConnectionBean currentConnection : cons) {
@@ -207,7 +210,6 @@ public class ConnectionUserPerReader {
} catch (Exception e) {
e.printStackTrace();
}
}
public void createPropertyFile() {

View File

@@ -309,7 +309,7 @@ repository.metadataSAPConnections.alias=SAP
repository.SAPFunction=SAP\u30D5\u30A1\u30F3\u30AF\u30B7\u30E7\u30F3
repository.metadataSQLPatterns=SQL\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8
repository.metadataSQLPatterns.alias=SQLTemplates
repository.metadataFileDelimited=\u533A\u5207\u308A\u6587\u5B57\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited=\u533A\u5207\u308A\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited.alias=DELIM
repository.metadataFileLdif=LDIF\u30D5\u30A1\u30A4\u30EB
repository.metadataFileLdif.alias=LDIF

View File

@@ -33,7 +33,7 @@ public class TalendDataCollectorPreferenceInitializer extends AbstractPreference
IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD, 5);
if(IRemoteService.get().isCloudConnection()) {
if(IRemoteService.get() != null && IRemoteService.get().isCloudConnection()) {
preferenceStore.setValue(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
}
}

View File

@@ -47,7 +47,7 @@ public class TalendDataCollectorPreferencePage extends FieldEditorPreferencePage
@Override
protected void createFieldEditors() {
if(!IRemoteService.get().isCloudConnection()) {
if(!(IRemoteService.get() != null && IRemoteService.get().isCloudConnection())) {
addField(new BooleanFieldEditor(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED,
Messages.getString("TalendDataCollectorPreferencePage_EnableCapture"), getFieldEditorParent())); //$NON-NLS-1$
}

View File

@@ -42,6 +42,7 @@ import org.talend.core.model.metadata.builder.ConvertionHelper;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.process.ElementParameterParser;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.repository.RepositoryManager;
@@ -56,6 +57,7 @@ import org.talend.core.model.utils.TalendTextUtils;
import org.talend.core.prefs.PreferenceManipulator;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.services.ICoreTisService;
import org.talend.core.services.IJobCheckService;
import org.talend.core.utils.KeywordsValidator;
import org.talend.designer.codegen.ICodeGeneratorService;
@@ -400,4 +402,31 @@ public class CoreService implements ICoreService {
}
});
}
@Override
public Integer getSignatureVerifyResult(Property property, IPath resourcePath, boolean considerGP) throws Exception {
ICoreTisService coreTisService = ICoreTisService.get();
if (coreTisService != null) {
return coreTisService.getSignatureVerifyResult(property, resourcePath, considerGP);
}
return null;
}
@Override
public String getLicenseCustomer() {
ICoreTisService coreTisService = ICoreTisService.get();
if (coreTisService != null) {
return coreTisService.getLicenseCustomer();
}
return null;
}
@Override
public boolean isInValidGP() {
ICoreTisService coreTisService = ICoreTisService.get();
if (coreTisService != null) {
return coreTisService.isInValidGP();
}
return false;
}
}

View File

@@ -21,6 +21,7 @@ import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.components.conversions.IComponentConversion;
import org.talend.core.model.components.conversions.RenameComponentConversion;
import org.talend.core.model.components.conversions.DefaultRenameComponentConversion;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.properties.Item;
@@ -56,6 +57,20 @@ public class ModifyComponentsAction {
throws PersistenceException {
searchAndModify(item, item.getProcess(), filter, conversions);
}
/**
* Rename component name
* @param item job item
* @param processType Process type
* @param oldName old base name, for tck component, name does not include prefix "t", while for non tck components, name includes prefix "t".
* @param newName new base name, for tck component, name does not include prefix "t", while for non tck components, name includes prefix "t".
* @return
* @throws PersistenceException
*/
public static boolean searchAndRenameComponent(Item item, ProcessType processType, String oldName, String newName) throws PersistenceException {
return searchAndModify(item, processType, new NameComponentFilter(oldName), Arrays.<IComponentConversion> asList(new DefaultRenameComponentConversion(oldName, newName)));
}
public static boolean searchAndModify(Item item, ProcessType processType, IComponentFilter filter,
List<IComponentConversion> conversions) throws PersistenceException {

View File

@@ -0,0 +1,118 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.components.conversions;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.runtime.model.components.IComponentConstants;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.designer.core.model.utils.emf.talendfile.ConnectionType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.MetadataType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.core.model.utils.emf.talendfile.SubjobType;
/**
* @author bhe created on Jul 6, 2022
*
*/
public class DefaultRenameComponentConversion implements IComponentConversion {
private String newName;
private String oldName;
/**
* Rename component name
*
* @param oldName old base name of the component, e.g. NetSuiteV2019Input
* @param newName new base name of the component, e.g. NetSuiteNewInput
*/
public DefaultRenameComponentConversion(String oldName, String newName) {
super();
this.newName = newName;
this.oldName = oldName;
}
public void transform(NodeType node) {
node.setComponentName(newName);
ProcessType item = (ProcessType) node.eContainer();
String oldNodeUniqueName = ComponentUtilities.getNodeUniqueName(node);
ComponentUtilities.setNodeUniqueName(node, oldNodeUniqueName.replaceAll(oldName, newName));
replaceAllInAllNodesParameterValue(item, this.oldName, this.newName);
}
protected static void replaceAllInAllNodesParameterValue(ProcessType item, String oldName, String newName) {
for (Object o : item.getNode()) {
NodeType nt = (NodeType) o;
ComponentUtilities.replaceInNodeParameterValue(nt, oldName, newName);
EList metaList = nt.getMetadata();
if (metaList != null) {
if (!metaList.isEmpty()) {
for (Object obj : metaList) {
MetadataType meta = (MetadataType) obj;
if (meta.getName().contains(oldName)) {
meta.setName(meta.getName().replaceAll(oldName, newName));
}
}
}
}
}
for (Object o : item.getConnection()) {
ConnectionType currentConnection = (ConnectionType) o;
if (currentConnection.getSource().contains(oldName)) {
currentConnection.setSource(currentConnection.getSource().replaceAll(oldName, newName));
}
if (currentConnection.getTarget().contains(oldName)) {
currentConnection.setTarget(currentConnection.getTarget().replaceAll(oldName, newName));
}
if (currentConnection.getMetaname().contains(oldName)) {
currentConnection.setMetaname(currentConnection.getMetaname().replaceAll(oldName, newName));
}
if ("RUN_IF".equals(currentConnection.getConnectorName())) {
for (Object obj : currentConnection.getElementParameter()) {
ElementParameterType type = (ElementParameterType) obj;
if ("CONDITION".equals(type.getName())) {
if (type.getValue() != null && type.getValue().contains(oldName)) {
String replaceAll = type.getValue().replaceAll(oldName, newName);
type.setValue(replaceAll);
}
break;
}
}
}
}
for (Object o : item.getSubjob()) {
SubjobType sj = (SubjobType) o;
for (Object obj : sj.getElementParameter()) {
ElementParameterType p = (ElementParameterType) obj;
if (p.getName().equals(IComponentConstants.UNIQUE_NAME)) {
if (p.getValue() != null && p.getValue().contains(oldName)) {
String replaceAll = p.getValue().replaceAll(oldName, newName);
p.setValue(replaceAll);
}
}
}
}
}
public String getNewName() {
return this.newName;
}
public void setNewName(String newName) {
this.newName = newName;
}
}

View File

@@ -1,86 +1,103 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.prefs;
import java.util.Arrays;
import java.util.ResourceBundle;
import org.talend.commons.i18n.MessagesCore;
/**
* Use to retrieve general application parameters.<br/>
*
* $Id: Messages.java 1 2006-09-29 17:06:40 +0000 (ven., 29 sept. 2006) nrousseau $
*
*/
public class GeneralParametersProvider extends MessagesCore {
private static final String BUNDLE_NAME = "parameters"; //$NON-NLS-1$
private static final String PLUGIN_ID = "org.talend.core"; //$NON-NLS-1$
private static ResourceBundle resourceBundle;
private static ResourceBundle getBundle() {
if (resourceBundle == null) {
try {
resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
} catch (Exception e) {
// Nothing to do (return null)
}
}
return resourceBundle;
}
/**
* Returns the value corresponding to the specified key.
*/
public static String getString(GeneralParameters key) {
return getString(key.getParamName(), PLUGIN_ID, getBundle());
}
/**
* Returns a sorted string array containing values corresponding to the specified key.
*/
public static String[] getStrings(GeneralParameters key) {
String value = getString(key);
String[] toReturn = value.split(","); //$NON-NLS-1$
Arrays.sort(toReturn);
return toReturn;
}
/**
* DOC smallet GeneralParametersProvider class global comment. Detailled comment <br/>
*
* $Id$
*/
public enum GeneralParameters {
AUTHORIZED_LANGUAGE("param.authorizedlanguage"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_WIN32("param.defaultPerlInterpreterPath.win32"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_LINUX("param.defaultPerlInterpreterPath.linux"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_EMBEDDED_SUFFIX_WIN32("param.defaultPerlInterpreterEmbeddedSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_WIN32("param.defaultJavaInterpreterSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_LINUX("param.defaultJavaInterpreterSuffix.linux"), //$NON-NLS-1$
PROJECTS_EXCLUDED_FROM_EXPORT("param.projectsExcludedFromExport"); //$NON-NLS-1$
private String paramName;
GeneralParameters(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return this.paramName;
}
}
}
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.prefs;
import java.util.Arrays;
import java.util.Locale;
import java.util.ResourceBundle;
import org.apache.commons.lang3.StringUtils;
import org.talend.commons.i18n.MessagesCore;
import org.talend.core.CorePlugin;
/**
* Use to retrieve general application parameters.<br/>
*
* $Id: Messages.java 1 2006-09-29 17:06:40 +0000 (ven., 29 sept. 2006) nrousseau $
*
*/
public class GeneralParametersProvider extends MessagesCore {
private static final String BUNDLE_NAME = "parameters"; //$NON-NLS-1$
private static final String PLUGIN_ID = "org.talend.core"; //$NON-NLS-1$
private static ResourceBundle resourceBundle;
private static ResourceBundle getBundle() {
if (resourceBundle == null) {
try {
resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
} catch (Exception e) {
// Nothing to do (return null)
}
}
return resourceBundle;
}
/**
* Returns the value corresponding to the specified key.
*/
public static String getString(GeneralParameters key) {
return getString(key.getParamName(), PLUGIN_ID, getBundle());
}
/**
* Returns a sorted string array containing values corresponding to the specified key.
*/
public static String[] getStrings(GeneralParameters key) {
String value = getString(key);
String[] toReturn = value.split(","); //$NON-NLS-1$
Arrays.sort(toReturn);
return toReturn;
}
public static String getOnLineHelpLanguageSetting() {
String language = CorePlugin.getDefault().getPluginPreferences().getString(ITalendCorePrefConstants.LANGUAGE_SELECTOR);
if (StringUtils.isBlank(language)) {
language = Locale.getDefault().getLanguage();
}
if (Locale.FRENCH.getLanguage().equals(language)) {
return "fr";
}
if (Locale.JAPAN.getLanguage().equals(language)) {
return "ja";
}
return "en"; //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* DOC smallet GeneralParametersProvider class global comment. Detailled comment <br/>
*
* $Id$
*/
public enum GeneralParameters {
AUTHORIZED_LANGUAGE("param.authorizedlanguage"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_WIN32("param.defaultPerlInterpreterPath.win32"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_LINUX("param.defaultPerlInterpreterPath.linux"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_EMBEDDED_SUFFIX_WIN32("param.defaultPerlInterpreterEmbeddedSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_WIN32("param.defaultJavaInterpreterSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_LINUX("param.defaultJavaInterpreterSuffix.linux"), //$NON-NLS-1$
PROJECTS_EXCLUDED_FROM_EXPORT("param.projectsExcludedFromExport"); //$NON-NLS-1$
private String paramName;
GeneralParameters(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return this.paramName;
}
}
}

View File

@@ -18,6 +18,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.osgi.service.prefs.BackingStoreException;
@@ -84,6 +85,12 @@ public interface ICoreTisService extends IService {
public void afterImport (Property property) throws PersistenceException;
Integer getSignatureVerifyResult(Property property, IPath resourcePath, boolean considerGP) throws Exception;
String getLicenseCustomer();
boolean isInValidGP();
boolean hasNewPatchInPatchesFolder();
boolean isDefaultLicenseAndProjectType();

View File

@@ -278,6 +278,19 @@ public class ProcessorUtilities {
needExportItemsForDQ = false;
}
public static void resetExportConfig(boolean noResetDq) {
interpreter = null;
codeLocation = null;
libraryPath = null;
exportConfig = false;
exportAsOSGI = false;
exportTimeStamp = null;
exportJobAsMicroService = false;
if (!noResetDq) {
needExportItemsForDQ = false;
}
}
public static String getInterpreter() {
return interpreter;
}

View File

@@ -11,7 +11,7 @@
<packaging>eclipse-plugin</packaging>
<properties>
<tcomp.version>${component-runtime.version}</tcomp.version>
<cxf.version>3.5.1</cxf.version>
<cxf.version>3.5.2</cxf.version>
<geronimo.version>1.0.2</geronimo.version>
<jcache.version>1.0.5</jcache.version>
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
@@ -20,7 +20,7 @@
<microprofile.version>1.2.1</microprofile.version>
<owb.version>2.0.26</owb.version>
<slf4j.version>1.7.33</slf4j.version>
<tomcat.version>9.0.62</tomcat.version>
<tomcat.version>9.0.63</tomcat.version>
<xbean.version>4.20</xbean.version>
<reload4j.version>1.2.19</reload4j.version>
<log4j2.version>2.17.2</log4j2.version>

View File

@@ -113,12 +113,12 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.68</version>
<version>1.70</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>

View File

@@ -84,12 +84,12 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.68</version>
<version>1.70</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>

View File

@@ -38,7 +38,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.68</version>
<version>1.70</version>
</dependency>
</dependencies>
<build>

View File

@@ -13,7 +13,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>

View File

@@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
@@ -123,7 +123,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.46.1</tcomp.version>
<tcomp.version>1.48.1</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
<reload4j.version>1.2.19</reload4j.version>
</properties>

View File

@@ -24,195 +24,27 @@
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.8</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-bom</artifactId>
<version>4.13.0</version>
<type>pom</type>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-parent</artifactId>
<version>4.2.9</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-bom</artifactId>
<version>4.2.9</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-bom</artifactId>
<version>3.0.10</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
<version>36</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-build-configuration-parent</artifactId>
<version>12.1.11.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-bom</artifactId>
<version>12.1.11.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.13.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>2.35</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-bom</artifactId>
<version>9.4.46.v20220331</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-bom</artifactId>
<version>1.6.21</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-bom</artifactId>
<version>1.5.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.logging</groupId>
<artifactId>logging-parent</artifactId>
<version>5</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.17.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>24</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-bom</artifactId>
<version>1.8.6</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.77.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc-bom</artifactId>
<version>21.3.0.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>parent</artifactId>
<version>0.12.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_bom</artifactId>
<version>0.12.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-bom</artifactId>
<version>5.0.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-bom</artifactId>
<version>Arabba-SR13</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>2020.0.19</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.rsocket</groupId>
<artifactId>rsocket-bom</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-bom</artifactId>
<version>2021.1.4</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.3.20</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-bom</artifactId>
<version>5.5.12</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>5.6.5</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-bom</artifactId>
<version>2021.1.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>

View File

@@ -58,7 +58,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -68,7 +68,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -100,7 +100,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -147,7 +147,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -199,12 +199,12 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -228,6 +228,11 @@
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -254,7 +259,12 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -267,6 +277,11 @@
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>

View File

@@ -122,7 +122,7 @@ public class TalendMavenLaunchDelegate extends JavaLaunchDelegate implements Mav
this.extensionsSupport = MavenLaunchExtensionsSupport.create(configuration, launch);
log.info("" + getWorkingDirectory(configuration)); //$NON-NLS-1$
log.info(" mvn" + getProgramArguments(configuration, IRemoteService.get().isCloudConnection())); //$NON-NLS-1$
log.info(" mvn" + getProgramArguments(configuration, IRemoteService.get() == null ? false: IRemoteService.get().isCloudConnection())); //$NON-NLS-1$
this.programArguments = null;
extensionsSupport.configureSourceLookup(configuration, launch, monitor);

View File

@@ -241,7 +241,8 @@ public class BuildCacheManager {
property.getVersion(), true);
if (obj != null) {
IRunProcessService.get().generatePom(obj.getProperty().getItem(),
TalendProcessOptionConstants.GENERATE_POM_NOT_CLEAR_CACHE);
TalendProcessOptionConstants.GENERATE_POM_NOT_CLEAR_CACHE
| TalendProcessOptionConstants.GENERATE_NO_RESET_DQ);
}
}
}
@@ -331,7 +332,7 @@ public class BuildCacheManager {
private ITalendProcessJavaProject getTalendJobJavaProject(Property property) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault()
IRunProcessService service = GlobalServiceRegister.getDefault()
.getService(IRunProcessService.class);
return service.getTalendJobJavaProject(property);
}
@@ -347,7 +348,7 @@ public class BuildCacheManager {
private boolean isBuildJob() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault()
IRunProcessService service = GlobalServiceRegister.getDefault()
.getService(IRunProcessService.class);
return service.isExportConfig();
}

View File

@@ -140,8 +140,14 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
Exclusion jacksonExclusion = new Exclusion();
jacksonExclusion.setGroupId("com.fasterxml.jackson.core"); //$NON-NLS-1$
jacksonExclusion.setArtifactId("jackson-databind "); //$NON-NLS-1$
Exclusion configuration2Exclusion = new Exclusion();
configuration2Exclusion.setGroupId("org.apache.commons"); //$NON-NLS-1$
configuration2Exclusion.setArtifactId("commons-configuration2"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
dependency.addExclusion(jacksonExclusion);
dependency.addExclusion(configuration2Exclusion);
}
existedDependencies.add(dependency);
}

View File

@@ -128,7 +128,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
if (ProcessUtils.isTestContainer(process)) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testService = (ITestContainerProviderService) GlobalServiceRegister.getDefault()
ITestContainerProviderService testService = GlobalServiceRegister.getDefault()
.getService(ITestContainerProviderService.class);
try {
property = testService.getParentJobItem(property.getItem()).getProperty();
@@ -231,7 +231,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
Dependency mavenCoreDep = new Dependency();
mavenCoreDep.setGroupId("org.apache.maven");
mavenCoreDep.setArtifactId("maven-core");
mavenCoreDep.setVersion("3.8.3");
mavenCoreDep.setVersion("3.8.6");
shade.getDependencies().add(guavaDep);
shade.getDependencies().add(codecDep);
@@ -454,6 +454,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
*
* @param hasLoopDependency the hasLoopDependency to set
*/
@Override
public void setHasLoopDependency(boolean hasLoopDependency) {
this.hasLoopDependency = hasLoopDependency;
}

View File

@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/stax2-api-4.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woden-api-1.0M9.jar"/>
<classpathentry exported="true" kind="lib" path="lib/axiom-api-1.2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/axiom-impl-1.2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/neethi-3.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wstx-asl-3.2.9.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.2.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

View File

@@ -20,12 +20,13 @@ Bundle-ClassPath: lib/axiom-api-1.3.0.jar,
lib/geronimo-stax-api_1.0_spec-1.0.1.jar,
lib/mail-1.4.jar,
lib/neethi-3.0.1.jar,
lib/wstx-asl-3.2.9.jar,
lib/xmlschema-core-2.2.1.jar,
lib/woden-api-1.0M9.jar,
lib/axis2-codegen-1.8.0.jar,
lib/axis2-java2wsdl-1.8.0.jar,
lib/axis2-metadata-1.8.0.jar,
lib/woodstox-core-asl-4.4.1.jar,
lib/stax2-api-4.2.1.jar,
.
Export-Package: com.ctc.wstx.api,
com.ctc.wstx.cfg,

View File

@@ -80,6 +80,16 @@
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
<version>1.3.0</version>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.4.1</version>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>4.2.1</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-3.0.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.11.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="class"/>

View File

@@ -4,22 +4,38 @@ Bundle-Name: Lucene plug-in
Bundle-SymbolicName: org.talend.libraries.apache.lucene
Bundle-Version: 8.0.1.qualifier
Bundle-Vendor: .Talend SA.
Bundle-ClassPath: lib/lucene-core-3.0.3.jar,
Bundle-ClassPath: lib/lucene-core-8.11.2.jar,
.
Export-Package: org.apache.lucene,
org.apache.lucene.analysis,
org.apache.lucene.analysis.standard,
org.apache.lucene.analysis.tokenattributes,
org.apache.lucene.codecs,
org.apache.lucene.codecs.blocktree,
org.apache.lucene.codecs.compressing,
org.apache.lucene.codecs.lucene50,
org.apache.lucene.codecs.lucene60,
org.apache.lucene.codecs.lucene80,
org.apache.lucene.codecs.lucene84,
org.apache.lucene.codecs.lucene86,
org.apache.lucene.codecs.lucene87,
org.apache.lucene.codecs.perfield,
org.apache.lucene.document,
org.apache.lucene.geo,
org.apache.lucene.index,
org.apache.lucene.messages,
org.apache.lucene.queryParser,
org.apache.lucene.search,
org.apache.lucene.search.function,
org.apache.lucene.search.payloads,
org.apache.lucene.search.comparators,
org.apache.lucene.search.similarities,
org.apache.lucene.search.spans,
org.apache.lucene.store,
org.apache.lucene.util,
org.apache.lucene.util.cache
org.apache.lucene.util.automaton,
org.apache.lucene.util.bkd,
org.apache.lucene.util.compress,
org.apache.lucene.util.fst,
org.apache.lucene.util.graph,
org.apache.lucene.util.hppc,
org.apache.lucene.util.mutable,
org.apache.lucene.util.packed
Bundle-ActivationPolicy: lazy
Eclipse-BundleShape: dir

View File

@@ -1,5 +1,4 @@
output.. = class/
bin.includes = META-INF/,\
.,\
lib/lucene-core-2.9.3.jar,\
lib/lucene-core-3.0.3.jar
lib/lucene-core-8.11.2.jar

View File

@@ -9,4 +9,36 @@
</parent>
<artifactId>org.talend.libraries.apache.lucene</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<lucene.version>8.11.2</lucene.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-backward-codecs-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-8.11.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

@@ -5,10 +5,11 @@ Bundle-SymbolicName: org.talend.libraries.apache.lucene8
Bundle-Version: 8.0.1.qualifier
Bundle-Vendor: .Talend SA.
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: lib/lucene-analyzers-common-8.3.1.jar,
lib/lucene-core-8.3.1.jar,
lib/lucene-queries-8.3.1.jar,
lib/lucene-queryparser-8.3.1.jar
Bundle-ClassPath: lib/lucene-analyzers-common-8.11.2.jar,
lib/lucene-backward-codecs-8.11.2.jar,
lib/lucene-core-8.11.2.jar,
lib/lucene-queries-8.11.2.jar,
lib/lucene-queryparser-8.11.2.jar
Export-Package: org.apache.lucene,
org.apache.lucene.analysis,
org.apache.lucene.analysis.ar,
@@ -78,6 +79,8 @@ Export-Package: org.apache.lucene,
org.apache.lucene.codecs.lucene60,
org.apache.lucene.codecs.lucene70,
org.apache.lucene.codecs.lucene80,
org.apache.lucene.codecs.lucene84,
org.apache.lucene.codecs.lucene86,
org.apache.lucene.codecs.perfield,
org.apache.lucene.collation,
org.apache.lucene.collation.tokenattributes,

View File

@@ -1,7 +1,8 @@
bin.includes = META-INF/,\
.,\
lib/lucene-analyzers-common-8.3.1.jar,\
lib/lucene-core-8.3.1.jar,\
lib/lucene-queries-8.3.1.jar,\
lib/lucene-queryparser-8.3.1.jar
lib/lucene-analyzers-common-8.11.2.jar,\
lib/lucene-backward-codecs-8.11.2.jar,\
lib/lucene-core-8.11.2.jar,\
lib/lucene-queries-8.11.2.jar,\
lib/lucene-queryparser-8.11.2.jar

View File

@@ -9,4 +9,57 @@
</parent>
<artifactId>org.talend.libraries.apache.lucene8</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<lucene.version>8.11.2</lucene.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-backward-codecs</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${lucene.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" path="lib/h2-2.1.210.jar"/>
<classpathentry kind="lib" path="lib/h2-2.1.214.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -4,7 +4,7 @@ Bundle-Name: H2
Bundle-SymbolicName: org.talend.libraries.jdbc.h2
Bundle-Version: 8.0.1.qualifier
Bundle-ClassPath: .,
lib/h2-2.1.210.jar
lib/h2-2.1.214.jar
Export-Package: org.h2,
org.h2.api;uses:="org.h2.command.ddl,org.h2.table",
org.h2.bnf;uses:="org.h2.server.web",

View File

@@ -1,4 +1,4 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/h2-2.1.210.jar
lib/h2-2.1.214.jar

View File

@@ -28,7 +28,7 @@
<artifactItem>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.210</version>
<version>2.1.214</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -243,10 +243,39 @@ public class JSONObject {
*
* @param bean An object that has getter methods that should be used to make a JSONObject.
*/
@Deprecated
public JSONObject(Object bean) {
this();
populateMap(bean);
}
/**
* Construct a JSONObject from an Object using bean getters. It reflects on all of the public methods of the object.
* For each of the methods with no parameters and a name starting with <code>"get"</code> or <code>"is"</code>
* followed by an uppercase letter, the method is invoked, and a key and the value returned from the getter method
* are put into the new JSONObject.
*
* The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix. If the second remaining
* character is not upper case, then the first character is converted to lower case.
*
* For example, if an object has a method named <code>"getName"</code>, and if the result of calling
* <code>object.getName()</code> is <code>"Larry Fine"</code>, then the JSONObject will contain
* <code>"name": "Larry Fine"</code>.
*
* @param bean An object that has getter methods that should be used to make a JSONObject.
* @param expectedClass Bean must be the instance of this class, for safe to avoid evil script inject
*/
public JSONObject(Object bean, Class<?> expectedClass) {
this();
Class<?> clazz = bean.getClass();
if((clazz == expectedClass) || (expectedClass!=null && expectedClass.isAssignableFrom(clazz))) {
populateMap(bean);
return;
}
throw new JSONException("expectedClass doesn't match the bean or is null");
}
/**
* Construct a JSONObject from an Object, using reflection to find the public members. The resulting JSONObject's

View File

@@ -105,7 +105,7 @@ public class ResumeUtil {
csvWriter.write("stackTrace");// stackTrace
csvWriter.write("dynamicData");// dynamicData
csvWriter.endRecord();
csvWriter.flush();
csvWriter.flush(true);
}
// shared
sharedWriterMap.put(this.root_pid, this.csvWriter);
@@ -171,7 +171,7 @@ public class ResumeUtil {
csvWriter.write(item.stackTrace);// stackTrace
csvWriter.write(item.dynamicData);// dynamicData--->it is the 17th field. @see:feature:11296
csvWriter.endRecord();
csvWriter.flush();
csvWriter.flush(false);
fileLock.release();
}
// for test the order
@@ -194,6 +194,16 @@ public class ResumeUtil {
}
}
public void flush() {
if (csvWriter == null) {
return;
}
synchronized (csvWriter) {
csvWriter.flush(true);
}
}
// Util: invoke target check point
@Deprecated
public static void invokeTargetCheckPoint(String resuming_checkpoint_path, Object jobObject,
@@ -353,13 +363,12 @@ public class ResumeUtil {
String str = out.toString();
return str;
}
// to support encrypt the password in the resume
public static String convertToJsonText(Object context, List<String> parametersToEncrypt) {
public static String convertToJsonText(Object context, Class<?> expectedClass, List<String> parametersToEncrypt) {
String jsonText = "";
try {
JSONObject firstNode = new JSONObject();
JSONObject secondNode = new JSONObject(context);
JSONObject secondNode = new JSONObject(context, expectedClass);
if (parametersToEncrypt != null) {
for (String parameterToEncrypt : parametersToEncrypt) {
if (secondNode.isNull(parameterToEncrypt)) {
@@ -379,9 +388,15 @@ public class ResumeUtil {
return jsonText;
}
// to support encrypt the password in the resume
@Deprecated
public static String convertToJsonText(Object context, List<String> parametersToEncrypt) {
return convertToJsonText(context, context == null ? null : context.getClass(), parametersToEncrypt);
}
// Util: convert the context variable to json style text.
// feature:11296
// @Deprecated
@Deprecated
public static String convertToJsonText(Object context) {
return convertToJsonText(context, null);
}
@@ -459,6 +474,8 @@ public class ResumeUtil {
USER_DEF_LOG,
JOB_ENDED;
}
/**
* this class is reference with CsvWriter.
@@ -503,7 +520,10 @@ public class ResumeUtil {
private String lineSeparator = System.getProperty("line.separator");
private int capibility = 2<<14; //32k
private int capibility = 2 << 22; //8M
private int FLUSH_FACTOR = 6 *1024 *1024; //6M
public SimpleCsvWriter(FileChannel channel) {
this.channel = channel;
@@ -534,10 +554,8 @@ public class ResumeUtil {
}
byte[] contentByte = content.getBytes();
if(contentByte.length > capibility - 1024) {
flush();
capibility = contentByte.length * 2;
buf = ByteBuffer.allocate(capibility);
if(contentByte.length > capibility - buf.position()) {
flush(true);
}
buf.put(contentByte);
@@ -562,18 +580,20 @@ public class ResumeUtil {
/**
* flush
*/
public void flush() {
try {
((Buffer) buf).flip();
channel.position(channel.size());
while(buf.hasRemaining()) {
channel.write(buf);
public void flush(boolean force) {
if(force || buf.position() > FLUSH_FACTOR) {
try {
((Buffer) buf).flip();
channel.position(channel.size());
while(buf.hasRemaining()) {
channel.write(buf);
}
channel.force(true);
((Buffer) buf).clear();
} catch (IOException e) {
e.printStackTrace();
}
channel.force(true);
((Buffer) buf).clear();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**

View File

@@ -202,6 +202,9 @@ public class JavaLibrariesService extends AbstractLibrariesService {
if (!repositoryBundleService.isInitialized()) {
// 2. Components libraries and libraries from extension
repositoryBundleService.createModulesIndexFromComponentAndExtension(monitorWrap);
} else {
//TUP-31721 & TUP-36231:Handle the custom components deployment when studio index is not re-generated.
repositoryBundleService.deployLibsFromCustomComponents();
}
repositoryBundleService.installModules(ModulesNeededProvider.getSystemRunningModules(), null);

View File

@@ -1352,6 +1352,21 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
}
return mavenURIMap;
}
public void deployLibsFromCustomComponents() {
IComponentsService service = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentsService.class)) {
service = GlobalServiceRegister.getDefault().getService(IComponentsService.class);
}
if (service != null) {
Map<String, String> platformURLMap = new HashMap<>();
platformURLMap = LibrariesIndexManager.getInstance().getAllStudioLibsFromIndex();
// Need to read components first, otherwise FiltUtils.getFilesFromFolderByName() returns empty for custom
// component folder.
service.getComponentsFactory().readComponents();
deployLibsFromCustomComponents(service, platformURLMap);
}
}
/**
*

View File

@@ -29,6 +29,7 @@ Bundle-Vendor: .Talend SA.
Bundle-Localization: plugin
Export-Package: org.talend.metadata.managment.ui,
org.talend.metadata.managment.ui.celleditor,
org.talend.metadata.managment.ui.convert.strategy,
org.talend.metadata.managment.ui.dialog,
org.talend.metadata.managment.ui.editor,
org.talend.metadata.managment.ui.i18n,

View File

@@ -510,10 +510,12 @@ InegerCellEditorListener.NumeralMessage=Valeur d'entr\u00E9e invalide
MetadataTalendTypeEditor.button.edit=Mo&difier
MetadataTalendTypeEditor.button.export=E&xporter
MetadataTalendTypeEditor.button.import=I&mporter
MetadataTalendTypeEditor.button.restore=R&estaurer
MetadataTalendTypeEditor.column1.Name=Fichier de mapping de m\u00E9tadonn\u00E9es
MetadataTalendTypeEditor.editMappingDialog.title=Modifier le fichier de mapping
MetadataTalendTypeEditor.error.message=Message d'erreur
MetadataTalendTypeEditor.fileIsImported=Le fichier a d\u00E9j\u00E0 \u00E9t\u00E9 import\u00E9.
MetadataTalendTypeEditor.fileOverwrite=Ce fichier existe d\u00E9j\u00E0. L'\u00E9craser\u00A0?
MetadataTalendTypeEditor.fileIsInvalid=Le fichier de m\u00E9tadonn\u00E9es import\u00E9 n'est pas valide.
MetadataTalendTypeEditor.fileNameStartRule=Le nom de fichier doit commencer par 'mapping_'.
ContextModeSelectPage.contextModes=Cr\u00E9er un contexte ou r\u00E9utiliser le contexte existant
@@ -549,5 +551,5 @@ MetadataTalendTypeEditor.confirmMessage=Voulez-vous remplacer les param\u00E8tre
PromptDialog.title=Ex\u00E9cuter le contexte {0} avec les param\u00E8tres\u00A0:
PromptDialog.stringTip=Le texte d'entr\u00E9e doit \u00EAtre entour\u00E9 par des guillemets.
PromptDialog.choose.title=Choisissez un contexte
PromptDialog.promptGroup.name=Variables \u00E0 compl\u00E9ter
PromptDialog.variablePrompts.name=Variables \u00E0 compl\u00E9ter
PromptDialog.context.environments.name=Environnement

View File

@@ -510,10 +510,12 @@ InegerCellEditorListener.NumeralMessage=\u5165\u529B\u5024\u304C\u7121\u52B9\u30
MetadataTalendTypeEditor.button.edit=\u7DE8\u96C6(&D)
MetadataTalendTypeEditor.button.export=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8(&X)
MetadataTalendTypeEditor.button.import=\u30A4\u30F3\u30DD\u30FC\u30C8(&M)
MetadataTalendTypeEditor.button.restore=\u5FA9\u5143(&E)
MetadataTalendTypeEditor.column1.Name=\u30E1\u30BF\u30C7\u30FC\u30BF\u30DE\u30C3\u30D4\u30F3\u30B0\u30D5\u30A1\u30A4\u30EB
MetadataTalendTypeEditor.editMappingDialog.title=\u30DE\u30C3\u30D4\u30F3\u30B0\u30D5\u30A1\u30A4\u30EB\u3092\u7DE8\u96C6
MetadataTalendTypeEditor.error.message=\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8
MetadataTalendTypeEditor.fileIsImported=\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u65E2\u306B\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\u3002
MetadataTalendTypeEditor.fileOverwrite=\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B?
MetadataTalendTypeEditor.fileIsInvalid=\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u304C\u7121\u52B9\u3067\u3059\u3002
MetadataTalendTypeEditor.fileNameStartRule=\u30D5\u30A1\u30A4\u30EB\u540D\u306F 'mapping_' \u3067\u59CB\u3081\u3066\u304F\u3060\u3055\u3044\u3002
ContextModeSelectPage.contextModes=\u65B0\u898F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u65E2\u5B58\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u518D\u4F7F\u7528

View File

@@ -510,10 +510,12 @@ InegerCellEditorListener.NumeralMessage=\u8F93\u5165\u503C\u65E0\u6548
MetadataTalendTypeEditor.button.edit=\u7F16\u8F91(&D)
MetadataTalendTypeEditor.button.export=\u5BFC\u51FA(&X)
MetadataTalendTypeEditor.button.import=\u5BFC\u5165 (&M)
MetadataTalendTypeEditor.button.restore=\u6062\u590D (&E)
MetadataTalendTypeEditor.column1.Name=\u5143\u6570\u636E\u6620\u5C04\u6587\u4EF6
MetadataTalendTypeEditor.editMappingDialog.title=\u7F16\u8F91\u6620\u5C04\u6587\u4EF6
MetadataTalendTypeEditor.error.message=\u9519\u8BEF\u6D88\u606F
MetadataTalendTypeEditor.fileIsImported=\u6B64\u6587\u4EF6\u5DF2\u88AB\u5BFC\u5165\u3002
MetadataTalendTypeEditor.fileOverwrite=\u6B64\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u8986\u76D6\u5417?
MetadataTalendTypeEditor.fileIsInvalid=\u5BFC\u5165\u7684\u5143\u6570\u636E\u6587\u4EF6\u65E0\u6548\u3002
MetadataTalendTypeEditor.fileNameStartRule=\u6587\u4EF6\u540D\u5FC5\u987B\u4EE5 'mapping_' \u5F00\u5934\u3002
ContextModeSelectPage.contextModes=\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u73AF\u5883\u6216\u91CD\u65B0\u4F7F\u7528\u73B0\u6709\u7684\u73AF\u5883

View File

@@ -0,0 +1,106 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// 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.metadata.managment.ui.convert.strategy;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.hadoop.IHadoopClusterService;
import org.talend.core.hadoop.repository.HadoopRepositoryUtil;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.properties.ConnectionItem;
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.repository.IRepositoryViewObject;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
import org.talend.metadata.managment.ui.utils.ISwitchContext;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
public abstract class AbstractSwitchContextStrategy implements ISwitchContext {
private static Logger log = Logger.getLogger(AbstractSwitchContextStrategy.class);
@Override
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext) {
return updateContextGroup(connItem, selectedContext, null);
}
@Override
public boolean updateContextForConnectionItems(Map<String, String> contextGroupRanamedMap,
ContextItem contextItem) {
if (contextItem == null) {
return false;
}
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
List<IRepositoryViewObject> allConnectionItem =
factory.getAll(ProjectManager.getInstance().getCurrentProject(),
ERepositoryObjectType.METADATA_CONNECTIONS);
for (IRepositoryViewObject connectionItem : allConnectionItem) {
Item item = connectionItem.getProperty().getItem();
if (item instanceof ConnectionItem
&& ConnectionContextHelper.checkContextMode((ConnectionItem) item) != null) {
Connection con = ((ConnectionItem) item).getConnection();
String contextId = con.getContextId();
if (contextId != null && contextId.equals(contextItem.getProperty().getId())) {
String oldContextGroup = con.getContextName();
boolean modified = false;
if (oldContextGroup != null && !"".equals(oldContextGroup)) { //$NON-NLS-1$
String newContextGroup = contextGroupRanamedMap.get(oldContextGroup);
if (newContextGroup != null) { // rename
con.setContextName(newContextGroup);
modified = true;
}
} else { // if not set, set default group
ContextItem originalItem = ContextUtils.getContextItemById2(contextId);
con.setContextName(originalItem.getDefaultContext());
modified = true;
}
if (modified) {
factory.save(item);
}
}
}
}
IHadoopClusterService hadoopClusterService = HadoopRepositoryUtil.getHadoopClusterService();
if (hadoopClusterService != null) {
hadoopClusterService.updateConfJarsByContextGroup(contextItem, contextGroupRanamedMap);
}
return true;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
return false;
}
protected void saveConnection(ConnectionItem connItem, boolean... isMigrationTask) {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
factory.save(connItem, isMigrationTask);
} catch (PersistenceException e) {
log.error(e, e);
}
}
}

View File

@@ -0,0 +1,224 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// 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.metadata.managment.ui.convert.strategy;
import org.apache.log4j.Logger;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.DatabaseConnStrUtil;
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.FileConnection;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.cwm.helper.CatalogHelper;
import org.talend.cwm.helper.ConnectionHelper;
import org.talend.cwm.helper.SchemaHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
import orgomg.cwm.resource.relational.Catalog;
import orgomg.cwm.resource.relational.Schema;
/**
* default strategy work for except generic jdbc
*/
public class SwitchContextWithReplace extends AbstractSwitchContextStrategy {
private static Logger log = Logger.getLogger(SwitchContextWithReplace.class);
@Override
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext, String originalContext,
boolean... isMigrationTask) {
if (connItem == null) {
return false;
}
Connection con = connItem.getConnection();
// MOD msjian 2012-2-13 TDQ-4559: make it support file/mdm connection
if (con != null) {
// TDQ-4559~
String oldContextName = originalContext == null ? con.getContextName() : originalContext;
String newContextName = selectedContext;
if (newContextName == null) {
ContextType newContextType =
ConnectionContextHelper.getContextTypeForContextMode(con, selectedContext, false);
newContextName = newContextType == null ? null : newContextType.getName();
}
if (!isContextIsValid(newContextName, oldContextName, connItem) && hasDependency(connItem)) {
// can not update connection when context is invalid(catalog or schema is null) and has dependecy
return false;
}
con.setContextName(newContextName);
if (con instanceof DatabaseConnection) {
DatabaseConnection dbConn = (DatabaseConnection) connItem.getConnection();
String newURL = getChangedURL(dbConn, newContextName);
dbConn.setURL(newURL);
// do nothing when schema or catalog is null
updateConnectionForSidOrUiSchema(dbConn, oldContextName);
}
saveConnection(connItem);
return true;
}
return false;
}
private boolean hasDependency(ConnectionItem connItem) {
// Added TDQ-18565
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepService =
GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
if (tdqRepService.hasClientDependences(connItem)) {
return true;
}
}
return false;
}
/**
* DOC talend Comment method "checkContextIsValid".
*
* @param selectedContext
* @paramconn
*/
private boolean isContextIsValid(String selectedContext, String oldContextName, ConnectionItem connItem) {
boolean retCode = false;
Connection conn = connItem.getConnection();
if (conn instanceof DatabaseConnection) {
EDatabaseTypeName dbType =
EDatabaseTypeName.getTypeFromDbType(((DatabaseConnection) conn).getDatabaseType());
if (dbType == EDatabaseTypeName.GODBC) {// for ODBC
retCode = true;
} else if (dbType == EDatabaseTypeName.GENERAL_JDBC) {
retCode = true;
} else {
DatabaseConnection dbConn = (DatabaseConnection) conn;
boolean hasCatalog = ConnectionHelper.hasCatalog(dbConn);
boolean hasSchema = ConnectionHelper.hasSchema(dbConn);
ContextType newContextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn,
selectedContext, false);
ContextType oldContextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn,
oldContextName, false);
String newSidOrDatabase = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getSID());
String newUiShema = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getUiSchema());
String oldSidOrDatabase = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getSID());
String oldUiShema = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getUiSchema());
if (hasCatalog) {// for example mysql
retCode = checkEmpty(newSidOrDatabase, oldSidOrDatabase);
if (hasSchema) {// for example mssql
retCode &= checkEmpty(newUiShema, oldUiShema);
}
} else if (hasSchema) {// for example oracle
retCode = checkEmpty(newUiShema, oldUiShema);
} else {// some db didnot have catelog and schema
retCode = true;
}
}
} else if (conn instanceof FileConnection) {
retCode = true;
}
return retCode;
}
private boolean checkEmpty(String newSidOrDatabase, String oldSidOrDatabase) {
if (isEmptyString(oldSidOrDatabase) && isEmptyString(newSidOrDatabase)) {
return true;
}
return !isEmptyString(oldSidOrDatabase) && !isEmptyString(newSidOrDatabase);
}
/**
*
* check whether str is null or length is zero
*
* @param str
* @return
*/
private boolean isEmptyString(final String str) {
return str == null || str.length() == 0;
}
/**
* change the URL according to selected context Added yyin 20120918 TDQ-5668
*
* @param connItem
* @param con
* @param selectedContext
*/
private String getChangedURL(DatabaseConnection dbConn, String selectedContext) {
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn, selectedContext, false);
String url = dbConn.getURL();
if (url != null) {
return url;
}
String server = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getServerName());
String username = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getUsername());
String password = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getRawPassword());
String port = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getPort());
String sidOrDatabase = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getSID());
String datasource = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getDatasourceName());
String filePath = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getFileFieldName());
String dbRootPath = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getDBRootPath());
String additionParam = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getAdditionalParams());
return DatabaseConnStrUtil.getURLString(dbConn.getDatabaseType(), dbConn.getDbVersionString(), server, username,
password, port, sidOrDatabase, filePath.toLowerCase(), datasource, dbRootPath, additionParam);
}
/**
*
* change context Group need to synchronization name of catalog or schema
*
* @param dbConn
* @param oldContextName
*/
private void updateConnectionForSidOrUiSchema(DatabaseConnection dbConn, String oldContextName) {
String selectedContext = dbConn.getContextName();
ContextType newContextType =
ConnectionContextHelper.getContextTypeForContextMode(dbConn, selectedContext, false);
ContextType oldContextType =
ConnectionContextHelper.getContextTypeForContextMode(dbConn, oldContextName, false);
String newSidOrDatabase = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getSID());
String newUiShema = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getUiSchema());
String oldSidOrDatabase = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getSID());
String oldUiShema = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getUiSchema());
if (!isEmptyString(newSidOrDatabase) && !isEmptyString(oldSidOrDatabase)) {// for example mysql or mssql
Catalog catalog = CatalogHelper.getCatalog(dbConn, oldSidOrDatabase);
if (catalog != null) {
catalog.setName(newSidOrDatabase);
Schema schema = SchemaHelper.getSchemaByName(CatalogHelper.getSchemas(catalog), oldUiShema);// for
// example
// mssql
if (schema != null) {
schema.setName(newUiShema);
}
}
}
if (!isEmptyString(newUiShema) && !isEmptyString(oldUiShema)) {// for example oracle
Schema schema = SchemaHelper.getSchema(dbConn, oldUiShema);
if (schema != null) {
schema.setName(newUiShema);
}
}
}
}

View File

@@ -0,0 +1,216 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// 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.metadata.managment.ui.convert.strategy;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.database.jdbc.ExtractorFactory;
import org.talend.core.model.metadata.builder.database.jdbc.IUrlDbNameExtractor;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.cwm.helper.TaggedValueHelper;
/**
* generic jdbc connection will use this strategy
*/
public class SwitchContextWithTaggedValue extends AbstractSwitchContextStrategy {
private static Logger log = Logger.getLogger(SwitchContextWithTaggedValue.class);
@Override
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext, String originalContext,
boolean... isMigrationTask) {
// judge database type by dbMetadata
IUrlDbNameExtractor extractorInstance =
ExtractorFactory.getExtractorInstance(connItem, selectedContext, originalContext);
if (extractorInstance == null) {
return false;
}
extractorInstance.initUiSchemaOrSID();
String sid = extractorInstance.getExtractResult().get(0);
String uiSchema = extractorInstance.getExtractResult().get(1);
DatabaseConnection dbConn = null;
if (connItem instanceof DatabaseConnectionItem) {
dbConn = (DatabaseConnection) connItem.getConnection();
} else {
return false;
}
// catalog never be null
if (extractorInstance.hasCatalog() && StringUtils.isEmpty(sid)) {
return false;
}
// schema can be null only when there are catalog
if (!extractorInstance.hasCatalog() && extractorInstance.hasSchema() && StringUtils.isEmpty(uiSchema)) {
return false;
}
boolean hasChanged = false;
// extract sid by different url try to create class structor to handle default case and special case
// setting sid or uischema by different databaseType
boolean isOriginalChanged = recordOriginalValue(connItem, selectedContext, originalContext, sid, uiSchema);
if (extractorInstance.hasBothSturctor()) {
if (sidIsValid(sid, dbConn) && uiSchemaIsValid(uiSchema, dbConn)) {
// change catalog and schema with same time when both structor exist and no one is empty
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.TARGET_SID, sid);
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.TARGET_UISCHEMA, uiSchema);
hasChanged = true;
}
} else {
if (extractorInstance.hasCatalog() && sidIsValid(sid, dbConn)) {
// only catalog case
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.TARGET_SID, sid);
hasChanged = true;
}
if (extractorInstance.hasSchema() && uiSchemaIsValid(uiSchema, dbConn)) {
// only schema case
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.TARGET_UISCHEMA, uiSchema);
hasChanged = true;
}
}
// special case when there are catalog and schema then schema can be set to null for switch between different
// catalog same schema case
if (isOriginalChanged && extractorInstance.hasBothSturctor() && StringUtils.isEmpty(uiSchema)) {
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.TARGET_UISCHEMA, uiSchema);
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.TARGET_SID, sid);
hasChanged = true;
}
if (hasChanged) {
dbConn.setContextName(selectedContext);
saveConnection(connItem, isMigrationTask);
return true;
}
return false;
}
private boolean recordOriginalValue(ConnectionItem connItem, String selectedContext, String originalContext,
String targetSid, String targetUiSchema) {
boolean hasChanged = false;
IUrlDbNameExtractor extractorInstance =
ExtractorFactory.getExtractorInstance(connItem, originalContext, selectedContext);
if (extractorInstance == null) {
return hasChanged;
}
extractorInstance.initUiSchemaOrSID();
String originalSid = extractorInstance.getExtractResult().get(0);
String originalUiSchema = extractorInstance.getExtractResult().get(1);
DatabaseConnection dbConn = null;
if (connItem instanceof DatabaseConnectionItem) {
dbConn = (DatabaseConnection) connItem.getConnection();
} else {
return hasChanged;
}
// catalog never be empty when catalog exist
if (extractorInstance.hasCatalog() && StringUtils.isEmpty(originalSid)) {
return false;
}
// schema can be empty only when catalog is exist
if (!extractorInstance.hasCatalog() && extractorInstance.hasSchema() && StringUtils.isEmpty(originalUiSchema)) {
return false;
}
String taggedOriSid = TaggedValueHelper.getValueString(TaggedValueHelper.ORIGINAL_SID, dbConn);
String taggedOriUiShchema = TaggedValueHelper.getValueString(TaggedValueHelper.ORIGINAL_UISCHEMA, dbConn);
// case1:catalog original value is empty then save original record(first time to switch)
if (extractorInstance.hasCatalog() && StringUtils.isEmpty(taggedOriSid)) {
if (!StringUtils.isEmpty(originalSid) && !StringUtils.isEmpty(targetSid)) {
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.ORIGINAL_SID, originalSid);
hasChanged = true;
}
}
// case1:schema original value is empty then save original record(first time to switch)
if (extractorInstance.hasSchema() && StringUtils.isEmpty(taggedOriUiShchema)) {
if (!StringUtils.isEmpty(originalUiSchema) && !StringUtils.isEmpty(targetUiSchema)) {
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.ORIGINAL_UISCHEMA, originalUiSchema);
hasChanged = true;
}
}
// case2 original value is in the context group then do nothing
// case3 originalContext same with selectedContext(
// .e.g. DQ->DQ2->DQ2 the second time switch will change original value to DQ2
// DQ->DQ2->DQ the second time switch will keep original value to DQ and switch target value as
// DQ
if (extractorInstance.hasCatalog() && !StringUtils.isEmpty(taggedOriSid) && originalContext.equals(selectedContext)) {
// change original catalog need to judge schema is not empty with same time
if (!StringUtils.isEmpty(originalSid)
&& (!extractorInstance.hasSchema() || !StringUtils.isEmpty(originalUiSchema))) {
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.ORIGINAL_SID, originalSid);
hasChanged = true;
}
}
if (extractorInstance.hasSchema() && !StringUtils.isEmpty(taggedOriUiShchema)
&& originalContext.equals(selectedContext)) {
// change original schema need to judge catalog is not empty with same time
if (!StringUtils.isEmpty(originalUiSchema)
&& (!extractorInstance.hasCatalog()
|| !StringUtils.isEmpty(originalSid) && !StringUtils.isEmpty(targetUiSchema))) {
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.ORIGINAL_UISCHEMA, originalUiSchema);
hasChanged = true;
}
}
// case4 both has catalog and schema case then schema maybe set null when both original and target are null with
// same time
if (isSpecial4Case(targetUiSchema, extractorInstance, originalUiSchema, taggedOriUiShchema)) {
if (originalContext.equals(selectedContext)) {
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.ORIGINAL_SID, originalSid);
}
TaggedValueHelper.setTaggedValue(dbConn, TaggedValueHelper.ORIGINAL_UISCHEMA, originalUiSchema);
hasChanged = true;
}
return hasChanged;
}
protected boolean isSpecial4Case(String targetUiSchema, IUrlDbNameExtractor extractorInstance,
String originalUiSchema, String taggedOriUiShchema) {
return extractorInstance.hasBothSturctor()
&& StringUtils.isEmpty(originalUiSchema) && StringUtils.isEmpty(targetUiSchema);
}
private boolean originalValueExistInGroup(String taggedOriSid, String originalSid, String targetSid,
String taggedOriUiShchema, String originalUiSchema, String targetUiSchema) {
if (compareAllSameOrEmpty(taggedOriSid, originalSid)
&& compareAllSameOrEmpty(taggedOriUiShchema, originalUiSchema)
|| compareAllSameOrEmpty(taggedOriSid, targetSid)
&& compareAllSameOrEmpty(taggedOriUiShchema, targetUiSchema)) {
return true;
}
return false;
}
protected boolean compareAllSameOrEmpty(String taggedOriSid, String originalSid) {
return taggedOriSid == originalSid || StringUtils.isEmpty(taggedOriSid) && StringUtils.isEmpty(originalSid);
}
private boolean originalValueIsEmpty(String taggedOriSid, String taggedOriUiShchema) {
return StringUtils.isEmpty(taggedOriSid) || StringUtils.isEmpty(taggedOriUiShchema);
}
private boolean uiSchemaIsValid(String uiSchema, DatabaseConnection dbConn) {
return !StringUtils.isEmpty(uiSchema)
&& !StringUtils.isEmpty(TaggedValueHelper.getValueString(TaggedValueHelper.ORIGINAL_UISCHEMA, dbConn));
}
private boolean sidIsValid(String sid, DatabaseConnection dbConn) {
return !StringUtils.isEmpty(sid)
&& !StringUtils.isEmpty(TaggedValueHelper.getValueString(TaggedValueHelper.ORIGINAL_SID, dbConn));
}
}

View File

@@ -893,6 +893,7 @@ public final class DBConnectionContextUtils {
managerConnection.setValue(0, dbType, urlConnection, server, username, password, sidOrDatabase, port, filePath,
datasource, schemaOracle, additionParam, driverClassName, driverJarPath, dbVersionString);
managerConnection.setDbRootPath(dbRootPath);
managerConnection.setSupportNLS(dbConn.isSupportNLS());
return urlConnection;
}
@@ -1058,6 +1059,12 @@ public final class DBConnectionContextUtils {
cloneConn.setSQLMode(true);
}
if(dbConn.isSetSupportNLS()) {
cloneConn.setSupportNLS(dbConn.isSupportNLS());
} else {
cloneConn.setSupportNLS(false);
}
// cloneConn.setProperties(dbConn.getProperties());
// cloneConn.setCdcConns(dbConn.getCdcConns());
// cloneConn.setQueries(dbConn.getQueries());

View File

@@ -162,6 +162,10 @@ public class ExtendedNodeConnectionContextUtils {
DataBricksClusterId,
DataBricksToken,
DataBricksDBFSDepFolder,
DataBricksClusterType,
DataBricksRuntimeVersion,
DataBricksDriverNodeType,
DataBricksNodeType,
//Knox
SparkMode,

View File

@@ -31,6 +31,16 @@ public interface ISwitchContext {
*/
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext);
/**
* update Context Group for one Connection Item.
*
* @param connItem
* @param selectedContext
* @return
*/
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext, String originalContext,
boolean... isMigrationTask);
/**
* update Context For all Connection Items.
*

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