Compare commits

..

1 Commits

Author SHA1 Message Date
AlixMetivier
b528a033fa Revert "feat(TBD-13810): add dynamic schema on thdfsinputformat components (#5442)"
This reverts commit a5df51204e.
2022-08-18 10:02:06 +02:00
162 changed files with 660 additions and 6618 deletions

View File

@@ -72,27 +72,12 @@ public final class MessageBoxExceptionHandler {
}
}
public static void process(Throwable ex, Shell shell, boolean wrapMessage) {
CommonExceptionHandler.process(ex);
if (CommonsPlugin.isHeadless() || CommonsPlugin.isJUnitTest()) {
return;
}
if (shell != null) {
showMessage(ex, shell, wrapMessage);
}
}
public static void showMessage(Throwable ex, Shell shell) {
showMessage(ex, shell, true);
}
/**
* Open a message box showing a generic message and exception message.
*
* @param ex - exception to show
*/
public static void showMessage(Throwable ex, Shell shell, boolean wrapMessage) {
public static void showMessage(Throwable ex, Shell shell) {
if (ex.equals(lastShowedAction)) {
return;
}
@@ -100,14 +85,10 @@ public final class MessageBoxExceptionHandler {
// TODO smallet use ErrorDialogWidthDetailArea ?
String title = Messages.getString("commons.error"); //$NON-NLS-1$
String excepMsg = ex.getMessage();
String msg = Messages.getString("exception.errorOccured", ex.getMessage()); //$NON-NLS-1$
//add for tup-19726/19790, as for exception detailMessage will show more details on log area.
if(ex.getCause()!=null) {
excepMsg = ex.getCause().getMessage();
}
String msg = Messages.getString("exception.errorOccured", excepMsg); //$NON-NLS-1$
if (!wrapMessage) {
msg = Messages.getString("exception.message", excepMsg); //$NON-NLS-1$
msg = Messages.getString("exception.errorOccured", ex.getCause().getMessage()); //$NON-NLS-1$
}
Priority priority = CommonExceptionHandler.getPriority(ex);

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=table is null
TableViewerCreator.TableColumn.AssertMsg=The TableColumn of TableEditorColumn with idProperty '{0}' has not the correct Table parent
TreeToTablesLinker.Type.Unsupported=This type of currentControl is unsupported
commons.error=Error
exception.message={0}\nSee log for more details.
exception.errorOccured=An error occured ({0}).\nSee log for more details.
ModelSelectionDialog.Message=Please choose one option, or cancel.
ModelSelectionDialog.Option=option

View File

@@ -16,14 +16,8 @@ import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
@@ -164,35 +158,8 @@ public class ImageUtils {
return imageDes;
}
private static Map<byte[], ImageDataProvider> imageFromDataCachedImages = Collections.synchronizedMap(new HashMap<byte[], ImageDataProvider>());
private static Map<Long, byte[]> cachedImagesTimeKeeping = Collections.synchronizedMap(new HashMap<Long, byte[]>());
private static Thread clearImageFromDataCachedImages = new Thread() {
@SuppressWarnings("static-access")
public void run() {
long timeout = 5 * 60 * 1000;
while(true) {//remove older than 5 mins
Set<Entry<Long, byte[]>> collect = cachedImagesTimeKeeping.entrySet().stream()
.filter(entry -> (System.currentTimeMillis() - entry.getKey()) > timeout).collect(Collectors.toSet());
for(Entry<Long, byte[]> entry: collect) {
Long key = entry.getKey();
cachedImagesTimeKeeping.remove(key);
imageFromDataCachedImages.remove(entry.getValue());
}
try {
sleep(timeout);
} catch (InterruptedException e) {//
}
}
};
};
private static Map<byte[], ImageDataProvider> imageFromDataCachedImages = new HashMap<byte[], ImageDataProvider>();
static {
clearImageFromDataCachedImages.setDaemon(true);
clearImageFromDataCachedImages.start();
}
/**
* By default, keep in memory the .
*
@@ -202,17 +169,12 @@ public class ImageUtils {
*/
public static ImageDescriptor createImageFromData(byte[] data, boolean... keepInMemory) {
if (data != null) {
ImageDataProvider imageProvider = null;
Optional<byte[]> findKey = imageFromDataCachedImages.keySet().stream().filter(key->Arrays.equals(key, data)).findAny();
if(findKey.isPresent()) {
imageProvider = imageFromDataCachedImages.get(findKey.get());
}
ImageDataProvider imageProvider = imageFromDataCachedImages.get(data);
if (imageProvider == null) {
ByteArrayInputStream bais = new ByteArrayInputStream(data);
ImageData img = new ImageData(bais);
imageProvider = new TalendImageProvider(img);
imageFromDataCachedImages.put(data, imageProvider);
cachedImagesTimeKeeping.put(System.currentTimeMillis(), data);
}
return ImageDescriptor.createFromImageDataProvider(imageProvider);
}
@@ -221,9 +183,8 @@ public class ImageUtils {
public static void disposeImages(byte[] data) {
if (data != null) {
Optional<byte[]> findKey = imageFromDataCachedImages.keySet().stream().filter(key->Arrays.equals(key, data)).findAny();
if(findKey.isPresent()) {
imageFromDataCachedImages.remove(findKey.get());
if (imageFromDataCachedImages.get(data) != null) {
imageFromDataCachedImages.remove(data);
}
}
}

View File

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

View File

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

View File

@@ -19,8 +19,6 @@ import org.talend.repository.model.RepositoryConstants;
*/
public interface FileConstants {
String DOT = ".";
String OLD_TALEND_PROJECT_FILENAME = "talendProject"; //$NON-NLS-1$
String LOCAL_PROJECT_FILENAME = "talend.project"; //$NON-NLS-1$
@@ -114,4 +112,5 @@ public interface FileConstants {
String TALEND_FOLDER_NAME = "TALEND-INF"; //$NON-NLS-1$
String MAVEN_FOLDER_NAME = "MAVEN-INF";
}

View File

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

View File

@@ -2319,7 +2319,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
if (monitor != null && monitor.isCanceled()) {
throw new OperationCanceledException(""); //$NON-NLS-1$
}
PendoItemSignatureManager.getInstance().sendTrackToPendo();
boolean isCommandLineLocalRefProject = false;
CommandLineContext commandLineContext = (CommandLineContext) CoreRuntimePlugin.getInstance().getContext()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -351,19 +351,11 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_TYPE = "CONN_PARA_KEY_DATABRICKS_CLUSTER_TYPE";
public static final String CONN_PARA_KEY_DATABRICKS_RUN_MODE = "CONN_PARA_KEY_DATABRICKS_RUN_MODE";
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";
public static final String CONN_PARA_KEY_DATABRICKS_TOKEN="CONN_PARA_KEY_DATABRICKS_TOKEN";
public static final String CONN_PARA_KEY_DATABRICKS_NODE_TYPE="CONN_PARA_KEY_DATABRICKS_NODE_TYPE";
public static final String CONN_PARA_KEY_DATABRICKS_DRIVER_NODE_TYPE="CONN_PARA_KEY_DATABRICKS_DRIVER_NODE_TYPE";
public static final String CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION="CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION";
public static final String CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER="CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER";
@@ -387,8 +379,6 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_KNOX_DIRECTORY="CONN_PARA_KEY_KNOX_DIRECTORY";
public static final String CONN_PARA_KEY_KNOX_TIMEOUT="CONN_PARA_KEY_KNOX_TIMEOUT";
// CDE
public static final String CONN_PARA_KEY_CDE_API_ENDPOINT="CONN_PARA_KEY_CDE_API_ENDPOINT";
public static final String CONN_PARA_KEY_CDE_TOKEN="CONN_PARA_KEY_CDE_TOKEN";

View File

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

View File

@@ -95,12 +95,12 @@ public enum EDatabaseVersion4Drivers {
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL,
"Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IBMDB2(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
"db2jcc_license_cisuz.jar" })), //$NON-NLS-1$
IBMDB2ZOS(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2ZOS, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$

View File

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

View File

@@ -222,32 +222,6 @@ public class ContextUtils {
}
return parameterType;
}
// TUP-36519:For possible duplicate internalid scenario(TUP-36667) after several times' renaming in joblet. Loop all and find the nearest
// one.
public static ContextParameterType getContextParameterTypeById(ContextType contextType, final String uuId,
boolean isFromContextItem, String paraName) {
if (contextType == null || uuId == null) {
return null;
}
ContextParameterType parameterType = null;
for (ContextParameterType param : (List<ContextParameterType>) contextType.getContextParameter()) {
String paramId = null;
if (isFromContextItem) {
paramId = ResourceHelper.getUUID(param);
} else {
paramId = param.getInternalId();
}
if (uuId.equals(paramId)) {
parameterType = param;
if (paraName != null && StringUtils.equals(paraName, param.getName())) {
break;
}
}
}
return parameterType;
}
public static ContextParameterType getContextParameterTypeById(ContextType contextType, final String uuId,
boolean isFromContextItem) {
@@ -872,7 +846,7 @@ public class ContextUtils {
if (item != null) {
final ContextType repoContextType = ContextUtils.getContextTypeByName(item, contextType.getName());
ContextParameterType repoContextParam = ContextUtils.getContextParameterTypeById(repoContextType,
paramLink.getId(), item instanceof ContextItem, contextParameterType.getName());
paramLink.getId(), item instanceof ContextItem);
if (repoContextParam != null
&& !StringUtils.equals(repoContextParam.getName(), contextParameterType.getName())) {
renamedMap.put(repoContextParam.getName(), contextParameterType.getName());
@@ -941,7 +915,7 @@ public class ContextUtils {
if (item != null) {
ContextType contextType = ContextUtils.getContextTypeByName(item, context.getName());
ContextParameterType repoParameterType = ContextUtils.getContextParameterTypeById(contextType,
parameterLink.getId(), item instanceof ContextItem, parameterType.getName());
parameterLink.getId(), item instanceof ContextItem);
if (repoParameterType != null
&& !StringUtils.equals(repoParameterType.getName(), parameterType.getName())) {
renamedMap.put(repoParameterType.getName(), parameterType.getName());
@@ -1001,7 +975,7 @@ public class ContextUtils {
ContextParameterType contextParameterType = null;
if (paramLink != null && paramLink.getId() != null && contextType != null) {
contextParameterType = getContextParameterTypeById(contextType, paramLink.getId(),
contextItem instanceof ContextItem, paramName);
contextItem instanceof ContextItem);
}
if (contextParameterType != null) {// Compare use UUID
if (!StringUtils.equals(contextParameterType.getName(), paramName)) {

View File

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

View File

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

View File

@@ -13,15 +13,10 @@ public class SparkBatchMetadataTalendTypeFilter extends SparkMetadataTalendTypeF
public static List<String> dynamicTypeCompatibleComponents = Arrays.asList(
"tDeltaLakeInput",
"tDeltaLakeOutput",
"tFileInputDelimited",
"tFileInputParquet",
"tFileOutputParquet",
"tJDBCInput",
"tJDBCOutput",
"tLogRow",
"tMongoDBInput",
"tMongoDBOutput",
"tSqlRow"
"tJDBCOutput", "tLogRow", "tSqlRow"
);
public SparkBatchMetadataTalendTypeFilter(INode node) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -359,9 +359,7 @@ public abstract class RepositoryUpdateManager {
List<UpdateResult> checkedResults = null;
if (parameter == null) { // update all job
// TUP-36519: comment out the filter for only opening job
// checkedResults = filterSpecialCheckedResult(results);
checkedResults = results;
checkedResults = filterSpecialCheckedResult(results);
} else { // filter
checkedResults = filterCheckedResult(results);
}

View File

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

View File

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

View File

@@ -19,17 +19,13 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.properties.PendoLoginProperties;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.service.IStudioLiteP2Service;
import org.talend.core.service.IStudioLiteP2Service.UpdateSiteConfig;
import org.talend.core.ui.IInstalledPatchService;
import org.talend.repository.ProjectManager;
import org.talend.utils.json.JSONObject;
@@ -65,7 +61,11 @@ public class PendoTrackDataUtil {
}
public static IPendoDataProperties getLoginEventProperties() {
String studioPatch = getLatestPatchInstalledVersion();
String studioPatch = null;
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
if (installedPatchService != null) {
studioPatch = installedPatchService.getLatestInstalledPatchVersion();
}
PendoLoginProperties loginEvent = new PendoLoginProperties();
IStudioLiteP2Service studioLiteP2Service = IStudioLiteP2Service.get();
try {
@@ -85,18 +85,6 @@ public class PendoTrackDataUtil {
loginEvent.setEnabledFeatures(enabledFeatures);
}
setUpRefProjectsStructure(loginEvent);
loginEvent.setIsOneClickLogin(Boolean.FALSE.toString());
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
loginEvent.setIsOneClickLogin(Boolean.TRUE.toString());
}
loginEvent.setManagedUpdate(Boolean.FALSE.toString());
if (IStudioLiteP2Service.get() != null) {
IProgressMonitor monitor = new NullProgressMonitor();
UpdateSiteConfig config = IStudioLiteP2Service.get().getUpdateSiteConfig(monitor);
if (config.isEnableTmcUpdateSettings(monitor) && !config.isOverwriteTmcUpdateSettings(monitor)) {
loginEvent.setManagedUpdate(Boolean.TRUE.toString());
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
@@ -105,15 +93,6 @@ public class PendoTrackDataUtil {
return loginEvent;
}
public static String getLatestPatchInstalledVersion() {
String studioPatch = "";
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
if (installedPatchService != null) {
studioPatch = installedPatchService.getLatestInstalledVersion(true);
}
return studioPatch;
}
private static void setUpRefProjectsStructure(PendoLoginProperties loginEvent) {
ProjectManager projectManager = ProjectManager.getInstance();
Project currentProject = projectManager.getCurrentProject();
@@ -183,9 +162,7 @@ public class PendoTrackDataUtil {
OPEN_IN_APITester("Open in API Tester"),
OPEN_API_DOCUMENTATION("Open API Documentation"),
AUTOMAP("tMap Automap"),
TMAP("tMap"),
ITEM_IMPORT("Import items"),
ITEM_SIGNATURE("Item Signature");
TMAP("tMap");
private String event;

View File

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

View File

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

View File

@@ -1,232 +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.pendo.properties;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoSignImportProperties implements IPendoDataProperties {
@JsonProperty("source_version")
private List<String> sourceVersion;
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("valid_items")
private int validItems;
@JsonProperty("unsigned_items_from_SE")
private String unsignSEItems;
@JsonProperty("unsigned_items_from_EE")
private int unsignEEItems;
@JsonProperty("grace_period")
private String gracePeriod;
@JsonProperty("installed_date")
private String installDate;
@JsonProperty("project_creation_date")
private String projectCreateDate;
@JsonProperty("valid_migration_token")
private String validMigrationToken;
@JsonProperty("import_product")
private List<String> importProduct;
/**
* Getter for sourceVersion.
* @return the sourceVersion
*/
public List<String> getSourceVersion() {
return sourceVersion;
}
/**
* Sets the sourceVersion.
* @param sourceVersion the sourceVersion to set
*/
public void setSourceVersion(List<String> sourceVersion) {
this.sourceVersion = sourceVersion;
}
/**
* Getter for studioVersion.
*
* @return the studioVersion
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studioVersion.
*
* @param studioVersion the studioVersion to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for validItems.
*
* @return the validItems
*/
public int getValidItems() {
return validItems;
}
/**
* Sets the validItems.
*
* @param validItems the validItems to set
*/
public void setValidItems(int validItems) {
this.validItems = validItems;
}
/**
* Getter for unsignSEItems.
* @return the unsignSEItems
*/
public String getUnsignSEItems() {
return unsignSEItems;
}
/**
* Sets the unsignSEItems.
* @param unsignSEItems the unsignSEItems to set
*/
public void setUnsignSEItems(String unsignSEItems) {
this.unsignSEItems = unsignSEItems;
}
/**
* Getter for unsignEEItems.
*
* @return the unsignEEItems
*/
public int getUnsignEEItems() {
return unsignEEItems;
}
/**
* Sets the unsignEEItems.
*
* @param unsignEEItems the unsignEEItems to set
*/
public void setUnsignEEItems(int unsignEEItems) {
this.unsignEEItems = unsignEEItems;
}
/**
* Getter for gracePeriod.
*
* @return the gracePeriod
*/
public String getGracePeriod() {
return gracePeriod;
}
/**
* Sets the gracePeriod.
*
* @param gracePeriod the gracePeriod to set
*/
public void setGracePeriod(String gracePeriod) {
this.gracePeriod = gracePeriod;
}
/**
* Getter for installDate.
*
* @return the installDate
*/
public String getInstallDate() {
return installDate;
}
/**
* Sets the installDate.
*
* @param installDate the installDate to set
*/
public void setInstallDate(String installDate) {
this.installDate = installDate;
}
/**
* Getter for projectCreateDate.
*
* @return the projectCreateDate
*/
public String getProjectCreateDate() {
return projectCreateDate;
}
/**
* Sets the projectCreateDate.
*
* @param projectCreateDate the projectCreateDate to set
*/
public void setProjectCreateDate(String projectCreateDate) {
this.projectCreateDate = projectCreateDate;
}
/**
* Getter for validMigrationToken.
*
* @return the validMigrationToken
*/
public String getValidMigrationToken() {
return validMigrationToken;
}
/**
* Sets the validMigrationToken.
*
* @param validMigrationToken the validMigrationToken to set
*/
public void setValidMigrationToken(String validMigrationToken) {
this.validMigrationToken = validMigrationToken;
}
/**
* Getter for importProduct.
* @return the importProduct
*/
public List<String> getImportProduct() {
return importProduct;
}
/**
* Sets the importProduct.
* @param importProduct the importProduct to set
*/
public void setImportProduct(List<String> importProduct) {
this.importProduct = importProduct;
}
}

View File

@@ -1,251 +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.pendo.properties;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoSignLogonProperties implements IPendoDataProperties {
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("valid_items")
private int validItems;
@JsonProperty("signature_invalid_items")
private int invalidSignItems;
@JsonProperty("unsigned_items_from_SE")
private String unsignSEItems;
@JsonProperty("unsigned_items_from_EE")
private int unsignEEItems;
@JsonProperty("invalid_item_source_version")
private String invalidItemSourceVersion;
@JsonProperty("signed_by_migration")
private int signByMigration;
@JsonProperty("grace_period")
private String gracePeriod;
@JsonProperty("installed_date")
private String installDate;
@JsonProperty("project_creation_date")
private String projectCreateDate;
@JsonProperty("valid_migration_token")
private String validMigrationToken;
/**
* Getter for studioVersion.
*
* @return the studioVersion
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studioVersion.
*
* @param studioVersion the studioVersion to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for validItems.
*
* @return the validItems
*/
public int getValidItems() {
return validItems;
}
/**
* Sets the validItems.
*
* @param validItems the validItems to set
*/
public void setValidItems(int validItems) {
this.validItems = validItems;
}
/**
* Getter for invalidSignItems.
*
* @return the invalidSignItems
*/
public int getInvalidSignItems() {
return invalidSignItems;
}
/**
* Sets the invalidSignItems.
*
* @param invalidSignItems the invalidSignItems to set
*/
public void setInvalidSignItems(int invalidSignItems) {
this.invalidSignItems = invalidSignItems;
}
/**
* Getter for unsignSEItems.
* @return the unsignSEItems
*/
public String getUnsignSEItems() {
return unsignSEItems;
}
/**
* Sets the unsignSEItems.
* @param unsignSEItems the unsignSEItems to set
*/
public void setUnsignSEItems(String unsignSEItems) {
this.unsignSEItems = unsignSEItems;
}
/**
* Getter for unsignEEItems.
*
* @return the unsignEEItems
*/
public int getUnsignEEItems() {
return unsignEEItems;
}
/**
* Sets the unsignEEItems.
*
* @param unsignEEItems the unsignEEItems to set
*/
public void setUnsignEEItems(int unsignEEItems) {
this.unsignEEItems = unsignEEItems;
}
/**
* Getter for invalidItemSourceVersion.
*
* @return the invalidItemSourceVersion
*/
public String getInvalidItemSourceVersion() {
return invalidItemSourceVersion;
}
/**
* Sets the invalidItemSourceVersion.
*
* @param invalidItemSourceVersion the invalidItemSourceVersion to set
*/
public void setInvalidItemSourceVersion(String invalidItemSourceVersion) {
this.invalidItemSourceVersion = invalidItemSourceVersion;
}
/**
* Getter for signByMigration.
*
* @return the signByMigration
*/
public int getSignByMigration() {
return signByMigration;
}
/**
* Sets the signByMigration.
*
* @param signByMigration the signByMigration to set
*/
public void setSignByMigration(int signByMigration) {
this.signByMigration = signByMigration;
}
/**
* Getter for gracePeriod.
*
* @return the gracePeriod
*/
public String getGracePeriod() {
return gracePeriod;
}
/**
* Sets the gracePeriod.
*
* @param gracePeriod the gracePeriod to set
*/
public void setGracePeriod(String gracePeriod) {
this.gracePeriod = gracePeriod;
}
/**
* Getter for installDate.
*
* @return the installDate
*/
public String getInstallDate() {
return installDate;
}
/**
* Sets the installDate.
*
* @param installDate the installDate to set
*/
public void setInstallDate(String installDate) {
this.installDate = installDate;
}
/**
* Getter for projectCreateDate.
*
* @return the projectCreateDate
*/
public String getProjectCreateDate() {
return projectCreateDate;
}
/**
* Sets the projectCreateDate.
*
* @param projectCreateDate the projectCreateDate to set
*/
public void setProjectCreateDate(String projectCreateDate) {
this.projectCreateDate = projectCreateDate;
}
/**
* Getter for validMigrationToken.
*
* @return the validMigrationToken
*/
public String getValidMigrationToken() {
return validMigrationToken;
}
/**
* Sets the validMigrationToken.
*
* @param validMigrationToken the validMigrationToken to set
*/
public void setValidMigrationToken(String validMigrationToken) {
this.validMigrationToken = validMigrationToken;
}
}

View File

@@ -91,13 +91,13 @@ public class PendoTMapProperties implements IPendoDataProperties {
* Number of input columns which are mapped to multiple output columns, either mapped directly or mapped through the
* Var column
*/
@JsonProperty("mapping_1_to_n")
@JsonProperty("1-to-n mapping")
private int oneToNMappings;
/**
* Number of output columns which have multiple source columns, either input columns or var columns
*/
@JsonProperty("mapping_n_to_1")
@JsonProperty("n-to-1 mapping")
private int nToOneMappings;
/**

View File

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

View File

@@ -552,8 +552,6 @@ BusinessAppearanceComposite.textAlignment.vertical.centre=Centre
ConnectionBean.Local=Local
ConnectionBean.Remote=Distant
ConnectionBean.DefaultConnection=Connexion par d\u00E9faut
ConnectionBean.Cloud.name=Connect\u00E9(e) \u00E0\u00A0: Cloud ({0})
ConnectionBean.CloudConnection.description=Connexion distante au Cloud - Connect\u00E9(e) \u00E0\u00A0: Cloud ({0})
InegerCellEditorListener.NegativeNumberMessage=La valeur de {0} ne peut \u00EAtre un nombre n\u00E9gatif.
InegerCellEditorListener.NumeralMessage=La valeur de {0} doit \u00EAtre num\u00E9rique.
OpenXSDFileDialog.cancel=Annuler
@@ -577,7 +575,7 @@ repository.servicesPort=Port
BinRepositoryNode.label=Corbeille
HDFS=HDFS
HCAT=HCAT
AbstractRepositoryContentHandler.deleteNode.exception=\u00C9chec de la suppression des pertinences de n\u0153ud\u00A0: {0}
AbstractRepositoryContentHandler.deleteNode.exception=\u00C9chec de la suppression des pertinences de noeud\u00A0: {0}
HadoopCustomVersionDialog.topTitle=D\u00E9finition de la version Hadoop personnalis\u00E9e
HadoopCustomVersionDialog.title=D\u00E9finir la distribution Hadoop personnalis\u00E9e
HadoopCustomVersionDialog.msg=Configurer les biblioth\u00E8ques n\u00E9cessaires \u00E0 la version personnalis\u00E9e de Hadoop

View File

@@ -184,7 +184,7 @@ AbstractTalendFunctionParser.checkMethod=\u30EB\u30FC\u30C1\u30F3: "{0}.{1}\\"\u
JavaGlobalVariableProposal.Description=\u8AAC\u660E: {0}
JavaGlobalVariableProposal.VariableName=\n\n\u5909\u6570\u540D: {1}
JavaSimpleDateFormatProposalProvider.displaySingleQuote= ' : \u4E00\u91CD\u5F15\u7528\u7B26\u3092\u8868\u793A
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3067\uFF11\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3092\u793A\u3057\u307E\u3059\u3002
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3067\uFF11\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3092\u793A\u3057\u307E\u3059\u3002
JavaTypesManager.bigDecimal=BIGDECIMAL\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.integer=INTEGER\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.list=LIST\u306F\u6570\u5024\u3067\u3059:
@@ -449,7 +449,7 @@ repository.rulesSql=SQL
repository.rulesParser=\u30D1\u30FC\u30B5\u30FC
repository.rulesMatcher=\u4E00\u81F4
repository.systemIndicators=\u30B7\u30B9\u30C6\u30E0\u30A4\u30F3\u30C7\u30A3\u30B1\u30FC\u30BF\u30FC
repository.userDefineIndicators=\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u306E\u30A4\u30F3\u30B8\u30B1\u30FC\u30BF\u30FC
repository.userDefineIndicators=\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u30A4\u30F3\u30B8\u30B1\u30FC\u30BF\u30FC
repository.userDefineIndicators.lib=lib
repository.systemIndicators.advancedStatistics=\u8A73\u7D30\u7D71\u8A08
repository.systemIndicators.businessRules=\u30D3\u30B8\u30CD\u30B9\u30EB\u30FC\u30EB
@@ -552,8 +552,6 @@ BusinessAppearanceComposite.textAlignment.vertical.centre=\u4E2D\u5FC3
ConnectionBean.Local=\u30ED\u30FC\u30AB\u30EB
ConnectionBean.Remote=\u30EA\u30E2\u30FC\u30C8
ConnectionBean.DefaultConnection=\u30C7\u30D5\u30A9\u30EB\u30C8\u63A5\u7D9A
ConnectionBean.Cloud.name=\u30B5\u30A4\u30F3\u30A4\u30F3\u6E08\u307F: \u30AF\u30E9\u30A6\u30C9({0})
ConnectionBean.CloudConnection.description=\u30AF\u30E9\u30A6\u30C9\u3078\u306E\u30EA\u30E2\u30FC\u30C8\u63A5\u7D9A - \u30B5\u30A4\u30F3\u30A4\u30F3\u6E08\u307F: \u30AF\u30E9\u30A6\u30C9({0})
InegerCellEditorListener.NegativeNumberMessage={0}\u306B\u306F\u8CA0\u306E\u5024\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
InegerCellEditorListener.NumeralMessage={0}\u306B\u306F\u6570\u5024\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
OpenXSDFileDialog.cancel=\u30AD\u30E3\u30F3\u30BB\u30EB

View File

@@ -552,8 +552,6 @@ BusinessAppearanceComposite.textAlignment.vertical.centre=\u4E2D\u592E
ConnectionBean.Local=\u672C\u5730
ConnectionBean.Remote=\u8FDC\u7A0B
ConnectionBean.DefaultConnection=\u9ED8\u8BA4\u8FDE\u63A5
ConnectionBean.Cloud.name=\u5DF2\u767B\u5F55: \u4E91\u7AEF ({0})
ConnectionBean.CloudConnection.description=\u4E91\u7AEF\u8FDC\u7A0B\u8FDE\u63A5 - \u5DF2\u767B\u5F55: \u4E91\u7AEF ({0})
InegerCellEditorListener.NegativeNumberMessage={0} \u7684\u503C\u4E0D\u80FD\u8BBE\u5B9A\u4E3A\u8D1F\u6570\u3002
InegerCellEditorListener.NumeralMessage={0} \u7684\u503C\u5E94\u8BE5\u4E3A\u6570\u5B57\u3002
OpenXSDFileDialog.cancel=\u53D6\u6D88

View File

@@ -78,10 +78,5 @@ public interface IProjectSettingPreferenceConstants {
public static final String TEMPLATE_DOCKER_PROFILE_POM = "template_docker_profile_pom_script"; //$NON-NLS-1$
public static final String USE_STRICT_REFERENCE_JOBLET = "use_strict_reference_joblet"; //$NON-NLS-1$
/*
* Default microservices application properties
*/
public static final String MS_APPLICATION_PROPERTIES = "ms_application_properties";
}

View File

@@ -19,8 +19,6 @@ package org.talend.core.runtime.projectsetting;
public interface IProjectSettingTemplateConstants {
final static String PATH_RESOURCES = "resources";
final static String PATH_APPLICATION_PROPERTIES = PATH_RESOURCES + '/' + "application.properties";
final static String PATH_RESOURCES_TEMPLATES = PATH_RESOURCES + '/' + "templates";

View File

@@ -1,6 +1,5 @@
package org.talend.core.runtime.services;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.properties.Item;
@@ -10,11 +9,4 @@ public interface IFilterService extends IService {
public boolean isFilterAccepted(Item item, String filter);
public static IFilterService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IFilterService.class)) {
return GlobalServiceRegister.getDefault().getService(IFilterService.class);
}
return null;
}
}

View File

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

View File

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

View File

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

View File

@@ -160,8 +160,6 @@ public interface IRunProcessService extends IService {
public void checkLastGenerationHasCompilationError(boolean updateProblemsView) throws ProcessorException;
public void checkLastGenerationHasCompilationError(boolean updateProblemsView, boolean isJob) throws ProcessorException;
/**
* DOC ycbai Comment method "getResourceFilePath".
*

View File

@@ -380,27 +380,24 @@ public final class ProjectManager {
return null;
}
/**
* @deprecated unable to get project when resource is unloaded, use {@link #getProject(EObject)} instead
*/
public org.talend.core.model.properties.Project getProject(Project project, EObject object) {
// if (object != null) {
// if (object instanceof org.talend.core.model.properties.Project) {
// return (org.talend.core.model.properties.Project) object;
// }
// if (object instanceof Property) {
// return getProject(project, ((Property) object).getItem());
// }
// if (object instanceof Item) {
// return getProject(project, ((Item) object).getParent());
// }
// }
//
// // default
// if (project != null) {
// return project.getEmfProject();
// }
return getProject(object);
if (object != null) {
if (object instanceof org.talend.core.model.properties.Project) {
return (org.talend.core.model.properties.Project) object;
}
if (object instanceof Property) {
return getProject(project, ((Property) object).getItem());
}
if (object instanceof Item) {
return getProject(project, ((Item) object).getParent());
}
}
// default
if (project != null) {
return project.getEmfProject();
}
return null;
}
public IProject getResourceProject(org.talend.core.model.properties.Project project) {
@@ -446,7 +443,7 @@ public final class ProjectManager {
public boolean isInMainProject(Project mainProject, EObject object) {
if (object != null) {
org.talend.core.model.properties.Project project = getProject(object);
org.talend.core.model.properties.Project project = getProject(mainProject, object);
if (project != null && mainProject != null) {
return project.getTechnicalLabel().equals(mainProject.getEmfProject().getTechnicalLabel());
}

View File

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

View File

@@ -133,7 +133,7 @@ JavaFunctionParser.checkMethod=\u30EB\u30FC\u30C1\u30F3: "{0}.{1}"\u89E3\u6790\u
JavaGlobalVariableProposal.Description=\u8AAC\u660E: {0}
JavaGlobalVariableProposal.VariableName=\n\n\u5909\u6570\u540D: {1}
JavaSimpleDateFormatProposalProvider.displaySingleQuote= ' : \u4E00\u91CD\u5F15\u7528\u7B26\u3092\u8868\u793A
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3067\uFF11\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3092\u793A\u3057\u307E\u3059\u3002
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3067\uFF11\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3092\u793A\u3057\u307E\u3059\u3002
JavaTypesManager.bigDecimal=BIGDECIMAL\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.integer=INTEGER\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.list=LIST\u306F\u6570\u5024\u3067\u3059:

View File

@@ -115,7 +115,7 @@ GlobalServiceRegister.ServiceNotRegistered=\u30B5\u30FC\u30D3\u30B9{0}\u304C\u76
GroupByContextAction.groupContext=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3054\u3068\u306B\u30B0\u30EB\u30FC\u30D4\u30F3\u30B0
GroupByVariableAction.groupVariable=\u5909\u6570\u3054\u3068\u306B\u30B0\u30EB\u30FC\u30D4\u30F3\u30B0
JavaSimpleDateFormatProposalProvider.displaySingleQuote= ' : \u4E00\u91CD\u5F15\u7528\u7B26\u3092\u8868\u793A
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3067\uFF11\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3092\u793A\u3057\u307E\u3059\u3002
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3067\uFF11\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3092\u793A\u3057\u307E\u3059\u3002
JavaTypesManager.bigDecimal=BIGDECIMAL\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.integer=INTEGER\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.list=LIST\u306F\u6570\u5024\u3067\u3059:

View File

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

View File

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

View File

@@ -1,118 +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.components.conversions;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.runtime.model.components.IComponentConstants;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.designer.core.model.utils.emf.talendfile.ConnectionType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.MetadataType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.core.model.utils.emf.talendfile.SubjobType;
/**
* @author bhe created on Jul 6, 2022
*
*/
public class DefaultRenameComponentConversion implements IComponentConversion {
private String newName;
private String oldName;
/**
* Rename component name
*
* @param oldName old base name of the component, e.g. NetSuiteV2019Input
* @param newName new base name of the component, e.g. NetSuiteNewInput
*/
public DefaultRenameComponentConversion(String oldName, String newName) {
super();
this.newName = newName;
this.oldName = oldName;
}
public void transform(NodeType node) {
node.setComponentName(newName);
ProcessType item = (ProcessType) node.eContainer();
String oldNodeUniqueName = ComponentUtilities.getNodeUniqueName(node);
ComponentUtilities.setNodeUniqueName(node, oldNodeUniqueName.replaceAll(oldName, newName));
replaceAllInAllNodesParameterValue(item, this.oldName, this.newName);
}
protected static void replaceAllInAllNodesParameterValue(ProcessType item, String oldName, String newName) {
for (Object o : item.getNode()) {
NodeType nt = (NodeType) o;
ComponentUtilities.replaceInNodeParameterValue(nt, oldName, newName);
EList metaList = nt.getMetadata();
if (metaList != null) {
if (!metaList.isEmpty()) {
for (Object obj : metaList) {
MetadataType meta = (MetadataType) obj;
if (meta.getName().contains(oldName)) {
meta.setName(meta.getName().replaceAll(oldName, newName));
}
}
}
}
}
for (Object o : item.getConnection()) {
ConnectionType currentConnection = (ConnectionType) o;
if (currentConnection.getSource().contains(oldName)) {
currentConnection.setSource(currentConnection.getSource().replaceAll(oldName, newName));
}
if (currentConnection.getTarget().contains(oldName)) {
currentConnection.setTarget(currentConnection.getTarget().replaceAll(oldName, newName));
}
if (currentConnection.getMetaname().contains(oldName)) {
currentConnection.setMetaname(currentConnection.getMetaname().replaceAll(oldName, newName));
}
if ("RUN_IF".equals(currentConnection.getConnectorName())) {
for (Object obj : currentConnection.getElementParameter()) {
ElementParameterType type = (ElementParameterType) obj;
if ("CONDITION".equals(type.getName())) {
if (type.getValue() != null && type.getValue().contains(oldName)) {
String replaceAll = type.getValue().replaceAll(oldName, newName);
type.setValue(replaceAll);
}
break;
}
}
}
}
for (Object o : item.getSubjob()) {
SubjobType sj = (SubjobType) o;
for (Object obj : sj.getElementParameter()) {
ElementParameterType p = (ElementParameterType) obj;
if (p.getName().equals(IComponentConstants.UNIQUE_NAME)) {
if (p.getValue() != null && p.getValue().contains(oldName)) {
String replaceAll = p.getValue().replaceAll(oldName, newName);
p.setValue(replaceAll);
}
}
}
}
}
public String getNewName() {
return this.newName;
}
public void setNewName(String newName) {
this.newName = newName;
}
}

View File

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

View File

@@ -18,7 +18,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.osgi.service.prefs.BackingStoreException;
@@ -85,25 +84,9 @@ public interface ICoreTisService extends IService {
public void afterImport (Property property) throws PersistenceException;
Integer getSignatureVerifyResult(Property property, IPath resourcePath, boolean considerGP) throws Exception;
String getLicenseCustomer();
void storeLicenseAndUpdateConfig(String licenseString) throws IOException;
boolean isInValidGP();
boolean hasNewPatchInPatchesFolder();
boolean isDefaultLicenseAndProjectType();
String getLicenseProductName(String licenseString) throws Exception;
String getLicenseProductEdition(String licenseString) throws Exception;
boolean isLicenseExpired(String licenseString) throws Exception;
boolean isLicenseVersionCorrect(String licenseString) throws Exception;
void syncProjectUpdateSettingsFromServer(IProgressMonitor monitor, Project proj) throws Exception;

View File

@@ -819,8 +819,7 @@ public class ProcessorUtilities {
// TDI-36930, just after compile, need check the compile errors first.
// only check current build
if (isMainJob) {
CorePlugin.getDefault().getRunProcessService().checkLastGenerationHasCompilationError(true,
!ComponentCategory.CATEGORY_4_CAMEL.getName().equals(currentProcess.getComponentsType()));
CorePlugin.getDefault().getRunProcessService().checkLastGenerationHasCompilationError(true);
}
}

View File

@@ -56,7 +56,7 @@ _UI_TypeAlias_type=Type Alias
_UI_Union_type=Union
_UI_UnionMember_type=Membre de l'union
_UI_ExpressionNode_type=N\u0153ud d'expression
_UI_ConstantNode_type=N\u0153ud constant
_UI_ConstantNode_type=Noeud constant
_UI_ElementNode_type=N\u0153ud d'\u00E9l\u00E9ment
_UI_FeatureNode_type=N\u0153ud de fonctionnalit\u00E9
_UI_UniqueKey_type=Cl\u00E9 unique

View File

@@ -788,7 +788,7 @@ _UI_Term_concept_feature=\u30B3\u30F3\u30BB\u30D7\u30C8
_UI_Term_relatedTerm_feature=\u95A2\u9023\u7528\u8A9E
_UI_Term_term_feature=\u7528\u8A9E
_UI_Term_preferredTerm_feature=\u597D\u307E\u3057\u3044Term
_UI_Term_synonym_feature=\u30B7\u30CE\u30CB\u30E0
_UI_Term_synonym_feature=\u540C\u7FA9\u8A9E
_UI_Term_widerTerm_feature=\u5E45\u5E83\u3044Term
_UI_Term_narrowerTerm_feature=Narrower Term
_UI_WarehouseProcess_staticDefinition_feature=\u9759\u7684\u5B9A\u7FA9

View File

@@ -11,16 +11,16 @@
<packaging>eclipse-plugin</packaging>
<properties>
<tcomp.version>${component-runtime.version}</tcomp.version>
<cxf.version>3.5.2</cxf.version>
<cxf.version>3.5.1</cxf.version>
<geronimo.version>1.0.2</geronimo.version>
<jcache.version>1.0.5</jcache.version>
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
<johnzon.version>1.2.19</johnzon.version>
<meecrowave.version>1.2.14</meecrowave.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.27</owb.version>
<slf4j.version>1.7.34</slf4j.version>
<tomcat.version>9.0.63</tomcat.version>
<owb.version>2.0.26</owb.version>
<slf4j.version>1.7.33</slf4j.version>
<tomcat.version>9.0.62</tomcat.version>
<xbean.version>4.20</xbean.version>
<reload4j.version>1.2.19</reload4j.version>
<log4j2.version>2.17.2</log4j2.version>

View File

@@ -11,8 +11,8 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.49.1</tcomp.version>
<slf4j.version>1.7.34</slf4j.version>
<tcomp.version>1.47.1</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
<reload4j.version>1.2.19</reload4j.version>
</properties>

View File

@@ -14,16 +14,15 @@ package org.talend.designer.maven.tools;
import static org.talend.designer.maven.model.TalendJavaProjectConstants.*;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -65,10 +64,8 @@ import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.Relation;
@@ -528,7 +525,7 @@ public class AggregatorPomsHelper {
@Override
public void run(final IProgressMonitor monitor) throws CoreException {
try {
syncAllPomsWithoutProgress(monitor, PomIdsHelper.getPomFilter(), false);
syncAllPomsWithoutProgress(monitor, PomIdsHelper.getPomFilter());
} catch (Exception e) {
ExceptionHandler.process(e);
}
@@ -623,11 +620,10 @@ public class AggregatorPomsHelper {
}
public void syncAllPomsWithoutProgress(IProgressMonitor monitor) throws Exception {
syncAllPomsWithoutProgress(monitor, PomIdsHelper.getPomFilter(), false);
syncAllPomsWithoutProgress(monitor, PomIdsHelper.getPomFilter());
}
public void syncAllPomsWithoutProgress(IProgressMonitor monitor, String pomFilter, boolean withDependencies)
throws Exception {
public void syncAllPomsWithoutProgress(IProgressMonitor monitor, String pomFilter) throws Exception {
LOGGER.info("syncAllPomsWithoutProgress, pomFilter: " + pomFilter);
IRunProcessService runProcessService = IRunProcessService.get();
if (runProcessService == null) {
@@ -638,43 +634,11 @@ public class AggregatorPomsHelper {
Boolean isCIMode = IRunProcessService.get().isCIMode();
List<IRepositoryViewObject> objects = new ArrayList<>();
List<ERepositoryObjectType> allJobletTypes = ERepositoryObjectType.getAllTypesOfJoblet();
for (ERepositoryObjectType type : ERepositoryObjectType.getAllTypesOfProcess2()) {
if (isCIMode && withDependencies && allJobletTypes.contains(type)) {
continue;
}
objects.addAll(ProxyRepositoryFactory.getInstance().getAll(type, true, true));
}
Iterator<IRepositoryViewObject> iterator = objects.iterator();
while (iterator.hasNext()) {
IRepositoryViewObject object = iterator.next();
if (object.getProperty() == null || object.getProperty().getItem() == null) {
iterator.remove();
continue;
}
if (isCIMode && !allJobletTypes.contains(object.getRepositoryObjectType()) && IFilterService.get() != null
&& !IFilterService.get().isFilterAccepted(object.getProperty().getItem(), pomFilter)) {
iterator.remove();
continue;
}
if (isCIMode && object.isDeleted() && PomIdsHelper.getIfExcludeDeletedItems()) {
iterator.remove();
}
}
Set<Item> allItems;
if (withDependencies) {
allItems = objects.stream().flatMap(object -> {
ProcessItem item = (ProcessItem) object.getProperty().getItem();
Set<JobInfo> allJobInfos = ProcessorUtilities.getChildrenJobInfo(item, false, true);
allJobInfos.add(new JobInfo(item, item.getProcess().getDefaultContext()));
return allJobInfos.stream();
}).map(info -> info.getJobletProperty() != null ? info.getJobletProperty().getItem() : info.getProcessItem())
.collect(Collectors.toSet());
} else {
allItems = objects.stream().map(object -> object.getProperty().getItem()).collect(Collectors.toSet());
}
int size = 3 + allItems.size();
int size = 3 + objects.size();
monitor.setTaskName("Synchronize all poms"); //$NON-NLS-1$
monitor.beginTask("", size); //$NON-NLS-1$
// project pom
@@ -710,17 +674,41 @@ public class AggregatorPomsHelper {
}
// all jobs pom
List<String> modules = new ArrayList<>();
IFilterService filterService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IFilterService.class)) {
filterService = (IFilterService) GlobalServiceRegister.getDefault().getService(IFilterService.class);
}
List<Property> serviceRefJobs = getAllServiceReferencedJobs();
for (Item item : allItems) {
if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
monitor.subTask("Synchronize job pom: " + item.getProperty().getLabel() //$NON-NLS-1$
+ "_" + item.getProperty().getVersion()); //$NON-NLS-1$
runProcessService.generatePom(item, TalendProcessOptionConstants.GENERATE_POM_NO_FILTER);
IFile pomFile = getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
// filter esb data service node
// FIXME use serviceRefJobs.contains(item.getProperty()) if isSOAPServiceProvider() doesn't work.
if (isCIMode && !isSOAPServiceProvider(item.getProperty()) && pomFile.exists()) {
modules.add(getModulePath(pomFile));
List<ERepositoryObjectType> allJobletTypes = ERepositoryObjectType.getAllTypesOfJoblet();
for (IRepositoryViewObject object : objects) {
if (filterService != null) {
if (isCIMode && !allJobletTypes.contains(object.getRepositoryObjectType())
&& !filterService.isFilterAccepted(object.getProperty().getItem(), pomFilter)) {
continue;
}
}
if (object.getProperty() != null && object.getProperty().getItem() != null) {
if (isCIMode && object.isDeleted() && PomIdsHelper.getIfExcludeDeletedItems()) {
continue;
}
Item item = object.getProperty().getItem();
if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
monitor.subTask("Synchronize job pom: " + item.getProperty().getLabel() //$NON-NLS-1$
+ "_" + item.getProperty().getVersion()); //$NON-NLS-1$
if (runProcessService != null) {
// already filtered
runProcessService.generatePom(item, TalendProcessOptionConstants.GENERATE_POM_NO_FILTER);
} else {
ExceptionHandler.log("Cannot generate pom for " + object.getLabel()
+ " - Reason: RunProcessService is null.");
}
IFile pomFile = getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
// TODO if not work, use serviceRefJobs.contains(object.getProperty()) to judge
// filter esb data service node
if (isCIMode && !isSOAPServiceProvider(object.getProperty()) && pomFile.exists()) {
modules.add(getModulePath(pomFile));
}
}
}
monitor.worked(1);

View File

@@ -300,111 +300,6 @@ public class PomIdsHelper {
return filter;
}
private static String getPublishCloudVersion(String latestVersion) {
if (null == latestVersion) {
return "0.1.0";
} else {
int i = latestVersion.lastIndexOf('.') + 1;
return latestVersion.substring(0, i) + (Long.parseLong(latestVersion.substring(i)) + 1);
}
}
/**
* @return "<bundleVersion>".
*/
public static String getNotIteratedBundleVersion(Property property, String bundleVersion) {
String version = null;
if (property != null) {
boolean useSnapshot = false;
if (property.getAdditionalProperties() != null) {
version = (String) property.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = bundleVersion;
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
return version;
}
/**
* @return "<featureVersion>".
*/
public static String getNotIteratedFeatureVersion(Property property, String featureVersion) {
String version = null;
if (property != null) {
boolean useSnapshot = false;
if (property.getAdditionalProperties() != null) {
version = (String) property.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = featureVersion;
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
return version;
}
/**
* @return "<bundleVersion>".
*/
public static String getBundleVersion(Property property, String bundleVersion) {
String version = null;
if (property != null) {
boolean useSnapshot = false;
if (property.getAdditionalProperties() != null) {
version = (String) property.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = getPublishCloudVersion(bundleVersion);
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
return version;
}
/**
* @return "<featureVersion>".
*/
public static String getFeatureVersion(Property property, String featureVersion) {
String version = null;
if (property != null) {
boolean useSnapshot = false;
if (property.getAdditionalProperties() != null) {
version = (String) property.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = getPublishCloudVersion(featureVersion);
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
return version;
}
public static boolean useProfileModule() {
String useProfileModule = System.getProperty("talend.profile.module");
if (useProfileModule != null) {
@@ -531,4 +426,4 @@ public class PomIdsHelper {
return preferenceManagers.get(projectTechName);
}
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-3.0.3.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="class"/>

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-backward-codecs-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-8.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-8.3.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>

View File

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

View File

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

View File

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

View File

@@ -135,8 +135,6 @@ public class FastDateParser {
calendar.clear();
calendar.set(year, month, day);
return calendar.getTime();
} catch (NumberFormatException numberFormatException){
throw new RuntimeException("Unparseable date: \"" + source + "\""); //$NON-NLS-1$ //$NON-NLS-2$
} catch (Exception e) {
pos.setErrorIndex(index);
e.printStackTrace();

View File

@@ -193,15 +193,11 @@ public class ResumeUtil {
}
}
}
public void flush() {
if (csvWriter == null) {
return;
}
synchronized (csvWriter) {
csvWriter.flush(true);
}
if(csvWriter != null) {
csvWriter.flush(true);
}
}
// Util: invoke target check point

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -162,10 +162,6 @@ public class ExtendedNodeConnectionContextUtils {
DataBricksClusterId,
DataBricksToken,
DataBricksDBFSDepFolder,
DataBricksClusterType,
DataBricksRuntimeVersion,
DataBricksDriverNodeType,
DataBricksNodeType,
//Knox
SparkMode,
@@ -174,7 +170,6 @@ public class ExtendedNodeConnectionContextUtils {
KnoxUsername,
KnoxPassword,
KnoxDirectory,
KnoxTimeout,
//Cde
CdeApiEndPoint,

View File

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

View File

@@ -12,25 +12,46 @@
// ============================================================================
package org.talend.metadata.managment.ui.utils;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.DatabaseConnStrUtil;
import org.talend.core.hadoop.IHadoopClusterService;
import org.talend.core.hadoop.repository.HadoopRepositoryUtil;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.FileConnection;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.metadata.managment.ui.convert.strategy.SwitchContextWithReplace;
import org.talend.metadata.managment.ui.convert.strategy.SwitchContextWithTaggedValue;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.cwm.helper.CatalogHelper;
import org.talend.cwm.helper.ConnectionHelper;
import org.talend.cwm.helper.SchemaHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
import orgomg.cwm.resource.relational.Catalog;
import orgomg.cwm.resource.relational.Schema;
/**
* this class is used when switching context group name.
*/
public class SwitchContextGroupNameImpl implements ISwitchContext {
private static SwitchContextGroupNameImpl instance;
private static Logger log = Logger.getLogger(SwitchContextGroupNameImpl.class);
// default strategy is replace
private ISwitchContext strategy = new SwitchContextWithReplace();
private static SwitchContextGroupNameImpl instance;
private SwitchContextGroupNameImpl() {
}
@@ -47,22 +68,6 @@ public class SwitchContextGroupNameImpl implements ISwitchContext {
return instance;
}
public boolean switchStrategy(ConnectionItem connItem) {
if (connItem == null || !(connItem instanceof DatabaseConnectionItem)) {
return false;
}
DatabaseConnection dbCon = (DatabaseConnection) connItem.getConnection();
String databaseType = dbCon.getDatabaseType();
if (EDatabaseTypeName.GENERAL_JDBC.getXMLType().equals(databaseType)) {
strategy = new SwitchContextWithTaggedValue();
} else {
strategy = new SwitchContextWithReplace();
}
return true;
}
/*
* (non-Javadoc)
*
@@ -71,10 +76,7 @@ public class SwitchContextGroupNameImpl implements ISwitchContext {
*/
@Override
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext) {
if (connItem == null || connItem.getConnection() == null) {
return false;
}
return updateContextGroup(connItem, selectedContext, connItem.getConnection().getContextName());
return updateContextGroup(connItem, selectedContext, null);
}
/*
@@ -83,15 +85,187 @@ public class SwitchContextGroupNameImpl implements ISwitchContext {
* @see org.talend.core.model.metadata.builder.database.ISwitchContext#updateContextGroup(org.talend.core.model.
* properties .ContextItem, org.talend.core.model.metadata.builder.connection.Connection)
*/
@Override
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext, String originalContext,
boolean... isMigrationTask) {
switchStrategy(connItem);
return strategy.updateContextGroup(connItem, selectedContext, originalContext, isMigrationTask);
public boolean updateContextGroup(ConnectionItem connItem, String selectedContext, String originalContext) {
if (connItem == null) {
return false;
}
Connection con = connItem.getConnection();
// MOD msjian 2012-2-13 TDQ-4559: make it support file/mdm connection
if (con != null) {
// TDQ-4559~
String oldContextName = originalContext == null ? con.getContextName() : originalContext;
String newContextName = selectedContext;
if (newContextName == null) {
ContextType newContextType =
ConnectionContextHelper.getContextTypeForContextMode(con, selectedContext, false);
newContextName = newContextType == null ? null : newContextType.getName();
}
if (!isContextIsValid(newContextName, oldContextName, connItem) && hasDependency(connItem)) {
// can not update connection when context is invalid(catalog or schema is null) and has dependecy
return false;
}
con.setContextName(newContextName);
if (con instanceof DatabaseConnection) {
DatabaseConnection dbConn = (DatabaseConnection) connItem.getConnection();
String newURL = getChangedURL(dbConn, newContextName);
dbConn.setURL(newURL);
// do nothing when schema or catalog is null
updateConnectionForSidOrUiSchema(dbConn, oldContextName);
}
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
factory.save(connItem);
} catch (PersistenceException e) {
log.error(e, e);
}
return true;
}
return false;
}
private boolean hasDependency(ConnectionItem connItem) {
// Added TDQ-18565
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepService =
GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
if (tdqRepService.hasClientDependences(connItem)) {
return true;
}
}
return false;
}
/**
* DOC talend Comment method "checkContextIsValid".
*
* @param selectedContext
* @paramconn
*/
private boolean isContextIsValid(String selectedContext, String oldContextName, ConnectionItem connItem) {
boolean retCode = false;
Connection conn = connItem.getConnection();
if (conn instanceof DatabaseConnection) {
EDatabaseTypeName dbType = EDatabaseTypeName.getTypeFromDbType(((DatabaseConnection) conn).getDatabaseType());
if (dbType == EDatabaseTypeName.GODBC) {// for ODBC
retCode = true;
} else if (dbType == EDatabaseTypeName.GENERAL_JDBC) {
retCode = true;
} else {
DatabaseConnection dbConn = (DatabaseConnection) conn;
boolean hasCatalog = ConnectionHelper.hasCatalog(dbConn);
boolean hasSchema = ConnectionHelper.hasSchema(dbConn);
ContextType newContextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn,
selectedContext, false);
ContextType oldContextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn,
oldContextName, false);
String newSidOrDatabase = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getSID());
String newUiShema = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getUiSchema());
String oldSidOrDatabase = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getSID());
String oldUiShema = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getUiSchema());
if (hasCatalog) {// for example mysql
retCode = checkEmpty(newSidOrDatabase, oldSidOrDatabase);
if (hasSchema) {// for example mssql
retCode &= checkEmpty(newUiShema, oldUiShema);
}
} else if (hasSchema) {// for example oracle
retCode = checkEmpty(newUiShema, oldUiShema);
}else {//some db didnot have catelog and schema
retCode = true;
}
}
} else if (conn instanceof FileConnection) {
retCode = true;
}
return retCode;
}
private boolean checkEmpty(String newSidOrDatabase, String oldSidOrDatabase) {
if (isEmptyString(oldSidOrDatabase) && isEmptyString(newSidOrDatabase)) {
return true;
}
return !isEmptyString(oldSidOrDatabase) && !isEmptyString(newSidOrDatabase);
}
/**
*
* change context Group need to synchronization name of catalog or schema
*
* @param dbConn
* @param oldContextName
*/
private void updateConnectionForSidOrUiSchema(DatabaseConnection dbConn, String oldContextName) {
String selectedContext = dbConn.getContextName();
ContextType newContextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn, selectedContext, false);
ContextType oldContextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn, oldContextName, false);
String newSidOrDatabase = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getSID());
String newUiShema = ConnectionContextHelper.getOriginalValue(newContextType, dbConn.getUiSchema());
String oldSidOrDatabase = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getSID());
String oldUiShema = ConnectionContextHelper.getOriginalValue(oldContextType, dbConn.getUiSchema());
if (!isEmptyString(newSidOrDatabase) && !isEmptyString(oldSidOrDatabase)) {// for example mysql or mssql
Catalog catalog = CatalogHelper.getCatalog(dbConn, oldSidOrDatabase);
if (catalog != null) {
catalog.setName(newSidOrDatabase);
Schema schema = SchemaHelper.getSchemaByName(CatalogHelper.getSchemas(catalog), oldUiShema);// for
// example
// mssql
if (schema != null) {
schema.setName(newUiShema);
}
}
}
if (!isEmptyString(newUiShema) && !isEmptyString(oldUiShema)) {// for example oracle
Schema schema = SchemaHelper.getSchema(dbConn, oldUiShema);
if (schema != null) {
schema.setName(newUiShema);
}
}
}
/**
*
* check whether str is null or length is zero
*
* @param str
* @return
*/
private boolean isEmptyString(final String str) {
return str == null || str.length() == 0;
}
/**
* change the URL according to selected context Added yyin 20120918 TDQ-5668
*
* @param connItem
* @param con
* @param selectedContext
*/
private String getChangedURL(DatabaseConnection dbConn, String selectedContext) {
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(dbConn, selectedContext, false);
String url = dbConn.getURL();
if(url != null){
return url;
}
String server = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getServerName());
String username = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getUsername());
String password = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getRawPassword());
String port = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getPort());
String sidOrDatabase = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getSID());
String datasource = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getDatasourceName());
String filePath = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getFileFieldName());
String dbRootPath = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getDBRootPath());
String additionParam = ConnectionContextHelper.getOriginalValue(contextType, dbConn.getAdditionalParams());
return DatabaseConnStrUtil.getURLString(dbConn.getDatabaseType(), dbConn.getDbVersionString(), server, username,
password, port, sidOrDatabase, filePath.toLowerCase(), datasource, dbRootPath, additionParam);
}
/*
* (non-Javadoc)
@@ -101,6 +275,49 @@ public class SwitchContextGroupNameImpl implements ISwitchContext {
*/
@Override
public boolean updateContextForConnectionItems(Map<String, String> contextGroupRanamedMap, ContextItem contextItem) {
return strategy.updateContextForConnectionItems(contextGroupRanamedMap, contextItem);
if (contextItem == null) {
return false;
}
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
List<IRepositoryViewObject> allConnectionItem = factory.getAll(ProjectManager.getInstance().getCurrentProject(),
ERepositoryObjectType.METADATA_CONNECTIONS);
for (IRepositoryViewObject connectionItem : allConnectionItem) {
Item item = connectionItem.getProperty().getItem();
if (item instanceof ConnectionItem && ConnectionContextHelper.checkContextMode((ConnectionItem) item) != null) {
Connection con = ((ConnectionItem) item).getConnection();
String contextId = con.getContextId();
if (contextId != null && contextId.equals(contextItem.getProperty().getId())) {
String oldContextGroup = con.getContextName();
boolean modified = false;
if (oldContextGroup != null && !"".equals(oldContextGroup)) { //$NON-NLS-1$
String newContextGroup = contextGroupRanamedMap.get(oldContextGroup);
if (newContextGroup != null) { // rename
con.setContextName(newContextGroup);
modified = true;
}
} else { // if not set, set default group
ContextItem originalItem = ContextUtils.getContextItemById2(contextId);
con.setContextName(originalItem.getDefaultContext());
modified = true;
}
if (modified) {
factory.save(item);
}
}
}
}
IHadoopClusterService hadoopClusterService = HadoopRepositoryUtil.getHadoopClusterService();
if (hadoopClusterService != null) {
hadoopClusterService.updateConfJarsByContextGroup(contextItem, contextGroupRanamedMap);
}
return true;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
return false;
}
}

View File

@@ -23,7 +23,6 @@ Export-Package: metadata.managment.i18n,
org.talend.core.model.metadata.builder.database,
org.talend.core.model.metadata.builder.database.dburl,
org.talend.core.model.metadata.builder.database.extractots,
org.talend.core.model.metadata.builder.database.jdbc,
org.talend.core.model.metadata.builder.database.manager,
org.talend.core.model.metadata.builder.database.manager.dbs,
org.talend.metadata.managment,
@@ -34,7 +33,6 @@ Export-Package: metadata.managment.i18n,
org.talend.metadata.managment.mdm,
org.talend.metadata.managment.model,
org.talend.metadata.managment.repository,
org.talend.metadata.managment.ui.convert,
org.talend.metadata.managment.utils
Bundle-ClassPath: .
Bundle-Vendor: .Talend SA.

View File

@@ -86,14 +86,6 @@
name="ojdbc6.jar"
required="true">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.libraries.jdbc.oracle"
language="java"
message="Needed for Oracle jdbc plugin National Language Support (NLS)."
mvn_uri="mvn:com.oracle.database.nls/orai18n/19.3.0.0/jar"
name="orai18n-19.3.0.0.jar"
required="true">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.libraries.jdbc.as400"
language="java"
@@ -112,8 +104,8 @@
context="PostgresPlus wizard"
language="java"
message="wizard for PostgresPlus"
mvn_uri="mvn:org.postgresql/postgresql/42.2.26"
name="postgresql-42.2.26.jar"
mvn_uri="mvn:org.postgresql/postgresql/42.2.25"
name="postgresql-42.2.25.jar"
required="true">
</libraryNeeded>
<libraryNeeded

View File

@@ -160,7 +160,7 @@ JavaFunctionParser.checkMethod=\u30EB\u30FC\u30C1\u30F3: "{0}.{1}"\u89E3\u6790\u
JavaGlobalVariableProposal.Description=\u8AAC\u660E: {0}
JavaGlobalVariableProposal.VariableName=\n\n\u5909\u6570\u540D: {1}
JavaSimpleDateFormatProposalProvider.displaySingleQuote= ' : \u4E00\u91CD\u5F15\u7528\u7B26\u3092\u8868\u793A
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3067\uFF11\u3064\u306E\u4E00\u91CD\u5F15\u7528\u7B26\u3092\u793A\u3057\u307E\u3059\u3002
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\uFF12\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3067\uFF11\u3064\u306E\u30B7\u30F3\u30B0\u30EB\u30AF\u30A9\u30FC\u30C8\u3092\u793A\u3057\u307E\u3059\u3002
JavaSqlFactory.NoClassName=\u30AF\u30E9\u30B9\u540D\u304C\u306A\u304F\u3001\u30C9\u30E9\u30A4\u30D0\u304C\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093
JavaTypesManager.bigDecimal=BIGDECIMAL\u306F\u6570\u5024\u3067\u3059:
JavaTypesManager.integer=INTEGER\u306F\u6570\u5024\u3067\u3059:

View File

@@ -291,7 +291,6 @@ public class ExtractMetaDataFromDataBase {
* DOC cantoine. Method to test DataBaseConnection.
*
* @param dbVersionString
* @param supportNLS
*
* @param String driverClass
* @param String urlString pwd
@@ -300,14 +299,14 @@ public class ExtractMetaDataFromDataBase {
* @return ConnectionStatus : the result of connection(boolean Result, String messageException)
*/
public static ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema,
final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam, boolean supportNLS) {
final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam) {
return testConnection(dbType, url, username, pwd, schema, driverClassName, driverJarPath, dbVersionString,
additionalParam, supportNLS, null, null);
additionalParam, null, null);
}
public static ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema,
final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam,
boolean supportNLS, StringBuffer retProposedSchema, String sidOrDatabase) {
StringBuffer retProposedSchema, String sidOrDatabase) {
Connection connection = null;
ConnectionStatus connectionStatus = new ConnectionStatus();
connectionStatus.setResult(false);
@@ -316,7 +315,7 @@ public class ExtractMetaDataFromDataBase {
List list = new ArrayList();
list = ExtractMetaDataUtils.getInstance().connect(dbType, url, username, pwd, driverClassName, driverJarPath,
dbVersionString, additionalParam, supportNLS);
dbVersionString, additionalParam);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i) instanceof Connection) {
@@ -499,7 +498,7 @@ public class ExtractMetaDataFromDataBase {
List list = metaData.getConnection(iMetadataConnection.getDbType(), url, iMetadataConnection.getUsername(),
iMetadataConnection.getPassword(), iMetadataConnection.getDatabase(), iMetadataConnection.getSchema(),
iMetadataConnection.getDriverClass(), iMetadataConnection.getDriverJarPath(),
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams(), iMetadataConnection.isSupportNLS());
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams());
Connection conn = null;
DriverShim wapperDriver = null;
@@ -583,7 +582,7 @@ public class ExtractMetaDataFromDataBase {
List list = extractMeta.getConnection(iMetadataConnection.getDbType(), iMetadataConnection.getUrl(),
iMetadataConnection.getUsername(), iMetadataConnection.getPassword(), iMetadataConnection.getDatabase(),
iMetadataConnection.getSchema(), iMetadataConnection.getDriverClass(), iMetadataConnection.getDriverJarPath(),
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams(), iMetadataConnection.isSupportNLS());
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams());
DriverShim wapperDriver = null;
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {

View File

@@ -121,8 +121,6 @@ public class ExtractMetaDataUtils {
private String[] ORACLE_SSL_JARS = new String[] { "oraclepki-12.2.0.1.jar", "osdt_cert-12.2.0.1.jar", //$NON-NLS-1$//$NON-NLS-2$
"osdt_core-12.2.0.1.jar" }; //$NON-NLS-1$
private String ORACLE_NLS_JARS = "orai18n-19.3.0.0.jar";
public static final String SNOWFLAKE = "Snowflake"; //$NON-NLS-1$
@@ -831,11 +829,6 @@ public class ExtractMetaDataUtils {
*/
public List getConnection(String dbType, String url, String username, String pwd, String dataBase, String schemaBase,
final String driverClassName, final String driverJarPath, String dbVersion, String additionalParams) {
return getConnection(dbType, url, username, pwd, dataBase, schemaBase, driverClassName, driverJarPath, dbVersion, additionalParams, false);
}
public List getConnection(String dbType, String url, String username, String pwd, String dataBase, String schemaBase,
final String driverClassName, final String driverJarPath, String dbVersion, String additionalParams, boolean supportNLS) {
boolean isColsed = false;
List conList = new ArrayList();
try {
@@ -853,7 +846,7 @@ public class ExtractMetaDataUtils {
closeConnection(true); // colse before connection.
checkDBConnectionTimeout();
list = connect(dbType, url, username, pwd, driverClassName, driverJarPath, dbVersion, additionalParams, supportNLS);
list = connect(dbType, url, username, pwd, driverClassName, driverJarPath, dbVersion, additionalParams);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i) instanceof Connection) {
@@ -945,7 +938,7 @@ public class ExtractMetaDataUtils {
* @throws Exception
*/
public List connect(String dbType, String url, String username, String pwd, final String driverClassNameArg,
final String driverJarPathArg, String dbVersion, String additionalParams, boolean supportNLS) throws Exception {
final String driverJarPathArg, String dbVersion, String additionalParams) throws Exception {
Connection connection = null;
DriverShim wapperDriver = null;
List conList = new ArrayList();
@@ -960,18 +953,11 @@ public class ExtractMetaDataUtils {
if ((driverJarPathArg == null || driverJarPathArg.equals(""))) { //$NON-NLS-1$
List<String> driverNames = EDatabaseVersion4Drivers.getDrivers(dbType, dbVersion);
if (driverNames != null) {
if(EDatabaseTypeName.ORACLEFORSID.getProduct().equals(EDatabaseTypeName.getTypeFromDbType(dbType).getProduct())) {
if(supportNLS){
driverNames.add(ORACLE_NLS_JARS);
}
}
if (EDatabaseTypeName.ORACLE_CUSTOM.getDisplayName().equals(dbType)
&& StringUtils.isNotEmpty(additionalParams)) {
if (additionalParams.contains(SSLPreferenceConstants.TRUSTSTORE_TYPE)) {
driverNames.addAll(Arrays.asList(ORACLE_SSL_JARS));
}
} else if (SNOWFLAKE.equals(dbType)) { // $NON-NLS-1$
// TDQ-17294 msjian Support of Snowflake for DQ Datamart
driverNames.add(SNOWFLAKE_DRIVER_JAR);
@@ -1295,7 +1281,7 @@ public class ExtractMetaDataUtils {
List list = getConnection(metadataConnection.getDbType(), metadataConnection.getUrl(), metadataConnection.getUsername(),
metadataConnection.getPassword(), metadataConnection.getDatabase(), metadataConnection.getSchema(),
metadataConnection.getDriverClass(), metadataConnection.getDriverJarPath(),
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams());
return list;
}

View File

@@ -17,7 +17,6 @@ import java.nio.charset.Charset;
import java.security.Provider;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -209,20 +208,10 @@ public class JDBCDriverLoader {
}
connection = wapperDriver.connect(url, info);
}
try {
ResultSet schemas = connection.getMetaData().getSchemas();
if(schemas.next()) {
schemas.getString(1);
}
} catch (Exception e) {
}
// }
// DriverManager.deregisterDriver(wapperDriver);
// bug 9162
list.add(connection);
list.add(wapperDriver);
return list;
} catch (Throwable e) {

View File

@@ -1,122 +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.metadata.builder.database.jdbc;
import java.util.ArrayList;
import java.util.List;
import org.talend.core.database.conn.DatabaseConnStrUtil;
public abstract class AbstractUrlDbNameExtractor implements IUrlDbNameExtractor {
private String url;
private String driverName;
private String version;
private String sid;
private String uiSchema;
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public void setUrl(String url) {
this.url = url;
}
@Override
public String getUrl() {
return url;
}
public String getSid() {
return sid;
}
public void setSid(String sid) {
this.sid = sid;
}
public String getUiSchema() {
return uiSchema;
}
public void setUiSchema(String uiSchema) {
this.uiSchema = uiSchema;
}
/**
* Sets the driverName.
*
* @param driverName the driverName to set
*/
public void setDriverName(String driverName) {
this.driverName = driverName;
}
/**
* Getter for driverName.
*
* @return the driverName
*/
public String getDriverName() {
return driverName;
}
@Override
public void initUiSchemaOrSID() {
String[] analyseURL = DatabaseConnStrUtil.analyseURL(getCurrentDbType(), getDbVersion(), url);
if (analyseURL == null) {
return;
}
analyseResult(analyseURL);
}
protected abstract void analyseResult(String[] analyseURL);
@Override
public List<String> getExtractResult() {
List<String> result = new ArrayList<>();
result.add(sid);
result.add(uiSchema);
return result;
}
@Override
public boolean hasCatalog() {
return false;
}
@Override
public boolean hasSchema() {
return false;
}
@Override
public boolean hasBothSturctor() {
return hasCatalog() && hasSchema();
}
protected abstract String getDbVersion();
protected abstract String getCurrentDbType();
}

View File

@@ -1,65 +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.metadata.builder.database.jdbc;
import org.talend.core.database.EDatabaseTypeName;
public enum EDBTypeProductNameMapping {
/**
* mappingID reference from the id attribute of mapping file on the org.talend.core
* ProductName.toUppercase reference EDatabaseTypeName.project and produce of mapping file
*/
// Mysql(EDatabaseTypeName.MYSQL, "Mysql", "mysql_id"),
Snowflake(EDatabaseTypeName.SNOWFLAKE, "Snowflake", "snowflake_id");
EDatabaseTypeName type;
String productName;
String mappingID;
EDBTypeProductNameMapping(EDatabaseTypeName type, String productName, String mappingID) {
this.type = type;
this.productName = productName;
this.mappingID = mappingID;
}
public static EDBTypeProductNameMapping findTypeByProductName(String productName) {
if (productName == null) {
return null;
}
for (EDBTypeProductNameMapping type : EDBTypeProductNameMapping.values()) {
if (type.productName.equalsIgnoreCase(productName)) {
return type;
}
}
return null;
}
public static EDBTypeProductNameMapping findTypeByMappingID(String mappingID) {
if (mappingID == null) {
return null;
}
for (EDBTypeProductNameMapping type : EDBTypeProductNameMapping.values()) {
if (type.mappingID.equalsIgnoreCase(mappingID)) {
return type;
}
}
return null;
}
}

View File

@@ -1,236 +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.metadata.builder.database.jdbc;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import org.apache.commons.lang.StringUtils;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.model.metadata.builder.ConvertionHelper;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.cwm.helper.TaggedValueHelper;
public class ExtractorFactory {
/*
* when run the tDqReportRun, save the job's context information(selected in the job's Run tab)
*/
private static java.util.Properties STANDALONE_JOB_CONTEXT_PROPERTIES = new java.util.Properties();
public static java.util.Properties getSTANDALONE_JOB_CONTEXT_PROPERTIES() {
return STANDALONE_JOB_CONTEXT_PROPERTIES;
}
public static void setSTANDALONE_JOB_CONTEXT_PROPERTIES(java.util.Properties sTANDALONE_JOB_CONTEXT_PROPERTIES) {
STANDALONE_JOB_CONTEXT_PROPERTIES = sTANDALONE_JOB_CONTEXT_PROPERTIES;
}
public static String getJdbcUrl(java.util.Properties props) {
if (props != null) {
for (Object key : props.keySet()) {
if (key != null && String.valueOf(key).toLowerCase().endsWith("_jdbcurl")) { //$NON-NLS-1$
return String.valueOf(props.get(key));
}
}
}
return null;
}
public static final String DEFAULT = "Default"; //$NON-NLS-1$
public static String getCatalogFromJobContext(DatabaseConnection dbConn) {
return getCatalogSchemaFromJobContext(dbConn, 0);
}
public static String getSchemaFromJobContext(DatabaseConnection dbConn) {
return getCatalogSchemaFromJobContext(dbConn, 1);
}
/**
* @param index: 0-catalog, 1-schema
*/
private static String getCatalogSchemaFromJobContext(DatabaseConnection dbConn, int index) {
IUrlDbNameExtractor extractorInstance =
getExtractorInstance(dbConn, DEFAULT, DEFAULT);
if (extractorInstance != null) {
String jdbcUrl = ExtractorFactory.getJdbcUrl(getSTANDALONE_JOB_CONTEXT_PROPERTIES());
if (!StringUtils.isBlank(jdbcUrl)) {
extractorInstance.setUrl(jdbcUrl);
}
extractorInstance.initUiSchemaOrSID();
return extractorInstance.getExtractResult().get(index);
}
return null;
}
public static IUrlDbNameExtractor getExtractorInstance(DatabaseMetaData dbMetadata,
IMetadataConnection metadataConnection) {
if (dbMetadata == null) {
return null;
}
if (!checkIsGenericJDBCType(metadataConnection)) {
return null;
}
IUrlDbNameExtractor theExtractor = null;
String databaseProductName = null;
try {
databaseProductName = dbMetadata.getDatabaseProductName();
theExtractor = createExtractorByDP(databaseProductName);
initExtractor(theExtractor, dbMetadata, metadataConnection);
return theExtractor;
} catch (SQLException e) {
}
return null;
}
public static IUrlDbNameExtractor getExtractorInstance(ConnectionItem connItem, String selectedContext,
String originalContext) {
if (connItem == null) {
return null;
}
DatabaseConnection dbConn=null;
if(connItem instanceof DatabaseConnectionItem) {
dbConn=(DatabaseConnection)connItem.getConnection();
}
return getExtractorInstance(dbConn, selectedContext, originalContext);
}
public static IUrlDbNameExtractor getExtractorInstance(DatabaseConnection dbconn, String selectedContext,
String originalContext) {
if (dbconn == null) {
return null;
}
if (!checkIsGenericJDBCType(dbconn)) {
return null;
}
IUrlDbNameExtractor theExtractor = null;
String databaseProductName = TaggedValueHelper.getValueString(TaggedValueHelper.DB_PRODUCT_NAME, dbconn);
theExtractor = createExtractorByDP(databaseProductName);
IMetadataConnection metadataConnection = ConvertionHelper.convert(dbconn, false, selectedContext);
initExtractor(theExtractor, metadataConnection);
return theExtractor;
}
private static boolean checkIsGenericJDBCType(DatabaseConnection dbConn) {
if (dbConn == null) {
return false;
}
return EDatabaseTypeName.GENERAL_JDBC.getXMLType().equals(dbConn.getDatabaseType());
}
private static boolean checkIsGenericJDBCType(IMetadataConnection metadataConnection) {
if (metadataConnection == null) {
return false;
}
return EDatabaseTypeName.GENERAL_JDBC.getXMLType().equals(metadataConnection.getDbType());
}
protected static void initExtractor(IUrlDbNameExtractor theExtractor, DatabaseMetaData dbMetadata,
IMetadataConnection metadataConnection) {
if (theExtractor != null) {
initURL(theExtractor, dbMetadata, metadataConnection);
initDriverName(theExtractor, dbMetadata, metadataConnection);
initVersion(theExtractor, dbMetadata, metadataConnection);
}
}
protected static void initExtractor(IUrlDbNameExtractor theExtractor, IMetadataConnection metadataConnection) {
if (theExtractor != null) {
theExtractor.setUrl(metadataConnection.getUrl());
theExtractor.setDriverName(metadataConnection.getDriverJarPath());
theExtractor.setVersion(metadataConnection.getDbVersionString());
}
}
private static void initVersion(IUrlDbNameExtractor theExtractor, DatabaseMetaData dbMetadata,
IMetadataConnection metadataConnection) {
try {
theExtractor.setVersion(dbMetadata.getDatabaseProductVersion());
} catch (SQLException e) {
}
if (metadataConnection != null && theExtractor.getVersion() == null) {
theExtractor.setVersion(metadataConnection.getDbVersionString());
}
}
private static void initDriverName(IUrlDbNameExtractor theExtractor, DatabaseMetaData dbMetadata,
IMetadataConnection metadataConnection) {
try {
theExtractor.setDriverName(dbMetadata.getDriverName());
} catch (SQLException e) {
}
if (metadataConnection != null
&& (theExtractor.getDriverName() == null || !theExtractor.getDriverName().contains(".jar"))) {
theExtractor.setDriverName(metadataConnection.getDriverJarPath());
}
}
protected static void initURL(IUrlDbNameExtractor theExtractor, DatabaseMetaData dbMetadata,
IMetadataConnection metadataConnection) {
try {
theExtractor.setUrl(dbMetadata.getURL());
} catch (SQLException e) {
}
if (metadataConnection != null
&& (theExtractor.getUrl() == null || metadataConnection.getUrl().contains(theExtractor.getUrl()))) {
theExtractor.setUrl(metadataConnection.getUrl());
}
}
private static IUrlDbNameExtractor createExtractorByDP(String databaseProductName) {
if (databaseProductName == null) {
return null;
}
EDBTypeProductNameMapping dbType = EDBTypeProductNameMapping.findTypeByProductName(databaseProductName);
return createExtractor(dbType);
}
private static IUrlDbNameExtractor createExtractor(EDBTypeProductNameMapping dbType) {
if (dbType == null) {
return null;
}
switch (dbType) {
// case Mysql:
// return new MysqlExtractor();
case Snowflake:
return new SnowflakeExtractor();
}
return null;
}
public static boolean isSupportDB(EDBTypeProductNameMapping dbType) {
return createExtractor(dbType) != null;
}
private static IUrlDbNameExtractor createExtractorByMappingID(IMetadataConnection metadataConnection) {
if (metadataConnection == null) {
return null;
}
String mappingID = metadataConnection.getMapping();
if (mappingID == null) {
return null;
}
EDBTypeProductNameMapping dbType = EDBTypeProductNameMapping.findTypeByMappingID(mappingID);
return createExtractor(dbType);
}
}

View File

@@ -1,45 +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.metadata.builder.database.jdbc;
import java.util.List;
public interface IUrlDbNameExtractor {
void setUrl(String url);
String getUrl();
void initUiSchemaOrSID();
void setDriverName(String driverName);
String getDriverName();
void setVersion(String version);
String getVersion();
/**
* Return the result of url extract
* 0 is sid null mean that can not found it
* 1 is uiSchema null mean that can not found it
*/
List<String> getExtractResult();
boolean hasCatalog();
boolean hasSchema();
boolean hasBothSturctor();
}

View File

@@ -1,41 +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.metadata.builder.database.jdbc;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
public class MysqlExtractor extends AbstractUrlDbNameExtractor {
@Override
protected String getDbVersion() {
return EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.MYSQL, getDriverName());
}
@Override
protected String getCurrentDbType() {
return EDatabaseTypeName.MYSQL.getDisplayName();
}
@Override
protected void analyseResult(String[] analyseURL) {
// need to be implement later
}
@Override
public boolean hasCatalog() {
return true;
}
}

View File

@@ -1,71 +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.metadata.builder.database.jdbc;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.DatabaseConnConstants;
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
public class SnowflakeExtractor extends AbstractUrlDbNameExtractor {
@Override
protected String getDbVersion() {
if (this.getVersion() != null) {
return this.getVersion();
}
return EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.SNOWFLAKE, getDriverName());
}
@Override
protected String getCurrentDbType() {
return EDatabaseTypeName.SNOWFLAKE.getDisplayName();
}
@Override
protected void analyseResult(String[] analyseURL) {
if (analyseURL.length >= 5) {
String line = analyseURL[3];
String patternSid = "(.*)db=" + DatabaseConnConstants.PATTERN_SID + "(.*)";
String patternUiSchema = "(.*)schema=" + DatabaseConnConstants.PATTERN_SID + "(.*)";
// create Pattern
Pattern sidResult = Pattern.compile(patternSid);
Pattern uischemaResult = Pattern.compile(patternUiSchema);
// create matcher
Matcher mSid = sidResult.matcher(line);
Matcher mUiSchema = uischemaResult.matcher(line);
if (mSid.find()) {
this.setSid(mSid.group(2));
}
if (mUiSchema.find()) {
// set ui schema
this.setUiSchema(mUiSchema.group(2));
}
}
}
@Override
public boolean hasCatalog() {
return true;
}
@Override
public boolean hasSchema() {
return true;
}
}

View File

@@ -470,7 +470,7 @@ public class ExtractManager {
metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(),
metadataConnection.getSchema(), metadataConnection.getDriverClass(),
metadataConnection.getDriverJarPath(), metadataConnection.getDbVersionString(),
metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
metadataConnection.getAdditionalParams());
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i) instanceof Driver) {
@@ -574,7 +574,7 @@ public class ExtractManager {
metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(),
metadataConnection.getSchema(), metadataConnection.getDriverClass(),
metadataConnection.getDriverJarPath(), metadataConnection.getDbVersionString(),
metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
metadataConnection.getAdditionalParams());
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i) instanceof DriverShim) {
@@ -1064,7 +1064,7 @@ public class ExtractManager {
List connList = extractMeta.getConnection(metadataConnection.getDbType(), metadataConnection.getUrl(),
metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(),
metadataConnection.getSchema(), metadataConnection.getDriverClass(), metadataConnection.getDriverJarPath(),
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams());
try {
if (!tableInfoParameters.isUsedName()) {
if (tableInfoParameters.getSqlFiter() != null && !"".equals(tableInfoParameters.getSqlFiter())) { //$NON-NLS-1$

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