Compare commits
4 Commits
release/8.
...
release/8.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ab77c2d84 | ||
|
|
ff2f9fd884 | ||
|
|
b5df336d2f | ||
|
|
ef2db192d1 |
Binary file not shown.
|
Before Width: | Height: | Size: 618 B |
@@ -39,8 +39,6 @@ public enum EImage implements IImage {
|
||||
EDIT_ICON("/icons/write_obj.gif"), //$NON-NLS-1$
|
||||
READ_ICON("/icons/read_obj.gif"), //$NON-NLS-1$
|
||||
|
||||
QUESTION_ICON("/icons/question.gif"), //$NON-NLS-1$
|
||||
|
||||
CREATE_CONNECTION_ICON("/icons/connection.gif"), //$NON-NLS-1$
|
||||
|
||||
RESET_DBTYPES_ICON("/icons/reset_dbtypes.jpg"), //$NON-NLS-1$
|
||||
|
||||
@@ -58,14 +58,10 @@ public class CommonsPlugin implements BundleActivator {
|
||||
// TESB-17856: For commandline builds ESB Micorservice bundle
|
||||
private static boolean isESBMicorservice = false;
|
||||
|
||||
private static Boolean isJunitWorking;
|
||||
|
||||
private static Boolean isDevMode = null;
|
||||
|
||||
private static ServiceTracker proxyTracker;
|
||||
|
||||
private static Boolean isDebugP2 = null;
|
||||
|
||||
public static boolean isWorkbenchCreated() {
|
||||
return isWorkbenchCreated;
|
||||
}
|
||||
@@ -128,17 +124,6 @@ public class CommonsPlugin implements BundleActivator {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDebugP2() {
|
||||
try {
|
||||
if (isDebugP2 == null) {
|
||||
isDebugP2 = Boolean.getBoolean("talend.studio.lite.p2.debug");
|
||||
}
|
||||
return isDebugP2;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDebugMode() {
|
||||
return Boolean.getBoolean("talendDebug") //$NON-NLS-1$
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
@@ -152,35 +137,6 @@ public class CommonsPlugin implements BundleActivator {
|
||||
return "org.talend.rcp.branding.tuj.product".equals(Platform.getProduct().getId()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static boolean isJunitWorking() {
|
||||
if (isJunitWorking == null) {
|
||||
try {
|
||||
String[] args = Platform.getCommandLineArgs();
|
||||
String applicationId = null;
|
||||
|
||||
for (int i = 0; i < args.length - 1; i++) {
|
||||
if (args[i].equalsIgnoreCase("-application")) { //$NON-NLS-1$
|
||||
applicationId = args[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
if (applicationId != null
|
||||
&& (applicationId.equals("org.eclipse.swtbot.eclipse.junit.headless.swtbottestapplication") //$NON-NLS-1$
|
||||
|| applicationId.equals("org.eclipse.pde.junit.runtime.uitestapplication"))) { //$NON-NLS-1$
|
||||
isJunitWorking = true;
|
||||
} else {
|
||||
isJunitWorking = false;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
isJunitWorking = false;
|
||||
}
|
||||
}
|
||||
if (isJunitWorking == null) {
|
||||
isJunitWorking = false;
|
||||
}
|
||||
return isJunitWorking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Answer the file associated with name. This handles the case of running as a plugin and running standalone which
|
||||
* happens during testing.
|
||||
|
||||
@@ -46,8 +46,6 @@ public interface ITaCoKitService {
|
||||
|
||||
boolean isTaCoKitType(Object repoType);
|
||||
|
||||
boolean isValueSelectionParameter(Object parameter);
|
||||
|
||||
public static ITaCoKitService getInstance() {
|
||||
BundleContext bc = FrameworkUtil.getBundle(ITaCoKitService.class).getBundleContext();
|
||||
Collection<ServiceReference<ITaCoKitService>> tacokitServices = Collections.emptyList();
|
||||
|
||||
@@ -168,8 +168,7 @@ ProjectRepositoryNode.sapFunctions.inputSchema=Lecture
|
||||
ProjectRepositoryNode.sapFunctions.outputSchema=Sortie
|
||||
ProjectRepositoryNode.sapIDocs=SAP IDoc
|
||||
ProjectRepositoryNode.sapTables=Tables SAP
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject.input=SAP ADSO (Entr\u00E9e)
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject.output=SAP ADSO (Sortie)
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject=ADSO SAP
|
||||
ProjectRepositoryNode.sapBWDataSource=Source des donn\u00E9es SAP
|
||||
ProjectRepositoryNode.sapBWDataStoreObject=Objet Data Store SAP
|
||||
ProjectRepositoryNode.sapBWInfoCube=InfoCube SAP
|
||||
|
||||
@@ -168,8 +168,7 @@ ProjectRepositoryNode.sapFunctions.inputSchema=\u5165\u529B
|
||||
ProjectRepositoryNode.sapFunctions.outputSchema=\u51FA\u529B
|
||||
ProjectRepositoryNode.sapIDocs=SAP iDocs
|
||||
ProjectRepositoryNode.sapTables=SAP\u30C6\u30FC\u30D6\u30EB
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject.input=SAP ADSO (\u5165\u529B)
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject.output=SAP ADSO (\u51FA\u529B)
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject=SAP ADSO
|
||||
ProjectRepositoryNode.sapBWDataSource=SAP DataSource
|
||||
ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
|
||||
@@ -168,8 +168,7 @@ ProjectRepositoryNode.sapFunctions.inputSchema=\u8F93\u5165
|
||||
ProjectRepositoryNode.sapFunctions.outputSchema=\u8F93\u51FA
|
||||
ProjectRepositoryNode.sapIDocs=SAP iDocs
|
||||
ProjectRepositoryNode.sapTables=SAP \u8868
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject.input=SAP ADSO (\u8F93\u5165)
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject.output=SAP ADSO (\u8F93\u51FA)
|
||||
ProjectRepositoryNode.sapBWAdvancedDataStoreObject=SAP ADSO
|
||||
ProjectRepositoryNode.sapBWDataSource=SAP DataSource
|
||||
ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
|
||||
@@ -17,23 +17,23 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public enum ERedshiftDriver {
|
||||
|
||||
DRIVER_V2("Driver v2", new String[] { "redshift-jdbc42-2.1.0.3.jar" }),
|
||||
DRIVER_V1("Driver v1", new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar" });
|
||||
DRIVER_V2("Driver v2", new String[] { "redshift-jdbc42-2.1.0.3.jar", "antlr4-runtime-4.8-1.jar" }),
|
||||
DRIVER_V1("Driver v1", new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" });
|
||||
|
||||
private String displayName;
|
||||
|
||||
private String[] drivers = new String[] {};
|
||||
private Set<String> drivers = new HashSet<String>();
|
||||
|
||||
private ERedshiftDriver(String displayName, String[] drivers) {
|
||||
private ERedshiftDriver(String displayName, String[] driverStr) {
|
||||
this.displayName = displayName;
|
||||
this.drivers = drivers;
|
||||
for (String driver : driverStr) {
|
||||
drivers.add(driver);
|
||||
}
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
@@ -44,36 +44,19 @@ public enum ERedshiftDriver {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String[] getDrivers() {
|
||||
public Set<String> getDrivers() {
|
||||
return drivers;
|
||||
}
|
||||
|
||||
public void setDrivers(String[] drivers) {
|
||||
public void setDrivers(Set<String> drivers) {
|
||||
this.drivers = drivers;
|
||||
}
|
||||
|
||||
public static Set<String> getDriversByVersion(EDatabaseVersion4Drivers v4d, String version) {
|
||||
public static Set<String> getDriversByVersion(String version) {
|
||||
Set<String> drivers = new HashSet<String>();
|
||||
Set<String> providerDrivers = v4d.getProviderDrivers();
|
||||
ERedshiftDriver redshiftDriver = ERedshiftDriver.valueOf(version);
|
||||
if (redshiftDriver != null && DRIVER_V1 != redshiftDriver) {
|
||||
// to replace default one
|
||||
String[] v1Drivers = DRIVER_V1.getDrivers();
|
||||
for (String driver : providerDrivers) {
|
||||
boolean replaced = false;
|
||||
for (int i = 0; i < v1Drivers.length; i++) {
|
||||
if (driver.equals(v1Drivers[i])) {
|
||||
drivers.add(redshiftDriver.getDrivers()[i]);
|
||||
replaced = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!replaced) {
|
||||
drivers.add(driver);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
drivers.addAll(providerDrivers);
|
||||
if (redshiftDriver != null) {
|
||||
return redshiftDriver.getDrivers();
|
||||
}
|
||||
return drivers;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,9 @@ public enum EDatabaseVersion4Drivers {
|
||||
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
|
||||
|
||||
SAS_9_1(new DbVersion4Drivers(EDatabaseTypeName.SAS, "SAS 9.1", "SAS_9.1", new String[] { "sas.core.jar", //$NON-NLS-1$
|
||||
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
|
||||
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
|
||||
// MYSQL, add for 9594
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -84,8 +84,8 @@ public enum EDatabaseVersion4Drivers {
|
||||
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
|
||||
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.19.jar", "jackson-core-2.13.2.jar",
|
||||
"jackson-databind-2.13.2.2.jar", "jackson-annotations-2.13.2.jar", "jcip-annotations-1.0-1.jar",
|
||||
"oauth2-oidc-sdk-9.7.jar", "log4j-1.2.17.jar", "jackson-core-2.12.1.jar",
|
||||
"jackson-databind-2.12.1.jar", "jackson-annotations-2.12.1.jar", "jcip-annotations-1.0-1.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.9.3.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",
|
||||
"content-type-2.1.jar", "lang-tag-1.5.jar" })),
|
||||
|
||||
@@ -155,8 +155,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
"jackson-databind-2.11.4.jar", "jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
|
||||
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"aws-java-sdk-redshift-internal-1.12.x.jar" })), //$NON-NLS-1$
|
||||
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar" })), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.49.jar")); //$NON-NLS-1$
|
||||
|
||||
@@ -312,8 +311,8 @@ public enum EDatabaseVersion4Drivers {
|
||||
|
||||
private static Set<String> getDriversByDriverVersion(EDatabaseVersion4Drivers v4d, String version) {
|
||||
Set<String> drivers = new HashSet<String>();
|
||||
if (REDSHIFT == v4d || REDSHIFT_SSO == v4d) {
|
||||
drivers = ERedshiftDriver.getDriversByVersion(v4d, version);
|
||||
if (REDSHIFT == v4d) {
|
||||
drivers = ERedshiftDriver.getDriversByVersion(version);
|
||||
}
|
||||
return drivers;
|
||||
}
|
||||
|
||||
@@ -766,11 +766,11 @@ public class ContextUtils {
|
||||
return ContextUtils.getContextTypeByName(contextItem, contextName, true);
|
||||
} else if (item instanceof JobletProcessItem) {
|
||||
JobletProcessItem jobletProcessItem = (JobletProcessItem) item;
|
||||
return ContextUtils.getContextTypeByName(jobletProcessItem.getJobletProcess().getContext(),
|
||||
return ContextUtils.getContextTypeByName((List<ContextType>) jobletProcessItem.getJobletProcess().getContext(),
|
||||
contextName, jobletProcessItem.getJobletProcess().getDefaultContext());
|
||||
} else if (item instanceof ProcessItem) {
|
||||
ProcessItem processItem = (ProcessItem) item;
|
||||
return ContextUtils.getContextTypeByName(processItem.getProcess().getContext(), contextName,
|
||||
return ContextUtils.getContextTypeByName((List<ContextType>) processItem.getProcess().getContext(), contextName,
|
||||
processItem.getProcess().getDefaultContext());
|
||||
}
|
||||
return null;
|
||||
@@ -1134,31 +1134,5 @@ public class ContextUtils {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static IContext convert2IContext(ContextType contextType) {
|
||||
return convert2IContext(contextType, null);
|
||||
}
|
||||
|
||||
public static IContext convert2IContext(ContextType contextType, String repositoryContextId) {
|
||||
if (contextType == null) {
|
||||
return null;
|
||||
}
|
||||
IContext jobContext = new JobContext(contextType.getName());
|
||||
List<ContextParameterType> repoParams = contextType.getContextParameter();
|
||||
for (ContextParameterType repoParam : repoParams) {
|
||||
IContextParameter jobParam = new JobContextParameter();
|
||||
jobParam.setName(repoParam.getName());
|
||||
jobParam.setContext(jobContext);
|
||||
jobParam.setComment(repoParam.getComment());
|
||||
jobParam.setPrompt(repoParam.getPrompt());
|
||||
jobParam.setPromptNeeded(repoParam.isPromptNeeded());
|
||||
jobParam.setSource(repositoryContextId != null ? repositoryContextId : repoParam.getRepositoryContextId());
|
||||
jobParam.setType(repoParam.getType());
|
||||
jobParam.setValue(repoParam.getValue());
|
||||
jobParam.setInternalId(repoParam.getInternalId());
|
||||
jobContext.getContextParameterList().add(jobParam);
|
||||
}
|
||||
return jobContext;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -273,8 +273,7 @@ public final class ConvertionHelper {
|
||||
|
||||
private static String getDriverVersionString(DatabaseConnection dbConn) {
|
||||
String dbVersionString = dbConn.getDbVersionString();
|
||||
if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbConn.getDatabaseType())
|
||||
|| EDatabaseTypeName.REDSHIFT_SSO.getDisplayName().equals(dbConn.getDatabaseType())) {
|
||||
if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbConn.getDatabaseType())) {
|
||||
EMap<String, String> parameters = dbConn.getParameters();
|
||||
if (parameters != null) {
|
||||
String driverString = parameters.get(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_DRIVER);
|
||||
@@ -728,8 +727,7 @@ public final class ConvertionHelper {
|
||||
origValueConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_SSL_KEY_STORE_PASSWORD), false));
|
||||
}
|
||||
}
|
||||
} else if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(origValueConn.getDatabaseType())
|
||||
|| EDatabaseTypeName.REDSHIFT_SSO.getDisplayName().equals(origValueConn.getDatabaseType())) {
|
||||
} else if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(origValueConn.getDatabaseType())) {
|
||||
Properties info = new Properties();
|
||||
EMap<String, String> parameters = origValueConn.getParameters();
|
||||
if (parameters != null
|
||||
|
||||
@@ -489,11 +489,6 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
|
||||
else if (EDatabaseTypeName.REDSHIFT_SSO.getDbType().equals((String) parameter.getValue())) {
|
||||
connection.setProductId(EDatabaseTypeName.REDSHIFT_SSO.getProduct());
|
||||
connection.setDatabaseType(EDatabaseTypeName.REDSHIFT_SSO.getDisplayName());
|
||||
}
|
||||
|
||||
// NeTezza
|
||||
else if (EDatabaseTypeName.NETEZZA.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.NETEZZA.getDisplayName());
|
||||
|
||||
@@ -1045,13 +1045,8 @@ public class RepositoryToComponentProperty {
|
||||
return Boolean.valueOf(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_STRINGPARA));
|
||||
}
|
||||
if (value.equals("ENTRY_PROPERTIES")) {
|
||||
List<Map<String, Object>> tableProperties = new ArrayList<Map<String, Object>>();
|
||||
String propertiesInfo = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_PARATABLE);
|
||||
if (org.apache.commons.lang.StringUtils.isNotBlank(propertiesInfo)) {
|
||||
tableProperties = ConvertionHelper
|
||||
.getEntryProperties(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_PARATABLE));
|
||||
}
|
||||
return tableProperties;
|
||||
return ConvertionHelper
|
||||
.getEntryProperties(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_PARATABLE));
|
||||
}
|
||||
if (value.equals("DRIVER_VERSION")) {
|
||||
String driverVersion = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_DRIVER);
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.update;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public interface IStudioUpdateConfig {
|
||||
|
||||
Boolean isEnabled();
|
||||
|
||||
IStudioUpdate getStudioUpdate();
|
||||
|
||||
public interface IStudioUpdate {
|
||||
|
||||
String getName();
|
||||
|
||||
String getStudioVersion();
|
||||
|
||||
Date getReleaseDate();
|
||||
|
||||
Date getApprovedDate();
|
||||
|
||||
String getInfoUrl();
|
||||
|
||||
String getBaseUrl();
|
||||
|
||||
String getUpdateUrl();
|
||||
|
||||
String getApprovedBy();
|
||||
|
||||
String getApprovedName();
|
||||
|
||||
String getProjectId();
|
||||
|
||||
Boolean isCustom();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.update;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public class StudioUpdateConfig implements IStudioUpdateConfig {
|
||||
|
||||
private Boolean enabled;
|
||||
|
||||
private IStudioUpdate studioUpdate;
|
||||
|
||||
@Override
|
||||
public Boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStudioUpdate getStudioUpdate() {
|
||||
return studioUpdate;
|
||||
}
|
||||
|
||||
public void setStudioUpdate(IStudioUpdate studioUpdate) {
|
||||
this.studioUpdate = studioUpdate;
|
||||
}
|
||||
|
||||
public static class StudioUpdate implements IStudioUpdate {
|
||||
|
||||
private String name;
|
||||
|
||||
private String studioVersion;
|
||||
|
||||
private String updateUrl;
|
||||
|
||||
private Date releaseDate;
|
||||
|
||||
private String infoUrl;
|
||||
|
||||
private String baseUrl;
|
||||
|
||||
private String approvedBy;
|
||||
|
||||
private String approvedName;
|
||||
|
||||
private Date approvedDate;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private Boolean custom;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStudioVersion() {
|
||||
return studioVersion;
|
||||
}
|
||||
|
||||
public void setStudioVersion(String studioVersion) {
|
||||
this.studioVersion = studioVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpdateUrl() {
|
||||
return updateUrl;
|
||||
}
|
||||
|
||||
public void setUpdateUrl(String updateUrl) {
|
||||
this.updateUrl = updateUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setReleaseDate(Date releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoUrl() {
|
||||
return infoUrl;
|
||||
}
|
||||
|
||||
public void setInfoUrl(String infoUrl) {
|
||||
this.infoUrl = infoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseUrl() {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
public void setBaseUrl(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getApprovedBy() {
|
||||
return approvedBy;
|
||||
}
|
||||
|
||||
public void setApprovedBy(String approvedBy) {
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getApprovedName() {
|
||||
return approvedName;
|
||||
}
|
||||
|
||||
public void setApprovedName(String approvedName) {
|
||||
this.approvedName = approvedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getApprovedDate() {
|
||||
return approvedDate;
|
||||
}
|
||||
|
||||
public void setApprovedDate(Date approvedDate) {
|
||||
this.approvedDate = approvedDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isCustom() {
|
||||
return custom;
|
||||
}
|
||||
|
||||
public void setCustom(Boolean custom) {
|
||||
this.custom = custom;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
AbstractBrandingService_job_license_header_content=// ============================================================================\n//\n// \u7248\u6743\u6240\u6709 (c) 2005-2010, Talend Inc.\n//\n\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// / JobDesigner (CodeGenerator \u7248\u672C {1})\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002\n//\n// ============================================================================
|
||||
AbstractBrandingService.routines_license_header_content2014=\u7248\u6743\u6240\u6709 (c) 2006-2014, Talend Inc.\n//\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// CodeGenerator \u7248\u672C {1}\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002
|
||||
AbstractBrandingService.routines_license_header_content2014=\u7248\u6743\u6240\u6709 (c) 2006-2014, Talend Inc.\n//\n\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// CodeGenerator \u7248\u672C {1}\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002
|
||||
AbstractComponentsProvider.folderNotExist=\u6587\u4EF6\u5939 {0} \u4E0D\u5B58\u5728\u3002
|
||||
AbstractItemMigrationTask.taskFailed=\u8FC1\u79FB\u4EFB\u52A1 {0} \u5728\u8FC1\u79FB\u9879\u76EE {1} \u65F6\u5931\u8D25
|
||||
AdvancedSocketFactory.failedInitial=\u9519\u8BEF\uFF1A\u65E0\u6CD5\u521D\u59CB\u5316\uFF1A
|
||||
|
||||
@@ -12,14 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
|
||||
@@ -40,12 +35,4 @@ public interface IMetadataManagmentUiService extends IService {
|
||||
|
||||
public boolean isContextMode(Connection connection, String value);
|
||||
|
||||
public boolean promptConfirmLauch(Shell shell, Connection connection, ContextItem contextItem);
|
||||
|
||||
public IContext promptConfirmLauch(Shell shell, List<IContext> contexts);
|
||||
|
||||
public boolean promptConfirmLauch(Shell shell, IContext context);
|
||||
|
||||
public boolean isPromptNeeded(List<IContext> contexts);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.update.IStudioUpdateConfig;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
@@ -123,8 +122,6 @@ public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
boolean checkProjectCompatibility(IProgressMonitor monitor, Project proj) throws Exception;
|
||||
|
||||
void setupTmcUpdate(IProgressMonitor monitor, IStudioUpdateConfig updateConfig) throws Exception;
|
||||
|
||||
public static IStudioLiteP2Service get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IStudioLiteP2Service.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IStudioLiteP2Service.class);
|
||||
@@ -134,9 +131,7 @@ public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
public static abstract class AbsCheckUpdateListener {
|
||||
|
||||
public void beforeCheckUpdate(IProgressMonitor monitor) throws Exception {
|
||||
IStudioLiteP2Service.get().unregistCheckUpdateListener(this);
|
||||
}
|
||||
abstract public void beforeCheckUpdate(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@@ -195,42 +190,18 @@ public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
boolean isReleaseEditable();
|
||||
|
||||
@Deprecated
|
||||
URI getRelease(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
@Deprecated
|
||||
void setRelease(IProgressMonitor monitor, URI uri) throws Exception;
|
||||
|
||||
URI getLocalRelease(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
void setLocalRelease(IProgressMonitor monitor, URI uri) throws Exception;
|
||||
|
||||
String getTmcRelease(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
boolean isUpdateEditable();
|
||||
|
||||
@Deprecated
|
||||
Collection<URI> getUpdates(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
@Deprecated
|
||||
void setUpdates(IProgressMonitor monitor, Collection<URI> uris) throws Exception;
|
||||
|
||||
Collection<URI> getLocalUpdates(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
void setLocalUpdates(IProgressMonitor monitor, Collection<URI> uris) throws Exception;
|
||||
|
||||
String getTmcUpdate(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
void resetToDefault(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
boolean isEnableTmcUpdateSettings(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
void enableTmcUpdateSettings(IProgressMonitor monitor, boolean enable) throws Exception;
|
||||
|
||||
boolean isOverwriteTmcUpdateSettings(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
void overwriteTmcUpdateSettings(IProgressMonitor monitor, boolean overwrite) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -173,8 +173,6 @@ public class ConnectionParameters {
|
||||
|
||||
private Map<String, String> parameters;
|
||||
|
||||
private String selectContext = null;
|
||||
|
||||
/**
|
||||
* Sets the connectionComment.
|
||||
*
|
||||
@@ -909,12 +907,4 @@ public class ConnectionParameters {
|
||||
this.isFirstOpenSqlBuilder = isFirstOpenSqlBuilder;
|
||||
}
|
||||
|
||||
public String getSelectContext() {
|
||||
return this.selectContext;
|
||||
}
|
||||
|
||||
public void setSelectContext(String selectContext) {
|
||||
this.selectContext = selectContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
@@ -280,6 +279,4 @@ public interface IRunProcessService extends IService {
|
||||
|
||||
void updateAllCodeCacheStatus(boolean isUpdated);
|
||||
|
||||
IContext promptConfirmLauch(Shell shell, IProcess process);
|
||||
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProjectReference;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.GITConstant;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.RepositoryManager;
|
||||
import org.talend.core.model.repository.GITConstant;
|
||||
import org.talend.core.model.utils.TalendPropertiesUtil;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.util.URIHelper;
|
||||
@@ -836,7 +836,8 @@ public final class ProjectManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, String> getProjectLabelWithOriginVersion() {
|
||||
return projectLabelWithOriginVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AbstractBrandingService_job_license_header_content=// ============================================================================\n//\n// \u7248\u6743\u6240\u6709 (c) 2005-2011\uFF0CTalend Inc.\n//\n\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// / JobDesigner (CodeGenerator \u7248\u672C {1})\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002\n//\n// ============================================================================
|
||||
AbstractBrandingService.routines_license_header_content=\u7248\u6743\u6240\u6709 (c) 2005-2011\uFF0CTalend Inc.\n//\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// CodeGenerator \u7248\u672C {1}\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002
|
||||
AbstractBrandingService.routines_license_header_content=\u7248\u6743\u6240\u6709 (c) 2005-2011\uFF0CTalend Inc.\n//\n\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// CodeGenerator \u7248\u672C {1}\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002
|
||||
AbstractComponentsProvider.folderNotExist=\u6587\u4EF6\u5939 {0} \u4E0D\u5B58\u5728\u3002
|
||||
AbstractItemMigrationTask.taskFailed=\u8FC1\u79FB\u4EFB\u52A1 {0} \u5728\u8FC1\u79FB\u9879\u76EE {1} \u65F6\u5931\u8D25
|
||||
AdvancedSocketFactory.failedInitial=\u9519\u8BEF\uFF1A\u65E0\u6CD5\u521D\u59CB\u5316:
|
||||
|
||||
@@ -172,10 +172,6 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
|
||||
|
||||
@Override
|
||||
public boolean isEditable(int columnIndex, int rowIndex) {
|
||||
if (columnIndex == 4) {
|
||||
// active the prompt when export as context
|
||||
return true;
|
||||
}
|
||||
if (modelManager != null && modelManager.isReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.text.MessageFormat;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.jface.fieldassist.IContentProposal;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
@@ -77,15 +76,11 @@ public class ContextParameterProposal implements IContentProposal {
|
||||
} else {
|
||||
desc = Messages.getString("ContextParameterProposal.NoCommentAvaiable"); //$NON-NLS-1$
|
||||
}
|
||||
String type = contextParameter.getType();
|
||||
String value = contextParameter.getValue();
|
||||
if (PasswordEncryptUtil.isPasswordType(type)) {
|
||||
value = "******"; //$NON-NLS-1$
|
||||
}
|
||||
// TDI-30683:fix the NPE pb and another description match pb(need move "\n" from message.propreties to code).
|
||||
MessageFormat format = new MessageFormat(getDescriptionMessagePattern());
|
||||
if (contextParameter.getContext() != null) {
|
||||
Object[] replaceArgs = new Object[] { desc, contextParameter.getContext().getName(), type, value };
|
||||
Object[] replaceArgs = new Object[] { desc, contextParameter.getContext().getName(), contextParameter.getType(),
|
||||
contextParameter.getValue() };
|
||||
return format.format(replaceArgs);
|
||||
}
|
||||
return desc;
|
||||
|
||||
@@ -87,9 +87,7 @@ public interface ICoreTisService extends IService {
|
||||
boolean hasNewPatchInPatchesFolder();
|
||||
|
||||
boolean isDefaultLicenseAndProjectType();
|
||||
|
||||
void syncProjectUpdateSettingsFromServer(IProgressMonitor monitor, Project proj) throws Exception;
|
||||
|
||||
|
||||
void refreshPatchesFolderCache();
|
||||
|
||||
static ICoreTisService get() {
|
||||
|
||||
@@ -89,7 +89,6 @@ import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
@@ -2507,13 +2506,6 @@ public class ProcessorUtilities {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
// TUP-35219 avoid resource unload
|
||||
if (property != null && property.getItem() != null
|
||||
&& property.getItem() instanceof JobletProcessItem) {
|
||||
((JobletProcessItem) property.getItem()).getJobletProcess();
|
||||
}
|
||||
|
||||
JobInfo jobInfo = new JobInfo(property, jobletProcess.getDefaultContext());
|
||||
if (!jobInfos.contains(jobInfo)) {
|
||||
jobInfos.add(jobInfo);
|
||||
|
||||
@@ -13,17 +13,18 @@
|
||||
<tcomp.version>${component-runtime.version}</tcomp.version>
|
||||
<cxf.version>3.5.1</cxf.version>
|
||||
<geronimo.version>1.0.2</geronimo.version>
|
||||
<jackson.version>2.12.1</jackson.version>
|
||||
<jcache.version>1.0.5</jcache.version>
|
||||
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
|
||||
<johnzon.version>1.2.16</johnzon.version>
|
||||
<meecrowave.version>1.2.13</meecrowave.version>
|
||||
<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>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<tomcat.version>9.0.59</tomcat.version>
|
||||
<xbean.version>4.20</xbean.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
<log4j2.version>2.17.2</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
|
||||
</properties>
|
||||
<repositories>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.44.3</tcomp.version>
|
||||
<tcomp.version>1.43.1</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
</properties>
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
|
||||
if (module.getDeployStatus() != ELibraryInstallStatus.DEPLOYED) {
|
||||
// try to retrieve from custom Nexus
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
|
||||
ILibraryManagerService libManagerService = GlobalServiceRegister.getDefault()
|
||||
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
|
||||
.getService(ILibraryManagerService.class);
|
||||
isDeployed = libManagerService.retrieve(module, null, false);
|
||||
}
|
||||
@@ -137,11 +137,7 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
|
||||
Exclusion exclusion = new Exclusion();
|
||||
exclusion.setGroupId("commons-codec"); //$NON-NLS-1$
|
||||
exclusion.setArtifactId("commons-codec"); //$NON-NLS-1$
|
||||
Exclusion jacksonExclusion = new Exclusion();
|
||||
jacksonExclusion.setGroupId("com.fasterxml.jackson.core"); //$NON-NLS-1$
|
||||
jacksonExclusion.setArtifactId("jackson-databind "); //$NON-NLS-1$
|
||||
dependency.addExclusion(exclusion);
|
||||
dependency.addExclusion(jacksonExclusion);
|
||||
}
|
||||
existedDependencies.add(dependency);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ModulesNeededProvider {
|
||||
|
||||
private static volatile boolean installModuleForRountine = false;
|
||||
|
||||
private static Set<ModuleNeeded> missingModulesForRountine = new HashSet<>();
|
||||
private static Set<ModuleNeeded> modulesForRountine = new HashSet<>();
|
||||
|
||||
private static List<ModuleNeeded> systemModules = null;
|
||||
|
||||
@@ -407,7 +407,6 @@ public class ModulesNeededProvider {
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<ModuleNeeded> getModulesNeededForJobs() {
|
||||
IProxyRepositoryFactory repositoryFactory = repositoryService.getProxyRepositoryFactory();
|
||||
List<ModuleNeeded> importNeedsList = new ArrayList<ModuleNeeded>();
|
||||
@@ -1147,37 +1146,30 @@ public class ModulesNeededProvider {
|
||||
return mvnPath;
|
||||
}
|
||||
|
||||
static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
|
||||
private static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
|
||||
if (!importNeedsList.isEmpty()) {
|
||||
for (ModuleNeeded mod : importNeedsList) {
|
||||
if (ELibraryInstallStatus.NOT_INSTALLED == mod.getStatus()) {
|
||||
missingModulesForRountine.add(mod);
|
||||
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
|
||||
installModuleForRountine = true;
|
||||
}
|
||||
}
|
||||
modulesForRountine.addAll(importNeedsList);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean installModuleForRoutineOrBeans() {
|
||||
if (!installModuleForRountine) {
|
||||
for (ModuleNeeded mod : missingModulesForRountine) {
|
||||
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
|
||||
installModuleForRountine = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return installModuleForRountine;
|
||||
}
|
||||
|
||||
public static void setInstallModuleForRoutineOrBeans() {
|
||||
installModuleForRountine = false;
|
||||
Iterator<ModuleNeeded> iterator = missingModulesForRountine.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ModuleNeeded mod = iterator.next();
|
||||
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
|
||||
iterator.remove();
|
||||
boolean allSet = true;
|
||||
for (ModuleNeeded mod : modulesForRountine) {
|
||||
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
|
||||
allSet = false;
|
||||
}
|
||||
}
|
||||
if (allSet) {
|
||||
installModuleForRountine = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1053,9 +1053,6 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
if (localMavenUri == null) {
|
||||
localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
if (!isResolveAllowed(localMavenUri)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
File resolvedJar = TalendMavenResolver.resolve(localMavenUri);
|
||||
if (resolvedJar != null) {
|
||||
|
||||
@@ -548,6 +548,3 @@ MetadataTalendTypeEditor.confirmTitle=Warning
|
||||
MetadataTalendTypeEditor.confirmMessage=Are you sure to replace current with default system settings?
|
||||
PromptDialog.title=Run Context {0} with parameters:
|
||||
PromptDialog.stringTip=The input text must be surrounded with single quote.
|
||||
PromptDialog.choose.title=Choose context
|
||||
PromptDialog.promptGroup.name=Prompt variables
|
||||
PromptDialog.context.environments.name=Context environments
|
||||
|
||||
@@ -12,17 +12,12 @@
|
||||
// ============================================================================
|
||||
package org.talend.metadata.managment.ui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.jface.wizard.WizardDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.service.IMetadataManagmentUiService;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.metadata.managment.ui.dialog.OpenXSDFileDialog;
|
||||
@@ -76,24 +71,4 @@ public class MetadataManagmentUiService implements IMetadataManagmentUiService {
|
||||
return ConnectionContextHelper.isContextMode(connection, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean promptConfirmLauch(Shell shell, Connection connection, ContextItem contextItem) {
|
||||
return ConnectionContextHelper.promptConfirmLauch(shell, connection, contextItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IContext promptConfirmLauch(Shell shell, List<IContext> contexts) {
|
||||
return ConnectionContextHelper.promptConfirmLauch(shell, contexts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean promptConfirmLauch(Shell shell, IContext context) {
|
||||
return ConnectionContextHelper.promptConfirmLauch(shell, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPromptNeeded(List<IContext> contexts) {
|
||||
return ConnectionContextHelper.isPromptNeeded(contexts);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -12,12 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.metadata.managment.ui.dialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CCombo;
|
||||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
@@ -37,119 +34,54 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.DirectoryDialog;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.dialogs.SelectionDialog;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.celleditor.DateDialog;
|
||||
import org.talend.commons.ui.swt.formtools.LabelledCombo;
|
||||
import org.talend.commons.ui.utils.PathUtils;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.ui.context.DefaultCellEditorFactory;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.metadata.managment.ui.i18n.Messages;
|
||||
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
|
||||
/**
|
||||
*
|
||||
* created by hcyi on Apr 21, 2022 Detailled comment
|
||||
* this class copied from org.talend.designer.runprocess.ui.PromptDialog
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
public class PromptDialog extends SelectionDialog {
|
||||
public class PromptDialog extends Dialog {
|
||||
|
||||
private static final int Y_POSITION = 150;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final int Y_POSITION = 100;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final int X_POSITION = 300;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final int CELLPADDING = 10;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final int MINIMUM_WIDTH = 50;
|
||||
|
||||
private static final String DEFAULT_FLAG = "(default)"; //$NON-NLS-1$
|
||||
|
||||
private static final String TITLE = Messages.getString("ContextSetsSelectionDialog.Title"); //$NON-NLS-1$
|
||||
|
||||
private Object source;
|
||||
|
||||
private List<String> contextSetsList = new ArrayList<String>();
|
||||
|
||||
private String defalutContext = ConnectionContextHelper.EMPTY;
|
||||
|
||||
private String selectedContext = null;
|
||||
|
||||
private IContext currentContext = null;
|
||||
|
||||
private boolean canCancel = false;
|
||||
|
||||
private LabelledCombo contextCombo;
|
||||
|
||||
private Composite contextComp;
|
||||
|
||||
private Composite child;
|
||||
IContext context;
|
||||
|
||||
/**
|
||||
* DOC nrousseau PromptDialog constructor comment.
|
||||
*
|
||||
* @param parentShell
|
||||
*/
|
||||
public PromptDialog(Shell parentShell, IContext context) {
|
||||
super(parentShell);
|
||||
initDialog(context, canCancel, Messages.getString("ContextSetsSelectionDialog.Messages")); //$NON-NLS-1$
|
||||
initSets();
|
||||
}
|
||||
|
||||
public PromptDialog(Shell parentShell, ContextItem contextItem) {
|
||||
super(parentShell);
|
||||
initDialog(contextItem, canCancel, Messages.getString("ContextSetsSelectionDialog.Messages")); //$NON-NLS-1$
|
||||
initSets();
|
||||
}
|
||||
|
||||
public PromptDialog(Shell parentShell, List<IContext> contexts) {
|
||||
super(parentShell);
|
||||
initDialog(contexts, canCancel, Messages.getString("ContextSetsSelectionDialog.Messages")); //$NON-NLS-1$
|
||||
initSets();
|
||||
}
|
||||
|
||||
private void initDialog(Object object, boolean cancelFlag, String message) {
|
||||
this.source = object;
|
||||
this.canCancel = cancelFlag;
|
||||
setHelpAvailable(false);
|
||||
setTitle(TITLE);
|
||||
setMessage(message);
|
||||
}
|
||||
|
||||
private void initSets() {
|
||||
if (source != null) {
|
||||
if (source instanceof ContextItem) {
|
||||
ContextItem contextItem = (ContextItem) source;
|
||||
List<ContextType> contexts = contextItem.getContext();
|
||||
String repositoryContextId = contextItem.getProperty().getId();
|
||||
defalutContext = contextItem.getDefaultContext();
|
||||
for (ContextType contextType : contexts) {
|
||||
String name = contextType.getName();
|
||||
if (name.equals(defalutContext)) {
|
||||
name = name + DEFAULT_FLAG;
|
||||
selectedContext = name;
|
||||
currentContext = ContextUtils.convert2IContext(contextType, repositoryContextId).clone();
|
||||
}
|
||||
contextSetsList.add(name);
|
||||
}
|
||||
} else if (source instanceof List) {
|
||||
List<IContext> contexts = (List<IContext>) source;
|
||||
defalutContext = "Default"; //$NON-NLS-1$
|
||||
for (IContext context : contexts) {
|
||||
String name = context.getName();
|
||||
if (name.equals(defalutContext)) {
|
||||
name = name + DEFAULT_FLAG;
|
||||
selectedContext = name;
|
||||
currentContext = context.clone();
|
||||
}
|
||||
contextSetsList.add(name);
|
||||
}
|
||||
} else if (source instanceof IContext) {
|
||||
currentContext = (IContext) source;
|
||||
}
|
||||
}
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,84 +89,16 @@ public class PromptDialog extends SelectionDialog {
|
||||
final Composite composite = (Composite) super.createDialogArea(parent);
|
||||
composite.setLayout(new FillLayout());
|
||||
|
||||
ScrolledComposite sc = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
|
||||
child = new Composite(sc, SWT.NONE);
|
||||
final ScrolledComposite sc = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
|
||||
|
||||
final Composite child = new Composite(sc, SWT.NONE);
|
||||
child.setLayout(new GridLayout(1, false));
|
||||
|
||||
createSourceArea(child);
|
||||
createSelectionArea(child);
|
||||
|
||||
contextComp = new Composite(child, SWT.NONE);
|
||||
contextComp.setLayout(new GridLayout(1, false));
|
||||
contextComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
createContextArea(currentContext, contextComp);
|
||||
|
||||
sc.setContent(child);
|
||||
|
||||
// Set the minimum size
|
||||
// sc.setMinSize(400, 400);
|
||||
|
||||
// Expand both horizontally and vertically
|
||||
sc.setExpandHorizontal(true);
|
||||
sc.setExpandVertical(true);
|
||||
sc.addControlListener(new ControlAdapter() {
|
||||
|
||||
public void controlResized(ControlEvent e) {
|
||||
Rectangle r = sc.getClientArea();
|
||||
sc.setMinSize(child.computeSize(r.width, SWT.DEFAULT));
|
||||
}
|
||||
});
|
||||
addFieldsListeners();
|
||||
return composite;
|
||||
}
|
||||
|
||||
private void createSourceArea(Composite parent) {
|
||||
if (source != null && source instanceof ContextItem) {
|
||||
ContextItem contextItem = (ContextItem) source;
|
||||
|
||||
Composite inner = new Composite(parent, SWT.NONE);
|
||||
GridLayout gridLayout = new GridLayout(2, false);
|
||||
gridLayout.marginHeight = 0;
|
||||
inner.setLayout(gridLayout);
|
||||
inner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
Label label = new Label(inner, SWT.NONE);
|
||||
label.setText(Messages.getString("ContextSetsSelectionDialog.Source")); //$NON-NLS-1$
|
||||
|
||||
Label source = new Label(inner, SWT.NONE);
|
||||
source.setText(contextItem.getProperty().getLabel() + " " + contextItem.getProperty().getVersion()); //$NON-NLS-1$
|
||||
source.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
|
||||
}
|
||||
}
|
||||
|
||||
private void createSelectionArea(Composite parent) {
|
||||
if (source != null && (source instanceof ContextItem || source instanceof List)) {
|
||||
Composite inner = new Composite(parent, SWT.NONE);
|
||||
GridLayout gridLayout = new GridLayout();
|
||||
gridLayout.marginHeight = 0;
|
||||
inner.setLayout(gridLayout);
|
||||
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gridData.minimumWidth = 220;
|
||||
gridData.minimumHeight = 100;
|
||||
inner.setLayoutData(gridData);
|
||||
|
||||
contextCombo = new LabelledCombo(inner, Messages.getString("PromptDialog.context.environments.name"), null, //$NON-NLS-1$
|
||||
contextSetsList, true);
|
||||
contextCombo.setText(defalutContext + DEFAULT_FLAG);
|
||||
}
|
||||
}
|
||||
|
||||
private void createContextArea(IContext currentContext, Composite parent) {
|
||||
Group promptGroup = new Group(parent, SWT.NONE);
|
||||
promptGroup.setText(Messages.getString("PromptDialog.promptGroup.name")); //$NON-NLS-1$
|
||||
promptGroup.setLayout(new GridLayout(1, false));
|
||||
promptGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
// Prompt for context values ?
|
||||
for (final IContextParameter parameter : currentContext.getContextParameterList()) {
|
||||
for (final IContextParameter parameter : context.getContextParameterList()) {
|
||||
if (parameter.isPromptNeeded()) {
|
||||
if (DefaultCellEditorFactory.isBoolean(parameter.getType())) {
|
||||
final Composite composite2 = new Composite(promptGroup, SWT.NONE);
|
||||
final Composite composite2 = new Composite(child, SWT.NONE);
|
||||
final GridLayout gridLayout = new GridLayout(2, false);
|
||||
gridLayout.horizontalSpacing = 5;
|
||||
gridLayout.marginBottom = 0;
|
||||
@@ -269,22 +133,42 @@ public class PromptDialog extends SelectionDialog {
|
||||
|
||||
});
|
||||
} else {
|
||||
Label label = new Label(promptGroup, SWT.NONE);
|
||||
Label label = new Label(child, SWT.NONE);
|
||||
label.setText(parameter.getPrompt());
|
||||
label.setAlignment(SWT.LEFT);
|
||||
GridData data = new GridData(GridData.FILL_HORIZONTAL);
|
||||
data.minimumWidth = MINIMUM_WIDTH;
|
||||
label.setLayoutData(data);
|
||||
createParameterComposite(promptGroup, parameter, label);
|
||||
createParameterComposite(child, parameter, label);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (promptGroup.getChildren().length == 0) {
|
||||
promptGroup.dispose();
|
||||
}
|
||||
|
||||
sc.setContent(child);
|
||||
|
||||
// Set the minimum size
|
||||
// sc.setMinSize(400, 400);
|
||||
|
||||
// Expand both horizontally and vertically
|
||||
sc.setExpandHorizontal(true);
|
||||
sc.setExpandVertical(true);
|
||||
sc.addControlListener(new ControlAdapter() {
|
||||
|
||||
public void controlResized(ControlEvent e) {
|
||||
Rectangle r = sc.getClientArea();
|
||||
sc.setMinSize(child.computeSize(r.width, SWT.DEFAULT));
|
||||
}
|
||||
});
|
||||
return composite;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC qiang.zhang Comment method "createParameterComposite".
|
||||
*
|
||||
* @param parent
|
||||
* @param parameter
|
||||
* @param label
|
||||
*/
|
||||
private void createParameterComposite(final Composite parent, final IContextParameter parameter, Label label) {
|
||||
final Composite child = new Composite(parent, SWT.NONE);
|
||||
final GridLayout layout = new GridLayout(2, false);
|
||||
@@ -302,14 +186,7 @@ public class PromptDialog extends SelectionDialog {
|
||||
}
|
||||
|
||||
final Text text = new Text(child, SWT.SINGLE | SWT.BORDER);
|
||||
|
||||
String paramValue = parameter.getValue();
|
||||
if (DefaultCellEditorFactory.isPassword(parameter.getType())) {
|
||||
if (StudioEncryption.hasEncryptionSymbol(paramValue)) {
|
||||
paramValue = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(paramValue);
|
||||
}
|
||||
}
|
||||
text.setText(paramValue);
|
||||
text.setText(parameter.getValue());
|
||||
|
||||
text.addModifyListener(new ModifyListener() {
|
||||
|
||||
@@ -410,6 +287,13 @@ public class PromptDialog extends SelectionDialog {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC bqian Comment method "createListParameterArea".
|
||||
*
|
||||
* @param parameter
|
||||
* @param label
|
||||
* @param parent
|
||||
*/
|
||||
private void createListParameterArea(final IContextParameter parameter, Label label, final Composite parent) {
|
||||
|
||||
final CCombo combo = new CCombo(parent, SWT.BORDER);
|
||||
@@ -441,26 +325,7 @@ public class PromptDialog extends SelectionDialog {
|
||||
combo.setToolTipText(parameter.getComment());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void addFieldsListeners() {
|
||||
if (contextCombo != null) {
|
||||
contextCombo.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(final ModifyEvent e) {
|
||||
selectedContext = contextCombo.getItem(contextCombo.getSelectionIndex());
|
||||
contextComp.dispose();
|
||||
contextComp = new Composite(child, SWT.NONE);
|
||||
contextComp.setLayout(new GridLayout(1, false));
|
||||
contextComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
createContextArea(getCloneContext(), contextComp);
|
||||
child.layout();
|
||||
child.getParent().layout();
|
||||
contextComp.layout();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -487,7 +352,7 @@ public class PromptDialog extends SelectionDialog {
|
||||
int height = t.getLineHeight() + CELLPADDING;
|
||||
t.dispose();
|
||||
int nbParams = 0;
|
||||
for (IContextParameter parameter : currentContext.getContextParameterList()) {
|
||||
for (IContextParameter parameter : context.getContextParameterList()) {
|
||||
if (parameter.isPromptNeeded()) {
|
||||
nbParams++;
|
||||
}
|
||||
@@ -495,42 +360,7 @@ public class PromptDialog extends SelectionDialog {
|
||||
Point dialogSize = new Point(X_POSITION, Math.min((height * nbParams) + Y_POSITION, 400));
|
||||
setSize(newShell, dialogSize);
|
||||
|
||||
if (source != null && source instanceof IContext) {
|
||||
newShell.setText(Messages.getString("PromptDialog.title", currentContext.getName())); //$NON-NLS-1$
|
||||
} else {
|
||||
newShell.setText(Messages.getString("PromptDialog.choose.title")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
newShell.setText(Messages.getString("PromptDialog.title", context.getName())); //$NON-NLS-1$
|
||||
|
||||
public IContext getCloneContext() {
|
||||
if (source != null) {
|
||||
if (source instanceof ContextItem) {
|
||||
ContextItem contextItem = (ContextItem) source;
|
||||
List<ContextType> contexts = contextItem.getContext();
|
||||
String repositoryContextId = contextItem.getProperty().getId();
|
||||
for (ContextType contextType : contexts) {
|
||||
String name = contextType.getName();
|
||||
if (name.equals(selectedContext) || (name + DEFAULT_FLAG).equals(selectedContext)) {
|
||||
currentContext = ContextUtils.convert2IContext(contextType, repositoryContextId).clone();
|
||||
return currentContext;
|
||||
}
|
||||
}
|
||||
} else if (source instanceof List) {
|
||||
List<IContext> contexts = (List<IContext>) source;
|
||||
for (IContext context : contexts) {
|
||||
String name = context.getName();
|
||||
if (name.equals(selectedContext) || (name + DEFAULT_FLAG).equals(selectedContext)) {
|
||||
currentContext = context.clone();
|
||||
return currentContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IContext getCurrentContext() {
|
||||
return currentContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ import org.talend.core.model.metadata.builder.connection.SAPConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.WSDLSchemaConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.XmlFileConnection;
|
||||
import org.talend.core.model.metadata.builder.database.JavaSqlFactory;
|
||||
import org.talend.core.model.metadata.designerproperties.RepositoryToComponentProperty;
|
||||
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.metadata.types.JavaType;
|
||||
@@ -96,11 +95,11 @@ import org.talend.core.ui.context.model.table.ConectionAdaptContextVariableModel
|
||||
import org.talend.core.ui.process.IGEFProcess;
|
||||
import org.talend.core.ui.services.IDesignerCoreUIService;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.metadata.managment.ui.dialog.PromptDialog;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.impl.ContextTypeImpl;
|
||||
import org.talend.metadata.managment.ui.dialog.PromptDialog;
|
||||
import org.talend.metadata.managment.ui.i18n.Messages;
|
||||
import org.talend.metadata.managment.ui.model.IConnParamName;
|
||||
import org.talend.metadata.managment.ui.utils.DBConnectionContextUtils.EDBParamName;
|
||||
@@ -359,7 +358,7 @@ public final class ConnectionContextHelper {
|
||||
// TODO:Maybe later has other type support context for the additional table.Now only sap
|
||||
INOSQLService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(INOSQLService.class)) {
|
||||
service = GlobalServiceRegister.getDefault().getService(INOSQLService.class);
|
||||
service = (INOSQLService) GlobalServiceRegister.getDefault().getService(INOSQLService.class);
|
||||
}
|
||||
if (service != null && service.isUseReplicaSet(currentConnection)) {
|
||||
String replicaSets = service.getMongoDBReplicaSets(currentConnection);
|
||||
@@ -729,7 +728,7 @@ public final class ConnectionContextHelper {
|
||||
// refresh context view
|
||||
if (added.get()) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService service = GlobalServiceRegister.getDefault()
|
||||
IDesignerCoreService service = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerCoreService.class);
|
||||
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
|
||||
|
||||
@@ -841,7 +840,7 @@ public final class ConnectionContextHelper {
|
||||
// refresh context view
|
||||
if (added) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService service = GlobalServiceRegister.getDefault()
|
||||
IDesignerCoreService service = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerCoreService.class);
|
||||
service.switchToCurContextsView();
|
||||
}
|
||||
@@ -1017,7 +1016,7 @@ public final class ConnectionContextHelper {
|
||||
// refresh context view
|
||||
if (added) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService service = GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService service = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService.class);
|
||||
service.switchToCurContextsView();
|
||||
}
|
||||
@@ -1090,7 +1089,7 @@ public final class ConnectionContextHelper {
|
||||
|
||||
public static boolean isGenericConnection(Connection connection){
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
|
||||
IGenericWizardService wizardService = GlobalServiceRegister.getDefault().getService(
|
||||
IGenericWizardService wizardService = (IGenericWizardService) GlobalServiceRegister.getDefault().getService(
|
||||
IGenericWizardService.class);
|
||||
if (wizardService != null) {
|
||||
return wizardService.isGenericConnection(connection);
|
||||
@@ -1123,7 +1122,8 @@ public final class ConnectionContextHelper {
|
||||
if (objectValue != null) {
|
||||
if (objectValue instanceof List) {
|
||||
List list = (List) objectValue;
|
||||
for (Object object : list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object object = list.get(i);
|
||||
if (object instanceof HashMap) {
|
||||
Map map = (HashMap) object;
|
||||
if (!map.isEmpty()) {
|
||||
@@ -2156,76 +2156,6 @@ public final class ConnectionContextHelper {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isPromptNeeded(List<IContext> contexts) {
|
||||
if (contexts != null) {
|
||||
for (IContext context : contexts) {
|
||||
for (IContextParameter parameter : context.getContextParameterList()) {
|
||||
if (parameter.isPromptNeeded()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static IContext promptConfirmLauch(Shell shell, List<IContext> contexts) {
|
||||
int nbValues = 0;
|
||||
Assert.isNotNull(contexts);
|
||||
// Prompt for context values ?
|
||||
for (IContext context : contexts) {
|
||||
for (IContextParameter parameter : context.getContextParameterList()) {
|
||||
if (parameter.isPromptNeeded()) {
|
||||
nbValues++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nbValues > 0 || (contexts != null && contexts.size() > 1)) {
|
||||
PromptDialog promptDialog = new PromptDialog(shell, contexts);
|
||||
if (promptDialog.open() == PromptDialog.OK) {
|
||||
return promptDialog.getCurrentContext();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean promptConfirmLauch(Shell shell, Connection connection, ContextItem contextItem) {
|
||||
boolean continueLaunch = true;
|
||||
|
||||
int nbValues = 0;
|
||||
Assert.isNotNull(contextItem);
|
||||
// Prompt for context values ?
|
||||
List<ContextType> contexts = contextItem.getContext();
|
||||
for (ContextType contextType : contexts) {
|
||||
IContext jobContext = ContextUtils.convert2IContext(contextType, contextItem.getProperty().getId());
|
||||
for (IContextParameter parameter : jobContext.getContextParameterList()) {
|
||||
if (parameter.isPromptNeeded()) {
|
||||
nbValues++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nbValues > 0 || (contexts != null && contexts.size() > 1)) {
|
||||
PromptDialog promptDialog = new PromptDialog(shell, contextItem);
|
||||
if (promptDialog.open() == PromptDialog.OK) {
|
||||
IContext selectedContext = promptDialog.getCurrentContext();
|
||||
connection.setContextName(selectedContext.getName());
|
||||
// save the input prompt context values to cache
|
||||
for (IContextParameter param : selectedContext.getContextParameterList()) {
|
||||
JavaSqlFactory.savePromptConVars2Cache(connection, param);
|
||||
}
|
||||
// set the input values to connection
|
||||
JavaSqlFactory.setPromptContextValues(connection);
|
||||
JavaSqlFactory.haveSetPromptContextVars = true;
|
||||
} else {
|
||||
continueLaunch = false;
|
||||
}
|
||||
}
|
||||
return continueLaunch;
|
||||
}
|
||||
|
||||
public static boolean promptConfirmLauch(Shell shell, IContext context) {
|
||||
boolean continueLaunch = true;
|
||||
|
||||
|
||||
@@ -841,12 +841,12 @@ public final class DBConnectionContextUtils {
|
||||
*
|
||||
* set the ManagerConnection parameter and return the url string connection.
|
||||
*/
|
||||
public static String setManagerConnectionValues(ManagerConnection managerConnection, Connection connection,
|
||||
public static String setManagerConnectionValues(ManagerConnection managerConnection, ConnectionItem connectionItem,
|
||||
ContextType contextType, final String dbType) {
|
||||
if (managerConnection == null || connection == null || dbType == null || dbType.length() < 0) {
|
||||
if (managerConnection == null || connectionItem == null || dbType == null || dbType.length() < 0) {
|
||||
return null;
|
||||
}
|
||||
DatabaseConnection dbConn = (DatabaseConnection) connection;
|
||||
DatabaseConnection dbConn = (DatabaseConnection) connectionItem.getConnection();
|
||||
|
||||
if (contextType == null) {
|
||||
contextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn);
|
||||
@@ -899,7 +899,7 @@ public final class DBConnectionContextUtils {
|
||||
|
||||
public static String setManagerConnectionValues(ManagerConnection managerConnection, ConnectionItem connectionItem,
|
||||
final String dbType) {
|
||||
return setManagerConnectionValues(managerConnection, connectionItem.getConnection(), null, dbType);
|
||||
return setManagerConnectionValues(managerConnection, connectionItem, null, dbType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AbstractBrandingService_job_license_header_content=// ============================================================================\n//\n// \u7248\u6743\u6240\u6709 (c) 2005-2010, Talend Inc.\n//\n\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// / JobDesigner (CodeGenerator \u7248\u672C {1})\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002\n//\n// ============================================================================
|
||||
AbstractBrandingService.routines_license_header_content=\u7248\u6743\u6240\u6709 (c) 2005-2010, Talend Inc.\n//\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// CodeGenerator \u7248\u672C {1}\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002
|
||||
AbstractBrandingService.routines_license_header_content=\u7248\u6743\u6240\u6709 (c) 2005-2010, Talend Inc.\n//\n\u6B64\u6E90\u4EE3\u7801\u5DF2\u7531_{0} \u81EA\u52A8\u751F\u6210\n// CodeGenerator \u7248\u672C {1}\n// \u60A8\u53EF\u4EE5\u8BBF\u95EE www.talend.com \u4E86\u89E3 Talend \u4EA7\u54C1\u7684\u66F4\u591A\u4FE1\u606F\u3002\n// \u60A8\u53EF\u4EE5\u6839\u636E GNU LGPL \u8BB8\u53EF\u8BC1\u6761\u6B3E\u5206\u53D1\u6B64\u4EE3\u7801\n// http://www.gnu.org/licenses/lgpl.html)\u3002
|
||||
AbstractComponentsProvider.folderNotExist=\u6587\u4EF6\u5939 {0} \u4E0D\u5B58\u5728\u3002
|
||||
AbstractItemMigrationTask.taskFailed=\u8FC1\u79FB\u4EFB\u52A1 {0} \u5728\u8FC1\u79FB\u9879\u76EE {1} \u65F6\u5931\u8D25
|
||||
AdvancedSocketFactory.failedInitial=\u9519\u8BEF\uFF1A\u65E0\u6CD5\u521D\u59CB\u5316\uFF1A
|
||||
|
||||
@@ -168,8 +168,7 @@ public class JDBCDriverLoader {
|
||||
}
|
||||
|
||||
if (additionalParams != null && !"".equals(additionalParams)
|
||||
&& (dbType.toUpperCase().contains("ORACLE") || EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbType)
|
||||
|| EDatabaseTypeName.REDSHIFT_SSO.getDisplayName().equals(dbType))) {// $NON-NLS-1$//$NON-NLS-2$
|
||||
&& (dbType.toUpperCase().contains("ORACLE") || EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbType))) {// $NON-NLS-1$//$NON-NLS-2$
|
||||
if (additionalParams.contains(SSLPreferenceConstants.TRUSTSTORE_TYPE)) {
|
||||
System.setProperty("jsse.enableCBCProtection", "false");//$NON-NLS-1$//$NON-NLS-2$
|
||||
Object pki = ReflectionUtils.newInstance("oracle.security.pki.OraclePKIProvider", loader, //$NON-NLS-1$
|
||||
|
||||
@@ -17,12 +17,13 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.IRepositoryContextService;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.DatabaseConnStrUtil;
|
||||
@@ -42,13 +43,10 @@ import org.talend.cwm.helper.TaggedValueHelper;
|
||||
import org.talend.metadata.managment.utils.MetadataConnectionUtils;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
import org.talend.utils.sql.ConnectionUtils;
|
||||
import org.talend.utils.sugars.ReturnCode;
|
||||
import org.talend.utils.sugars.TypedReturnCode;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
|
||||
/**
|
||||
* @author scorreia
|
||||
*
|
||||
@@ -84,14 +82,7 @@ public final class JavaSqlFactory {
|
||||
public static void savePromptConVars2Cache(Connection conn, IContextParameter param) {
|
||||
if (param != null && param.isPromptNeeded()) {
|
||||
String promptConVarsMapKey = getPromptConVarsMapKey(conn, "context." + param.getName()); //$NON-NLS-1$
|
||||
String paramValue = param.getValue();
|
||||
if (PasswordEncryptUtil.isPasswordType(param.getType())) {
|
||||
if (StudioEncryption.hasEncryptionSymbol(paramValue)) {
|
||||
paramValue = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM)
|
||||
.decrypt(paramValue);
|
||||
}
|
||||
}
|
||||
promptContextVars.put(promptConVarsMapKey, paramValue);
|
||||
promptContextVars.put(promptConVarsMapKey, param.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,14 +97,7 @@ public final class JavaSqlFactory {
|
||||
if (param != null && param.isPromptNeeded()) {
|
||||
String promptConVarsMapKey =
|
||||
getPromptConVarsMapKey(groupName, param.getSource(), "context." + param.getName()); //$NON-NLS-1$
|
||||
String paramValue = param.getValue();
|
||||
if (PasswordEncryptUtil.isPasswordType(param.getType())) {
|
||||
if (StudioEncryption.hasEncryptionSymbol(paramValue)) {
|
||||
paramValue = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM)
|
||||
.decrypt(paramValue);
|
||||
}
|
||||
}
|
||||
promptContextVars.put(promptConVarsMapKey, paramValue);
|
||||
promptContextVars.put(promptConVarsMapKey, param.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ public class ManagerConnection {
|
||||
private List<String> fetchEmbeddedHiveDriverJars(IMetadataConnection metadataConn) {
|
||||
String dbType = metadataConn.getDbType();
|
||||
String dbVersion = metadataConn.getDbVersionString();
|
||||
ILibraryManagerService librairesManagerService = GlobalServiceRegister.getDefault().getService(
|
||||
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
|
||||
ILibraryManagerService.class);
|
||||
|
||||
List<String> jarPathList = new ArrayList<String>();
|
||||
@@ -286,7 +286,6 @@ public class ManagerConnection {
|
||||
if (isSchemaFromSidOrDatabase(type)) {
|
||||
schemaName = sidOrDatabase;
|
||||
}
|
||||
|
||||
// test the connection
|
||||
testConnection = ExtractMetaDataFromDataBase.testConnection(dbTypeString, urlConnectionString, username, password,
|
||||
schemaName, driverClassName, driverJarPath, dbVersionString, additionalParams, retProposedSchema,
|
||||
@@ -467,10 +466,6 @@ public class ManagerConnection {
|
||||
this.dbVersionString = dbVersion;
|
||||
}
|
||||
|
||||
public void setAdditionalParams(String additionalParams) {
|
||||
this.additionalParams = additionalParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the isValide.
|
||||
*
|
||||
|
||||
@@ -21,13 +21,10 @@ import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
import javax.xml.rpc.ServiceException;
|
||||
|
||||
@@ -35,10 +32,6 @@ import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
@@ -48,7 +41,6 @@ import org.talend.core.IRepositoryContextService;
|
||||
import org.talend.core.database.EDatabase4DriverClassName;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.metadata.IMetadataConnection;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
@@ -60,21 +52,15 @@ import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.database.DriverShim;
|
||||
import org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils;
|
||||
import org.talend.core.model.metadata.builder.database.IDriverService;
|
||||
import org.talend.core.model.metadata.builder.database.JavaSqlFactory;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.service.IMetadataManagmentUiService;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.SwitchHelpers;
|
||||
import org.talend.cwm.relational.RelationalFactory;
|
||||
import org.talend.cwm.relational.TdColumn;
|
||||
import org.talend.cwm.relational.TdSqlDataType;
|
||||
import org.talend.cwm.xml.TdXmlElementType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.metadata.managment.connection.manager.HiveConnectionManager;
|
||||
import org.talend.metadata.managment.connection.manager.ImpalaConnectionManager;
|
||||
import org.talend.metadata.managment.mdm.AbsMdmConnectionHelper;
|
||||
@@ -211,12 +197,12 @@ public class MetadataConnectionUtils {
|
||||
|
||||
Driver driver = null;
|
||||
if (!list.isEmpty()) {
|
||||
for (Object element : list) {
|
||||
if (element instanceof Driver) {
|
||||
driver = (Driver) element;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i) instanceof Driver) {
|
||||
driver = (Driver) list.get(i);
|
||||
}
|
||||
if (element instanceof java.sql.Connection) {
|
||||
sqlConn = (java.sql.Connection) element;
|
||||
if (list.get(i) instanceof java.sql.Connection) {
|
||||
sqlConn = (java.sql.Connection) list.get(i);
|
||||
}
|
||||
}
|
||||
ReturnCode varc = ConnectionUtils.isValid(sqlConn);
|
||||
@@ -1367,7 +1353,7 @@ public class MetadataConnectionUtils {
|
||||
PreparedStatement statement = null;
|
||||
try {
|
||||
statement = connection.prepareStatement("SELECT FIRST 1 * FROM " + tableName + ";");
|
||||
ResultSet resultSet = statement.executeQuery(); // $NON-NLS-1$
|
||||
ResultSet resultSet = statement.executeQuery(); // $NON-NLS-1$ //$NON-NLS-2$
|
||||
ResultSetMetaData rsMetaData = resultSet.getMetaData();
|
||||
columnTypeName = rsMetaData.getColumnTypeName(colIndex);
|
||||
} catch (Exception e) {
|
||||
@@ -1401,110 +1387,5 @@ public class MetadataConnectionUtils {
|
||||
}
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public static boolean isPromptNeeded(List<IContext> contexts) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IMetadataManagmentUiService.class)) {
|
||||
IMetadataManagmentUiService mmUIService = GlobalServiceRegister.getDefault()
|
||||
.getService(IMetadataManagmentUiService.class);
|
||||
return mmUIService.isPromptNeeded(contexts);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static IContext promptConfirmLauch(List<IContext> contexts) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IMetadataManagmentUiService.class)) {
|
||||
IMetadataManagmentUiService mmUIService = GlobalServiceRegister.getDefault()
|
||||
.getService(IMetadataManagmentUiService.class);
|
||||
return mmUIService.promptConfirmLauch(PlatformUI.getWorkbench().getDisplay().getActiveShell(), contexts);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Connection prepareConection(Connection connection) {
|
||||
return prepareConection(connection, false);
|
||||
}
|
||||
|
||||
public static Connection prepareConection(Connection connection, boolean isDefaultContext) {
|
||||
// TDQ-19889 msjian: check whether context confirmation needed popup,
|
||||
// Enabling the prompt to context variables
|
||||
if (!Platform.isRunning() || !connection.isContextMode()) {
|
||||
return connection;
|
||||
}
|
||||
Connection copyConnection = deepCopy(connection);
|
||||
JavaSqlFactory.haveSetPromptContextVars = false;
|
||||
ContextItem contextItem = ContextUtils.getContextItemById2(connection.getContextId());
|
||||
// only consider the connection currently used context
|
||||
ContextType contextType = ContextUtils.getContextTypeByName(contextItem.getContext(), connection.getContextName(),
|
||||
contextItem.getDefaultContext());
|
||||
IContext jobContext = ContextUtils.convert2IContext(contextType, contextItem.getProperty().getId());
|
||||
// only when have context
|
||||
if (jobContext != null) {
|
||||
boolean promptConfirmLauch = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IMetadataManagmentUiService.class)) {
|
||||
IMetadataManagmentUiService mmUIService = GlobalServiceRegister.getDefault()
|
||||
.getService(IMetadataManagmentUiService.class);
|
||||
Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
|
||||
if (isDefaultContext) {
|
||||
promptConfirmLauch = mmUIService.promptConfirmLauch(shell, jobContext);
|
||||
} else {
|
||||
promptConfirmLauch = mmUIService.promptConfirmLauch(shell, copyConnection, contextItem);
|
||||
}
|
||||
}
|
||||
if (!promptConfirmLauch) {
|
||||
return null;
|
||||
} else {
|
||||
if (isDefaultContext) {
|
||||
// save the input prompt context values to cache
|
||||
for (IContextParameter param : jobContext.getContextParameterList()) {
|
||||
JavaSqlFactory.savePromptConVars2Cache(connection, param);
|
||||
}
|
||||
// set the input values to connection
|
||||
JavaSqlFactory.setPromptContextValues(copyConnection);
|
||||
}
|
||||
}
|
||||
}
|
||||
JavaSqlFactory.haveSetPromptContextVars = true;
|
||||
return copyConnection;
|
||||
}
|
||||
|
||||
public static <T extends EObject> T deepCopy(T emfObject) {
|
||||
EcoreUtil.Copier copier = new EcoreUtil.Copier(Boolean.TRUE, Boolean.FALSE);
|
||||
preDeepCopy(emfObject, copier);
|
||||
T copy = (T) copier.copy(emfObject);
|
||||
copier.copyReferences();
|
||||
return copy;
|
||||
}
|
||||
|
||||
private static void preDeepCopy(EObject emfObject, EcoreUtil.Copier copier) {
|
||||
Stack<EObject> work = new Stack<EObject>();
|
||||
work.push(emfObject);
|
||||
Collection<EObject> collection = new LinkedHashSet<EObject>();
|
||||
while (!work.isEmpty()) {
|
||||
EObject o = work.pop();
|
||||
if (collection.contains(o)) {
|
||||
continue;
|
||||
}
|
||||
collection.add(o);
|
||||
List<EObject> list = o.eContents();
|
||||
for (EObject eo : list) {
|
||||
if (!collection.contains(eo)) {
|
||||
work.push(eo);
|
||||
}
|
||||
}
|
||||
list = o.eCrossReferences();
|
||||
for (EObject eo : list) {
|
||||
if (!collection.contains(eo)) {
|
||||
work.push(eo);
|
||||
}
|
||||
}
|
||||
EObject container = o.eContainer();
|
||||
if (container != null && !collection.contains(container)) {
|
||||
work.push(container);
|
||||
}
|
||||
}
|
||||
collection = copier.copyAll(collection);
|
||||
copier.copyReferences();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ _UI_ExecutionTaskCmdPrm_executionTask_feature=\u5B9F\u884C\u30BF\u30B9\u30AF
|
||||
_UI_ExecutionTaskJobPrm_id_feature=Id
|
||||
_UI_ExecutionTaskJobPrm_label_feature=\u30E9\u30D9\u30EB
|
||||
_UI_ExecutionTaskJobPrm_defaultValue_feature=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024
|
||||
_UI_ExecutionTaskJobPrm_override_feature=\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9
|
||||
_UI_ExecutionTaskJobPrm_override_feature=\u4E0A\u66F8\u304D
|
||||
_UI_ExecutionTaskJobPrm_executionTask_feature=\u5B9F\u884C\u30BF\u30B9\u30AF
|
||||
_UI_ExecutionTaskJobPrm_originalValue_feature=\u5143\u306E\u5024
|
||||
_UI_TaskExecutionHistory_id_feature=Id
|
||||
@@ -949,7 +949,7 @@ _UI_ExecutionPlanPartCmdPrm_name_feature=\u540D\u524D
|
||||
_UI_ExecutionPlanPartCmdPrm_value_feature=\u5024
|
||||
_UI_ExecutionPlanPartJobPrm_id_feature=Id
|
||||
_UI_ExecutionPlanPartJobPrm_executionPlanPart_feature=\u30D7\u30E9\u30F3\u30D1\u30FC\u30C8\u306E\u5B9F\u884C
|
||||
_UI_ExecutionPlanPartJobPrm_override_feature=\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9
|
||||
_UI_ExecutionPlanPartJobPrm_override_feature=\u4E0A\u66F8\u304D
|
||||
_UI_ExecutionPlanPartJobPrm_name_feature=\u540D\u524D
|
||||
_UI_ExecutionPlanPartJobPrm_customValue_feature=\u30AB\u30B9\u30BF\u30E0\u5024
|
||||
_UI_ExecutionPlanPartJobPrm_partCustomValue_feature=\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u306E\u5024\u3092\u5206\u5272
|
||||
|
||||
@@ -7,7 +7,7 @@ Exchange=Exchange
|
||||
Videos=\u52D5\u753B
|
||||
Cloud=\u30AF\u30E9\u30A6\u30C9
|
||||
LinksToolbarItem_Learn=\u30AA\u30F3\u30C7\u30DE\u30F3\u30C9\u30C8\u30EC\u30FC\u30CB\u30F3\u30B0\u3068\u691C\u5B9A
|
||||
LinksToolbarItem_Documentation=Talend Help Center - \u30AA\u30F3\u30E9\u30A4\u30F3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9
|
||||
LinksToolbarItem_Documentation=Talend\u30D8\u30EB\u30D7\u30BB\u30F3\u30BF\u30FC - \u30AA\u30F3\u30E9\u30A4\u30F3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9
|
||||
LinksToolbarItem_7=\u8CEA\u554F\u3068\u6A5F\u80FD\u306E\u8981\u6C42
|
||||
LinksToolbarItem_exchange=Talend Exchange\u3078\u306E\u30EA\u30F3\u30AF
|
||||
LinksToolbarItem_videos=Talend\u30C1\u30E5\u30FC\u30C8\u30EA\u30A2\u30EB\u3078\u306E\u30EA\u30F3\u30AF
|
||||
|
||||
@@ -42,7 +42,7 @@ LinksToolbarItem_cloud=Talend Cloud\u3078\u306E\u30EA\u30F3\u30AF
|
||||
LinksToolbarItem_7=\u8CEA\u554F\u3068\u6A5F\u80FD\u306E\u8981\u6C42
|
||||
LinksToolbarItem_9=Talend\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u3068\u5171\u6709
|
||||
LinksToolbarItem_exchange=Talend Exchange\u3078\u306E\u30EA\u30F3\u30AF
|
||||
LinksToolbarItem_Learn=Talend Help Center - \u30AA\u30F3\u30E9\u30A4\u30F3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9
|
||||
LinksToolbarItem_Learn=Talend\u30D8\u30EB\u30D7\u30BB\u30F3\u30BF\u30FC - \u30AA\u30F3\u30E9\u30A4\u30F3\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9
|
||||
LinksToolbarItem_videos=Talend\u30C1\u30E5\u30FC\u30C8\u30EA\u30A2\u30EB\u3078\u306E\u30EA\u30F3\u30AF
|
||||
RegisterWizard.windowTitle={0}\u767B\u9332
|
||||
tips.createJob=\u307E\u305A\u3001<a>Job Designer</a>\u4F7F\u3063\u3066\u30C7\u30FC\u30BF\u30D5\u30ED\u30FC\u306E\u30B8\u30E7\u30D6\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002
|
||||
|
||||
@@ -11,7 +11,7 @@ LocalRepositoryFactory.logonDenyMsg=\u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u
|
||||
LocalRepositoryFactory.productionLower01=Studio\u3068\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 \n\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u958B\u304F\u306B\u306F\u3001Studio [{0}]\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
LocalRepositoryFactory.productionLower02=Studio\u3068\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 \n\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u958B\u304F\u306B\u306F\u3001Studio\u30D1\u30C3\u30C1[{0}]\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
LocalRepositoryFactory.productionNewer01=[{1}]\u306B\u66F4\u65B0\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307E\u3059\u3002\n\u3053\u306E\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3044\u3061\u3069\u9069\u7528\u3055\u308C\u308B\u3068\u3001\u305D\u308C\u3088\u308A\u53E4\u3044Studio\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002\n\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u79FB\u884C\u3057\u307E\u3059\u304B?
|
||||
LocalRepositoryFactory.productionNewer02=[{1}]\u306B\u66F4\u65B0\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307E\u3059\u3002\n\u3053\u306E\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u9069\u7528\u5F8C\u306F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092Studio\u306E\u4E0B\u4F4D\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u958B\u304F\u3053\u3068\u306F\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002\n\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u79FB\u884C\u3057\u307E\u3059\u304B? \n\u306A\u304A\u3001\u73FE\u5728\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u4F7F\u308F\u308C\u3066\u3044\u308B\u30D0\u30FC\u30B8\u30E7\u30F3\u306F[{0}]\u3067\u3059\u3002
|
||||
LocalRepositoryFactory.productionNewer02=[{1}]\u306B\u66F4\u65B0\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307E\u3059\u3002\n\u3053\u306E\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3044\u3061\u3069\u9069\u7528\u3055\u308C\u308B\u3068\u3001\u305D\u308C\u3088\u308A\u53E4\u3044Studio\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002\n\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u79FB\u884C\u3057\u307E\u3059\u304B? \n\u306A\u304A\u3001\u73FE\u5728\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u4F7F\u308F\u308C\u3066\u3044\u308B\u30D0\u30FC\u30B8\u30E7\u30F3\u306F[{0}]\u3067\u3059\u3002
|
||||
LocalRepositoryFactory.logonWarningTitle=\u30ED\u30B0\u30A4\u30F3\u60C5\u5831
|
||||
LocalRepositoryFactory.login.userCancel=\u30ED\u30B0\u30A4\u30F3\u304C\u30E6\u30FC\u30B6\u30FC\u306B\u3088\u3063\u3066\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F
|
||||
|
||||
|
||||
@@ -980,9 +980,6 @@ DatabaseForm.hc.link.repository=R\u00E9f\u00E9rentiel
|
||||
DatabaseForm.hc.link.title=Cluster Hadoop
|
||||
DatabaseForm.helpInfo.installDriverLink.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=80&lang=fr&env=prd
|
||||
DatabaseForm.helpInfo.installDriverLink.label=Installer un pilote
|
||||
DatabaseForm.redshift.driverVersion=Version du pilote
|
||||
DatabaseForm.redshift.driverVersion.tip=S\u00E9lectionnez un pilote Redshift
|
||||
DatabaseForm.redshift.useStringAdditionParam=Utiliser un param\u00E8tre de cha\u00EEne de caract\u00E8res
|
||||
DatabaseTableFilterForm.allSynonyms=Tous les synonymes
|
||||
DatabaseTableFilterForm.edit=Modifier...
|
||||
DatabaseTableFilterForm.editFilterName=Modifier le nom du filtre
|
||||
|
||||
@@ -916,7 +916,7 @@ DatabaseForm.encryption=\u6697\u53F7\u5316
|
||||
DatabaseForm.encryption.useSSLEncryption=SSL\u6697\u53F7\u5316\u3092\u4F7F\u7528
|
||||
DatabaseForm.encryption.useSSLEncryption.trustStorePath=\u30C8\u30E9\u30B9\u30C8\u30B9\u30C8\u30A2\u30D1\u30B9
|
||||
DatabaseForm.encryption.useSSLEncryption.trustStorePassword=\u30C8\u30E9\u30B9\u30C8\u30B9\u30C8\u30A2\u30D1\u30B9\u30EF\u30FC\u30C9
|
||||
DatabaseForm.encryption.useSSLEncryption.needClientAuth=\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u8A8D\u8A3C\u304C\u5FC5\u8981
|
||||
DatabaseForm.encryption.useSSLEncryption.needClientAuth=\u30AF\u30E9\u30A4\u30A8\u30F3\u30C8\u8A8D\u8A3C\u304C\u5FC5\u8981
|
||||
DatabaseForm.encryption.useSSLEncryption.keyStorePath=\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9
|
||||
DatabaseForm.encryption.useSSLEncryption.keyStorePassword=\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9
|
||||
DatabaseForm.encryption.useSSLEncryption.disableCBCProtection=CBC\u4FDD\u8B77\u3092\u7121\u52B9\u5316
|
||||
@@ -980,9 +980,6 @@ DatabaseForm.hc.link.repository=\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC
|
||||
DatabaseForm.hc.link.title=Hadoop\u30AF\u30E9\u30B9\u30BF
|
||||
DatabaseForm.helpInfo.installDriverLink.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=80&lang=ja&env=prd
|
||||
DatabaseForm.helpInfo.installDriverLink.label=\u30C9\u30E9\u30A4\u30D0\u30FC\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u65B9\u6CD5
|
||||
DatabaseForm.redshift.driverVersion=\u30C9\u30E9\u30A4\u30D0\u30FC\u306E\u30D0\u30FC\u30B8\u30E7\u30F3
|
||||
DatabaseForm.redshift.driverVersion.tip=Redshift\u30C9\u30E9\u30A4\u30D0\u30FC\u3092\u9078\u629E
|
||||
DatabaseForm.redshift.useStringAdditionParam=\u6587\u5B57\u5217\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u4F7F\u7528
|
||||
DatabaseTableFilterForm.allSynonyms=\u3059\u3079\u3066\u306E\u30B7\u30CE\u30CB\u30E0
|
||||
DatabaseTableFilterForm.edit=\u7DE8\u96C6...
|
||||
DatabaseTableFilterForm.editFilterName=\u30D5\u30A3\u30EB\u30BF\u30FC\u540D\u3092\u7DE8\u96C6
|
||||
|
||||
@@ -980,9 +980,6 @@ DatabaseForm.hc.link.repository=\u5B58\u50A8\u5E93
|
||||
DatabaseForm.hc.link.title=Hadoop \u96C6\u7FA4
|
||||
DatabaseForm.helpInfo.installDriverLink.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=80&lang=zh&env=prd
|
||||
DatabaseForm.helpInfo.installDriverLink.label=\u5982\u4F55\u5B89\u88C5\u9A71\u52A8
|
||||
DatabaseForm.redshift.driverVersion=\u9A71\u52A8\u7248\u672C
|
||||
DatabaseForm.redshift.driverVersion.tip=\u9009\u62E9\u4E00\u4E2A Redshift \u9A71\u52A8
|
||||
DatabaseForm.redshift.useStringAdditionParam=\u4F7F\u7528\u5B57\u4E32\u53C2\u6570
|
||||
DatabaseTableFilterForm.allSynonyms=\u6240\u6709\u540C\u4E49\u8BCD
|
||||
DatabaseTableFilterForm.edit=\u7F16\u8F91...
|
||||
DatabaseTableFilterForm.editFilterName=\u7F16\u8F91\u7B5B\u9009\u5668\u540D\u79F0
|
||||
|
||||
@@ -88,7 +88,6 @@ import org.talend.metadata.managment.connection.manager.HiveConnectionManager;
|
||||
import org.talend.metadata.managment.repository.ManagerConnection;
|
||||
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
|
||||
import org.talend.metadata.managment.ui.utils.SwitchContextGroupNameImpl;
|
||||
import org.talend.metadata.managment.utils.MetadataConnectionUtils;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
import org.talend.repository.metadata.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
@@ -720,7 +719,7 @@ public abstract class AbstractCreateTableAction extends AbstractCreateAction {
|
||||
|
||||
ISAPProviderService sapService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ISAPProviderService.class)) {
|
||||
sapService = GlobalServiceRegister.getDefault().getService(ISAPProviderService.class);
|
||||
sapService = (ISAPProviderService) GlobalServiceRegister.getDefault().getService(ISAPProviderService.class);
|
||||
if (sapService != null) {
|
||||
IWizard sapWizard = sapService.newWizard(PlatformUI.getWorkbench(), creation, node, getExistingNames());
|
||||
if (sapWizard != null) {
|
||||
@@ -851,12 +850,7 @@ public abstract class AbstractCreateTableAction extends AbstractCreateAction {
|
||||
ConnParameterKeys.CONN_PARA_KEY_USE_KRB));
|
||||
// TUP-596 : Update the context name in connection when the user does a context switch in DI
|
||||
String oldContextName = connection.getContextName();
|
||||
Connection copyConnection = MetadataConnectionUtils.prepareConection(connection);
|
||||
if (copyConnection == null) {
|
||||
return;
|
||||
}
|
||||
IMetadataConnection metadataConnection = ConvertionHelper.convert(copyConnection, false,
|
||||
copyConnection.getContextName());
|
||||
IMetadataConnection metadataConnection = ConvertionHelper.convert(connection, false, null);
|
||||
String newContextName = connection.getContextName();
|
||||
if (oldContextName != null && newContextName != null && !oldContextName.equals(newContextName)) {
|
||||
if (node != null && node.getObject() != null && node.getObject().getProperty() != null) {
|
||||
@@ -870,7 +864,7 @@ public abstract class AbstractCreateTableAction extends AbstractCreateAction {
|
||||
boolean isTcomDB = false;
|
||||
IGenericDBService dbService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericDBService.class)) {
|
||||
dbService = GlobalServiceRegister.getDefault().getService(
|
||||
dbService = (IGenericDBService) GlobalServiceRegister.getDefault().getService(
|
||||
IGenericDBService.class);
|
||||
}
|
||||
if(dbService != null){
|
||||
@@ -988,7 +982,7 @@ public abstract class AbstractCreateTableAction extends AbstractCreateAction {
|
||||
}
|
||||
};
|
||||
repositoryWorkUnit.setAvoidUnloadResources(isAvoidUnloadResources());
|
||||
IRepositoryService repositoryService = GlobalServiceRegister.getDefault().getService(
|
||||
IRepositoryService repositoryService = (IRepositoryService) GlobalServiceRegister.getDefault().getService(
|
||||
IRepositoryService.class);
|
||||
repositoryService.getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);
|
||||
monitor.done();
|
||||
|
||||
@@ -109,7 +109,6 @@ import org.talend.core.hadoop.version.custom.HadoopCustomVersionDefineDialog;
|
||||
import org.talend.core.hadoop.version.custom.HadoopVersionControlUtils;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.metadata.IMetadataConnection;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
@@ -122,7 +121,6 @@ import org.talend.core.model.metadata.builder.database.JavaSqlFactory;
|
||||
import org.talend.core.model.metadata.connection.hive.HiveModeInfo;
|
||||
import org.talend.core.model.metadata.connection.hive.HiveServerVersionInfo;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
@@ -667,7 +665,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
} else if (isDBTypeSelected(EDatabaseConnTemplate.IMPALA)) {
|
||||
initImpalaSettings();
|
||||
initImpalaInfo();
|
||||
} else if (isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT) || isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT_SSO)) {
|
||||
} else if (isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT)) {
|
||||
initRedshiftAdditionalParamSetting();
|
||||
} else if (isHiveDBConnSelected()) {
|
||||
// Changed by Marvin Wang on Oct. 15, 2012 for but TDI-23235.
|
||||
@@ -4184,8 +4182,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
|
||||
private void setupDefaultRedshiftAdditionalParamSetting() {
|
||||
boolean isRedshiftSelected = isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT)
|
||||
|| isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT_SSO);
|
||||
boolean isRedshiftSelected = isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT);
|
||||
if (isRedshiftSelected) {
|
||||
redshiftDriverCombo.setText(ERedshiftDriver.DRIVER_V2.getDisplayName());
|
||||
}
|
||||
@@ -4516,26 +4513,16 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
final ManagerConnection managerConnection = new ManagerConnection();
|
||||
StringBuffer sgb = new StringBuffer();
|
||||
Connection connection = connectionItem.getConnection();
|
||||
Connection copyConnection = connection;
|
||||
if (isContextMode()) { // context mode
|
||||
String connectionTypeName = connection.getConnectionTypeName();
|
||||
String connectionTypeName = connectionItem.getConnection().getConnectionTypeName();
|
||||
if (connectionTypeName.equals(EDatabaseConnTemplate.HBASE.getDBDisplayName())
|
||||
|| connectionTypeName.equals(EDatabaseConnTemplate.HIVE.getDBDisplayName())) {
|
||||
selectedContextType = ConnectionContextHelper.getContextTypeForContextMode(connection, true);
|
||||
selectedContextType = ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection(), true);
|
||||
} else {
|
||||
JavaSqlFactory.clearPromptContextCache();
|
||||
copyConnection = MetadataConnectionUtils.prepareConection(connection);
|
||||
if (copyConnection == null) {
|
||||
checkButton.setEnabled(true);
|
||||
return;
|
||||
}
|
||||
ContextItem contextItem = ContextUtils.getContextItemById2(copyConnection.getContextId());
|
||||
selectedContextType = ContextUtils.getContextTypeByName(contextItem.getContext(), copyConnection.getContextName(),
|
||||
contextItem.getDefaultContext());
|
||||
selectedContextType = ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection());
|
||||
}
|
||||
String urlStr = null;
|
||||
urlStr = DBConnectionContextUtils.setManagerConnectionValues(managerConnection, copyConnection, selectedContextType,
|
||||
urlStr = DBConnectionContextUtils.setManagerConnectionValues(managerConnection, connectionItem, selectedContextType,
|
||||
getConnectionDBType());
|
||||
if (isImpalaDBConnSelected()) {
|
||||
String contextName = getConnection().getContextName();
|
||||
@@ -4571,25 +4558,6 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
}
|
||||
urlConnectionStringText.setText(urlStr);
|
||||
if (isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT) || isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT_SSO)) {
|
||||
if (ERedshiftDriver.DRIVER_V2.getDisplayName().equals(redshiftDriverCombo.getText())
|
||||
&& !useStringAdditionParam.getSelection()) {
|
||||
Properties info = new Properties();
|
||||
List<Map<String, Object>> entryProperties = additionParamTable.getPropertiesTableModel().getBeansList();
|
||||
for (Map<String, Object> entryMap : entryProperties) {
|
||||
String key = TalendQuoteUtils.removeQuotes(String.valueOf(entryMap.get("KEY")));
|
||||
if (StringUtils.isNotBlank(key)) {
|
||||
String value = TalendQuoteUtils.removeQuotes(String.valueOf(entryMap.get("VALUE")));
|
||||
ConvertionHelper.updateAdditionParam(sgb, info, key, value);
|
||||
}
|
||||
}
|
||||
managerConnection.setAdditionalParams(sgb.toString());
|
||||
}
|
||||
String driverVName = ERedshiftDriver.getEnameByDisplayName(redshiftDriverCombo.getText());
|
||||
if (StringUtils.isNotBlank(driverVName)) {
|
||||
managerConnection.setDbVersionString(driverVName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String versionStr = dbVersionCombo.getText();
|
||||
if (isHiveDBConnSelected()) {
|
||||
@@ -4645,7 +4613,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
|
||||
String dbVersionString = enableDbVersion() ? versionStr : null;
|
||||
if (isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT) || isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT_SSO)) {
|
||||
if (isDBTypeSelected(EDatabaseConnTemplate.REDSHIFT)) {
|
||||
if (ERedshiftDriver.DRIVER_V2.getDisplayName().equals(redshiftDriverCombo.getText())
|
||||
&& !useStringAdditionParam.getSelection()) {
|
||||
Properties info = new Properties();
|
||||
@@ -4781,7 +4749,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
setPropertiesFormEditable(true);
|
||||
}
|
||||
}
|
||||
String msg = checkDBVersion(copyConnection);
|
||||
String msg = checkDBVersion();
|
||||
if (msg != null) {
|
||||
updateStatus(IStatus.WARNING, msg);
|
||||
}
|
||||
@@ -7433,7 +7401,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
return false;
|
||||
}
|
||||
EDatabaseConnTemplate template = EDatabaseConnTemplate.indexOfTemplate(getConnectionDBType());
|
||||
return template != null && (template == EDatabaseConnTemplate.REDSHIFT || template == EDatabaseConnTemplate.REDSHIFT_SSO);
|
||||
return template != null && template == EDatabaseConnTemplate.REDSHIFT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7680,11 +7648,11 @@ public class DatabaseForm extends AbstractForm {
|
||||
return getConnectionDBType().trim().length() == 0;
|
||||
}
|
||||
|
||||
private String checkDBVersion(Connection conn) {
|
||||
private String checkDBVersion() {
|
||||
String msg = null;
|
||||
EDatabaseVersion4Drivers version = EDatabaseVersion4Drivers.indexOfByVersionDisplay(dbVersionCombo.getText());
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
DatabaseConnection connection = (DatabaseConnection) conn;
|
||||
DatabaseConnection connection = getConnection();
|
||||
List<EDatabaseVersion4Drivers> dbTypeList = EDatabaseVersion4Drivers.indexOfByDbType(connection.getDatabaseType());
|
||||
if (version != null && dbTypeList.size() > 1) {
|
||||
EDatabaseTypeName dbType = EDatabaseTypeName.getTypeFromDbType(getConnection().getDatabaseType());
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.database.conn;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.ERedshiftDriver;
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class DatabaseVersion4DriversTest {
|
||||
|
||||
@Test
|
||||
public void testGetDriversByDriverVersion4Redshift() {
|
||||
String[] redshiftDrivers = new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" };
|
||||
List<String> drivers = EDatabaseVersion4Drivers.getDrivers(EDatabaseTypeName.REDSHIFT.getDisplayName(),
|
||||
ERedshiftDriver.DRIVER_V1.name());
|
||||
assertTrue(drivers.containsAll(Arrays.asList(redshiftDrivers)));
|
||||
|
||||
redshiftDrivers = new String[] { "redshift-jdbc42-2.1.0.3.jar", "antlr4-runtime-4.8-1.jar" };
|
||||
drivers = EDatabaseVersion4Drivers.getDrivers(EDatabaseTypeName.REDSHIFT.getDisplayName(),
|
||||
ERedshiftDriver.DRIVER_V2.name());
|
||||
assertTrue(drivers.containsAll(Arrays.asList(redshiftDrivers)));
|
||||
|
||||
String[] redshiftSSODrivers = new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar",
|
||||
"aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", "jackson-databind-2.11.4.jar",
|
||||
"jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", "joda-time-2.8.1.jar",
|
||||
"commons-logging-1.2.jar", "commons-codec-1.14.jar", "aws-java-sdk-redshift-internal-1.12.x.jar" };
|
||||
drivers = EDatabaseVersion4Drivers.getDrivers(EDatabaseTypeName.REDSHIFT_SSO.getDisplayName(),
|
||||
ERedshiftDriver.DRIVER_V1.name());
|
||||
assertTrue(drivers.containsAll(Arrays.asList(redshiftSSODrivers)));
|
||||
|
||||
redshiftSSODrivers = new String[] { "redshift-jdbc42-2.1.0.3.jar", "antlr4-runtime-4.8-1.jar",
|
||||
"aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", "jackson-databind-2.11.4.jar",
|
||||
"jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", "joda-time-2.8.1.jar",
|
||||
"commons-logging-1.2.jar", "commons-codec-1.14.jar", "aws-java-sdk-redshift-internal-1.12.x.jar" };
|
||||
drivers = EDatabaseVersion4Drivers.getDrivers(EDatabaseTypeName.REDSHIFT_SSO.getDisplayName(),
|
||||
ERedshiftDriver.DRIVER_V2.name());
|
||||
assertTrue(drivers.containsAll(Arrays.asList(redshiftSSODrivers)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,16 +12,14 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
|
||||
/**
|
||||
@@ -36,7 +34,6 @@ public class ElementParameterParserTest {
|
||||
input = input.replace("\"", "");
|
||||
return SE.decrypt(input);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCanEncrypt() {
|
||||
String paramName = "__PASSWORD__";
|
||||
@@ -87,76 +84,56 @@ public class ElementParameterParserTest {
|
||||
elementParametersWithChildrens.add(parameter);
|
||||
when(node.getElementParametersWithChildrens()).thenReturn(elementParametersWithChildrens);
|
||||
|
||||
// input: "ab"
|
||||
// "ab"
|
||||
String val = "\"ab\"";
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("ab",
|
||||
String targetVal = TalendQuoteUtils.removeQuotes(val);
|
||||
targetVal = TalendQuoteUtils.checkSlashAndRemoveQuotation(targetVal);
|
||||
assertEquals(targetVal,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
// input: "a\"b"
|
||||
// "a\"b"
|
||||
val = "\"a\\\"b\"";
|
||||
targetVal = TalendQuoteUtils.removeQuotes(val);
|
||||
targetVal = TalendQuoteUtils.checkSlashAndRemoveQuotation(targetVal);
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("a\"b",
|
||||
assertEquals(targetVal,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
// input: "a\\b" (keep the studio behavior)
|
||||
// "a\\b"
|
||||
val = "\"a\\\\b\"";
|
||||
targetVal = TalendQuoteUtils.removeQuotes(val);
|
||||
targetVal = TalendQuoteUtils.checkSlashAndRemoveQuotation(targetVal);
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("a\\\\b",
|
||||
assertEquals(targetVal,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
// input: "a\\\\b" (keep the studio behavior)
|
||||
// "a\\\\b"
|
||||
val = "\"a\\\\\\\\b\"";
|
||||
targetVal = TalendQuoteUtils.removeQuotes(val);
|
||||
targetVal = TalendQuoteUtils.checkSlashAndRemoveQuotation(targetVal);
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("a\\\\\\\\b",
|
||||
assertEquals(targetVal,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
// input: "test"+context.mypassword + "a"
|
||||
// "test"+context.mypassword + "a"
|
||||
val = "\"test\"+context.mypassword + \"a\"";
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals(val,
|
||||
ElementParameterParser.getEncryptedValue(node, paramName));
|
||||
// input: "a" + "b"
|
||||
// "a" + "b"
|
||||
val = "\"a\" + \"b\"";
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals(val, ElementParameterParser.getEncryptedValue(node, paramName));
|
||||
// input: "\\123456/" (keep the studio behavior)
|
||||
// \\123456/
|
||||
val = "\"\\\\123456/\"";
|
||||
targetVal = TalendQuoteUtils.removeQuotes(val);
|
||||
targetVal = TalendQuoteUtils.checkSlashAndRemoveQuotation(targetVal);
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("\\\\123456/",
|
||||
assertEquals(targetVal,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
// input: "\123456/" (keep the studio behavior)
|
||||
// \123456/
|
||||
val = "\"\\123456/\"";
|
||||
final String exp = "\\123456/";
|
||||
targetVal = TalendQuoteUtils.removeQuotes(val);
|
||||
targetVal = TalendQuoteUtils.checkSlashAndRemoveQuotation(targetVal);
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals(exp,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
// input: "\,\n123\"" (keep the studio behavior)
|
||||
val = "\"\\,\\n123\\\"\"";
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("\\,\\n123\"", decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetEncryptedValue_multiLine() {
|
||||
String paramName = "__PASSWORD__";
|
||||
// mock parameter
|
||||
IElementParameter parameter = mock(IElementParameter.class);
|
||||
when(parameter.getVariableName()).thenReturn(paramName);
|
||||
when(parameter.getName()).thenReturn("PASSWORD");
|
||||
|
||||
// mock the node
|
||||
IElement node = mock(IElement.class);
|
||||
List elementParametersWithChildrens = new ArrayList();
|
||||
elementParametersWithChildrens.add(parameter);
|
||||
when(node.getElementParametersWithChildrens()).thenReturn(elementParametersWithChildrens);
|
||||
|
||||
// {
|
||||
// "a":"b",
|
||||
// "c":"d"
|
||||
// }
|
||||
|
||||
// "{\r\n\"a\":\"b\",\r\n\"c\":\"d\"\r\n}" (keep the studio behavior)
|
||||
String val = "\"{\r\n\\\"a\\\":\\\"b\\\",\r\n\\\"c\\\":\\\"d\\\"\r\n}\"";
|
||||
when(parameter.getValue()).thenReturn(val);
|
||||
assertEquals("{\r\n\"a\":\"b\",\r\n\"c\":\"d\"\r\n}",
|
||||
assertEquals(targetVal,
|
||||
decryptPassword(ElementParameterParser.getEncryptedValue(node, paramName)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ui.proposal;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.context.JobContext;
|
||||
import org.talend.core.model.context.JobContextParameter;
|
||||
import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
|
||||
/**
|
||||
* created by hcyi on Apr 25, 2022
|
||||
* Detailled comment
|
||||
*
|
||||
*/
|
||||
public class ContextParameterProposalTest {
|
||||
|
||||
@Test
|
||||
public void testGetDescription4PasswordType() {
|
||||
IContextParameter contextParam = new JobContextParameter();
|
||||
JobContext newContext = new JobContext("JobContext");//$NON-NLS-1$
|
||||
contextParam.setName("abc");//$NON-NLS-1$
|
||||
contextParam.setComment("abc");//$NON-NLS-1$
|
||||
contextParam.setContext(newContext);
|
||||
contextParam.setType(JavaTypesManager.PASSWORD.getId());
|
||||
contextParam.setValue("abc123");//$NON-NLS-1$
|
||||
|
||||
ContextParameterProposal proposal = new ContextParameterProposal(contextParam);
|
||||
String desc = proposal.getDescription();
|
||||
assertEquals("Description: abc\n\nDefault context environment: JobContext\n\nType: id_Password\nValue: ******\n", //$NON-NLS-1$
|
||||
desc);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDescription4DefaultJavaType() {
|
||||
IContextParameter contextParam = new JobContextParameter();
|
||||
JobContext newContext = new JobContext("JobContext");//$NON-NLS-1$
|
||||
contextParam.setName("abc");//$NON-NLS-1$
|
||||
contextParam.setComment("abc");//$NON-NLS-1$
|
||||
contextParam.setContext(newContext);
|
||||
contextParam.setType(JavaTypesManager.getDefaultJavaType().getId());
|
||||
contextParam.setValue("abc123");//$NON-NLS-1$
|
||||
|
||||
ContextParameterProposal proposal = new ContextParameterProposal(contextParam);
|
||||
String desc = proposal.getDescription();
|
||||
assertEquals("Description: abc\n\nDefault context environment: JobContext\n\nType: id_String\nValue: abc123\n", //$NON-NLS-1$
|
||||
desc);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.librariesmanager.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -20,8 +19,6 @@ import java.util.Set;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
|
||||
import org.talend.core.model.general.ModuleStatusProvider;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
@@ -96,26 +93,4 @@ public class ModulesNeededProviderTest {
|
||||
Assert.assertEquals(module1.get(0).getContext(), "Global Routines " + routineItem.getProperty().getLabel());
|
||||
Assert.assertEquals(module2.get(0).getContext(), "Global Routines " + routineItem.getProperty().getLabel());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInstallModuleForRoutineOrBeans() throws Exception {
|
||||
ModuleNeeded module1 = new ModuleNeeded("", "ModulesNeededProviderTest", "description", false, null, null,
|
||||
"mvn:org.talend.librariesmanager.model/ModulesNeededProviderTest/8.0.1");
|
||||
try {
|
||||
ModuleStatusProvider.putStatus(module1.getMavenUri(), ELibraryInstallStatus.NOT_INSTALLED);
|
||||
ModulesNeededProvider.getModulesNeeded().add(module1);
|
||||
ModulesNeededProvider.checkInstallStatus(Arrays.asList(module1));
|
||||
Assert.assertTrue("Don't need to rebuild the codes project here",
|
||||
ModulesNeededProvider.installModuleForRoutineOrBeans() == false);
|
||||
ModuleStatusProvider.putStatus(module1.getMavenUri(), ELibraryInstallStatus.INSTALLED);
|
||||
Assert.assertTrue("Need to rebuild the codes project here",
|
||||
ModulesNeededProvider.installModuleForRoutineOrBeans() == true);
|
||||
ModulesNeededProvider.setInstallModuleForRoutineOrBeans();
|
||||
Assert.assertTrue("Don't need to rebuild the codes project here",
|
||||
ModulesNeededProvider.installModuleForRoutineOrBeans() == false);
|
||||
} finally {
|
||||
ModulesNeededProvider.getModulesNeeded().remove(module1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
@@ -59,7 +60,6 @@ import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
|
||||
import org.talend.core.model.general.ModuleStatusProvider;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.core.nexus.NexusServerUtils;
|
||||
@@ -67,6 +67,7 @@ import org.talend.core.nexus.TalendLibsServerManager;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.librariesmanager.emf.librariesindex.LibrariesIndex;
|
||||
import org.talend.librariesmanager.maven.MavenArtifactsHandler;
|
||||
import org.talend.librariesmanager.prefs.LibrariesManagerUtils;
|
||||
import org.talend.repository.ProjectManager;
|
||||
@@ -530,22 +531,6 @@ public class LocalLibraryManagerTest {
|
||||
assertFalse(lm.isResolveAllowed("a")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolveLocallySnapshotNoUpdate() {
|
||||
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(NexusServerUtils.ORG_TALEND_DESIGNER_CORE);
|
||||
int bak = node.getInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, 0);
|
||||
String mvnUrl = "mvn:a.b.c/d/1.0/jar";
|
||||
try {
|
||||
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.DEPLOYED);
|
||||
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, -1);
|
||||
LocalLibraryManager lm = new LocalLibraryManager();
|
||||
assertNull(lm.resolveStatusLocally(mvnUrl));
|
||||
} finally {
|
||||
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, bak);
|
||||
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.NOT_INSTALLED);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testNexusUpdateJar() throws Exception {
|
||||
|
||||
@@ -18,19 +18,14 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.junit.Test;
|
||||
import org.talend.core.IRepositoryContextService;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.ERedshiftDriver;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.model.metadata.DiSchemaConstants;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.IMetadataConnection;
|
||||
@@ -42,6 +37,8 @@ import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.FileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.SAPBWTable;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.utils.ReflectionUtils;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
@@ -500,31 +497,4 @@ public class ConvertionHelperTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertAdditionalParameters() {
|
||||
DatabaseConnection connection = ConnectionFactory.eINSTANCE.createDatabaseConnection();
|
||||
connection.setAdditionalParams("");
|
||||
connection.setDatabaseType(EDatabaseTypeName.REDSHIFT.getDisplayName());
|
||||
EMap<String, String> parameters = connection.getParameters();
|
||||
parameters.put(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_DRIVER, ERedshiftDriver.DRIVER_V2.name());
|
||||
parameters.put(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_STRINGPARA, String.valueOf(false));
|
||||
List<Map<String, Object>> propertiesList = new ArrayList<Map<String, Object>>();
|
||||
Map<String, Object> properties = new HashMap<String, Object>();
|
||||
properties.put("KEY", "pkey");
|
||||
properties.put("VALUE", "pvalue");
|
||||
propertiesList.add(properties);
|
||||
Map<String, Object> properties1 = new HashMap<String, Object>();
|
||||
properties1.put("KEY", "pkey1");
|
||||
properties1.put("VALUE", "pvalue1");
|
||||
propertiesList.add(properties1);
|
||||
String propertiesString = ConvertionHelper.getEntryPropertiesString(propertiesList);
|
||||
parameters.put(ConnParameterKeys.CONN_PARA_KEY_REDSHIFT_PARATABLE, propertiesString);
|
||||
String expect = "&pkey=pvalue&pkey1=pvalue1";
|
||||
String actual = ConvertionHelper.convertAdditionalParameters(connection);
|
||||
assertEquals(expect, actual);
|
||||
|
||||
connection.setDatabaseType(EDatabaseTypeName.MYSQL.getDisplayName());
|
||||
assertTrue(StringUtils.isBlank(ConvertionHelper.convertAdditionalParameters(connection)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,17 +12,11 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.metadata.builder.database;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.List;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.context.JobContextManager;
|
||||
import org.talend.core.model.context.JobContextParameter;
|
||||
import org.talend.core.model.metadata.builder.connection.ConnectionPackage;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
|
||||
/**
|
||||
* created by mzhao on Nov 12, 2012 Detailled comment
|
||||
@@ -67,51 +61,4 @@ public class JavaSqlFactoryTest {
|
||||
assertEquals("talend4ever", userName); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPromptPassword() {
|
||||
DatabaseConnection conn = getConnection();
|
||||
JobContextManager contextManager = getContextManager();
|
||||
for (IContextParameter contextParam : contextManager.getDefaultContext().getContextParameterList()) {
|
||||
JavaSqlFactory.savePromptConVars2Cache(conn, contextParam);
|
||||
}
|
||||
JavaSqlFactory.haveSetPromptContextVars = true;
|
||||
String pwd = JavaSqlFactory.getPassword(conn);
|
||||
assertEquals("Il1O0@01I", pwd); //$NON-NLS-1$
|
||||
JavaSqlFactory.haveSetPromptContextVars = false;
|
||||
|
||||
}
|
||||
|
||||
private DatabaseConnection getConnection() {
|
||||
DatabaseConnection conn = ConnectionPackage.eINSTANCE.getConnectionFactory().createDatabaseConnection();
|
||||
conn.setDatabaseType("MySQL");
|
||||
conn.setCdcTypeMode("true");
|
||||
conn.setContextId("_t6JiIL-JEeytPPESGs4uTQ");
|
||||
conn.setContextMode(true);
|
||||
conn.setPassword("context.mysql_Password");
|
||||
conn.setUsername("context.mysql_Login");
|
||||
return conn;
|
||||
}
|
||||
|
||||
public JobContextManager getContextManager() {
|
||||
JobContextManager contextManager = new JobContextManager();
|
||||
List<IContextParameter> contextParameterList = contextManager.getDefaultContext().getContextParameterList();
|
||||
|
||||
IContextParameter contextParam = new JobContextParameter();
|
||||
contextParam.setName("mysql_Password");
|
||||
contextParam.setPrompt("mysql_Password?");
|
||||
contextParam.setPromptNeeded(true);
|
||||
contextParam.setType(JavaTypesManager.PASSWORD.getId());
|
||||
contextParam.setValue("enc:system.encryption.key.v1:XvDCYmNqHBiWwueysEnyHM0Pl925+BNYbHHOpR+u4EGBX8d4MA==");
|
||||
contextParameterList.add(contextParam);
|
||||
|
||||
contextParam = new JobContextParameter();
|
||||
contextParam.setName("mysql_Login");
|
||||
contextParam.setPrompt("mysql_Login?");
|
||||
contextParam.setPromptNeeded(true);
|
||||
contextParam.setType(JavaTypesManager.getDefaultJavaType().getId());
|
||||
contextParam.setValue("xyz");
|
||||
contextParameterList.add(contextParam);
|
||||
return contextManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class DBConnectionContextUtilsTest {
|
||||
conn.setPort("3050");
|
||||
conn.setFileFieldName("/databases/TUJ");
|
||||
connectionItem.setConnection(conn);
|
||||
String setManagerConnectionValues = DBConnectionContextUtils.setManagerConnectionValues(managerConnection, connectionItem.getConnection(),
|
||||
String setManagerConnectionValues = DBConnectionContextUtils.setManagerConnectionValues(managerConnection, connectionItem,
|
||||
null, conn.getDatabaseType());
|
||||
Assert.assertEquals(EXPECT_URL, setManagerConnectionValues);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user