Compare commits

..

5 Commits

Author SHA1 Message Date
Zhiwei Xue
fae1ce455c feat(TUP-36683):Selective generateAllPoms (#5772)
* feat(TUP-36683):Selective generateAllPoms (#5753)

* feat(TUP-36683):Selective generateAllPoms (#5676)
2022-11-04 17:19:48 +08:00
sbliu
bbc391c7ab fix(TUP-36726) change tooltip message (#5729) 2022-10-21 11:11:34 +08:00
sbieliaievl
bbc7dffd22 fix(APPINT-34581) - fixed versions 2022-10-18 14:00:31 +02:00
Liu Xinquan
39f3b4d0f6 fix(TDQ-20751) tDqReportRun Snowflake Context (#5704) 2022-10-17 17:18:22 +08:00
Laurent BOURGEOIS
7893b956e6 fix(TBD-14263):Support MongoDB v4+ - Spark Batch 3.1+ - GA (#5686) 2022-10-14 15:09:33 +02:00
92 changed files with 1541 additions and 3815 deletions

View File

@@ -56,12 +56,5 @@
install-size="0"
version="0.0.0"
unpack="true"/>
<plugin
id="org.talend.signon.util"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=la table est null.
TableViewerCreator.TableColumn.AssertMsg=La TableColumn de TableEditorColumn avec idProperty '{0}' n'a pas la bonne Table parente
TreeToTablesLinker.Type.Unsupported=Ce type de currentControl n'est pas support\u00E9
commons.error=Erreur
exception.message={0}\nConsultez le log pour plus de d\u00E9tails.
exception.errorOccured=Une erreur est survenue ({0}).\nConsultez le log pour plus de d\u00E9tails.
ModelSelectionDialog.Message=S\u00E9lectionnez une option ou annulez.
ModelSelectionDialog.Option=Option

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u3067\u3059
TableViewerCreator.TableColumn.AssertMsg=idProperty'{0}'\u304C\u3042\u308BTableEditorColumn\u306ETableColumn\u306B\u306F\u3001\u6B63\u3057\u3044\u89AA\u30C6\u30FC\u30D6\u30EB\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093
TreeToTablesLinker.Type.Unsupported=currentControl\u306E\u3053\u306E\u30BF\u30A4\u30D7\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
commons.error=\u30A8\u30E9\u30FC
exception.message={0}\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
exception.errorOccured=\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Message=\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\uFF11\u3064\u9078\u629E\u3059\u308B\u304B\u3001\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=\u8868\u4E3A null
TableViewerCreator.TableColumn.AssertMsg=TableEditorColumn \u7684 idProperty \u4E3A '{0}' \u7684 TableColumn \u6CA1\u6709\u6B63\u786E\u7684 Table \u7236\u9879
TreeToTablesLinker.Type.Unsupported=\u4E0D\u652F\u6301\u8FD9\u79CD\u7C7B\u578B\u7684 currentControl
commons.error=\u9519\u8BEF
exception.message={0}\n\u8BF7\u67E5\u770B\u65E5\u5FD7\u4EE5\u83B7\u53D6\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u3002
exception.errorOccured=\u51FA\u73B0\u9519\u8BEF ({0})\u3002\n\u8BF7\u67E5\u770B\u65E5\u5FD7\u4EE5\u83B7\u53D6\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u3002
ModelSelectionDialog.Message=\u8BF7\u9009\u62E9\u4E00\u4E2A\u9009\u9879\u6216\u53D6\u6D88\u3002
ModelSelectionDialog.Option=\u9009\u9879

View File

@@ -24,7 +24,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarOutputStream;
import org.apache.tools.zip.ZipEntry;
@@ -170,52 +169,8 @@ public class ZipFileUtils {
inputStream.close();
}
}
public static void unZipFileEntry(File destFile, java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry entry) throws IOException {
InputStream inputStream;
FileOutputStream fileOut;
if (entry.isDirectory()) {
destFile.mkdirs();
} else {
File parent = destFile.getParentFile();
if (parent != null && !parent.exists()) {
parent.mkdirs();
}
inputStream = zipFile.getInputStream(entry);
fileOut = new FileOutputStream(destFile);
byte[] buf = new byte[bufSize];
int readedBytes;
while ((readedBytes = inputStream.read(buf)) > 0) {
fileOut.write(buf, 0, readedBytes);
}
fileOut.close();
inputStream.close();
}
}
public void setBufSize(int bufSize) {
ZipFileUtils.bufSize = bufSize;
}
public static boolean isValidJarFile(String moduleFilePath) {
if (moduleFilePath == null) {
return false;
}
if (!new File(moduleFilePath).exists()) {
return false;
}
try (JarFile zip = new JarFile(moduleFilePath)) {
zip.getManifest();
} catch (IOException e) {
return false;
}
return true;
}
}

View File

@@ -97,7 +97,7 @@
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.22</version>
<version>1.2.19</version>
</dependency>
</dependencies>

View File

@@ -12,8 +12,6 @@
// ============================================================================
package org.talend.commons.ui.swt.dialogs;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.talend.commons.ui.utils.image.ColorUtils;
@@ -31,7 +29,5 @@ public interface IConfigModuleDialog {
public String getMavenURI();
public int open();
public Map<String, String> getModulesMVNUrls();
}

View File

@@ -27,6 +27,10 @@ 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;
@@ -35,22 +39,22 @@ 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.AbstractPendoTrackManager;
import org.talend.core.pendo.PendoDataTrackFactory;
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.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
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 extends AbstractPendoTrackManager {
public class PendoItemSignatureManager {
private PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
private static PendoItemSignatureManager manager;
@@ -59,7 +63,7 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
static {
manager = new PendoItemSignatureManager();
try {
isTrackAvailable = PluginChecker.isTIS() && PendoDataTrackFactory.getInstance().isTrackSendAvailable();
isTrackAvailable = PluginChecker.isTIS() && PendoTrackSender.getInstance().isTrackSendAvailable();
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
@@ -83,12 +87,11 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
}
}
public IPendoDataProperties collectProperties() {
public void collectProperties() {
ICoreService coreService = ICoreService.get();
if (coreService == null || !isTrackAvailable) {
return null;
return;
}
PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
try {
itemSignProperties.setSignByMigration(signByLoginMigrationItems.size());
@@ -185,7 +188,6 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
return itemSignProperties;
}
@@ -256,12 +258,23 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
if (!isTrackAvailable) {
return;
}
super.sendTrackToPendo();
}
Job job = new Job("send pendo track") {
@Override
public TrackEvent getTrackEvent() {
return TrackEvent.ITEM_SIGNATURE;
@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

@@ -48,8 +48,6 @@ import org.talend.commons.runtime.model.emf.provider.EmfResourcesFactoryReader;
*/
public class TalendResourceSet extends ResourceSetImpl {
private boolean showLog;
public TalendResourceSet() {
super();
@@ -60,14 +58,6 @@ public class TalendResourceSet extends ResourceSetImpl {
getLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
}
public boolean isShowLog() {
return this.showLog;
}
public void setShowLog(boolean showLog) {
this.showLog = showLog;
}
/*
* (non-Javadoc)
*
@@ -93,13 +83,7 @@ public class TalendResourceSet extends ResourceSetImpl {
Resource resource = map.get(uri);
if (resource != null) {
if (loadOnDemand && !resource.isLoaded()) {
try {
demandLoadHelper(resource);
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
}
}
demandLoadHelper(resource);
}
return resource;
}
@@ -115,13 +99,7 @@ public class TalendResourceSet extends ResourceSetImpl {
}
if (theURIConverter.normalize(resource.getURI()).equals(normalizedURI)) {
if (loadOnDemand && !resource.isLoaded()) {
try {
demandLoadHelper(resource);
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
}
}
demandLoadHelper(resource);
}
if (map != null) {
@@ -147,13 +125,7 @@ public class TalendResourceSet extends ResourceSetImpl {
+ "'; a registered resource factory is needed");
}
try {
demandLoadHelper(resource);
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
}
}
demandLoadHelper(resource);
if (map != null) {
map.put(uri, resource);

View File

@@ -390,10 +390,6 @@ public class XmiResourceManager {
}
public Resource getItemResource(ResourceSet resourceSet, Item item, boolean forceLoad) {
return getItemResource(getResourceSet(), item, forceLoad, false);
}
public Resource getItemResource(ResourceSet resourceSet, Item item, boolean forceLoad, boolean showLog) {
if (item == null) {
return null;
}
@@ -406,23 +402,13 @@ public class XmiResourceManager {
} else {
itemResourceURI = getItemResourceURI(getItemURI(item));
}
Resource itemResource = null;
try {
if (resourceSet instanceof TalendResourceSet) {
((TalendResourceSet) resourceSet).setShowLog(showLog);
}
itemResource = resourceSet.getResource(itemResourceURI, false);
if (forceLoad && itemResource == null) {
if (item instanceof FileItem) {
itemResource = new ByteArrayResource(itemResourceURI);
resourceSet.getResources().add(itemResource);
}
itemResource = resourceSet.getResource(itemResourceURI, true);
}
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
Resource itemResource = resourceSet.getResource(itemResourceURI, false);
if (forceLoad && itemResource == null) {
if (item instanceof FileItem) {
itemResource = new ByteArrayResource(itemResourceURI);
resourceSet.getResources().add(itemResource);
}
itemResource = resourceSet.getResource(itemResourceURI, true);
}
return itemResource;
}
@@ -642,7 +628,7 @@ public class XmiResourceManager {
boolean isTestContainer = false;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testContainerService = GlobalServiceRegister
ITestContainerProviderService testContainerService = (ITestContainerProviderService) GlobalServiceRegister
.getDefault().getService(ITestContainerProviderService.class);
if (testContainerService != null) {
isTestContainer = testContainerService.isTestContainerItem(property.getItem());

View File

@@ -33,13 +33,6 @@ public class AnalysisReportRecorder extends ItemReportRecorder {
this.detailMessage = detailMessage;
}
public AnalysisReportRecorder(IItemAnalysisTask task, SeverityOption severity, String detailMessage) {
super();
this.task = task;
this.severity = severity;
this.detailMessage = detailMessage;
}
public String getTaskName() {
return task.getName();
}

View File

@@ -1,43 +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.analysistask;
import java.util.List;
import java.util.Set;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
/**
* created by hcyi on Oct 26, 2022
* Detailled comment
*
*/
public class DefaultItemsAnalysisTask extends AbstractItemAnalysisTask {
public DefaultItemsAnalysisTask() {
}
@Override
public Set<ERepositoryObjectType> getRepositoryObjectTypeScope() {
return null;
}
@Override
public List<AnalysisReportRecorder> execute(Item item) {
// TODO Auto-generated method stub
return null;
}
}

View File

@@ -20,7 +20,6 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -51,9 +50,7 @@ import org.talend.core.model.general.Project;
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.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.i18n.Messages;
import org.talend.designer.core.IDesignerCoreService;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
@@ -76,7 +73,7 @@ public class ItemAnalysisReportManager {
private AtomicBoolean inGenerating = new AtomicBoolean(false);
public List<AnalysisReportRecorder> executeAnalysisTask(Project project) {
IRepositoryService service = GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
IProxyRepositoryFactory repFactory = service.getProxyRepositoryFactory();
List<AnalysisReportRecorder> analysisResultList = new ArrayList<AnalysisReportRecorder>();
List<IItemAnalysisTask> analysisTasks = ItemAnalysisTaskRegistryReader.getInstance().getItemAnalysisTasks();
@@ -108,16 +105,6 @@ public class ItemAnalysisReportManager {
}
}
}
//
ItemAnalysisTaskRegistryReader.getInstance().getAllItemURIsMap().clear();
ItemAnalysisTaskRegistryReader.getInstance().getDuplicatedItemURIsMap().clear();
IDesignerCoreService designerCoreService = CoreRuntimePlugin.getInstance().getDesignerCoreService();
if (designerCoreService != null) {
List<AnalysisReportRecorder> recorder = designerCoreService.analysis(project);
if (recorder != null && !recorder.isEmpty()) {
analysisResultList.addAll(recorder);
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
@@ -203,42 +190,6 @@ public class ItemAnalysisReportManager {
inGenerating.set(newValue);
}
public String getCompleteObjectTypePath(ERepositoryObjectType itemType) {
ERepositoryObjectType rootItemType = itemType;
if (ERepositoryObjectType.JDBC != null && ERepositoryObjectType.JDBC.equals(rootItemType)) {
rootItemType = ERepositoryObjectType.METADATA_CONNECTIONS;
}
List<String> typeLabels = new ArrayList<String>();
findOutCompleteTypePath(rootItemType, typeLabels);
if (ERepositoryObjectType.PROCESS != null && ERepositoryObjectType.PROCESS.equals(rootItemType)) {
IRepositoryService repositoryService = IRepositoryService.get();
if (repositoryService != null) {
String standardNodeLabel = repositoryService.getStandardNodeLabel();
if (StringUtils.isNotBlank(standardNodeLabel)) {
typeLabels.add(standardNodeLabel);
}
}
}
StringBuffer buffer = new StringBuffer();
if (!typeLabels.isEmpty()) {
for (int i = 0; i < typeLabels.size(); i++) {
if (i != 0) {
buffer.append("/");
}
buffer.append(typeLabels.get(i));
}
}
return buffer.toString();
}
public void findOutCompleteTypePath(ERepositoryObjectType type, List<String> typeLabels) {
ERepositoryObjectType parentType = ERepositoryObjectType.findParentType(type);
if (parentType != null) {
findOutCompleteTypePath(parentType, typeLabels);
}
typeLabels.add(type.getLabel());
}
}
class AnalysisReportAccessDialog extends Dialog {

View File

@@ -32,10 +32,6 @@ public class ItemAnalysisTaskRegistryReader extends RegistryReader {
private static final ItemAnalysisTaskRegistryReader INSTANCE = new ItemAnalysisTaskRegistryReader();
private Map<String, String> allItemURIsMap = new HashMap<String, String>();
private Map<String, List<String>> duplicatedItemURIsMap = new HashMap<String, List<String>>();
public static ItemAnalysisTaskRegistryReader getInstance() {
return INSTANCE;
}
@@ -85,17 +81,4 @@ public class ItemAnalysisTaskRegistryReader extends RegistryReader {
idItemAnalysisTaskMap.clear();
}
/**
* Getter for allItemURIsMap.
*
* @return the allItemURIsMap
*/
public Map<String, String> getAllItemURIsMap() {
return this.allItemURIsMap;
}
public Map<String, List<String>> getDuplicatedItemURIsMap() {
return this.duplicatedItemURIsMap;
}
}

View File

@@ -12,8 +12,10 @@
// ============================================================================
package org.talend.commons.report;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.talend.analysistask.ItemAnalysisReportManager;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
@@ -21,6 +23,7 @@ import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.ui.ITestContainerCoreService;
import org.talend.repository.model.IRepositoryService;
/**
* DOC jding class global comment. Detailled comment
@@ -31,15 +34,8 @@ public class ItemReportRecorder {
protected String detailMessage;
protected String currentItemPath;
protected String currentItemType;
public String getItemType() {
String type = "";
if (item == null) {
return currentItemType;
}
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (itemType != null) {
if (ERepositoryObjectType.getAllTypesOfTestContainer().contains(itemType)) {
@@ -47,7 +43,7 @@ public class ItemReportRecorder {
if (parentJobItem != null) {
ERepositoryObjectType parentJobType = ERepositoryObjectType.getItemType(parentJobItem);
if (parentJobType != null) {
String parentTypePath = ItemAnalysisReportManager.getInstance().getCompleteObjectTypePath(parentJobType);
String parentTypePath = getCompleteObjectTypePath(parentJobType);
if (StringUtils.isNotBlank(parentTypePath)) {
type = parentTypePath + "/";
}
@@ -55,7 +51,7 @@ public class ItemReportRecorder {
}
type += itemType;
} else {
type = ItemAnalysisReportManager.getInstance().getCompleteObjectTypePath(itemType);
type = getCompleteObjectTypePath(itemType);
}
}
return type;
@@ -63,9 +59,6 @@ public class ItemReportRecorder {
public String getItemPath() {
String path = "";
if (this.currentItemPath != null) {
return this.currentItemPath;
}
StringBuffer buffer = new StringBuffer();
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
@@ -111,6 +104,42 @@ public class ItemReportRecorder {
return parentJobItem;
}
private String getCompleteObjectTypePath(ERepositoryObjectType itemType) {
ERepositoryObjectType rootItemType = itemType;
if (ERepositoryObjectType.JDBC != null && ERepositoryObjectType.JDBC.equals(rootItemType)) {
rootItemType = ERepositoryObjectType.METADATA_CONNECTIONS;
}
List<String> typeLabels = new ArrayList<String>();
findOutCompleteTypePath(rootItemType, typeLabels);
if (ERepositoryObjectType.PROCESS != null && ERepositoryObjectType.PROCESS.equals(rootItemType)) {
IRepositoryService repositoryService = IRepositoryService.get();
if (repositoryService != null) {
String standardNodeLabel = repositoryService.getStandardNodeLabel();
if (StringUtils.isNotBlank(standardNodeLabel)) {
typeLabels.add(standardNodeLabel);
}
}
}
StringBuffer buffer = new StringBuffer();
if (!typeLabels.isEmpty()) {
for (int i = 0; i < typeLabels.size(); i++) {
if (i != 0) {
buffer.append("/");
}
buffer.append(typeLabels.get(i));
}
}
return buffer.toString();
}
private void findOutCompleteTypePath(ERepositoryObjectType type, List<String> typeLabels) {
ERepositoryObjectType parentType = ERepositoryObjectType.findParentType(type);
if (parentType != null) {
findOutCompleteTypePath(parentType, typeLabels);
}
typeLabels.add(type.getLabel());
}
public Item getItem() {
return item;
}
@@ -119,22 +148,6 @@ public class ItemReportRecorder {
this.item = item;
}
public String getCurrentItemPath() {
return this.currentItemPath;
}
public void setCurrentPath(String currentItemPath) {
this.currentItemPath = currentItemPath;
}
public String getCurrentItemType() {
return this.currentItemType;
}
public void setCurrentItemType(String currentItemType) {
this.currentItemType = currentItemType;
}
public String getDetailMessage() {
return detailMessage;
}

View File

@@ -53,5 +53,5 @@ public interface ILibraryManagerUIService extends IService {
public boolean confirmDialog(String originalJarFileName);
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue, boolean allowDetectDependencies);
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue);
}

View File

@@ -27,8 +27,8 @@ import org.talend.core.database.conn.DatabaseConnConstants;
public enum EDatabaseVersion4Drivers {
// access
ACCESS_JDBC(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, new String[] {
"jackcess-2.1.12.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.3.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackcess-encrypt-2.1.4.jar", "bcprov-jdk15on-1.70.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
"jackcess-2.1.0.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.1.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackcess-encrypt-2.1.0.jar", "bcprov-jdk15on-1.51.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
ACCESS_2003(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2003", "Access_2003")), //$NON-NLS-1$ //$NON-NLS-2$
ACCESS_2007(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2007", "Access_2007")), //$NON-NLS-1$ //$NON-NLS-2$
// oracle
@@ -69,9 +69,9 @@ public enum EDatabaseVersion4Drivers {
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
SAS_9_1(new DbVersion4Drivers(EDatabaseTypeName.SAS, "SAS 9.1", "SAS_9.1", new String[] { "sas.core.jar", //$NON-NLS-1$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
// MYSQL, add for 9594
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -84,8 +84,8 @@ public enum EDatabaseVersion4Drivers {
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.22.jar", "jackson-core-2.13.4.jar",
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "jcip-annotations-1.0-1.jar",
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.19.jar", "jackson-core-2.13.2.jar",
"jackson-databind-2.13.2.2.jar", "jackson-annotations-2.13.2.jar", "jcip-annotations-1.0-1.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",
"content-type-2.1.jar", "lang-tag-1.5.jar" })),
@@ -153,8 +153,8 @@ public enum EDatabaseVersion4Drivers {
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.13.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"jackson-databind-2.11.4.jar", "jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"aws-java-sdk-redshift-internal-1.12.x.jar" })), //$NON-NLS-1$

View File

@@ -38,10 +38,7 @@ public class HadoopClassLoaderFactory2 {
public static ClassLoader getHDFSClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
return getClassLoader(relatedClusterId, EHadoopCategory.HDFS, distribution, version, useKrb);
}
public static ClassLoader getHDFSKnoxClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
return HadoopClassLoaderFactory2.getClassLoader(relatedClusterId, EHadoopCategory.HDFS, distribution, version, useKrb,
IHadoopArgs.HDFS_ARG_KNOX);
}
public static ClassLoader getMRClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
return getClassLoader(relatedClusterId, EHadoopCategory.MAP_REDUCE, distribution, version, useKrb);
}

View File

@@ -22,6 +22,4 @@ public interface IHadoopArgs {
public static final String HIVE_ARG_STANDALONE = "STANDALONE"; //$NON-NLS-1$
public static final String HDFS_ARG_KNOX = "USE_KNOX"; //$NON-NLS-1$
}

View File

@@ -20,7 +20,7 @@ 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.PendoDataTrackFactory;
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;
@@ -254,7 +254,7 @@ public class ConnectionBean implements Cloneable {
String user = conDetails.getString(USER);
if (isToken()) {
String url = getDynamicFields().get(RepositoryConstants.REPOSITORY_URL);
user = PendoDataTrackFactory.getInstance().getTmcUser(url, getPassword());
user = PendoTrackSender.getInstance().getTmcUser(url, getPassword());
if (StringUtils.isNotBlank(user)) {
setUser(user);
}

View File

@@ -19,9 +19,7 @@ public class SparkBatchMetadataTalendTypeFilter extends SparkMetadataTalendTypeF
"tJDBCInput",
"tJDBCOutput",
"tLogRow",
"tSqlRow",
"tAvroInput",
"tMongoDBInput",
"tMongoDBInput",
"tMongoDBOutput",
"tSqlRow"
);

View File

@@ -1,73 +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 org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.service.IRemoteService;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoDataTrackFactory {
private static PendoDataTrackFactory instance;
private static IRemoteService remoteService;
static {
instance = new PendoDataTrackFactory();
remoteService = IRemoteService.get();
}
private PendoDataTrackFactory() {
}
public static PendoDataTrackFactory getInstance() {
return instance;
}
public boolean isTrackSendAvailable() throws Exception {
if (remoteService != null) {
return remoteService.isPendoTrackAvailable();
}
return false;
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
if (remoteService != null) {
remoteService.sendPendoTrackData(event, properties);
}
}
public void sendProjectLoginTrack() {
if (remoteService != null) {
AbstractPendoTrackManager pendoProjectLoginManager = remoteService.getPendoProjectLoginManager();
pendoProjectLoginManager.sendTrackToPendo();
}
}
public void sendGenericTrack(TrackEvent event, IPendoDataProperties properties) {
if (remoteService != null) {
AbstractPendoTrackManager genericManager = remoteService.getPendoGenericManager(event, properties);
genericManager.sendTrackToPendo();
}
}
public String getTmcUser(String url, String token) {
if (remoteService != null) {
return remoteService.getTmcUser(url, token);
}
return "";
}
}

View File

@@ -12,12 +12,26 @@
// ============================================================================
package org.talend.core.pendo;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
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;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -50,6 +64,47 @@ public class PendoTrackDataUtil {
return content;
}
public static IPendoDataProperties getLoginEventProperties() {
String studioPatch = getLatestPatchInstalledVersion();
PendoLoginProperties loginEvent = new PendoLoginProperties();
IStudioLiteP2Service studioLiteP2Service = IStudioLiteP2Service.get();
try {
if (studioLiteP2Service != null) {
List<String> enabledFeatures = new ArrayList<String>();
List<String> enabledFeaturesList = studioLiteP2Service.getCurrentProjectEnabledFeatures();
enabledFeaturesList.stream().forEach(feature -> {
String result = feature;
if (result.startsWith(FEATURE_PREFIX)) {
result = result.substring(FEATURE_PREFIX.toCharArray().length);
}
if (result.endsWith(FEATURE_TAIL)) {
result = result.substring(0, result.lastIndexOf(FEATURE_TAIL));
}
enabledFeatures.add(result);
});
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);
}
loginEvent.setStudioVersion(VersionUtils.getInternalMajorVersion());
loginEvent.setStudioPatch(studioPatch);
return loginEvent;
}
public static String getLatestPatchInstalledVersion() {
String studioPatch = "";
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
@@ -59,6 +114,52 @@ public class PendoTrackDataUtil {
return studioPatch;
}
private static void setUpRefProjectsStructure(PendoLoginProperties loginEvent) {
ProjectManager projectManager = ProjectManager.getInstance();
Project currentProject = projectManager.getCurrentProject();
Map<String, Project> teclabelProjectMap = new HashMap<String, Project>();
List<Project> allReferencedProjects = projectManager.getAllReferencedProjects();
allReferencedProjects.forEach(refProject -> {
String technicalLabel = refProject.getTechnicalLabel();
if (StringUtils.isNotBlank(technicalLabel)) {
teclabelProjectMap.put(technicalLabel, refProject);
}
});
int[] refCount = new int[] {0};
List<String> resultList = new ArrayList<String>();
Map<String, String> desensitiveLabelMap = new HashMap<String, String>();
findReferencePorjectPath(currentProject, "Main", resultList, refCount, desensitiveLabelMap, teclabelProjectMap);
loginEvent.setRefProjectList(resultList);
loginEvent.setRefProjectCount(String.valueOf(desensitiveLabelMap.keySet().size()));
}
public static void findReferencePorjectPath(Project currentProject, String path, List<String> resultList, int[] refCount,
Map<String, String> desensitiveLabelMap, Map<String, Project> teclabelProjectMap) {
List<ProjectReference> projectReferenceList = currentProject.getProjectReferenceList();
for (ProjectReference projectReference : projectReferenceList) {
String structPath = path;
if (projectReference.getReferencedProject() == null) {
continue;
}
String technicalLabel = projectReference.getReferencedProject().getTechnicalLabel();
Project refProject = teclabelProjectMap.get(technicalLabel);
if (StringUtils.isBlank(technicalLabel) || refProject == null) {
continue;
}
String desensitiveLabel = desensitiveLabelMap.get(technicalLabel);
if (StringUtils.isBlank(desensitiveLabel)) {
refCount[0] = refCount[0] + 1;
desensitiveLabel = "Ref" + refCount[0];
desensitiveLabelMap.put(technicalLabel, desensitiveLabel);
}
structPath = structPath + "/" + desensitiveLabel;
resultList.add(structPath);
findReferencePorjectPath(refProject, structPath, resultList, refCount, desensitiveLabelMap, teclabelProjectMap);
}
}
public static String convertEntityJsonString(Object entity) {
ObjectMapper mapper = new ObjectMapper();
try {
@@ -72,4 +173,30 @@ public class PendoTrackDataUtil {
return "";
}
public enum TrackEvent {
PROJECT_LOGIN("Project Login"),
IMPORT_API_DEF("Import API Definition"),
UPDATE_API_DEF("Update API Definition"),
USE_API_DEF("Use API Definition"),
OPEN_IN_APIDesigner("Open in API Designer"),
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");
private String event;
TrackEvent(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}
}

View File

@@ -0,0 +1,325 @@
// ============================================================================
//
// 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.pendo;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.StatusLine;
import org.apache.http.client.entity.EntityBuilder;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
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.commons.utils.network.IProxySelectorProvider;
import org.talend.commons.utils.network.NetworkUtil;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.nexus.HttpClientTransport;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.service.IRemoteService;
import org.talend.repository.model.RepositoryConstants;
import org.talend.utils.json.JSONObject;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoTrackSender {
public 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 PREFIX_API = "api";
private static final String PENDO_INFO = "/monitoring/pendo/info";
private static final String PENDO_TRACK = "/monitoring/pendo/track";
private static final String HEAD_AUTHORIZATION = "Authorization";
private static final String HEAD_CONTENT_TYPE = "Content-Type";
private static final String HEAD_PENDO_KEY = "x-pendo-integration-key";
private static PendoTrackSender instance;
private static String adminUrl;
private static String apiBaseUrl;
private static String pendoInfo;
private PendoTrackSender() {
}
static {
instance = new PendoTrackSender();
RepositoryContext repositoryContext = getRepositoryContext();
if (repositoryContext != null) {
adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
}
}
public static PendoTrackSender getInstance() {
if (StringUtils.isBlank(adminUrl)) {
RepositoryContext repositoryContext = getRepositoryContext();
if (repositoryContext != null) {
adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
}
}
return instance;
}
public void sendToPendo(TrackEvent event, IPendoDataProperties properties) {
Job job = new Job("send pendo track") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (isTrackSendAvailable()) {
sendTrackData(event, properties);
}
} catch (Exception e) {
// warning only
ExceptionHandler.process(e, Level.WARN);
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
if (isPendoLocalDebug()) {
ExceptionHandler.log(event.getEvent() + ":" + PendoTrackDataUtil.convertEntityJsonString(properties));
return;
}
DefaultHttpClient client = null;
CloseableHttpResponse response = null;
IProxySelectorProvider proxySelectorProvider = null;
try {
String pendoInfo = getPendoInfo();
if (StringUtils.isBlank(pendoInfo)) {
throw new Exception("Pendo information is empty");
}
String pendoKey = getPendoKeyFromLicense();
if (StringUtils.isBlank(pendoKey)) {
throw new Exception("Pendo key is empty");
}
client = new DefaultHttpClient();
String url = getBaseUrl() + PENDO_TRACK;
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader(HEAD_CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
httpPost.setHeader(HEAD_PENDO_KEY, pendoKey);
proxySelectorProvider = HttpClientTransport.addProxy(client, new URI(url));
EntityBuilder entityBuilder = EntityBuilder.create();
String trackData = PendoTrackDataUtil.generateTrackData(pendoInfo, event, properties);
entityBuilder.setText(trackData).setContentType(ContentType.APPLICATION_JSON);
HttpEntity entity = entityBuilder.build();
httpPost.setEntity(entity);
response = client.execute(httpPost, HttpClientContext.create());
StatusLine statusLine = response.getStatusLine();
String responseStr = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if (isLogPendoData()) {
ExceptionHandler.log(trackData);
}
if (HttpURLConnection.HTTP_OK != statusLine.getStatusCode()) {
throw new Exception(statusLine.toString() + ", server message: [" + responseStr + "]");
}
} finally {
HttpClientTransport.removeProxy(proxySelectorProvider);
client.getConnectionManager().shutdown();
if (response != null) {
try {
response.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
if (client != null) {
try {
client.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
}
}
public boolean isTrackSendAvailable() throws Exception {
if (isPendoLocalDebug() || checkTokenUsed(adminUrl) && NetworkUtil.isNetworkValid()) {
return true;
}
return false;
}
public boolean isPendoLocalDebug() {
return Boolean.TRUE.toString().equals(System.getProperty(PROP_PENDO_LOCAL_CHECK));
}
public boolean isLogPendoData() {
return Boolean.TRUE.toString().equals(System.getProperty(PROP_PENDO_LOG_DATA));
}
private String getPendoInfo() throws Exception {
if (StringUtils.isBlank(pendoInfo)) {
pendoInfo = getPendoInfo(getBaseUrl(), getToken());
}
return pendoInfo;
}
private String getPendoInfo(String baseUrl, String token) throws Exception {
DefaultHttpClient client = null;
CloseableHttpResponse response = null;
IProxySelectorProvider proxySelectorProvider = null;
try {
client = new DefaultHttpClient();
String url = baseUrl + PENDO_INFO;
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader(HEAD_AUTHORIZATION, "Bearer " + token);
proxySelectorProvider = HttpClientTransport.addProxy(client, new URI(url));
response = client.execute(httpGet, HttpClientContext.create());
StatusLine statusLine = response.getStatusLine();
String responseStr = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if (HttpURLConnection.HTTP_OK != statusLine.getStatusCode()) {
throw new Exception(statusLine.toString() + ", server message: [" + responseStr + "]");
}
return responseStr;
} finally {
HttpClientTransport.removeProxy(proxySelectorProvider);
client.getConnectionManager().shutdown();
if (response != null) {
try {
response.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
if (client != null) {
try {
client.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
}
}
private boolean checkTokenUsed(String adminUrl) throws Exception {
if (StringUtils.isNotBlank(adminUrl) && GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService service = GlobalServiceRegister.getDefault().getService(IRemoteService.class);
return service.isTokenUsed(adminUrl);
}
return false;
}
public String getBaseUrl() throws Exception {
return getBaseUrl(adminUrl, false);
}
public String getBaseUrl(String adminUrl, boolean token) throws Exception {
if (StringUtils.isNotBlank(apiBaseUrl) && !token) {
return apiBaseUrl;
}
try {
URL url = new URL(adminUrl);
// tmc.int.cloud.talend.com
String authority = url.getAuthority();
String regex = "(\\w*\\-*\\w*\\.?){2}\\.(talend.com)";
Pattern pattern= Pattern.compile(regex);
Matcher match = pattern.matcher(authority);
if (match.find()) {
// int.cloud.talend.com
authority = match.group(0);
URL apiURL = new URL(url.getProtocol(), PREFIX_API + "." + authority, "");
// https://api.int.cloud.talend.com
apiBaseUrl = apiURL.toString();
} else {
throw new Exception("Can't match pendo url from " + adminUrl);
}
} catch (MalformedURLException e) {
throw new Exception("Invalid url " + adminUrl, e.getCause());
}
return apiBaseUrl;
}
private String getToken() {
return getRepositoryContext().getClearPassword();
}
public String getTmcUser(String url, String token) {
try {
String pendoInfo = getPendoInfo(getBaseUrl(url, true), token);
if (StringUtils.isNotBlank(pendoInfo)) {
JSONObject infoJson = new JSONObject(pendoInfo);
return ((JSONObject) infoJson.get("visitor")).getString("id"); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
return ""; //$NON-NLS-1$
}
private String getPendoKeyFromLicense() throws Exception {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService service = GlobalServiceRegister.getDefault().getService(IRemoteService.class);
return service.getPendoKeyFromLicense();
}
return null;
}
private static RepositoryContext getRepositoryContext() {
RepositoryContext repositoryContext = (RepositoryContext) CoreRuntimePlugin.getInstance().getContext()
.getProperty(Context.REPOSITORY_CONTEXT_KEY);
return repositoryContext;
}
public void setAdminUrl(String adminUrl) {
PendoTrackSender.adminUrl = adminUrl;
}
public void setApiBaseUrl(String apiBaseUrl) {
PendoTrackSender.apiBaseUrl = apiBaseUrl;
}
}

View File

@@ -1,79 +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;
/**
* DOC jding class global comment. Detailled comment
*/
public enum TrackEvent {
/**
* create by TUP-33421 update by TUP-34791, TUP-35523, TUP-36780
*/
PROJECT_LOGIN("Project Login"),
/**
* create by TUP-33990
*/
IMPORT_API_DEF("Import API Definition"),
/**
* create by TUP-33990
*/
UPDATE_API_DEF("Update API Definition"),
/**
* create by TUP-33990
*/
USE_API_DEF("Use API Definition"),
/**
* create by TUP-33990
*/
OPEN_IN_APIDesigner("Open in API Designer"),
/**
* create by TUP-33990
*/
OPEN_IN_APITester("Open in API Tester"),
/**
* create by TUP-33990
*/
OPEN_API_DOCUMENTATION("Open API Documentation"),
/**
* create by TUP-35644
*/
AUTOMAP("tMap Automap"),
/**
* create by TUP-35644 update by TUP-36710
*/
TMAP("tMap"),
/**
* create by TUP-35712 update by TUP-36893
*/
ITEM_IMPORT("Import items"),
/**
* create by TUP-35712
*/
ITEM_SIGNATURE("Item Signature");
private String event;
TrackEvent(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}

View File

@@ -10,7 +10,7 @@
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo;
package org.talend.core.pendo.mapper;
import org.apache.log4j.Level;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -18,24 +18,16 @@ 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.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoTMapProperties;
/**
* DOC jding class global comment. Detailled comment
*/
public abstract class AbstractPendoTrackManager {
public abstract class AbstractPendoTMapManager {
public abstract TrackEvent getTrackEvent();
public abstract IPendoDataProperties collectProperties();
public boolean isTrackSendAvailable() throws Exception {
return PendoDataTrackFactory.getInstance().isTrackSendAvailable();
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
PendoDataTrackFactory.getInstance().sendTrackData(event, properties);
}
protected abstract PendoTMapProperties calculateProperties();
public void sendTrackToPendo() {
Job job = new Job("send pendo track") {
@@ -43,9 +35,9 @@ public abstract class AbstractPendoTrackManager {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (isTrackSendAvailable()) {
IPendoDataProperties properties = collectProperties();
sendTrackData(getTrackEvent(), properties);
if (PendoTrackSender.getInstance().isTrackSendAvailable()) {
PendoTMapProperties properties = calculateProperties();
PendoTrackSender.getInstance().sendTrackData(TrackEvent.TMAP, properties);
}
} catch (Exception e) {
// warning only

View File

@@ -12,9 +12,8 @@
// ============================================================================
package org.talend.core.pendo.mapper;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoAutoMapProperties;
/**
@@ -22,7 +21,7 @@ import org.talend.core.pendo.properties.PendoAutoMapProperties;
*
* DOC jding class global comment. Detailled comment
*/
public class PendoAutoMapManager extends AbstractPendoTrackManager {
public class PendoAutoMapManager {
private int mappingChangeCount = 0;
@@ -46,18 +45,9 @@ public class PendoAutoMapManager extends AbstractPendoTrackManager {
if (mappingChangeCount < 1) {
return;
}
super.sendTrackToPendo();
}
@Override
public TrackEvent getTrackEvent() {
return TrackEvent.AUTOMAP;
}
@Override
public IPendoDataProperties collectProperties() {
PendoAutoMapProperties properties = new PendoAutoMapProperties();
properties.setAutoMappings(mappingChangeCount);
return properties;
PendoTrackSender.getInstance().sendToPendo(TrackEvent.AUTOMAP, properties);
}
}

View File

@@ -0,0 +1,171 @@
// ============================================================================
//
// 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 PendoLoginProperties implements IPendoDataProperties {
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("studio_patch")
private String studioPatch;
@JsonProperty("enabled_features")
private List<String> enabledFeatures;
@JsonProperty("referenced_project_number")
private String refProjectCount;
@JsonProperty("referenced_projects")
private List<String> refProjectList;
@JsonProperty("one_click_login")
private String isOneClickLogin;
@JsonProperty("managed_update")
private String managedUpdate;
/**
* Getter for studio_version.
*
* @return the studio_version
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studio_version.
*
* @param studio_version the studio_version to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for studio_patch.
*
* @return the studio_patch
*/
public String getStudioPatch() {
return studioPatch;
}
/**
* Sets the studio_patch.
*
* @param studio_patch the studio_patch to set
*/
public void setStudioPatch(String studioPatch) {
this.studioPatch = studioPatch;
}
/**
* Getter for enabled_features.
*
* @return the enabled_features
*/
public List<String> getEnabledFeatures() {
return enabledFeatures;
}
/**
* Sets the enabled_features.
*
* @param enabled_features the enabled_features to set
*/
public void setEnabledFeatures(List<String> enabledFeatures) {
this.enabledFeatures = enabledFeatures;
}
/**
* Getter for refProjectCount.
*
* @return the refProjectCount
*/
public String getRefProjectCount() {
return refProjectCount;
}
/**
* Sets the refProjectCount.
*
* @param refProjectCount the refProjectCount to set
*/
public void setRefProjectCount(String refProjectCount) {
this.refProjectCount = refProjectCount;
}
/**
* Getter for refProjectList.
*
* @return the refProjectList
*/
public List<String> getRefProjectList() {
return refProjectList;
}
/**
* Sets the refProjectList.
*
* @param refProjectList the refProjectList to set
*/
public void setRefProjectList(List<String> refProjectList) {
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

@@ -231,9 +231,6 @@ public class ProjectPreferenceManager {
if (isCurrentProject) {
try {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (qualifier == null) {
qualifier = "org.talend.designer.maven";
}
init(ResourceUtils.getProject(currentProject), qualifier);
} catch (PersistenceException e) {
ExceptionHandler.process(e);

View File

@@ -17,9 +17,6 @@ import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
@@ -38,17 +35,11 @@ public interface IRemoteService extends IService {
LoginException, JSONException;
boolean isAuthorized(String value);
boolean isTokenUsed(String adminUrl) throws Exception;
String getPendoKeyFromLicense() throws Exception;
boolean isPendoTrackAvailable() throws Exception;
void sendPendoTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception;
AbstractPendoTrackManager getPendoProjectLoginManager();
AbstractPendoTrackManager getPendoGenericManager(TrackEvent event, IPendoDataProperties peoperties);
String getTmcUser(String url, String token);
public boolean isCloudConnection();
public static IRemoteService get() {

View File

@@ -26,8 +26,6 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.talend.analysistask.AnalysisReportRecorder;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.IService;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.general.ModuleNeeded;
@@ -208,6 +206,4 @@ public interface IDesignerCoreService extends IService {
public IProcess getJobletProcessByItem(Item item);
public List<AnalysisReportRecorder> analysis(Project project) throws PersistenceException;
}

View File

@@ -167,7 +167,7 @@ public class ModuleListCellEditor extends DialogCellEditor {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerUIService.class)) {
ILibraryManagerUIService libUiService = (ILibraryManagerUIService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerUIService.class);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(cellEditorWindow.getShell(), "\"newLine\"".equals(value) ? "" : value, false);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(cellEditorWindow.getShell(), "\"newLine\"".equals(value) ? "" : value);
if (dialog.open() == IDialogConstants.OK_ID) {
String selecteModule = dialog.getMavenURI();
if (selecteModule != null && (value == null || !value.equals(selecteModule))) {

View File

@@ -1,8 +1,6 @@
package org.talend.core.ui.services;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
@@ -11,7 +9,6 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.general.Project;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.ui.properties.tab.IDynamicProperty;
@@ -31,16 +28,6 @@ public interface IGitUIProviderService extends IService {
public void openPushFailedDialog(Object pushResult);
boolean migrateOption(IProgressMonitor monitor, String newVersion, boolean hasUpdate) throws Exception;
boolean openSwitchGitModeDialog();
boolean canSwitchGitMode();
boolean canShowSwitchGitModePopup();
void showSwithGitModePopup();
Map<Project, List<Project>> getInvalidReferencedProjects();
public static IGitUIProviderService get() {
GlobalServiceRegister register = GlobalServiceRegister.getDefault();

View File

@@ -78,12 +78,5 @@
serviceId="ICoreService">
</Service>
</extension>
<extension
point="org.talend.core.runtime.service">
<Service
class="org.talend.core.services.NotificationService"
serviceId="INotificationService">
</Service>
</extension>
</plugin>

View File

@@ -56,29 +56,6 @@ public interface IGITProviderService extends IService {
void createOrUpdateGitIgnoreFile(IProject eclipseProject) throws CoreException;
String getDefaultBranch(Project project);
/**
* Whether git mode is standard mode
* @return
*/
boolean isStandardMode();
/**
* Set git mode
* @param standardMode
*/
void setStandardMode(boolean standardMode);
/**
* Get clean git repository url
* @param project project
* @return
*/
String getCleanGitRepositoryUrl(org.talend.core.model.properties.Project project);
boolean canShowSwitchGitModePopup();
void showSwithGitModePopup();
public static IGITProviderService get() {
GlobalServiceRegister register = GlobalServiceRegister.getDefault();

View File

@@ -1,34 +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.services;
import org.eclipse.jface.window.WindowManager;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
/**
* @author bhe created on Oct 27, 2022
*
*/
public interface INotificationService extends IService {
WindowManager getNotificationWindowManager();
public static INotificationService get() {
GlobalServiceRegister register = GlobalServiceRegister.getDefault();
if (!register.isServiceRegistered(INotificationService.class)) {
return null;
}
return register.getService(INotificationService.class);
}
}

View File

@@ -1,30 +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.services;
import org.eclipse.jface.window.WindowManager;
/**
* @author bhe created on Oct 28, 2022
*
*/
public class NotificationService implements INotificationService {
private WindowManager manager = new WindowManager();
@Override
public WindowManager getNotificationWindowManager() {
return manager;
}
}

View File

@@ -10,8 +10,8 @@
<artifactId>org.talend.designer.maven.repo.tck</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<jackson.version>2.13.4</jackson.version>
<jackson-databind.version>2.13.4.2</jackson-databind.version>
<jackson.version>2.13.2</jackson.version>
<jackson-databind.version>2.13.2.2</jackson-databind.version>
<slf4j.version>1.7.32</slf4j.version>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>

View File

@@ -1,479 +1,480 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.repo.tcksdk</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<tcomp.version>${component-runtime.version}</tcomp.version>
<cxf.version>3.5.2</cxf.version>
<geronimo.version>1.0.2</geronimo.version>
<jcache.version>1.0.5</jcache.version>
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
<johnzon.version>1.2.19</johnzon.version>
<meecrowave.version>1.2.14</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>
<xbean.version>4.20</xbean.version>
<reload4j.version>1.2.22</reload4j.version>
<log4j2.version>2.17.2</log4j2.version>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>
<repositories>
<repository>
<id>talend_open</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
<repository>
<id>talend_open_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
</repository>
<repository>
<id>sonatype_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime</artifactId>
<version>${component-runtime.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-integration-cdi</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-security</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-jcache-simple</artifactId>
<version>${jcache.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing-common</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcache_1.0_spec</artifactId>
<version>${jcache_spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.meecrowave</groupId>
<artifactId>meecrowave-core</artifactId>
<version>${meecrowave.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-el22</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-web</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jaspic-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jni</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util-scan</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm9-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-reflect</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
<version>${microprofile.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-design-extension</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-di</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-impl</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-manager</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-extension-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-model</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-spi</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>container-core</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>slf4j-standard</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>vault-client</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/repository</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${project.basedir}/tmp</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies-jar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
<includeScope>runtime</includeScope>
<useRepositoryLayout>true</useRepositoryLayout>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>zip-maven-repository</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<zip destfile="${project.basedir}/repository/maven_repository.zip" basedir="${project.basedir}/tmp/" />
<delete dir="${project.basedir}/tmp/" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.repo.tcksdk</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<tcomp.version>${component-runtime.version}</tcomp.version>
<cxf.version>3.5.2</cxf.version>
<geronimo.version>1.0.2</geronimo.version>
<jcache.version>1.0.5</jcache.version>
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
<johnzon.version>1.2.19</johnzon.version>
<meecrowave.version>1.2.14</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>
<xbean.version>4.20</xbean.version>
<reload4j.version>1.2.19</reload4j.version>
<log4j2.version>2.17.2</log4j2.version>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>
<repositories>
<repository>
<id>talend_open</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
<repository>
<id>talend_open_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
</repository>
<repository>
<id>sonatype_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime</artifactId>
<version>${component-runtime.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-integration-cdi</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-security</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-jcache-simple</artifactId>
<version>${jcache.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing-common</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcache_1.0_spec</artifactId>
<version>${jcache_spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.meecrowave</groupId>
<artifactId>meecrowave-core</artifactId>
<version>${meecrowave.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-el22</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-web</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jaspic-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jni</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util-scan</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm9-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-reflect</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
<version>${microprofile.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-design-extension</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-di</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-impl</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-manager</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-extension-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-model</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-spi</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>container-core</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>slf4j-standard</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>vault-client</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/repository</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${project.basedir}/tmp</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies-jar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
<includeScope>runtime</includeScope>
<useRepositoryLayout>true</useRepositoryLayout>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>zip-maven-repository</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<zip destfile="${project.basedir}/repository/maven_repository.zip" basedir="${project.basedir}/tmp/" />
<delete dir="${project.basedir}/tmp/" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -118,7 +118,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>

View File

@@ -89,7 +89,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>

View File

@@ -11,9 +11,9 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.50.1</tcomp.version>
<tcomp.version>1.49.1</tcomp.version>
<slf4j.version>1.7.34</slf4j.version>
<reload4j.version>1.2.22</reload4j.version>
<reload4j.version>1.2.19</reload4j.version>
</properties>
<repositories>

View File

@@ -43,7 +43,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
<version>1.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
@@ -109,7 +109,6 @@
<patternset>
<exclude name="repository/org/apache/maven/maven-artifact-manager/2.0.9/"/>
<exclude name="repository/org/apache/maven/maven-artifact-manager/2.0.6/"/>
<exclude name="repository/ch/qos/reload4j/reload4j/1.2.19/"/>
</patternset>
</unzip>
</tasks>

View File

@@ -10,7 +10,6 @@ ProjectPomProjectSettingPage_ConfirmMessage=Will apply and update for project PO
ProjectPomProjectSettingPage_FilterPomLabel=Filter to use to generate poms:
ProjectPomProjectSettingPage_FilterErrorMessage=Filter is invalid.
ProjectPomProjectSettingPage.syncAllPomsButtonText=Force full re-synchronize POMs
ProjectPomProjectSettingPage.syncBuildTypesButtonText=Force full re-synchronize build types
AbstractPersistentProjectSettingPage.syncAllPoms=Do you want to update all poms? \n This operation might take long time depends on your project size.
MavenProjectSettingPage.filterExampleMessage=Filter examples:\nlabel=myJob \t\t\t\t=> Generate only the job named "myJob"\n!(label=myJob) \t\t\t\t=> Generate any job except the one named "myJob"\n(path=folder1/folder2) \t\t\t=> Generate any job in the folder "folder1/folder2"\n(path=folder1/folder2)or(label=myJob)\t=> Generate any job in the folder "folder1/folder2" or named "myJob"\n(label=myJob)and(version=0.2)\t\t=> Generate only the job named "myJob" with version 0.2\n!((label=myJob)and(version=0.1))\t\t=> Generate every jobs except the "myJob" version 0.1
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
@@ -18,4 +17,3 @@ MavenProjectSettingPage.excludeDeletedItems=Exclude deleted items
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize POMs button to apply the new settings.
MavenProjectSettingPage.skipFolders=Skip folders
BuildProjectSettingPage.allowRecursiveJobsJoblets=Allow recursive Jobs and Joblets (not supported - for compatibility only)
BuildProjectSettingPage.allowRecursiveJobs=Allow recursive jobs (Not recommended)

View File

@@ -26,7 +26,6 @@ import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.projectsetting.AbstractProjectSettingPage;
import org.talend.designer.maven.DesignerMavenPlugin;
import org.talend.designer.maven.tools.AggregatorPomsHelper;
import org.talend.designer.maven.tools.BuildTypeManager;
import org.talend.designer.maven.ui.i18n.Messages;
/**
@@ -86,25 +85,7 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
});
if (isSyncBuildTypeAllowed()) {
Button syncBuildTypes = new Button(parent, SWT.NONE);
syncBuildTypes.setText(Messages.getString("ProjectPomProjectSettingPage.syncBuildTypesButtonText")); //$NON-NLS-1$
syncBuildTypes.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
new BuildTypeManager().syncBuildTypes(getCurrentPage());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
});
}
}
}
private void addSyncWarning() {
setMessage(Messages.getString("MavenProjectSettingPage.syncAllPomsWarning"), IMessage.WARNING); //$NON-NLS-1$
@@ -119,12 +100,4 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
return ok;
}
private static boolean isSyncBuildTypeAllowed() {
return Boolean.getBoolean("talend.builtype.syncallowed");
}
private MavenProjectSettingPage getCurrentPage() {
return this;
}
}

View File

@@ -1,149 +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.designer.maven.migration.common;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.ui.ITestContainerCoreService;
/**
* DOC jding class global comment. Detailled comment
*/
public class ItemReportRecorder {
protected Item item;
protected String detailMessage;
public String getItemType() {
String type = "";
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (itemType != null) {
if (ERepositoryObjectType.getAllTypesOfTestContainer().contains(itemType)) {
Item parentJobItem = getTestCaseParentJobItem(item);
if (parentJobItem != null) {
ERepositoryObjectType parentJobType = ERepositoryObjectType.getItemType(parentJobItem);
if (parentJobType != null) {
String parentTypePath = getCompleteObjectTypePath(parentJobType);
if (StringUtils.isNotBlank(parentTypePath)) {
type = parentTypePath + "/";
}
}
}
type += itemType;
} else {
type = getCompleteObjectTypePath(itemType);
}
}
return type;
}
public String getItemPath() {
String path = "";
StringBuffer buffer = new StringBuffer();
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (ERepositoryObjectType.getAllTypesOfTestContainer().contains(itemType)) {
StringBuffer testcaseBuffer = new StringBuffer();
Item parentJobItem = getTestCaseParentJobItem(item);
if (parentJobItem != null) {
if (parentJobItem.getState() != null && StringUtils.isNotBlank(parentJobItem.getState().getPath())) {
testcaseBuffer.append(parentJobItem.getState().getPath()).append("/");
}
testcaseBuffer.append(parentJobItem.getProperty() != null ? parentJobItem.getProperty().getLabel() : "");
if (StringUtils.isNotBlank(testcaseBuffer.toString())) {
buffer.append(testcaseBuffer.toString()).append("/");
}
}
} else {
if (item.getState() != null && StringUtils.isNotBlank(item.getState().getPath())) {
buffer.append(item.getState().getPath()).append("/");
}
}
Property property = item.getProperty();
if (property != null) {
buffer.append(property.getLabel() + "_" + property.getVersion());
}
path = buffer.toString();
return path;
}
private Item getTestCaseParentJobItem(Item testcaseItem) {
Item parentJobItem = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerCoreService.class)) {
ITestContainerCoreService testcaseService = GlobalServiceRegister.getDefault()
.getService(ITestContainerCoreService.class);
if (testcaseService != null) {
try {
parentJobItem = testcaseService.getParentJobItem(item);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
return parentJobItem;
}
private String getCompleteObjectTypePath(ERepositoryObjectType itemType) {
ERepositoryObjectType rootItemType = itemType;
if (ERepositoryObjectType.JDBC != null && ERepositoryObjectType.JDBC.equals(rootItemType)) {
rootItemType = ERepositoryObjectType.METADATA_CONNECTIONS;
}
List<String> typeLabels = new ArrayList<String>();
findOutCompleteTypePath(rootItemType, typeLabels);
StringBuffer buffer = new StringBuffer();
if (!typeLabels.isEmpty()) {
for (int i = 0; i < typeLabels.size(); i++) {
if (i != 0) {
buffer.append("/");
}
buffer.append(typeLabels.get(i));
}
}
return buffer.toString();
}
private void findOutCompleteTypePath(ERepositoryObjectType type, List<String> typeLabels) {
ERepositoryObjectType parentType = ERepositoryObjectType.findParentType(type);
if (parentType != null) {
findOutCompleteTypePath(parentType, typeLabels);
}
typeLabels.add(type.getLabel());
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public String getDetailMessage() {
return detailMessage;
}
public void setDetailMessage(String detailMessage) {
this.detailMessage = detailMessage;
}
}

View File

@@ -1,81 +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.designer.maven.migration.common;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.talend.core.utils.TalendQuoteUtils;
/**
* DOC jding class global comment. Detailled comment
*/
public class ItemsReportUtil {
public static boolean generateReportFile(File reportFile, String header, List<String> records) throws Exception {
boolean generateDone = false;
BufferedWriter printWriter = null;
try {
File parentFolder = new Path(reportFile.getAbsolutePath()).removeLastSegments(1).toFile();
// File parentFolder = new File(parentPath);
if (!parentFolder.exists()) {
parentFolder.mkdirs();
}
if (!reportFile.exists()) {
reportFile.createNewFile();
}
FileOutputStream fos = new FileOutputStream(reportFile);
fos.write(new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF });
OutputStreamWriter outputWriter = new OutputStreamWriter(fos, "UTF-8");
printWriter = new BufferedWriter(outputWriter);
printWriter.write(header);
printWriter.newLine();
for (String recordStr : records) {
printWriter.write(recordStr);
printWriter.newLine();
}
printWriter.flush();
generateDone = true;
} finally {
if (printWriter != null) {
printWriter.close();
}
}
return generateDone;
}
public static String handleColumnQuotes(String text) {
String quoteMark = TalendQuoteUtils.QUOTATION_MARK;
text = StringUtils.isBlank(text) ? "" : text;
if (text.contains(quoteMark)) {
// replace to double quote surround
text = text.replace(quoteMark, quoteMark + quoteMark);
}
return quoteMark + text + quoteMark;
}
public static String getCurrentTimeString() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String time = dateFormat.format(new Date());
return time;
}
}

View File

@@ -1,177 +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.designer.maven.migration.common;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.osgi.service.prefs.BackingStoreException;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.PluginChecker;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.migration.IProjectMigrationTask;
/**
* DOC jding class global comment. Detailled comment
*/
public class MigrationReportHelper {
private static final String COMMA = ",";
private static final String PLUGIN_ID = "org.talend.designer.maven";
private static final String DO_NOT_SHOW_PREF_KEY = "talend.migrationReportDialog.doNotShowAgain";
private static final String MIGRATION_REPORT_HEAD = "Task name,Task description,Item type,Path to migrated item,Migration details";
private static final MigrationReportHelper instance = new MigrationReportHelper();
public static MigrationReportHelper getInstance() {
return instance;
}
private String reportGeneratedPath = "";
private Set<String> taskItemRecords = new HashSet<String>();
private List<MigrationReportRecorder> migrationReportRecorders = new ArrayList<MigrationReportRecorder>();
public void generateMigrationReport(String projectTecName) {
if (migrationReportRecorders == null || migrationReportRecorders.isEmpty()) {
return;
}
if (!PluginChecker.isTIS()) {
clearRecorders();
return;
}
File exportFolder = null;
File reportFile = null;
try {
String currentTime = getCurrentTime();
String filePath = getReportExportFolder(currentTime) + "/" + getReportFileName(currentTime, projectTecName);
reportGeneratedPath = filePath;
reportFile = new File(filePath);
List<String> recordLines = new ArrayList<String>();
for (MigrationReportRecorder record : migrationReportRecorders) {
StringBuffer buffer = new StringBuffer();
buffer.append(ItemsReportUtil.handleColumnQuotes(record.getTaskClassName())).append(COMMA);
buffer.append(ItemsReportUtil.handleColumnQuotes(record.getTaskDescription())).append(COMMA);
buffer.append(ItemsReportUtil.handleColumnQuotes(record.getItemType())).append(COMMA);
buffer.append(ItemsReportUtil.handleColumnQuotes(record.getItemPath())).append(COMMA);
buffer.append(ItemsReportUtil.handleColumnQuotes(record.getDetailMessage()));
recordLines.add(buffer.toString());
}
ItemsReportUtil.generateReportFile(reportFile, MIGRATION_REPORT_HEAD, recordLines);
} catch (Exception e) {
ExceptionHandler.process(e);
if (reportFile != null && reportFile.exists()) {
reportFile.delete();
}
if (exportFolder != null && exportFolder.exists()) {
exportFolder.delete();
}
} finally {
migrationReportRecorders.clear();
taskItemRecords.clear();
}
}
public boolean isRequireDefaultRecord(IProjectMigrationTask task, Item item) {
boolean require = true;
if (task.getOrder() != null) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(task.getOrder());
int year = calendar.get(Calendar.YEAR);
if (year <= 2016) {
return false;
}
}
if (item.getProperty() != null) {
Property property = item.getProperty();
String key = task.getId() + "_" + property.getId() + "_" + property.getVersion();
if (taskItemRecords.contains(key)) {
return false;
}
}
return require;
}
private String getCurrentTime() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String time = dateFormat.format(new Date());
return time;
}
private String getReportExportFolder(String time) {
String folderName = "migrationReport" + "_" + time;
String path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString() + "/report/" + folderName;
return path;
}
private String getReportFileName(String time, String projectTecName) {
String fileName = time + "_" + projectTecName + "_" + "Migration" + "_" + "Report.csv";
return fileName;
}
public static void storeDoNotShowAgainPref(boolean selected) {
IScopeContext scopeContext = ConfigurationScope.INSTANCE;
IEclipsePreferences pref = scopeContext.getNode(PLUGIN_ID);
pref.putBoolean(DO_NOT_SHOW_PREF_KEY, selected);
try {
pref.flush();
} catch (BackingStoreException e) {
ExceptionHandler.process(e);
}
}
public static boolean isReportDialogDisable() {
IScopeContext scopeContext = ConfigurationScope.INSTANCE;
IEclipsePreferences pref = scopeContext.getNode(PLUGIN_ID);
return pref.getBoolean(DO_NOT_SHOW_PREF_KEY, false);
}
public void addRecorder(MigrationReportRecorder recorder) {
if (recorder != null) {
migrationReportRecorders.add(recorder);
if (recorder.getItem() != null && recorder.getItem().getProperty() != null) {
Property property = recorder.getItem().getProperty();
taskItemRecords.add(recorder.getTask().getId() + "_" + property.getId() + "_" + property.getVersion());
}
}
}
public void clearRecorders() {
reportGeneratedPath = "";
migrationReportRecorders.clear();
taskItemRecords.clear();
}
public String getReportGeneratedPath() {
return reportGeneratedPath;
}
}

View File

@@ -1,197 +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.designer.maven.migration.common;
import org.apache.commons.lang.StringUtils;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.properties.Item;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.migration.IProjectMigrationTask;
/**
* DOC jding class global comment. Detailled comment
*/
public class MigrationReportRecorder extends ItemReportRecorder {
private IProjectMigrationTask task;
private MigrationOperationType operationType;
private NodeType node;
private String paramName;
private String oldValue;
private String newValue;
public enum MigrationOperationType {
ADD,
MODIFY,
DELETE
}
public MigrationReportRecorder(IProjectMigrationTask task, Item item) {
super();
this.task = task;
this.item = item;
}
public MigrationReportRecorder(IProjectMigrationTask task, MigrationOperationType operationType, Item item, NodeType node,
String paramName, String oldValue, String newValue) {
super();
this.task = task;
this.operationType = operationType;
this.item = item;
this.node = node;
this.paramName = paramName;
this.oldValue = oldValue;
this.newValue = newValue;
}
public MigrationReportRecorder(IProjectMigrationTask task, Item item, String detailMessage) {
super();
this.task = task;
this.item = item;
this.detailMessage = detailMessage;
}
public String getTaskClassName() {
return task.getClass().getSimpleName();
}
public String getTaskDescription() {
String description = "";
if (StringUtils.isNotBlank(task.getDescription())) {
description = task.getDescription();
}
return description;
}
public String getDetailMessage() {
String details = detailMessage;
if (StringUtils.isNotBlank(detailMessage)) {
return details;
}
if (operationType == null || StringUtils.isBlank(paramName)) {
details = getTaskClassName() + " task is applied";
return details;
}
StringBuffer detailBuffer = new StringBuffer();
if (node != null) {
// migration for node, e.g. tRESTClient component "tRESTClient_2":
detailBuffer.append(node.getComponentName()).append(" component ");
ElementParameterType uniqueName = ComponentUtilities.getNodeProperty(node, "UNIQUE_NAME");
detailBuffer.append(TalendQuoteUtils.addQuotes(uniqueName.getValue())).append(":");
} else {
// migration for item, e.g. context item "testContext":
detailBuffer.append(getItemType() + " item ")
.append(TalendQuoteUtils.addQuotes(item.getProperty().getLabel())).append(":");
}
detailBuffer.append(paramName).append(" was ");
switch (operationType) {
case ADD:
detailBuffer.append("added");
if (StringUtils.isNotBlank(newValue)) {
detailBuffer.append(" with ").append(newValue);
}
break;
case MODIFY:
detailBuffer.append("changed");
if (StringUtils.isNotBlank(oldValue)) {
detailBuffer.append(" from ").append(oldValue);
}
if (StringUtils.isNotBlank(newValue)) {
detailBuffer.append(" to ").append(newValue);
}
break;
case DELETE:
detailBuffer.append("deleted");
break;
default:
break;
}
details = detailBuffer.toString();
return details;
}
/**
* Getter for task.
*
* @return the task
*/
public IProjectMigrationTask getTask() {
return task;
}
/**
* Sets the task.
*
* @param task the task to set
*/
public void setTask(IProjectMigrationTask task) {
this.task = task;
}
/**
* Sets the operationType.
*
* @param operationType the operationType to set
*/
public void setOperationType(MigrationOperationType operationType) {
this.operationType = operationType;
}
/**
* Sets the node.
*
* @param node the node to set
*/
public void setNode(NodeType node) {
this.node = node;
}
/**
* Sets the paramName.
*
* @param paramName the paramName to set
*/
public void setParamName(String paramName) {
this.paramName = paramName;
}
/**
* Sets the oldValue.
*
* @param oldValue the oldValue to set
*/
public void setOldValue(String oldValue) {
this.oldValue = oldValue;
}
/**
* Sets the newValue.
*
* @param newValue the newValue to set
*/
public void setNewValue(String newValue) {
this.newValue = newValue;
}
}

View File

@@ -1,121 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.emf.EmfHelper;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.migration.AbstractItemMigrationTask;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.repository.utils.ConvertJobsUtil;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.maven.migration.common.MigrationReportHelper;
import org.talend.designer.maven.migration.common.MigrationReportRecorder;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
public abstract class AbstractCorrectBuildItemMigrationTask extends AbstractItemMigrationTask implements ICorrectBuildTypeMigrationTask {
protected static final String BUILD_TYPE_PROPERTY = "BUILD_TYPE";
protected static final String BUILD_TYPE_STANDALONE = "STANDALONE";
protected static final String BUILD_TYPE_OSGI = "OSGI";
protected static final String BUILD_TYPE_ROUTE = "ROUTE";
protected static final String BUILD_TYPE_ROUTE_MICROSERVICE = "ROUTE_MICROSERVICE";
protected static final String REST_MS = "REST_MS";
protected static Map<String, String> migratedJobs = new HashMap<String, String>();
protected static void clearMigratedJobs () {
migratedJobs.clear();
}
protected static void skipMigrationForJob (String jobName, String migrationTask) {
migratedJobs.put(jobName, migrationTask);
}
protected static void storeMigratedJob (String jobName, String migrationTask) {
migratedJobs.put(jobName, migrationTask);
}
protected static boolean isJobMigrated (String jobName) {
return migratedJobs.containsKey(jobName);
}
protected static String getStoredJobMigraionTask (String jobName) {
return migratedJobs.get(jobName);
}
public void generateReportRecord(MigrationReportRecorder recorder) {
MigrationReportHelper.getInstance().addRecorder(recorder);
}
public static List<NodeType> searchComponent(ProcessType processType, IComponentFilter filter) {
List<NodeType> list = new ArrayList<NodeType>();
if (filter == null || processType == null) {
return list;
}
for (Object o : processType.getNode()) {
if (filter.accept((NodeType) o)) {
list.add((NodeType) o);
}
}
return list;
}
public void save(Item item) throws PersistenceException {
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault()
.getService(IRepositoryService.class);
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
factory.save(item, true);
}
public ProcessType getProcessType(Item item) {
ProcessType processType = null;
if (item instanceof ProcessItem) {
processType = ((ProcessItem) item).getProcess();
}
if (item instanceof JobletProcessItem) {
processType = ((JobletProcessItem) item).getJobletProcess();
}
if (processType != null) {
EmfHelper.visitChilds(processType);
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (itemType == ERepositoryObjectType.TEST_CONTAINER
&& !ConvertJobsUtil.JobType.STANDARD.getDisplayName().equalsIgnoreCase(processType.getJobType())) {
return null;
}
}
return processType;
}
/**
* Find element parameter with a given parameter name
*
* @param paramName
* @param elementParameterTypes
* @return
*/
public static final ElementParameterType findElementParameterByName(String paramName, NodeType node) {
for (Object obj : node.getElementParameter()) {
ElementParameterType cpType = (ElementParameterType) obj;
if (paramName.equals(cpType.getName())) {
return cpType;
}
}
return null;
}
abstract public void clear ();
}

View File

@@ -1,17 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.ArrayList;
import java.util.List;
import org.talend.core.model.repository.ERepositoryObjectType;
public abstract class AbstractDataServiceJobMigrationTask extends AbstractCorrectBuildItemMigrationTask {
@Override
public List<ERepositoryObjectType> getTypes() {
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
toReturn.add(ERepositoryObjectType.PROCESS);
return toReturn;
}
}

View File

@@ -1,18 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.ArrayList;
import java.util.List;
import org.talend.core.model.repository.ERepositoryObjectType;
public abstract class AbstractRouteMigrationTask extends AbstractCorrectBuildItemMigrationTask {
@Override
public List<ERepositoryObjectType> getTypes() {
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
toReturn.add(ERepositoryObjectType.PROCESS_ROUTE);
toReturn.add(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE);
return toReturn;
}
}

View File

@@ -1,268 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.maven.migration.common.MigrationReportRecorder;
import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.repository.ProjectManager;
/*
* If Job does not contain any of the following components: "tRouteInput", "tRESTClient", "tESBConsumer"
* then BUILD_TYPE must be STANDALONE
* Else (job contains one of "tRouteInput", "tRESTClient" or "tESBConsumer")
* If no BUILD_TYPE is set then default BUILD_TYPE must be STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
* If BUILD_TYPE is STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
* If BUILD_TYPE is ROUTE > EXCEPTION: need warning message! BUILD_TYPE was wrongly set to ROUTE from a previous migration task and has to be manually updated (all subjobs have to be checked manually). Value should be either STANDALONE (in most cases) or OSGI.
*/
public class CorrectBuildTypeForDIJobMigrationTask extends AbstractDataServiceJobMigrationTask {
private static final String[] ESB_COMPONENTS = { "tRouteInput", "tRESTClient", "tESBConsumer" };
private static final String T_RUB_JOB_COMPONENT = "tRunJob";
boolean failure = false;
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
String jobName = item.getProperty().getLabel();
/*
* Migrating remaining jobs only (which was not migrated previously)
*/
if (isJobMigrated(jobName)) {
return ExecutionResult.NOTHING_TO_DO;
}
Object originalBuildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
/*
* If BUILD_TYPE is ROUTE > EXCEPTION: need warning message! BUILD_TYPE was
* wrongly set to ROUTE from a previous migration task and has to be manually
* updated (all subjobs have to be checked manually). Value should be either
* STANDALONE (in most cases) or OSGI.
*/
if (originalBuildType != null && BUILD_TYPE_ROUTE.equalsIgnoreCase((String) originalBuildType)) {
ExceptionHandler.process(new RuntimeException("Job [" + jobName + "] has incorrect BUILD_TYPE ["
+ BUILD_TYPE_ROUTE
+ "] which has to be manually updated (all subjobs have to be checked manually). Value should be either STANDALONE (in most cases) or OSGI"));
return ExecutionResult.FAILURE;
}
for (String name : ESB_COMPONENTS) {
boolean modified = false;
IComponentFilter filter = new NameComponentFilter(name);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
/*
* job contains one of "tRouteInput", "tRESTClient" or "tESBConsumer") If no
* BUILD_TYPE is set then default BUILD_TYPE must be STANDALONE
*/
if (null == originalBuildType) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_STANDALONE);
try {
save(item);
modified |= true;
generateReportRecord(
new MigrationReportRecorder(this, MigrationReportRecorder.MigrationOperationType.MODIFY,
item, null, "Build Type", null, BUILD_TYPE_STANDALONE));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
/*
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
String currentParentJobBuildType = (String) item.getProperty().getAdditionalProperties()
.get(BUILD_TYPE_PROPERTY);
if (BUILD_TYPE_STANDALONE.equalsIgnoreCase(currentParentJobBuildType)) {
updateBuildTypeForSubJobs(item, currentParentJobBuildType);
}
if (failure) {
return ExecutionResult.FAILURE;
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
return ExecutionResult.NOTHING_TO_DO;
}
}
/*
* If Job does not contain any of the following components: "tRouteInput",
* "tRESTClient", "tESBConsumer" then BUILD_TYPE must be STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
if (null == originalBuildType || !BUILD_TYPE_STANDALONE.equalsIgnoreCase(originalBuildType.toString())) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_STANDALONE);
boolean modified = false;
try {
save(item);
modified |= true;
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, item, null, "Build Type",
(null == originalBuildType) ? null : originalBuildType.toString(), BUILD_TYPE_STANDALONE));
updateBuildTypeForSubJobs(item, BUILD_TYPE_STANDALONE);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
if (failure) {
return ExecutionResult.FAILURE;
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
}
/*
* If Job does not contain any of the following components: "tRouteInput",
* "tRESTClient", "tESBConsumer" and BUILD_TYPE is STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
if (BUILD_TYPE_STANDALONE.equalsIgnoreCase(originalBuildType.toString())) {
updateBuildTypeForSubJobs(item, BUILD_TYPE_STANDALONE);
if (failure) {
return ExecutionResult.FAILURE;
}
}
return ExecutionResult.NOTHING_TO_DO;
}
@Override
public String getDescription() {
return "Synchronize build types for DI jobs";
}
@Override
public void clear() {
clearMigratedJobs();
}
@SuppressWarnings("unchecked")
private void updateBuildTypeForSubJobs(Item parentJobItem, String parentJobBuiltType) {
IComponentFilter filter = new NameComponentFilter(T_RUB_JOB_COMPONENT);
ProcessType processType = getProcessType(parentJobItem);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
for (NodeType tRunJobComponent : c) {
String processID = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS",
tRunJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS", tRunJobComponent)
.getValue();
if (processID == null) {
processID = findElementParameterByName("PROCESS:PROCESS_TYPE_PROCESS",
tRunJobComponent) == null ? null
: findElementParameterByName("PROCESS:PROCESS_TYPE_PROCESS", tRunJobComponent)
.getValue();
}
String processVersion = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION",
tRunJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION", tRunJobComponent)
.getValue();
if (processVersion == null) {
processVersion = findElementParameterByName("PROCESS:PROCESS_TYPE_VERSION",
tRunJobComponent) == null ? null
: findElementParameterByName("PROCESS:PROCESS_TYPE_VERSION", tRunJobComponent)
.getValue();
}
if (processID != null && processVersion != null) {
ProcessItem childItem = ItemCacheManager.getProcessItem(processID, processVersion);
Project childItemProject = ProjectManager.getInstance().getCurrentProject();
if (childItem == null) {
for (Project refProject : ProjectManager.getInstance().getAllReferencedProjects()) {
childItem = ItemCacheManager.getRefProcessItem(getProject(), processID);
if (childItem != null) {
childItemProject = refProject;
break;
}
}
}
if (childItem != null) {
Object currentChildBuildType = childItem.getProperty().getAdditionalProperties()
.get(BUILD_TYPE_PROPERTY);
// String jobID = childItem.getProperty().getLabel();
String currentChildBuildTypeStr = (null == currentChildBuildType) ? null
: (String) currentChildBuildType;
if (BUILD_TYPE_STANDALONE.equalsIgnoreCase(parentJobBuiltType)
&& !BUILD_TYPE_STANDALONE.equalsIgnoreCase(currentChildBuildTypeStr)) {
childItem.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY,
BUILD_TYPE_STANDALONE);
try {
save(childItem);
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, childItem, null,
"Build Type", currentChildBuildTypeStr, BUILD_TYPE_STANDALONE));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
failure = true;
}
}
updateBuildTypeForSubJobs(childItem, parentJobBuiltType);
}
}
}
}
}
}

View File

@@ -1,107 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.maven.migration.common.MigrationReportRecorder;
/*
* (non-Javadoc)
* Data service REST (process) = Job with "tRESTRequest"
* If no BUILD_TYPE is set then default BUILD_TYPE must be OSGI
* If Job does not contain any of the following components: "tRouteInput", "tRESTClient", "tESBConsumer" then BUILD_TYPE must be STANDALONE
*/
public class CorrectBuildTypeForDsRestMigrationTask extends AbstractDataServiceJobMigrationTask {
private static final String T_REST_REQUEST = "tRESTRequest";
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
/*
* (non-Javadoc)
*
* @see
* org.talend.core.model.migration.AbstractDataserviceMigrationTask#execute(org
* .talend.core.model.properties.Item)
*/
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
boolean modified = false;
/*
* If no BUILD_TYPE is set then default BUILD_TYPE must be OSGI
*/
IComponentFilter filter = new NameComponentFilter(T_REST_REQUEST);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
Object buildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
if (null == buildType) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_OSGI);
try {
save(item);
modified |= true;
generateReportRecord(
new MigrationReportRecorder(this, MigrationReportRecorder.MigrationOperationType.MODIFY,
item, null, "Build Type", null, BUILD_TYPE_OSGI));
storeMigratedJob(item.getProperty().getLabel(), this.getClass().getName());
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.SUCCESS_NO_ALERT;
} else if (BUILD_TYPE_OSGI.equalsIgnoreCase((String)buildType)){
// current job has correct build type
// skip this job during next migrations
skipMigrationForJob(item.getProperty().getLabel(), this.getClass().getName());
} else if (REST_MS.equalsIgnoreCase((String)buildType)){
// current job has correct build type
// skip this job during next migrations
skipMigrationForJob(item.getProperty().getLabel(), this.getClass().getName());
}
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
} else {
return ExecutionResult.NOTHING_TO_DO;
}
}
@Override
public String getDescription() {
return "Synchronize build types for DS Rest jobs";
}
@Override
public void clear () {
clearMigratedJobs();
}
}

View File

@@ -1,255 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.maven.migration.common.MigrationReportRecorder;
import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.repository.ProjectManager;
/*
* Routes
* If no BUILD_TYPE is set then Default BUILD_TYPE must be ROUTE
* - Manage child jobs for routes ( parent, target BUILD_TYPE = OSGI )
* Else if BUILD_TYPE is ROUTE
* - Manage child jobs for routes ( parent, target BUILD_TYPE = OSGI )
* Else if BUILD_TYPE is ROUTE_MICROSERVICE
* -Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
public class CorrectBuildTypeForRoutesMigrationTask extends AbstractRouteMigrationTask {
private static final String C_TALEND_JOB = "cTalendJob";
protected Map<String, String> migratedChildJobs = new HashMap<String, String>();
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
boolean modified = false;
boolean migrationFailure = false;
/*
* If no BUILD_TYPE is set then default BUILD_TYPE must be ROUTE
*/
Object buildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
if (null == buildType) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_ROUTE);
try {
save(item);
modified |= true;
generateReportRecord(
new MigrationReportRecorder(this, MigrationReportRecorder.MigrationOperationType.MODIFY, item,
null, "Build Type", "null", BUILD_TYPE_OSGI));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
/*
* If no BUILD_TYPE is set then Default BUILD_TYPE must be ROUTE - Manage child
* jobs for routes ( parent, target BUILD_TYPE = OSGI ) Else if BUILD_TYPE is
* ROUTE - Manage child jobs for routes ( parent, target BUILD_TYPE = OSGI )
* Else if BUILD_TYPE is ROUTE_MICROSERVICE -Manage child jobs for jobs (
* parent, target BUILD_TYPE = STANDALONE )
*/
String currentRouteBuildType = (String) item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
String currentRouteID = item.getProperty().getLabel();
IComponentFilter filter = new NameComponentFilter(C_TALEND_JOB);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
for (NodeType cTalendJobComponent : c) {
String processID = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS",
cTalendJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS",
cTalendJobComponent).getValue();
String processVersion = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION",
cTalendJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION",
cTalendJobComponent).getValue();
if (processID != null && processVersion != null) {
ProcessItem childItem = ItemCacheManager.getProcessItem(processID, processVersion);
Project childItemProject = ProjectManager.getInstance().getCurrentProject();
if (childItem == null) {
for (Project refProject : ProjectManager.getInstance().getAllReferencedProjects()) {
childItem = ItemCacheManager.getRefProcessItem(getProject(), processID);
if (childItem != null) {
childItemProject = refProject;
break;
}
}
}
if (childItem != null) {
Object currentChildBuildType = childItem.getProperty().getAdditionalProperties()
.get(BUILD_TYPE_PROPERTY);
String jobID = childItem.getProperty().getLabel();
String currentChildBuildTypeStr = (null == currentChildBuildType) ? null
: (String) currentChildBuildType;
if (BUILD_TYPE_ROUTE.equalsIgnoreCase(currentRouteBuildType)
&& BUILD_TYPE_OSGI.equalsIgnoreCase(currentChildBuildTypeStr)) {
storeMigratedModel(jobID, currentRouteID);
}
if (BUILD_TYPE_ROUTE.equalsIgnoreCase(currentRouteBuildType)
&& !BUILD_TYPE_OSGI.equalsIgnoreCase(currentChildBuildTypeStr)) {
try {
if (isModelMigrated(jobID)) {
ExceptionHandler.process(new RuntimeException(
"Child Job is called by 2 or more different Routes which have different build types. Build type for child Job ["
+ jobID + "] was previously updated to [" + currentChildBuildTypeStr
+ "] to be compatible with parent Route ["
+ getStoredMigratedModelParentRoute(jobID)
+ "] which is not compatible with current parent Route ["
+ currentRouteID + "] with build type [" + currentRouteBuildType
+ "]. "));
migrationFailure = true;
continue;
} else {
childItem.getProperty().getAdditionalProperties()
.put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, BUILD_TYPE_OSGI);
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, childItem, null,
"Build Type", currentChildBuildTypeStr, BUILD_TYPE_OSGI));
ProxyRepositoryFactory.getInstance().save(childItemProject, childItem, true);
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
if (BUILD_TYPE_ROUTE_MICROSERVICE.equalsIgnoreCase(currentRouteBuildType)
&& !BUILD_TYPE_STANDALONE.equalsIgnoreCase(currentChildBuildTypeStr)) {
try {
if (isModelMigrated(jobID)) {
ExceptionHandler.process(new RuntimeException(
"Child Job is called by 2 or more different Routes which have different build types. Build type for child Job ["
+ jobID + "] was previously updated to [" + currentChildBuildTypeStr
+ "] to be compatible with parent Route ["
+ getStoredMigratedModelParentRoute(jobID)
+ "] which is not compatible with current parent Route ["
+ currentRouteID + "] with build type [" + currentRouteBuildType
+ "]. "));
migrationFailure = true;
continue;
} else {
childItem.getProperty().getAdditionalProperties()
.put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, BUILD_TYPE_STANDALONE);
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, childItem, null,
"Build Type", currentChildBuildTypeStr, BUILD_TYPE_STANDALONE));
ProxyRepositoryFactory.getInstance().save(childItemProject, childItem, true);
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
if(!isModelMigrated(jobID)) {
storeMigratedModel(jobID, currentRouteID);
}
}
}
}
}
if (migrationFailure) {
return ExecutionResult.FAILURE;
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
return ExecutionResult.NOTHING_TO_DO;
}
protected void clearMigratedChildJobs() {
migratedChildJobs.clear();
}
protected void storeMigratedModel(String jobName, String parentRouteName) {
migratedChildJobs.put(jobName, parentRouteName);
}
protected boolean isModelMigrated(String jobName) {
return migratedChildJobs.containsKey(jobName);
}
protected String getStoredMigratedModelParentRoute(String jobName) {
return migratedChildJobs.get(jobName);
}
@Override
public String getDescription() {
return "Synchronize build types for Routes (incuding child jobs)";
}
@Override
public void clear() {
clearMigratedChildJobs();
clearMigratedJobs();
}
}

View File

@@ -1,103 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.maven.migration.common.MigrationReportRecorder;
/*
* Data service SOAP = Job with "tESBProviderRequest"
* Set BUILD_TYPE as OSGI
* Manage child jobs for jobs ( parent job, target BUILD_TYPE = OSGI )
*/
public class CorrectBuildTypeForSOAPServiceJobMigrationTask extends AbstractDataServiceJobMigrationTask {
private static final String T_ESB_PROVIDER_REQUEST = "tESBProviderRequest";
private static final String BUILD_TYPE_PROPERTY = "BUILD_TYPE";
private static final String BUILD_TYPE_OSGI = "OSGI";
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
/*
* (non-Javadoc)
*
* @see
* org.talend.core.model.migration.AbstractDataserviceMigrationTask#execute(org
* .talend.core.model.properties.Item)
*/
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
boolean modified = false;
/*
* If no BUILD_TYPE is set then default BUILD_TYPE must be OSGI
*/
IComponentFilter filter = new NameComponentFilter(T_ESB_PROVIDER_REQUEST);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
Object originalBuildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
if (null == originalBuildType || !BUILD_TYPE_OSGI.equalsIgnoreCase(originalBuildType.toString())) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_OSGI);
try {
save(item);
modified |= true;
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, item, null, "Build Type",
(null == originalBuildType) ? null : originalBuildType.toString(), BUILD_TYPE_OSGI));
storeMigratedJob(item.getProperty().getLabel(), this.getClass().getName());
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.SUCCESS_NO_ALERT;
} else if (BUILD_TYPE_OSGI.equalsIgnoreCase((String)originalBuildType)){
// current job has correct build type
// skip this job during next migrations
skipMigrationForJob(item.getProperty().getLabel(), this.getClass().getName());
}
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
return ExecutionResult.NOTHING_TO_DO;
}
@Override
public String getDescription() {
return "Synchronize build types for SOAP service Jobs";
}
@Override
public void clear () {
clearMigratedJobs();
}
}

View File

@@ -1,7 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import org.talend.migration.IProjectMigrationTask;
public interface ICorrectBuildTypeMigrationTask extends IProjectMigrationTask {
public void clear ();
}

View File

@@ -1,118 +0,0 @@
package org.talend.designer.maven.tools;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.swt.widgets.Display;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.Project;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.designer.maven.migration.common.MigrationReportHelper;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForDIJobMigrationTask;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForDsRestMigrationTask;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForRoutesMigrationTask;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForSOAPServiceJobMigrationTask;
import org.talend.designer.maven.migration.tasks.ICorrectBuildTypeMigrationTask;
import org.talend.migration.IMigrationTask;
import org.talend.migration.IProjectMigrationTask;
import org.talend.repository.ProjectManager;
import org.talend.repository.RepositoryWorkUnit;
public class BuildTypeManager {
private ICorrectBuildTypeMigrationTask[] syncBuildTypeMigrationTasks = {
new CorrectBuildTypeForRoutesMigrationTask(), new CorrectBuildTypeForSOAPServiceJobMigrationTask(),
new CorrectBuildTypeForDsRestMigrationTask(), new CorrectBuildTypeForDIJobMigrationTask() };
private boolean hasErrors = false;
public void syncBuildTypes(FieldEditorPreferencePage page) throws Exception {
IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("Synchronize all build types") { //$NON-NLS-1$
@Override
protected void run() {
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
@Override
public void run(final IProgressMonitor monitor) throws CoreException {
try {
syncAllBuildTypesWithProgress(monitor, page);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
};
IWorkspace workspace = ResourcesPlugin.getWorkspace();
try {
ISchedulingRule schedulingRule = workspace.getRoot();
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
};
workUnit.setAvoidUnloadResources(true);
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}
};
hasErrors = false;
new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, true, runnableWithProgress);
if (hasErrors) {
page.setErrorMessage("Build types synchronization finished with errors. Check workspace logs for details.");
} else {
page.setErrorMessage(null);
}
}
public void syncAllBuildTypesWithProgress(IProgressMonitor monitor, FieldEditorPreferencePage page)
throws Exception {
Project project = ProjectManager.getInstance().getCurrentProject();
SubMonitor subMonitor = SubMonitor.convert(monitor, syncBuildTypeMigrationTasks.length);
for (ICorrectBuildTypeMigrationTask task : syncBuildTypeMigrationTasks) {
task.clear();
}
for (ICorrectBuildTypeMigrationTask task : syncBuildTypeMigrationTasks) {
subMonitor.beginTask(task.getDescription(), syncBuildTypeMigrationTasks.length);
IMigrationTask.ExecutionResult result = task.execute(project);
if (IMigrationTask.ExecutionResult.FAILURE.equals(result)) {
hasErrors = true;
}
subMonitor.worked(1);
}
subMonitor.beginTask("Generate migration report", syncBuildTypeMigrationTasks.length);
MigrationReportHelper.getInstance().generateMigrationReport(project.getTechnicalLabel());
monitor.done();
}
}

View File

@@ -302,16 +302,13 @@ public class PomIdsHelper {
private static String getPublishCloudVersion(String latestVersion) {
if (null == latestVersion) {
return null;
} else if (latestVersion.contains(MavenConstants.SNAPSHOT)) {
return latestVersion;
return "0.1.0";
} else {
latestVersion = VersionUtils.getPublishVersion(latestVersion);
int i = latestVersion.lastIndexOf('.') + 1;
return latestVersion.substring(0, i) + (Long.parseLong(latestVersion.substring(i)) + 1);
}
}
/**
* @return "<bundleVersion>".
*/
@@ -324,12 +321,12 @@ public class PomIdsHelper {
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = VersionUtils.getPublishVersion(bundleVersion);
version = bundleVersion;
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
@@ -348,12 +345,12 @@ public class PomIdsHelper {
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = VersionUtils.getPublishVersion(featureVersion);
version = featureVersion;
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
@@ -377,7 +374,7 @@ public class PomIdsHelper {
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
@@ -401,7 +398,7 @@ public class PomIdsHelper {
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}

View File

@@ -19,11 +19,9 @@ import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.SecureRandom;
import java.util.ArrayList;
@@ -1099,16 +1097,4 @@ public class PomUtil {
}
}
public static boolean isValidPomFile(String pomfile) {
if (pomfile != null) {
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
try (InputStream inputStream = new FileInputStream(new File(pomfile))) {
modelManager.readMavenModel(inputStream);
return true;
} catch (IOException | CoreException e) {
return false;
}
}
return false;
}
}

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/commons-text-1.10.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.10.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-pool2-2.4.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-validator-1.5.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-math3-3.3.jar"/>
@@ -10,5 +8,6 @@
<classpathentry exported="true" kind="lib" path="lib/commons-digester-2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-cli-2.0-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.15.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-text-1.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -10,7 +10,7 @@ Bundle-ClassPath: .,
lib/commons-math3-3.3.jar,
lib/commons-validator-1.5.1.jar,
lib/commons-pool2-2.4.2.jar,
lib/commons-text-1.10.0.jar,
lib/commons-text-1.1.jar,
lib/commons-io-2.10.0.jar
Export-Package: org.apache.commons.cli2,
org.apache.commons.cli2.builder,

View File

@@ -58,11 +58,6 @@
<artifactId>commons-pool2</artifactId>
<version>2.4.2</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</artifactItem>
<artifactItem>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>

View File

@@ -10,7 +10,7 @@
<artifactId>org.talend.libraries.apache</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<reload4j.version>1.2.22</reload4j.version>
<reload4j.version>1.2.19</reload4j.version>
<slf4j.version>1.7.29</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
</properties>

View File

@@ -6,42 +6,9 @@ COPYRIGHTS AND LICENSES
ORIGINAL LICENSE (a.k.a. "hypersonic_lic.txt")
For work developed by the HSQL Development Group:
For content, code, and products originally developed by Thomas Mueller and the Hypersonic SQL Group:
Copyright (c) 2001-2022, The HSQL Development Group
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the HSQL Development Group nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
For work originally developed by the Hypersonic SQL Group:
Copyright (c) 1995-2000, The Hypersonic SQL Group.
Copyright (c) 1995-2000 by the Hypersonic SQL Group.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -70,12 +37,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Hypersonic SQL Group.
This software consists of voluntary contributions made by many individuals on behalf of the
Hypersonic SQL Group.
For work added by the HSQL Development Group (a.k.a. hsqldb_lic.txt):
Copyright (c) 2001-2022, The HSQL Development Group
Copyright (c) 2001-2005, The HSQL Development Group
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -9,32 +9,4 @@
</parent>
<artifactId>org.talend.libraries.jdbc.hsql</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.7.1</version>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<destFileName>hsqldb.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -126,8 +126,6 @@ ConfigModuleDialog.error.missingName=Please input a module name!
ConfigModuleDialog.error.missingModule=Please select a module!
ConfigModuleDialog.search.noModules=No modules found for search of: {0} !
ConfigModuleDialog.warn.artifactory=User libraries artifact repository can't be connected!
ConfigModuleDialog.btn.detectDependencies=Add direct dependencies
ConfigModuleDialog.btn.detectDependenciesTip=Add direct dependencies for selected module
ImportCustomSettingsAction.title=Import custom settings
ImportCustomSettingsAction.warning=Are you sure to overwrite the custom mvn uri settings with the selected file ?
ExportCustomSettingsAction.title=Export custom settings

View File

@@ -185,7 +185,7 @@ public class LibraryManagerUIService implements ILibraryManagerUIService {
"ArtifactsDeployer.uploadJarEncounterMvnRepositroySameName.MessageContent", originalJarFileName, mvnUrlForJarName));//$NON-NLS-1$
}
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue, boolean allowDetectDependencies) {
return new ConfigModuleDialog(parentShell, initValue, allowDetectDependencies);
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue) {
return new ConfigModuleDialog(parentShell, initValue);
}
}

View File

@@ -19,20 +19,15 @@ import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.TimeoutException;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -41,7 +36,6 @@ import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.fieldassist.AutoCompleteField;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -62,19 +56,13 @@ import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.commons.ui.runtime.utils.ZipFileUtils;
import org.talend.commons.ui.swt.dialogs.IConfigModuleDialog;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleToInstall;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.librariesmanager.maven.MavenArtifactsHandler;
import org.talend.librariesmanager.model.ModulesNeededProvider;
import org.talend.librariesmanager.prefs.LibrariesManagerUtils;
import org.talend.librariesmanager.ui.LibManagerUiPlugin;
import org.talend.librariesmanager.ui.i18n.Messages;
import org.talend.librariesmanager.utils.ConfigModuleHelper;
@@ -144,13 +132,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
private Composite warningComposite;
private Button detectDepBtn;
private String moduleFilePath;
private boolean allowDetectDependencies = false;
private boolean detectDependencies = false;
/**
* DOC wchen InstallModuleDialog constructor comment.
*
@@ -161,13 +142,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE | getDefaultOrientation());
this.initValue = initValue;
}
public ConfigModuleDialog(Shell parentShell, String initValue, boolean allowDetectDependencies) {
super(parentShell);
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE | getDefaultOrientation());
this.initValue = initValue;
this.allowDetectDependencies = allowDetectDependencies;
}
@Override
protected void configureShell(Shell newShell) {
@@ -244,11 +218,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
GridData layoutData = new GridData(GridData.FILL_BOTH);
mvnContainer.setLayoutData(layoutData);
createMavenURIComposite(mvnContainer);
detectDepBtn = new Button(mvnContainer, SWT.CHECK);
detectDepBtn.setLayoutData(new GridData());
detectDepBtn.setText(Messages.getString("ConfigModuleDialog.btn.detectDependencies"));
detectDepBtn.setToolTipText(Messages.getString("ConfigModuleDialog.btn.detectDependenciesTip"));
detectDepBtn.setVisible(allowDetectDependencies());
}
@Override
@@ -288,7 +257,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setPlatformGroupEnabled(true);
setInstallNewGroupEnabled(false);
setRepositoryGroupEnabled(false);
setDetectBtnEnabled();
if (validateInputFields()) {
setupMavenURIforPlatform();
}
@@ -344,7 +312,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setPlatformGroupEnabled(false);
setInstallNewGroupEnabled(false);
setRepositoryGroupEnabled(true);
setDetectBtnEnabled();
}
});
@@ -682,12 +649,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setMessage(Messages.getString("InstallModuleDialog.error.jarPath"), IMessageProvider.ERROR);
return false;
}
boolean validPomFile = PomUtil.isValidPomFile(jarPathTxt.getText());
if(!(validPomFile || ZipFileUtils.isValidJarFile(jarPathTxt.getText()))) {
return false;
}
String originalText = defaultUriTxt.getText().trim();
String customURIWithType = MavenUrlHelper.addTypeForMavenUri(customUriText.getText(), moduleName);
if (useCustomBtn.getSelection()) {
@@ -702,9 +663,7 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
return false;
}
} else if (StringUtils.isEmpty(originalText)) {
if(!validPomFile) {
return false;
}
return false;
}
setMessage(Messages.getString("InstallModuleDialog.message"), IMessageProvider.INFORMATION);
@@ -780,98 +739,83 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
customURI = MavenUrlHelper.addTypeForMavenUri(customUriText.getText().trim(), moduleName);
urlToUse = !StringUtils.isEmpty(customURI) ? customURI : defaultURI;
}
detectDependencies = allowDetectDependencies() && detectDepBtn.getSelection();
Map<String, File> mvnurl2Files = null;
if (platfromRadioBtn.getSelection()) {
moduleName2MVNUrls.put(moduleName, urlToUse);
moduleFilePath = calculatePath(urlToUse);// for platform jar
mvnurl2Files = detectDependencies();
} else if (installRadioBtn.getSelection()) {
if (installRadioBtn.getSelection()) {
File jarFile = new File(jarPathTxt.getText().trim());
moduleFilePath = jarFile.getAbsolutePath();
mvnurl2Files = detectDependencies();
if(ZipFileUtils.isValidJarFile(moduleFilePath)) {
MavenArtifact art = MavenUrlHelper.parseMvnUrl(urlToUse);
moduleName = art.getFileName();
moduleName2MVNUrls.put(moduleName, urlToUse);
String sha1New = ConfigModuleHelper.getSHA1(jarFile);
art.setSha1(sha1New);
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
boolean install = false;
if (localFile != null && localFile.exists()) {
String sha1Local = ConfigModuleHelper.getSHA1(localFile);
// already installed with different jar
if (!sha1Local.equals(sha1New)) {
install = true;
}
} else {
// just install
MavenArtifact art = MavenUrlHelper.parseMvnUrl(urlToUse);
moduleName = art.getFileName();
String sha1New = ConfigModuleHelper.getSHA1(jarFile);
art.setSha1(sha1New);
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
boolean install = false;
if (localFile != null && localFile.exists()) {
String sha1Local = ConfigModuleHelper.getSHA1(localFile);
// already installed with different jar
if (!sha1Local.equals(sha1New)) {
install = true;
}
if (install) {
final IRunnableWithProgress progress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Install and share " + jarFile, 100);
monitor.worked(10);
DisplayUtils.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
} else {
// just install
install = true;
}
if (install) {
final IRunnableWithProgress progress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Install and share " + jarFile, 100);
monitor.worked(10);
DisplayUtils.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
try {
boolean deploy = true;
// check remote
List<MavenArtifact> remoteArtifacts = null;
try {
boolean deploy = true;
// check remote
List<MavenArtifact> remoteArtifacts = null;
try {
remoteArtifacts = ConfigModuleHelper.searchRemoteArtifacts(art.getGroupId(),
art.getArtifactId(), null);
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (remoteArtifacts != null && !remoteArtifacts.isEmpty()) {
if (ConfigModuleHelper.canFind(new HashSet<MavenArtifact>(remoteArtifacts), art)) {
deploy = false;
} else {
if (art.getVersion() != null
&& art.getVersion().endsWith(MavenUrlHelper.VERSION_SNAPSHOT)) {
// snapshot
deploy = true;
} else {
// popup and ask, reinstall?
deploy = MessageDialog.open(MessageDialog.CONFIRM, getShell(), "",
Messages.getString("ConfigModuleDialog.shareInfo"), SWT.NONE);
}
}
}
ConfigModuleHelper.install(jarFile, urlToUse, deploy);
updateIndex(urlToUse, moduleName);
remoteArtifacts = ConfigModuleHelper.searchRemoteArtifacts(art.getGroupId(),
art.getArtifactId(), null);
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (remoteArtifacts != null && !remoteArtifacts.isEmpty()) {
if (ConfigModuleHelper.canFind(new HashSet<MavenArtifact>(remoteArtifacts), art)) {
deploy = false;
} else {
if (art.getVersion() != null
&& art.getVersion().endsWith(MavenUrlHelper.VERSION_SNAPSHOT)) {
// snapshot
deploy = true;
} else {
// popup and ask, reinstall?
deploy = MessageDialog.open(MessageDialog.CONFIRM, getShell(), "",
Messages.getString("ConfigModuleDialog.shareInfo"), SWT.NONE);
}
}
}
ConfigModuleHelper.install(jarFile, urlToUse, deploy);
updateIndex(urlToUse);
} catch (Exception e) {
ExceptionHandler.process(e);
}
});
monitor.done();
}
};
runProgress(progress);
}
}
});
monitor.done();
}
};
runProgress(progress);
}
} else if (repositoryRadioBtn.getSelection()) {
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
if (localFile != null && localFile.exists()) {
moduleFilePath = localFile.getAbsolutePath();
moduleName2MVNUrls.put(moduleName, urlToUse);
mvnurl2Files = detectDependencies();
}
if (!isLocalSearch) {
boolean download = true;
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
if (localFile != null && localFile.exists()) {
// check sha1
String sha1Local = ConfigModuleHelper.getSHA1(localFile);
@@ -901,77 +845,15 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
DownloadModuleRunnableWithLicenseDialog downloadModuleRunnable = new DownloadModuleRunnableWithLicenseDialog(
toInstall, getShell());
runProgress(downloadModuleRunnable);
this.updateIndex(defaultURI, moduleName);
localFile = ConfigModuleHelper.resolveLocal(urlToUse);
moduleFilePath = localFile.getAbsolutePath();
moduleName2MVNUrls.put(moduleName, urlToUse);
mvnurl2Files = detectDependencies();
this.updateIndex(defaultURI);
}
}
}
shareLibs(mvnurl2Files);
setReturnCode(OK);
close();
}
private void shareLibs(Map<String, File> mvnurl2Files) {
if(mvnurl2Files != null && mvnurl2Files.size() > 0) {
Job shareLibJob = new Job("") {
@Override
protected IStatus run(IProgressMonitor arg0) {
Iterator<Entry<String, File>> iterator = mvnurl2Files.entrySet().iterator();
MavenArtifactsHandler mavenArtifactsHandler = new MavenArtifactsHandler();
while(iterator.hasNext()) {
Entry<String, File> entry = iterator.next();
String mvnurl = entry.getKey();
MavenArtifact art = MavenUrlHelper.parseMvnUrl(mvnurl);
List<MavenArtifact> remoteArtifacts = null;
try {
remoteArtifacts = ConfigModuleHelper.searchRemoteArtifacts(art.getGroupId(),
art.getArtifactId(), null);
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (remoteArtifacts != null && !remoteArtifacts.isEmpty()) {
if (ConfigModuleHelper.canFind(new HashSet<MavenArtifact>(remoteArtifacts), art)) {
continue;
}
}
try {
mavenArtifactsHandler.deploy(entry.getValue(), art);
} catch (Exception e) {
ExceptionHandler.process(e);
}
String generatedModuleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnurl);
updateIndex(mvnurl, generatedModuleName);
}
return Status.OK_STATUS;
}
};
shareLibJob.schedule();
}
}
private Map<String, File> detectDependencies() {
Map<String, File> mvnurl2Files = new HashMap<String, File>();
if(detectDependencies) {
mvnurl2Files = ModuleMavenURIUtils.getDependencyModules(moduleFilePath, urlToUse);
mvnurl2Files.keySet().stream().forEach(mvnUrl-> {
String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnUrl);
moduleName2MVNUrls.put(moduleName, mvnUrl);
});
}
return mvnurl2Files;
}
@Override
public String getModuleName() {
return moduleName;
@@ -1037,10 +919,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
}
useCustomBtn.setSelection(false);
}
private void setDetectBtnEnabled() {
detectDepBtn.setEnabled(true);
}
private void setupMavenURIforInstall() throws Exception {
if (validateInputForInstallPre()) {
@@ -1054,32 +932,18 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
defaultUri = detectUri;
}
}
if(filePath.trim().endsWith("xml") || filePath.trim().endsWith("pom")) {
defaultUriTxt.setText("");
customUriText.setText("");
useCustomBtn.setEnabled(false);
if(allowDetectDependencies()) {
detectDepBtn.setSelection(true);
detectDepBtn.setEnabled(false);
}
} else {
defaultUriTxt.setText(defaultUri);
customUriText.setText(defaultUri);
if (!org.apache.commons.lang3.StringUtils.isEmpty(detectUri)
&& !ConfigModuleHelper.isSameUri(defaultUri, detectUri)) {
customUriText.setText(detectUri);
}
useCustomBtn.setEnabled(true);
if(allowDetectDependencies()) {
detectDepBtn.setEnabled(true);
}
defaultUriTxt.setText(defaultUri);
customUriText.setText(defaultUri);
if (!org.apache.commons.lang3.StringUtils.isEmpty(detectUri)
&& !ConfigModuleHelper.isSameUri(defaultUri, detectUri)) {
customUriText.setText(detectUri);
}
customUriText.setEnabled(false);
}
validateInputFields();
}
private void updateIndex(String urlToUse, String moduleName) {
private void updateIndex(String urlToUse) {
Set<String> modulesNeededNames = ModulesNeededProvider.getAllManagedModuleNames();
if (!modulesNeededNames.contains(moduleName)) {
@@ -1139,84 +1003,4 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
platformComboField.setProposals(moduleValueArray);
}
private boolean allowDetectDependencies() {
return allowDetectDependencies;
}
private Map<String, String> moduleName2MVNUrls = new HashMap<String, String>();
@Override
public Map<String, String> getModulesMVNUrls() {
return moduleName2MVNUrls;
}
private String calculatePath(String mvnUrl) {
String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnUrl);
String filePath = null;
String librariesPath = LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA);
File file = new File(librariesPath);
if(file.exists()) {
File[] list = file.listFiles((dir, name)->name.equals(moduleName));
if(list != null && list.length > 0) {
filePath = list[0].getAbsolutePath();
}
}
if(filePath == null) {
filePath = searchLocalM2(mvnUrl);
}
return filePath;
}
private String searchLocalM2(String mvnUrl) {
MavenArtifact parsedMvnArtifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
String artifactPath = MavenUrlHelper.getArtifactPath(parsedMvnArtifact);
if (artifactPath == null) {
return null;
}
String filePath = null;
String LOCAL_M2 = MavenPlugin.getMaven().getLocalRepositoryPath();
if(MavenConstants.DEFAULT_LIB_GROUP_ID.equals(parsedMvnArtifact.getGroupId())) {
File m2Dir = new File(LOCAL_M2);
if (m2Dir.exists()) {
try {
String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnUrl);
filePath = searchWithFilename(m2Dir, moduleName);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
if(filePath == null && new File(LOCAL_M2 + "/" + artifactPath).exists()) {
filePath = LOCAL_M2 + "/" + artifactPath;
}
return filePath;
}
private String searchWithFilename(File dir, String filename) throws Exception {
String file = null;
File[] fs = dir.listFiles();
if(fs != null) {
for (File f : fs) {
if (f.isDirectory()) {
file = searchWithFilename(f, filename);
if(file != null) {
break;
}
} else {
if (f.isFile() && f.getName().equals(filename)) {
file = f.getAbsolutePath();
break;
}
}
}
}
return file;
}
}

View File

@@ -15,7 +15,7 @@ package org.talend.librariesmanager.ui.dialogs;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.text.MessageFormat;
import java.util.concurrent.TimeoutException;
import org.apache.commons.lang.StringUtils;
@@ -542,13 +542,4 @@ public class InstallModuleDialog extends TitleAreaDialog implements ICellEditorD
public String getMavenURI() {
return null;
}
/* (non-Javadoc)
* @see org.talend.commons.ui.swt.dialogs.IConfigModuleDialog#getModulesMVNUrls()
*/
@Override
public Map<String, String> getModulesMVNUrls() {
// TODO Auto-generated method stub
return null;
}
}

View File

@@ -12,54 +12,19 @@
// ============================================================================
package org.talend.librariesmanager.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
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.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.TimeoutException;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.stream.Collectors;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcherInput;
import org.apache.oro.text.regex.Perl5Compiler;
import org.apache.oro.text.regex.Perl5Matcher;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
@@ -67,31 +32,21 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.utils.ZipFileUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleStatusProvider;
import org.talend.core.model.general.Project;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.designer.maven.launch.MavenPomCommandLauncher;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.librariesmanager.ui.LibManagerUiPlugin;
import org.talend.librariesmanager.ui.i18n.Messages;
import org.talend.repository.ProjectManager;
/**
* created by wchen on Sep 25, 2017 Detailled comment
*
*/
public class ModuleMavenURIUtils {
private static Logger log = Logger.getLogger(ModuleMavenURIUtils.class);
private static PatternMatcherInput patternMatcherInput;
private static Perl5Matcher matcher = new Perl5Matcher();
@@ -197,455 +152,4 @@ public class ModuleMavenURIUtils {
clipBoard.setContents(new Object[] { text }, new Transfer[] { textTransfer });
}
}
public static Map<String, File> getDependencyModules(String jarpomFilePath, String mvnURL) {
Map<String, File> mvnurl2Files = new HashMap<String, File>();
String pomfile = jarpomFilePath;
boolean validJarFile = org.talend.commons.ui.runtime.utils.ZipFileUtils.isValidJarFile(jarpomFilePath);
Set<String> tempFiles = new HashSet<>();
try {
if (validJarFile) {
pomfile = extractPomFile(jarpomFilePath, mvnURL, tempFiles);
}
if (PomUtil.isValidPomFile(pomfile)) {
List<String> dependenciesMVNURL = callMavenCmd(pomfile, tempFiles);
if (dependenciesMVNURL.isEmpty()) {
dependenciesMVNURL = addDependencies(pomfile);
}
for (String _mvnurl : dependenciesMVNURL) {
File resolvedLocalFile = ConfigModuleHelper.resolveLocal(_mvnurl);
mvnurl2Files.put(_mvnurl, resolvedLocalFile);
// String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(_mvnurl);
}
}
} finally {
if(tempFiles != null) {
for(String file:tempFiles) {
if(!StringUtils.isBlank(file)) {
File tempFile = new File(file);
try {
tempFile.delete();
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
}
}
return mvnurl2Files;
}
private static List<String> callMavenCmd(String pomfile, Set<String> tempFiles) {
List<String> results = new LinkedList<String>();
String outputDependenciesFile = outputDependencyList(pomfile, tempFiles);
if (outputDependenciesFile != null && new File(outputDependenciesFile).exists()) {
results = translatetoMVNURL(outputDependenciesFile);
}
return results;
}
private static String extractPomFile(String moduleFilePath, String mvnURL, Set<String> tempFiles) {
final IContainer projTempFolder = getProjectTempFolder();
IFile file = projTempFolder.getFile(new Path("extractedPom.xml"));
deleteFile(file);
String destPomFile = file.getLocation().toOSString();
tempFiles.add(destPomFile);
try (JarFile zip = new JarFile(moduleFilePath)) {
List<? extends JarEntry> pomEntries = zip.stream().filter(entry -> entry.getName().endsWith("pom.xml"))
.collect(Collectors.toList());
if (!pomEntries.isEmpty()) {
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnURL);
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
for (JarEntry entry : pomEntries) {
try (InputStream inputStream = zip.getInputStream(entry)) {
Model model = parseMavenModel(inputStream, modelManager);
if (sameGAV(artifact, model)) {
ZipFileUtils.unZipFileEntry(new File(destPomFile), zip, entry);
break;
}
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
} catch (IOException e) {
ExceptionHandler.process(e);
}
return destPomFile;
}
private static String outputDependencyList(String pomfile, Set<String> tempFiles) {
final IContainer projTempFolder = getProjectTempFolder();
final IFile newFile = projTempFolder.getFile(new Path("pom.xml"));
deleteFile(newFile);
tempFiles.add(newFile.getLocation().toOSString());
File file = newFile.getLocation().toFile();
try {
FileUtils.copyFile(new File(pomfile), file);
newFile.refreshLocal(0, new NullProgressMonitor());
} catch (IOException | CoreException e) {
ExceptionHandler.process(e);
}
// output to
IFile ioutputFile = projTempFolder.getFile(new Path("dependencies.txt"));
deleteFile(ioutputFile);
String outputFile = ioutputFile.getLocation().toOSString();
tempFiles.add(outputFile);
final IRunnableWithProgress runnable = new IRunnableWithProgress() {
@SuppressWarnings("unchecked")
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
MavenPomCommandLauncher launcher = new MavenPomCommandLauncher(newFile, "dependency:list");
Map<String, Object> argumentsMap = new HashMap<>();
argumentsMap.put(TalendProcessArgumentConstant.ARG_PROGRAM_ARGUMENTS, "-f " + file.getAbsolutePath()
+ " -DoutputFile=" + outputFile + " -DexcludeTransitive=true -DincludeScope=runtime");
launcher.setArgumentsMap(argumentsMap);
try {
launcher.execute(new NullProgressMonitor());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
};
try {
final ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
dialog.run(true, false, runnable);
} catch (InvocationTargetException|InterruptedException e) {
ExceptionHandler.process(e);
}
return outputFile;
}
private static IContainer getProjectTempFolder() {
Project project = ProjectManager.getInstance().getCurrentProject();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IContainer projTempFolder = workspace.getRoot().getFolder(new Path(project.getTechnicalLabel() + "/temp"));
return projTempFolder;
}
private static void deleteFile(IFile file) {
if(file != null && file.exists()) {
try {
file.delete(true, new NullProgressMonitor());
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
private static List<String> translatetoMVNURL(String file) {
List<String> translatedLines = new LinkedList<>();
final String mvnUrlSep = "/";
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
List<String> readLines = IOUtils.readLines(bufferedReader);
for (String line : readLines) {
if (StringUtils.isBlank(line) || line.trim().startsWith("The following files")) {
continue;
}
line = line.trim().replaceAll(":", mvnUrlSep);
String[] arr = line.split(mvnUrlSep);
if(arr.length == 5 && "jar".equals(arr[2])) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(arr[0] + mvnUrlSep);
stringBuffer.append(arr[1] + mvnUrlSep);
stringBuffer.append(arr[3] + mvnUrlSep);
stringBuffer.append(arr[2]);
translatedLines.add("mvn:" + stringBuffer.toString());
}
}
} catch (IOException e) {
ExceptionHandler.process(e);
}
return translatedLines;
}
private static List<String> addDependencies(String jarpomfile) {
List<String> dependencies = new LinkedList<String>();
if (jarpomfile == null) {
return dependencies;
}
jarpomfile = jarpomfile.replaceAll("\\\\", "/");
File file = new File(jarpomfile);
if (!(file.exists() && file.isFile() && file.canRead())) {
return dependencies;
}
try (InputStream inputStream = new FileInputStream(new File(jarpomfile))) {
addDependencies(inputStream, dependencies);
} catch (IOException | CoreException e) {
ExceptionHandler.process(e);
}
return dependencies;
}
private static void addDependencies(InputStream inputStream, List<String> artifacts)
throws IOException, CoreException {
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
Model mavenModel = parseMavenModel(inputStream, modelManager);
List<File> filesInLocalM2 = readFromLocalM2("pom");
List<String> ignoreScopeList = Arrays.asList("provided", "test", "system");
boolean ingnoreOptional = false;
List<Dependency> dependencies = filterDependenciesWithParent(modelManager, mavenModel, filesInLocalM2, ignoreScopeList,
ingnoreOptional);
if (dependencies.size() > 0) {
// read properties from mavenModel & mavenModel's ancestor
Properties properties = new Properties();
readProperties(modelManager, mavenModel, properties, filesInLocalM2);
for (Dependency dep : dependencies) {
String groupId = dep.getGroupId();
String artifactId = dep.getArtifactId();
String version = dep.getVersion();
if ("${project.groupId}".equals(groupId)) {
dep.setGroupId(mavenModel.getGroupId());
if (mavenModel.getGroupId() == null) {
dep.setGroupId(mavenModel.getParent().getGroupId());
}
groupId = dep.getGroupId();
} else if (isVariable(groupId)) {
groupId = properties.getProperty(groupId.substring(2, groupId.length() - 1));
dep.setGroupId(groupId);
}
// version
if (version == null) {// if use value from dependencyManagement
version = (String) properties.get(groupId + ":" + artifactId);
dep.setVersion(version);
} else if (isVariable(version)) {// read variable
if ("${project.version}".equals(version)) {
version = mavenModel.getVersion();
dep.setVersion(version);
} else {
version = version.substring(2, version.length() - 1);
version = properties.getProperty(version);
dep.setVersion(version);
}
} else if(rangePattern(version)) {
String trim = version.trim();
String[] split = trim.split(",");
if(split.length == 1) {
version = trim.substring(1, trim.length()-1).trim();
dep.setVersion(version);
} else if(split.length == 2) {
if(trim.endsWith("]") && !split[1].trim().equals("]")) {
version = split[1].substring(0, split[1].length() - 1).trim();
dep.setVersion(version);
} else if(trim.startsWith("[") && !split[0].trim().equals("[")) {
version = split[0].substring(1).trim();
dep.setVersion(version);
} else {
version = null;
}
}
}
if (groupId == null || version == null) {
log.info("cannot parse dependency: groupID=" + dep.getGroupId() + ", artifactId=" + dep.getArtifactId()
+ ", version=" + dep.getVersion() + ", classfier=" + dep.getClassifier());
continue;
}
String mvnurl = MavenUrlHelper.generateMvnUrl(groupId, artifactId, version, dep.getType(),
dep.getClassifier());
artifacts.add(mvnurl);
}
}
}
private static boolean rangePattern(String version) {
//dependency version is range pattern: like [v1,v2], [v1,v2), [v1,)
String trim = version.trim();
if((trim.startsWith("[") || trim.startsWith("("))
&& (version.endsWith("]") || version.endsWith(")"))) {
return true;
}
return false;
}
private static List<File> readFromLocalM2(String... fileExtensions) {
List<File> pomFiles = new ArrayList<File>();
String LOCAL_M2 = MavenPlugin.getMaven().getLocalRepositoryPath();
File m2Dir = new File(LOCAL_M2);
if (m2Dir.exists()) {
try {
search(m2Dir, pomFiles, Arrays.asList(fileExtensions));
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return pomFiles;
}
private static Model parseMavenModel(InputStream inputStream, MavenModelManager modelManager) throws IOException, CoreException {
Model mavenModel = modelManager.readMavenModel(inputStream);
if (mavenModel.getVersion() == null) {
mavenModel.setVersion(mavenModel.getParent().getVersion());
}
if (mavenModel.getGroupId() == null) {
mavenModel.setGroupId(mavenModel.getParent().getGroupId());
}
return mavenModel;
}
private static List<Dependency> filterDependenciesWithParent(MavenModelManager modelManager, Model mavenModel,
List<File> pomsInLocalM2, List<String> ignoreScopeList, boolean ignoreOptional) {
List<Dependency> result = new LinkedList<Dependency>();
Parent parent = mavenModel.getParent();
if (parent != null && pomsInLocalM2.size() > 0) {
Optional<File> findFirst = pomsInLocalM2.stream()
.filter(pomFile -> pomFile.getName().equals(parent.getArtifactId() + "-" + parent.getVersion() + ".pom"))
.findFirst();
if (findFirst.isPresent()) {
File parentPomFile = findFirst.get();
try (FileInputStream inputStream = new FileInputStream(parentPomFile)) {
Model model = parseMavenModel(inputStream, modelManager);
result.addAll(filterDependenciesWithParent(modelManager, model, pomsInLocalM2, ignoreScopeList,
ignoreOptional));
} catch (CoreException | IOException e) {
ExceptionHandler.process(e);
}
}
}
// filter scope
List<Dependency> dependencies = mavenModel.getDependencies().stream()
.filter(d -> !ignoreScopeList.contains(d.getScope())).collect(Collectors.toList());
// filter optional = true
if (ignoreOptional) {
dependencies = dependencies.stream().filter(d -> !d.isOptional()).collect(Collectors.toList());
}
//filter pom type
dependencies = dependencies.stream().filter(d->!"pom".equals(d.getType())).collect(Collectors.toList());
result.addAll(dependencies);
return result;
}
private static void readProperties(MavenModelManager modelManager, Model mavenModel, Properties properties,
List<File> pomsInLocalM2) {
// read properties from parent, local m2
Parent parent = mavenModel.getParent();
if (parent != null && pomsInLocalM2.size() > 0) {
Optional<File> findFirst = pomsInLocalM2.stream()
.filter(pomFile -> pomFile.getName().equals(parent.getArtifactId() + "-" + parent.getVersion() + ".pom"))
.findFirst();
if (findFirst.isPresent()) {
File parentPomFile = findFirst.get();
try (FileInputStream inputStream = new FileInputStream(parentPomFile)) {
Model model = parseMavenModel(inputStream, modelManager);
readProperties(modelManager, model, properties, pomsInLocalM2);// read parent properties firstly
} catch (CoreException | IOException e) {
ExceptionHandler.process(e);
}
}
}
Properties props = mavenModel.getProperties();
for (Entry entry : props.entrySet()) {
String entryVal = entry.getValue().toString();
if (isVariable(entryVal)) {
if (entryVal.equals("${project.version}")) {
entryVal = mavenModel.getVersion();
} else {
Object object = props.get(entryVal.substring(2, entryVal.length() - 1));
if (object != null) {
entryVal = object.toString();
} else {// not found in self properties, to search in properties
entryVal = properties.getProperty(entryVal.substring(2, entryVal.length() - 1));
while (entryVal != null && isVariable(entryVal)
&& properties.containsKey(entryVal.substring(2, entryVal.length() - 1))) {
entryVal = properties.getProperty(entryVal.substring(2, entryVal.length() - 1));
}
}
}
}
if (entryVal == null) {
log.info("cannot parse property value for " + entry.getValue());
} else if (!isVariable(entryVal)) {
properties.put(entry.getKey(), entry.getValue());
}
}
// read self dependencies properties from DependencyManagement thirdly
if (mavenModel.getDependencyManagement() != null) {
List<Dependency> dependencies = mavenModel.getDependencyManagement().getDependencies();
if (dependencies != null) {
for (Dependency dep : dependencies) {
String version = dep.getVersion();
if (version != null) {
if (version.equals("${project.version}")) {
version = mavenModel.getVersion();
} else if (isVariable(version)) {
version = properties.getProperty(version.substring(2, version.length() - 1));
while (isVariable(version)
&& properties.containsKey(version.substring(2, version.length() - 1))) {
version = properties.getProperty(version.substring(2, version.length() - 1));
}
}
}
if (version != null && !isVariable(version)) {
properties.put(dep.getGroupId() + ":" + dep.getArtifactId(), version);
} else {
log.info("cannot parse version for dependency " + dep.getGroupId() + ":" + dep.getArtifactId());
}
}
}
}
}
private static boolean isVariable(String value) {
return value.startsWith("${") && value.endsWith("}");
}
private static boolean sameGAV(MavenArtifact artifact, Model mavenModel) {
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(artifact.getGroupId())) {
return true;
}
boolean sameGAV = false;
sameGAV = mavenModel.getGroupId().equals(artifact.getGroupId())
&& mavenModel.getArtifactId().equals(artifact.getArtifactId())
&& mavenModel.getVersion().equals(artifact.getVersion());
return sameGAV;
}
private static void search(File dir, List<File> ret, List<String> types) throws Exception {
File[] fs = dir.listFiles();
for (File f : fs) {
if (f.isDirectory()) {
search(f, ret, types);
} else {
if (f.isFile()) {
String ext = FilenameUtils.getExtension(f.getName());
if (types.contains(ext)) {
ret.add(f);
}
}
}
}
}
}

View File

@@ -46,23 +46,6 @@ public final class BundleUtils {
BUNDLE = bundle;
}
public static <T> T getService(Class<T> svcClass, String filter) {
if (BUNDLE == null) {
return null;
}
try {
Method getBundleContext = BUNDLE.getClass().getMethod("getBundleContext");
Object context = getBundleContext.invoke(BUNDLE);
Class<?> ctxClass = context.getClass();
Method getServiceReference = ctxClass.getMethod("getServiceReferences", Class.class, String.class);
Object serviceReference = getServiceReference.invoke(context, svcClass, filter);
Method getService = ctxClass.getMethod("getService", SERVICE_REFERENCE_CLASS);
return svcClass.cast(getService.invoke(context, ((java.util.Collection)serviceReference).iterator().next()));
} catch (Exception e) {
return null;
}
}
public static <T> T getService(Class<T> svcClass) {
if (BUNDLE == null) {
return null;

View File

@@ -520,13 +520,9 @@ public class ResumeUtil {
private String lineSeparator = System.getProperty("line.separator");
private final int capibility = 2 << 22; //8M
private final int FLUSH_FACTOR = 6 *1024 *1024; //6M
private final int SUBSTRING_SIZE = 2 << 20; //2M
private int capibility = 2 << 22; //8M
private int FLUSH_FACTOR = 6 *1024 *1024; //6M
public SimpleCsvWriter(FileChannel channel) {
@@ -557,16 +553,6 @@ public class ResumeUtil {
content = replace(content, "" + TextQualifier, "" + TextQualifier + TextQualifier);
}
if (content.length() > SUBSTRING_SIZE) { //2M
int index = 0;
for (; content.length() - index > SUBSTRING_SIZE; index += SUBSTRING_SIZE) {
flush(true);
final String substring = content.substring(index, index + SUBSTRING_SIZE);
buf.put(substring.getBytes());
}
content = content.substring(index);
}
byte[] contentByte = content.getBytes();
if(contentByte.length > capibility - buf.position()) {
flush(true);

View File

@@ -410,7 +410,7 @@ SalesforceStep1Form.SocksProxyParam=Param\u00E8tres de proxy
SalesforceStep1Form.selectModuleName=Veuillez s\u00E9lectionner un objet standard
SalesforceStep1Form.standardObjects=Objets standards et personnalis\u00E9s
SalesforceStep1Form.TimeOutErrorMessage=L'expiration du d\u00E9lai doit se composer de chiffres.
SalesforceStep1Form.TimeOutTitle=D\u00E9lai avant expiration (en millisecondes)
SalesforceStep1Form.TimeOutTitle=D\u00E9lai avant suspension (en millisecondes)
SalesforceStep1Form.Username=Nom d'utilisateur
SalesforceStep1Form.webURL=URL du service Web
SalesforceStep2Form.module=Module

View File

@@ -14,11 +14,11 @@
<!-- Seems those 3 are not useful -->
<classloader
index="HIVE:HORTONWORKS:HDP_1_0:EMBEDDED"
libraries="hive-hbase-handler-0.9.0.jar;hbase-0.92.0.jar;hadoop-core-1.0.3.jar;commons-logging-1.0.4.jar;datanucleus-api-jdo-3.0.7.jar;datanucleus-core-3.0.9.jar;datanucleus-rdbms-3.0.8.jar;hive-builtins-0.9.0.jar;hive-exec-0.9.0_hdp.jar;hive-jdbc-0.9.0_hdp.jar;hive-metastore-0.9.0_hdp.jar;hive-service-0.9.0_hdp.jar;libfb303-0.7.0.jar;libthrift-0.7.0.jar;commons-lang-2.4.jar;antlr-runtime-3.0.1.jar;commons-dbcp-1.4.jar;commons-pool-1.5.4.jar;derby-10.4.2.0.jar;commons-configuration2-2.8.0.jar;jdo2-api-2.3-ec.jar;reload4j-1.2.22.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;jackson-core-asl-1.8.8.jar;jackson-mapper-asl-1.8.8.jar">
libraries="hive-hbase-handler-0.9.0.jar;hbase-0.92.0.jar;hadoop-core-1.0.3.jar;commons-logging-1.0.4.jar;datanucleus-api-jdo-3.0.7.jar;datanucleus-core-3.0.9.jar;datanucleus-rdbms-3.0.8.jar;hive-builtins-0.9.0.jar;hive-exec-0.9.0_hdp.jar;hive-jdbc-0.9.0_hdp.jar;hive-metastore-0.9.0_hdp.jar;hive-service-0.9.0_hdp.jar;libfb303-0.7.0.jar;libthrift-0.7.0.jar;commons-lang-2.4.jar;antlr-runtime-3.0.1.jar;commons-dbcp-1.4.jar;commons-pool-1.5.4.jar;derby-10.4.2.0.jar;commons-configuration2-2.8.0.jar;jdo2-api-2.3-ec.jar;reload4j-1.2.19.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;jackson-core-asl-1.8.8.jar;jackson-mapper-asl-1.8.8.jar">
</classloader>
<classloader
index="HIVE:AMAZON_EMR:MapR_EMR:STANDALONE"
libraries="hadoop-core-0.20.203.0.jar;reload4j-1.2.22.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
libraries="hadoop-core-0.20.203.0.jar;reload4j-1.2.19.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
</classloader>
<!-- -->
<classloader
@@ -212,14 +212,6 @@
required="true"
uripath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.4.jar">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for plugin org.talend.metadata.managment"
name="hsqldb.jar" mvn_uri="mvn:org.hsqldb/hsqldb/2.7.1"
required="true"
uripath="platform:/plugin/org.talend.libraries.jdbc.hsql/lib/hsqldb.jar">
</libraryNeeded>
</extension>
<extension
point="org.talend.core.migrationTask">

View File

@@ -175,11 +175,6 @@ public class JDBCDriverLoader {
info.put("charSet", systemCharset.displayName()); //$NON-NLS-1$
}
}
//TUP-37016:Upgrade hsqldb to 2.7.1
if (dbType.equals(EDatabaseTypeName.ACCESS.getXmlName()) || ConnectionUtils.isHsql(url)) {
System.setProperty("hsqldb.method_class_names", "net.ucanaccess.converters.*");
}
if (additionalParams != null && !"".equals(additionalParams)
&& (dbType.toUpperCase().contains("ORACLE") || EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbType)

View File

@@ -40,7 +40,7 @@ public enum EHiveWithTezJars {
"api-asn1-api-1.0.0-M20.jar", "api-util-1.0.0-M20.jar", "asm-3.1.jar", "avro-1.7.4.jar",
"commons-beanutils-1.7.0.jar", "commons-beanutils-core-1.8.0.jar", "commons-compress-1.4.1.jar",
"commons-configuration-1.6.jar", "commons-digester-1.8.jar", "commons-net-3.1.jar", "curator-client-2.6.0.jar",
"curator-framework-2.6.0.jar", "curator-recipes-2.6.0.jar", "gson-2.9.0.jar", "guice-3.0.jar",
"curator-framework-2.6.0.jar", "curator-recipes-2.6.0.jar", "gson-2.2.4.jar", "guice-3.0.jar",
"guice-servlet-3.0.jar", "hadoop-auth-2.6.0.2.2.0.0-2041.jar", "hadoop-common-2.6.0.2.2.0.0-2041.jar",
"hadoop-hdfs-2.6.0.2.2.0.0-2041.jar", "hadoop-yarn-api-2.6.0.2.2.0.0-2041.jar",
"hadoop-yarn-client-2.6.0.2.2.0.0-2041.jar", "hadoop-yarn-common-2.6.0.2.2.0.0-2041.jar", "htrace-core-3.0.4.jar",
@@ -56,7 +56,7 @@ public enum EHiveWithTezJars {
"api-asn1-api-1.0.0-M20.jar", "api-util-1.0.0-M20.jar", "asm-3.2.jar", "avro-1.7.5.jar",
"commons-beanutils-1.7.0.jar", "commons-beanutils-core-1.8.0.jar", "commons-compress-1.4.1.jar",
"commons-configuration-1.6.jar", "commons-digester-1.8.jar", "commons-net-3.1.jar", "curator-client-2.7.1.jar",
"curator-framework-2.7.1.jar", "curator-recipes-2.7.1.jar", "gson-2.9.0.jar", "guice-3.0.jar",
"curator-framework-2.7.1.jar", "curator-recipes-2.7.1.jar", "gson-2.2.4.jar", "guice-3.0.jar",
"guice-servlet-3.0.jar", "hadoop-auth-2.7.1.2.3.2.0-2950.jar", "hadoop-common-2.7.1.2.3.2.0-2950.jar",
"hadoop-hdfs-2.7.1.2.3.2.0-2950.jar", "hadoop-yarn-api-2.7.1.2.3.2.0-2950.jar",
"hadoop-yarn-client-2.7.1.2.3.2.0-2950.jar", "hadoop-yarn-common-2.7.1.2.3.2.0-2950.jar",

View File

@@ -2,21 +2,23 @@
*/
package org.talend.designer.core.model.utils.emf.component.impl;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.talend.designer.core.model.utils.emf.component.ComponentPackage;
import org.talend.designer.core.model.utils.emf.component.IMPORTType;
import org.talend.designer.core.model.utils.emf.component.INSTALLType;
@@ -887,82 +889,5 @@ public class IMPORTTypeImpl extends EObjectImpl implements IMPORTType {
result.append(')');
return result.toString();
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.bundleID == null) ? 0 : this.bundleID.hashCode());
result = prime * result + ((this.mESSAGE == null) ? 0 : this.mESSAGE.hashCode());
result = prime * result + ((this.mODULE == null) ? 0 : this.mODULE.hashCode());
result = prime * result + ((this.mODULEGROUP == null) ? 0 : this.mODULEGROUP.hashCode());
result = prime * result + ((this.nAME == null) ? 0 : this.nAME.hashCode());
result = prime * result + ((this.rEQUIREDIF == null) ? 0 : this.rEQUIREDIF.hashCode());
result = prime * result + ((this.urlPath == null) ? 0 : this.urlPath.hashCode());
result = prime * result + ((this.mvn == null) ? 0 : this.mvn.hashCode());
result = prime * result + (this.mRREQUIREDESet ? 1231 : 1237); //boolean
result = prime * result + (this.rEQUIREDESet ? 1231 : 1237);
result = prime * result + (this.sHOWESet ? 1231 : 1237);
result = prime * result + ((this.uRL == null) ? 0 : this.uRL.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IMPORTTypeImpl other = (IMPORTTypeImpl) obj;
if(eIsProxy() != other.eIsProxy() ) {
return false;
}
if (!StringUtils.equals(this.getBundleID(), other.getBundleID())) {
return false;
}
if (!StringUtils.equals(this.getMESSAGE(), other.getMESSAGE())) {
return false;
}
if (!StringUtils.equals(this.getMODULE(), other.getMODULE())) {
return false;
}
if (!StringUtils.equals(this.getMODULEGROUP(), other.getMODULEGROUP())) {
return false;
}
if (!StringUtils.equals(this.getNAME(), other.getNAME())) {
return false;
}
if (!StringUtils.equals(this.getREQUIREDIF(), other.getREQUIREDIF())) {
return false;
}
if (!StringUtils.equals(this.getUrlPath(), other.getUrlPath())) {
return false;
}
if (!StringUtils.equals(this.getMVN(), other.getMVN())) {
return false;
}
if(this.mRREQUIREDESet != other.mRREQUIREDESet) {
return false;
}
if(this.rEQUIREDESet != other.rEQUIREDESet) {
return false;
}
if(this.sHOWESet != other.sHOWESet) {
return false;
}
if((uRL !=null && other.uRL == null) || ((uRL ==null && other.uRL != null))) {
return false;
} else if(uRL != null && other.uRL != null){
Collections.sort(uRL);
Collections.sort(other.uRL);
if(!Arrays.equals(uRL.toArray(), other.uRL.toArray())) {
return false;
}
}
return true;
}
} //IMPORTTypeImpl

View File

@@ -19,14 +19,12 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.LoginException;
@@ -36,7 +34,6 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.repository.utils.LoginTaskRegistryReader;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.services.IGITProviderService;
import org.talend.core.ui.branding.IBrandingConfiguration;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.core.ui.services.IGitUIProviderService;
@@ -150,12 +147,7 @@ public class ApplicationWorkbenchAdvisor extends IDEWorkbenchAdvisor {
if (!ArrayUtils.contains(Platform.getApplicationArgs(), EclipseCommandLine.TALEND_DISABLE_LOGINDIALOG_COMMAND)) {
RegisterManagement.getInstance().validateRegistration();
}
// not git project, do not show git settings preference page
if (IGITProviderService.get() == null || !IGITProviderService.get().isProjectInGitMode()) {
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
pm.remove("org.talend.core.prefs" + WorkbenchPlugin.PREFERENCE_PAGE_CATEGORY_SEPARATOR + "org.talend.repository.gitprovider.settings.GitPreferencePage");
}
// PerspectiveReviewUtil.checkPerspectiveDisplayItems();
}
@Override

View File

@@ -27,18 +27,20 @@ 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.eclipse.emf.ecore.util.EcoreUtil;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.properties.Property;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.PendoDataTrackFactory;
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.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoSignImportProperties;
import org.talend.core.services.ICoreTisService;
import org.talend.repository.items.importexport.handlers.model.ImportItem;
@@ -47,7 +49,7 @@ import org.talend.utils.migration.MigrationTokenUtil;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoImportManager extends AbstractPendoTrackManager {
public class PendoImportManager {
private static final String seperator = "@";
@@ -55,7 +57,7 @@ public class PendoImportManager extends AbstractPendoTrackManager {
static {
try {
isTrackAvailable = PendoDataTrackFactory.getInstance().isTrackSendAvailable();
isTrackAvailable = PendoTrackSender.getInstance().isTrackSendAvailable();
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
@@ -140,9 +142,9 @@ public class PendoImportManager extends AbstractPendoTrackManager {
}
}
public IPendoDataProperties collectProperties() {
protected void collectProperties() {
if (!isTrackRequired()) {
return null;
return;
}
importProperties.setUnsignSEItems(getSortTOSUnsignItems(tosUnsignItemMap));
@@ -182,7 +184,6 @@ public class PendoImportManager extends AbstractPendoTrackManager {
importProperties.setValidMigrationToken(ValueEnum.NO.getDisplayValue());
}
}
return importProperties;
}
private String getSortTOSUnsignItems(Map<String, Integer> tosUnsignItemMap) {
@@ -239,13 +240,27 @@ public class PendoImportManager extends AbstractPendoTrackManager {
if (!isTrackRequired()) {
return;
}
super.sendTrackToPendo();
Job job = new Job("send pendo track") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (isTrackAvailable) {
collectProperties();
PendoTrackSender.getInstance().sendTrackData(TrackEvent.ITEM_IMPORT, importProperties);
}
} catch (Exception e) {
// warning only
ExceptionHandler.process(e, Level.WARN);
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
@Override
public TrackEvent getTrackEvent() {
return TrackEvent.ITEM_IMPORT;
}
}

View File

@@ -984,7 +984,6 @@ DatabaseForm.redshift.driverVersion=Version du pilote
DatabaseForm.redshift.driverVersion.tip=S\u00E9lectionnez un pilote Redshift
DatabaseForm.redshift.useStringAdditionParam=Utiliser un param\u00E8tre de cha\u00EEne de caract\u00E8res
DatabaseForm.supportnls=Support de NLS
DatabaseForm.supportnls.warntip=Cette configuration sera prise en compte apr\u00E8s red\u00E9marrage du Studio
DatabaseTableFilterForm.allSynonyms=Tous les synonymes
DatabaseTableFilterForm.edit=Modifier...
DatabaseTableFilterForm.editFilterName=Modifier le nom du filtre
@@ -1166,7 +1165,7 @@ SalesforceStep1Form.SocksProxyParam=Param\u00E8tres de proxy
SalesforceStep1Form.selectModuleName=Veuillez s\u00E9lectionner un objet standard
SalesforceStep1Form.standardObjects=Objets standards et personnalis\u00E9s
SalesforceStep1Form.TimeOutErrorMessage=L'expiration du d\u00E9lai doit se composer de chiffres.
SalesforceStep1Form.TimeOutTitle=D\u00E9lai avant expiration (en millisecondes)
SalesforceStep1Form.TimeOutTitle=D\u00E9lai avant suspension (en millisecondes)
SalesforceStep1Form.Username=Nom d'utilisateur
SalesforceStep1Form.webURL=URL du service Web
SalesforceStep1Form.AuthParam=Authentification

View File

@@ -984,7 +984,6 @@ DatabaseForm.redshift.driverVersion=\u30C9\u30E9\u30A4\u30D0\u30FC\u306E\u30D0\u
DatabaseForm.redshift.driverVersion.tip=Redshift\u30C9\u30E9\u30A4\u30D0\u30FC\u3092\u9078\u629E
DatabaseForm.redshift.useStringAdditionParam=\u6587\u5B57\u5217\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u4F7F\u7528
DatabaseForm.supportnls=NLS\u3092\u30B5\u30DD\u30FC\u30C8
DatabaseForm.supportnls.warntip=\u3053\u306E\u8A2D\u5B9A\u306FStudio\u306E\u518D\u8D77\u52D5\u5F8C\u306B\u306E\u307F\u6709\u52B9\u3068\u306A\u308A\u307E\u3059\u3002
DatabaseTableFilterForm.allSynonyms=\u3059\u3079\u3066\u306E\u30B7\u30CE\u30CB\u30E0
DatabaseTableFilterForm.edit=\u7DE8\u96C6...
DatabaseTableFilterForm.editFilterName=\u30D5\u30A3\u30EB\u30BF\u30FC\u540D\u3092\u7DE8\u96C6

View File

@@ -984,7 +984,6 @@ DatabaseForm.redshift.driverVersion=\u9A71\u52A8\u7248\u672C
DatabaseForm.redshift.driverVersion.tip=\u9009\u62E9\u4E00\u4E2A Redshift \u9A71\u52A8
DatabaseForm.redshift.useStringAdditionParam=\u4F7F\u7528\u5B57\u4E32\u53C2\u6570
DatabaseForm.supportnls=\u652F\u6301 NLS
DatabaseForm.supportnls.warntip=\u6B64\u8BBE\u7F6E\u53EA\u6709\u5728\u91CD\u542F Studio \u540E\u624D\u4F1A\u751F\u6548\u3002
DatabaseTableFilterForm.allSynonyms=\u6240\u6709\u540C\u4E49\u8BCD
DatabaseTableFilterForm.edit=\u7F16\u8F91...
DatabaseTableFilterForm.editFilterName=\u7F16\u8F91\u7B5B\u9009\u5668\u540D\u79F0

View File

@@ -6317,7 +6317,7 @@ public class DatabaseForm extends AbstractForm {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerUIService.class)) {
ILibraryManagerUIService libUiService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerUIService.class);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(getShell(), null ,false);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(getShell(), null);
if (dialog.open() == IDialogConstants.OK_ID) {
// TOS_DQ only
String selecteModule = dialog.getMavenURI();

View File

@@ -34,7 +34,7 @@ public class SSOClientInstaller {
private final String INSTALL_FILE_NAME = "TalendSignTool.zip";
private final String version = "8.0.1.202210131253";
private final String version = "8.0.1.202206081050";
private static final SSOClientInstaller instance = new SSOClientInstaller();

View File

@@ -2,7 +2,9 @@ package org.talend.updates.runtime;
import org.eclipse.ui.IStartup;
import org.talend.core.PluginChecker;
import org.talend.core.pendo.PendoDataTrackFactory;
import org.talend.core.pendo.PendoTrackDataUtil;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.migration.MigrationReportHelper;
import org.talend.updates.runtime.ui.CheckExtraFeaturesToInstallJob;
@@ -11,7 +13,7 @@ public class WorkbenchStartup implements IStartup {
@Override
public void earlyStartup() {
MigrationReportHelper.getInstance().checkMigrationReport(true);
PendoDataTrackFactory.getInstance().sendProjectLoginTrack();
PendoTrackSender.getInstance().sendToPendo(TrackEvent.PROJECT_LOGIN, PendoTrackDataUtil.getLoginEventProperties());
if (!PluginChecker.isTIS() && !PluginChecker.isStudioLite()) {
CheckExtraFeaturesToInstallJob checkExtraFeaturesToInstallJob = new CheckExtraFeaturesToInstallJob();
checkExtraFeaturesToInstallJob.schedule();

View File

@@ -40,16 +40,16 @@ public class DatabaseVersion4DriversTest {
assertTrue(drivers.containsAll(Arrays.asList(redshiftDrivers)));
String[] redshiftSSODrivers = new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar",
"aws-java-sdk-1.11.848.jar", "jackson-core-2.13.4.jar", "jackson-databind-2.13.4.2.jar",
"jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", "joda-time-2.8.1.jar",
"aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", "jackson-databind-2.11.4.jar",
"jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", "joda-time-2.8.1.jar",
"commons-logging-1.2.jar", "commons-codec-1.14.jar", "aws-java-sdk-redshift-internal-1.12.x.jar" };
drivers = EDatabaseVersion4Drivers.getDrivers(EDatabaseTypeName.REDSHIFT_SSO.getDisplayName(),
ERedshiftDriver.DRIVER_V1.name());
assertTrue(drivers.containsAll(Arrays.asList(redshiftSSODrivers)));
redshiftSSODrivers = new String[] { "redshift-jdbc42-2.1.0.3.jar", "antlr4-runtime-4.8-1.jar",
"aws-java-sdk-1.11.848.jar", "jackson-core-2.13.4.jar", "jackson-databind-2.13.4.2.jar",
"jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", "joda-time-2.8.1.jar",
"aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", "jackson-databind-2.11.4.jar",
"jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", "joda-time-2.8.1.jar",
"commons-logging-1.2.jar", "commons-codec-1.14.jar", "aws-java-sdk-redshift-internal-1.12.x.jar" };
drivers = EDatabaseVersion4Drivers.getDrivers(EDatabaseTypeName.REDSHIFT_SSO.getDisplayName(),
ERedshiftDriver.DRIVER_V2.name());

View File

@@ -13,10 +13,22 @@
package org.talend.core.pendo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.mockito.Mockito;
import org.talend.core.model.properties.Project;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.model.properties.PropertiesFactory;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.properties.PendoImportAPIproperties;
import org.talend.core.pendo.properties.PendoUseAPIProperties;
import org.talend.repository.ProjectManager;
import org.talend.utils.json.JSONObject;
/**
@@ -119,4 +131,93 @@ public class PendoTrackDataUtilTest {
}
@Test
public void testFindReferencePorjectPath() {
Project mainEmfProj = createTestProject("testMain");
org.talend.core.model.general.Project mainProj = Mockito.mock(org.talend.core.model.general.Project.class);
mainProj.setEmfProject(mainEmfProj);
// Main -> Ref1 -> Ref2 -> Ref3
Project refEmfProj1 = createTestProject("ref_project1");
Project refEmfProj2 = createTestProject("ref_project2");
Project refEmfProj3 = createTestProject("ref_project3");
Map<String, org.talend.core.model.general.Project> teclabelProjectMap = new HashMap<String, org.talend.core.model.general.Project>();
org.talend.core.model.general.Project refProj1 = Mockito.mock(org.talend.core.model.general.Project.class);
mainProj.setEmfProject(refEmfProj1);
org.talend.core.model.general.Project refProj2 = Mockito.mock(org.talend.core.model.general.Project.class);
mainProj.setEmfProject(refEmfProj2);
org.talend.core.model.general.Project refProj3 = Mockito.mock(org.talend.core.model.general.Project.class);
mainProj.setEmfProject(refEmfProj3);
teclabelProjectMap.put(refEmfProj1.getTechnicalLabel(), refProj1);
teclabelProjectMap.put(refEmfProj2.getTechnicalLabel(), refProj2);
teclabelProjectMap.put(refEmfProj3.getTechnicalLabel(), refProj3);
ProjectReference projRef1 = createTestProjectReference(refEmfProj1);
ProjectReference projRef2 = createTestProjectReference(refEmfProj2);
ProjectReference projRef3 = createTestProjectReference(refEmfProj3);
List<ProjectReference> refList4Main = new ArrayList<ProjectReference>();
refList4Main.add(projRef1);
List<ProjectReference> refList4Ref1 = new ArrayList<ProjectReference>();
refList4Ref1.add(projRef2);
List<ProjectReference> refList4Ref2 = new ArrayList<ProjectReference>();
refList4Ref2.add(projRef3);
Mockito.when(mainProj.getProjectReferenceList()).thenReturn(refList4Main);
Mockito.when(refProj1.getProjectReferenceList()).thenReturn(refList4Ref1);
Mockito.when(refProj2.getProjectReferenceList()).thenReturn(refList4Ref2);
int[] refCount = new int[] {0};
List<String> resultList = new ArrayList<String>();
Map<String, String> desensitiveLabelMap = new HashMap<String, String>();
PendoTrackDataUtil.findReferencePorjectPath(mainProj, "Main", resultList, refCount, desensitiveLabelMap,
teclabelProjectMap);
String[] expect = new String[] { "Main/Ref1", "Main/Ref1/Ref2", "Main/Ref1/Ref2/Ref3" };
assertTrue(isResultMatch(expect, resultList));
// Main -> Ref1 -> Ref2 -> Ref3
// Main -> Ref4 -> Ref3
Project refEmfProj4 = createTestProject("ref_project4");
org.talend.core.model.general.Project refProj4 = Mockito.mock(org.talend.core.model.general.Project.class);
mainProj.setEmfProject(refEmfProj4);
teclabelProjectMap.put(refEmfProj4.getTechnicalLabel(), refProj4);
ProjectReference projRef4 = createTestProjectReference(refEmfProj4);
List<ProjectReference> refList4Ref4 = new ArrayList<ProjectReference>();
refList4Ref4.add(projRef3);
Mockito.when(refProj4.getProjectReferenceList()).thenReturn(refList4Ref4);
refList4Main.add(projRef4);
Mockito.when(mainProj.getProjectReferenceList()).thenReturn(refList4Main);
int[] refCount1 = new int[] { 0 };
List<String> resultList1 = new ArrayList<String>();
Map<String, String> desensitiveLabelMap1 = new HashMap<String, String>();
PendoTrackDataUtil.findReferencePorjectPath(mainProj, "Main", resultList1, refCount1, desensitiveLabelMap1,
teclabelProjectMap);
String[] expect1 = new String[] { "Main/Ref1", "Main/Ref1/Ref2", "Main/Ref1/Ref2/Ref3", "Main/Ref4", "Main/Ref4/Ref3" };
assertTrue(isResultMatch(expect1, resultList1));
}
private boolean isResultMatch(String[] expect, List<String> resultList) {
boolean match = expect.length == resultList.size();
for (int i = 0; i < expect.length; i++) {
String exp = expect[i];
if (!resultList.contains(exp)) {
match = false;
}
}
return match;
}
private Project createTestProject(String label) {
Project project = PropertiesFactory.eINSTANCE.createProject();
project.setLabel(label);
project.setTechnicalLabel(ProjectManager.getLocalTechnicalProjectName(project.getLabel()));
return project;
}
private ProjectReference createTestProjectReference(Project project) {
ProjectReference projReference = PropertiesFactory.eINSTANCE.createProjectReference();
projReference.setReferencedBranch("master");
projReference.setReferencedProject(project);
return projReference;
}
}

View File

@@ -0,0 +1,65 @@
// ============================================================================
//
// 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.pendo;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoTrackSenderTest {
@Test
public void testGetBaseUrl() throws Exception {
PendoTrackSender sender = PendoTrackSender.getInstance();
String adminUrl = "https://tmc.int.cloud.talend.com/studio_cloud_connection";
String expectBaseUrl = "https://api.int.cloud.talend.com";
sender.setAdminUrl(adminUrl);
assertEquals(expectBaseUrl, sender.getBaseUrl());
sender.setApiBaseUrl(null);
adminUrl = "https://tmc.us.cloud.talend.com/studio_cloud_connection";
expectBaseUrl = "https://api.us.cloud.talend.com";
sender.setAdminUrl(adminUrl);
assertEquals(expectBaseUrl, sender.getBaseUrl());
sender.setApiBaseUrl(null);
adminUrl = "https://tmc.eu.cloud.talend.com/studio_cloud_connection";
expectBaseUrl = "https://api.eu.cloud.talend.com";
sender.setAdminUrl(adminUrl);
assertEquals(expectBaseUrl, sender.getBaseUrl());
sender.setApiBaseUrl(null);
adminUrl = "https://tmc.ap.cloud.talend.com/studio_cloud_connection";
expectBaseUrl = "https://api.ap.cloud.talend.com";
sender.setAdminUrl(adminUrl);
assertEquals(expectBaseUrl, sender.getBaseUrl());
sender.setApiBaseUrl(null);
adminUrl = "https://tmc.au.cloud.talend.com/studio_cloud_connection";
expectBaseUrl = "https://api.au.cloud.talend.com";
sender.setAdminUrl(adminUrl);
assertEquals(expectBaseUrl, sender.getBaseUrl());
sender.setApiBaseUrl(null);
adminUrl = "https://tmc.us-west.cloud.talend.com/studio_cloud_connection";
expectBaseUrl = "https://api.us-west.cloud.talend.com";
sender.setAdminUrl(adminUrl);
assertEquals(expectBaseUrl, sender.getBaseUrl());
sender.setApiBaseUrl(null);
sender.setAdminUrl(null);
}
}

View File

@@ -12,12 +12,7 @@
// ============================================================================
package org.talend.librariesmanager.model.service;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
import java.io.File;
import java.io.FileInputStream;
@@ -761,9 +756,9 @@ public class LocalLibraryManagerTest {
@Test
public void testCheckModuleStatus() throws URISyntaxException, IOException {
// test a existing apach jar
String urlPath = "platform:/plugin/org.talend.libraries.apache.common/lib/commons-text-1.10.0.jar";
String mvnURI = "mvn:org.talend.libraries/commons-text-1.10.0/6.0.0/jar";
ModuleNeeded module = new ModuleNeeded("test", "commons-text-1.10.0.jar", "test", true, null, null, mvnURI);
String urlPath = "platform:/plugin/org.talend.libraries.apache.common/lib/commons-text-1.1.jar";
String mvnURI = "mvn:org.talend.libraries/commons-text-1.1/6.0.0/jar";
ModuleNeeded module = new ModuleNeeded("test", "commons-text-1.1.jar", "test", true, null, null, mvnURI);
module.setModuleLocaion(urlPath);
localLibraryManager.checkModuleStatus(module);
Assert.assertEquals(module.getStatus(), ELibraryInstallStatus.INSTALLED);