Compare commits
94 Commits
release/7.
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89ac637904 | ||
|
|
6d8b1b51c7 | ||
|
|
e30b1a45d2 | ||
|
|
e3e23006ed | ||
|
|
0e04133323 | ||
|
|
a8f2e79338 | ||
|
|
6950d5cf6a | ||
|
|
5d8dc7531f | ||
|
|
8a6b2ab76a | ||
|
|
5d277417ae | ||
|
|
c4c8ab5ba6 | ||
|
|
f660181adf | ||
|
|
46bb67ab7e | ||
|
|
22891b2e99 | ||
|
|
4b208e9fe4 | ||
|
|
2387b83d0f | ||
|
|
aec62af46c | ||
|
|
34a0e52678 | ||
|
|
274bfb2d40 | ||
|
|
984814d620 | ||
|
|
bbc6e17412 | ||
|
|
6665603efc | ||
|
|
ae1b013c5f | ||
|
|
8b0ea868e9 | ||
|
|
1a24f07710 | ||
|
|
43cdc97d1e | ||
|
|
f1c40a3920 | ||
|
|
b47a7b2067 | ||
|
|
7c8614b4ac | ||
|
|
baacc284fd | ||
|
|
9d0fdc4532 | ||
|
|
f3ad09604f | ||
|
|
4615ebdb75 | ||
|
|
5616d65272 | ||
|
|
ca85dd4b73 | ||
|
|
11d3c32066 | ||
|
|
a866707aae | ||
|
|
53e052989f | ||
|
|
f52c747409 | ||
|
|
6d36ff79bb | ||
|
|
c362aa776c | ||
|
|
318724d32c | ||
|
|
4b377af1aa | ||
|
|
695dcba405 | ||
|
|
4dc7e4e82f | ||
|
|
4c819add92 | ||
|
|
9c0f5e966d | ||
|
|
da5b7979fd | ||
|
|
8d3832fdfb | ||
|
|
cd8ff90b5b | ||
|
|
d98e5ea43c | ||
|
|
13b57c8823 | ||
|
|
0436bc8dd2 | ||
|
|
091de02e75 | ||
|
|
eb84dfe75d | ||
|
|
a7dd89cc3a | ||
|
|
211abcac09 | ||
|
|
089f43ccd4 | ||
|
|
d008463ef1 | ||
|
|
d7ed643621 | ||
|
|
0972593afd | ||
|
|
c50c5c2e46 | ||
|
|
0b7b156f22 | ||
|
|
30aa2d25a6 | ||
|
|
6a813e2a73 | ||
|
|
4b7a59b497 | ||
|
|
d5490d2663 | ||
|
|
fbfc3735ad | ||
|
|
76fbd6fd32 | ||
|
|
43ef7fa5e0 | ||
|
|
be28a0d122 | ||
|
|
e44522bb69 | ||
|
|
67f04b7db3 | ||
|
|
2502688e64 | ||
|
|
6175aca630 | ||
|
|
55f7531d68 | ||
|
|
d6c888e235 | ||
|
|
7db18b198f | ||
|
|
039ed90481 | ||
|
|
eea9c85609 | ||
|
|
ca9d09e04e | ||
|
|
b5dadab5a5 | ||
|
|
2add3ffc0e | ||
|
|
38b02ee746 | ||
|
|
d8daf75329 | ||
|
|
555a722ade | ||
|
|
8a003e1a21 | ||
|
|
ce75b33a11 | ||
|
|
72fe8689bd | ||
|
|
f71f9c03ed | ||
|
|
7063b514ff | ||
|
|
ee60d35aba | ||
|
|
93db6863a8 | ||
|
|
680031d91f |
@@ -92,7 +92,7 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.12.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
|
||||
@@ -12,16 +12,28 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.workbench.extensions;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.IllegalPluginConfigurationException;
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
import org.talend.utils.json.JSONException;
|
||||
import org.talend.utils.json.JSONObject;
|
||||
|
||||
/**
|
||||
* Utilities class uses to get implementation of extension points defined by plug-ins. <br/>
|
||||
@@ -36,6 +48,10 @@ public abstract class ExtensionImplementationProvider<I> {
|
||||
|
||||
private String plugInId;
|
||||
|
||||
public final static String FILE_FEATURES_INDEX = "extra_feature.index";
|
||||
|
||||
public final static String DROP_BUNDLE_INFO = "drop.bundle.info";
|
||||
|
||||
/**
|
||||
* Default Constructor. Must not be used.
|
||||
*/
|
||||
@@ -166,9 +182,17 @@ public abstract class ExtensionImplementationProvider<I> {
|
||||
}
|
||||
|
||||
IExtension[] extensions = pt.getExtensions();
|
||||
|
||||
Map<String, String> dropBundles = null;
|
||||
try {
|
||||
dropBundles = getDropBundleInfo();
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
for (IExtension extension : extensions) {
|
||||
|
||||
if (dropBundles != null && dropBundles.containsKey(extension.getNamespaceIdentifier())
|
||||
&& StringUtils.isEmpty(dropBundles.get(extension.getNamespaceIdentifier()))) {
|
||||
continue;
|
||||
}
|
||||
if (plugInId == null || extension.getNamespaceIdentifier().equals(plugInId)) {
|
||||
String configurationElementName = extensionPointLimiter.getConfigurationElementName();
|
||||
if (configurationElementName != null) {
|
||||
@@ -196,6 +220,32 @@ public abstract class ExtensionImplementationProvider<I> {
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
* Copied from org.talend.commons.configurator
|
||||
**********************************************************/
|
||||
public Map<String, String> getDropBundleInfo() throws IOException {
|
||||
File indexFile = new File(ConfigurationScope.INSTANCE.getLocation().toFile(), FILE_FEATURES_INDEX);
|
||||
if (!indexFile.exists()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, String> dropInfoMap = new HashMap<>();
|
||||
try {
|
||||
String jsonStr = new String(Files.readAllBytes(indexFile.toPath()));
|
||||
if (!jsonStr.isEmpty()) {
|
||||
JSONObject obj = new JSONObject(jsonStr);
|
||||
JSONObject dropInfo = obj.getJSONObject(DROP_BUNDLE_INFO);
|
||||
Iterator<String> iterator = dropInfo.keys();
|
||||
while (iterator.hasNext()) {
|
||||
String key = iterator.next();
|
||||
dropInfoMap.put(key, dropInfo.getString(key));
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
return dropInfoMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC amaumont Comment method "createAndAddImplementation".
|
||||
*
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MyURLClassLoader extends URLClassLoader {
|
||||
private Map pclasses = new HashMap();
|
||||
|
||||
public MyURLClassLoader(String fileName) throws IOException {
|
||||
this(new File(fileName).toURL());
|
||||
this(new File(fileName).toURI().toURL());
|
||||
}
|
||||
|
||||
public MyURLClassLoader(URL url) {
|
||||
|
||||
@@ -872,25 +872,38 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
List<IRepositoryViewObject> serializableAllVersion = new ArrayList<>();
|
||||
if (lastFolderForItemMap.containsKey(id)) {
|
||||
ERepositoryObjectType itemType = lastRepositoryTypeForItemMap.get(id);
|
||||
String currentPath = lastFolderForItemMap.get(id);
|
||||
Object fullFolder = getFullFolder(project, itemType, currentPath);
|
||||
try {
|
||||
if (fullFolder != null && (fullFolder instanceof FolderItem || ((IFolder) fullFolder).exists())) {
|
||||
serializableAllVersion.addAll(getSerializableFromFolder(project, fullFolder, id, itemType, false, false, true, true));
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// do nothing.
|
||||
// if any exception happen or can't find the item, just try to look for it everywhere.
|
||||
}
|
||||
}
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
}
|
||||
}
|
||||
int size = serializableAllVersion.size();
|
||||
|
||||
if (size > 1) {
|
||||
String message = getItemsMessages(serializableAllVersion, size);
|
||||
|
||||
throw new PersistenceException(Messages.getString(
|
||||
"AbstractEMFRepositoryFactory.presistenceException.OnlyOneOccurenceMustbeFound", message)); //$NON-NLS-1$
|
||||
} else if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void computePropertyMaxInformationLevel(Property property) {
|
||||
|
||||
@@ -85,6 +85,7 @@ import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.exception.TalendInternalPersistenceException;
|
||||
import org.talend.core.hadoop.BigDataBasicUtil;
|
||||
import org.talend.core.hadoop.IHadoopDistributionService;
|
||||
import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.Project;
|
||||
@@ -133,14 +134,15 @@ import org.talend.core.repository.utils.ProjectDataJsonProvider;
|
||||
import org.talend.core.repository.utils.RepositoryPathProvider;
|
||||
import org.talend.core.repository.utils.XmiResourceManager;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.hd.IDynamicDistributionManager;
|
||||
import org.talend.core.runtime.repository.item.ItemProductKeys;
|
||||
import org.talend.core.runtime.services.IGenericWizardService;
|
||||
import org.talend.core.runtime.services.IMavenUIService;
|
||||
import org.talend.core.runtime.util.ItemDateParser;
|
||||
import org.talend.core.runtime.util.SharedStudioUtils;
|
||||
import org.talend.core.service.ICoreUIService;
|
||||
import org.talend.core.service.IUpdateService;
|
||||
import org.talend.core.service.IDetectCVEService;
|
||||
import org.talend.core.service.IUpdateService;
|
||||
import org.talend.core.utils.CodesJarResourceCache;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.cwm.helper.TableHelper;
|
||||
@@ -2199,6 +2201,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IUpdateService.class)) {
|
||||
IUpdateService updateService = GlobalServiceRegister.getDefault().getService(IUpdateService.class);
|
||||
updateService.syncComponentM2Jars(currentMonitor);
|
||||
updateService.installComponents(currentMonitor);
|
||||
}
|
||||
|
||||
// init sdk component
|
||||
@@ -2448,6 +2451,15 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
runProcessService.clearProjectRelatedSettings();
|
||||
}
|
||||
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopDistributionService.class)) {
|
||||
IHadoopDistributionService hdService = GlobalServiceRegister.getDefault()
|
||||
.getService(IHadoopDistributionService.class);
|
||||
if (hdService != null) {
|
||||
IDynamicDistributionManager dynamicDistrManager = hdService.getDynamicDistributionManager();
|
||||
dynamicDistrManager.reset(null);
|
||||
}
|
||||
}
|
||||
|
||||
// clear detect CVE cache
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDetectCVEService.class)) {
|
||||
IDetectCVEService detectCVESvc = GlobalServiceRegister.getDefault().getService(IDetectCVEService.class);
|
||||
|
||||
@@ -39,6 +39,9 @@ import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.utils.JavaVersion;
|
||||
import org.talend.utils.StudioKeysFileCheck;
|
||||
import org.talend.utils.VersionException;
|
||||
|
||||
/**
|
||||
* Utilities around perl stuff. <br/>
|
||||
@@ -280,6 +283,10 @@ public final class JavaUtils {
|
||||
if (version == null) {
|
||||
return defaultCompliance;
|
||||
}
|
||||
JavaVersion ver = new JavaVersion(version);
|
||||
if (ver.getMajor() > 8) {
|
||||
return String.valueOf(ver.getMajor());
|
||||
}
|
||||
if (version.startsWith(JavaCore.VERSION_1_8)) {
|
||||
return JavaCore.VERSION_1_8;
|
||||
}
|
||||
@@ -361,4 +368,26 @@ public final class JavaUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void validateJavaVersion() {
|
||||
try {
|
||||
// validate jvm which is used to start studio
|
||||
StudioKeysFileCheck.validateJavaVersion();
|
||||
|
||||
// validate default complier's compliance level
|
||||
IVMInstall install = JavaRuntime.getDefaultVMInstall();
|
||||
String ver = getCompilerCompliance((IVMInstall2) install, JavaCore.VERSION_1_8);
|
||||
|
||||
if (new JavaVersion(ver).compareTo(new JavaVersion(StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING)) > 0) {
|
||||
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_NOT_SUPPORTED,
|
||||
"The maximum Java version supported by Studio is " + StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING
|
||||
+ ". Your compiler's compliance level is " + ver);
|
||||
throw e;
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
if (e1 instanceof VersionException) {
|
||||
throw e1;
|
||||
}
|
||||
ExceptionHandler.process(e1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -154,6 +155,8 @@ public interface ILibraryManagerService extends IService {
|
||||
public boolean contains(String jarName);
|
||||
|
||||
public void clearCache();
|
||||
|
||||
public void deployLibsFromCustomComponents(File componentFolder, List<ModuleNeeded> modulesNeeded);
|
||||
|
||||
@Deprecated
|
||||
public Set<String> list(boolean withComponent, IProgressMonitor... monitorWrap);
|
||||
|
||||
@@ -380,5 +380,6 @@ public class ConnParameterKeys {
|
||||
|
||||
public static final String CONN_PARA_KEY_KNOX_DIRECTORY="CONN_PARA_KEY_KNOX_DIRECTORY";
|
||||
|
||||
public static final String CONN_PARA_KEY_KNOX_TIMEOUT="CONN_PARA_KEY_KNOX_TIMEOUT";
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ import org.talend.core.database.conn.DatabaseConnConstants;
|
||||
public enum EDatabaseVersion4Drivers {
|
||||
// access
|
||||
ACCESS_JDBC(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, new String[] {
|
||||
"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" })),
|
||||
"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.69.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
|
||||
@@ -87,9 +87,9 @@ 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.25.jar", "slf4j-log4j12-1.7.25.jar", "adal4j-1.6.7.jar", //$NON-NLS-1$
|
||||
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.6.jar", "oauth2-oidc-sdk-9.7.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
|
||||
"accessors-smart-2.4.7.jar", "asm-9.1.jar", "content-type-2.1.jar" })),
|
||||
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.9.jar", "oauth2-oidc-sdk-9.7.jar",
|
||||
"json-smart-2.4.11.jar", "nimbus-jose-jwt-9.22.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
|
||||
"accessors-smart-2.4.11.jar", "asm-9.5.jar", "content-type-2.1.jar" })),
|
||||
|
||||
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
VERTICA_7_1_X(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 7.1.X (Deprecated)", "VERTICA_7_1_X", "vertica-jdbc-7.1.2-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -107,12 +107,12 @@ public enum EDatabaseVersion4Drivers {
|
||||
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
|
||||
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
|
||||
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
|
||||
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
PLUSPSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL,
|
||||
"Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
IBMDB2(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"db2jcc_license_cisuz.jar" })), //$NON-NLS-1$
|
||||
IBMDB2ZOS(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2ZOS, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
@@ -171,8 +171,10 @@ 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.10.1.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
"jackson-databind-2.10.1.jar", "jackson-annotations-2.10.1.jar", "httpcore-4.4.11.jar", "httpclient-4.5.9.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", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"jackson-core-2.13.4.jar", //$NON-NLS-1$
|
||||
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "httpcore-4.4.11.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"httpclient-4.5.9.jar", //$NON-NLS-1$
|
||||
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.11.jar" })), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.49.jar")); //$NON-NLS-1$
|
||||
|
||||
@@ -38,7 +38,10 @@ 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);
|
||||
}
|
||||
|
||||
@@ -22,4 +22,6 @@ 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$
|
||||
|
||||
}
|
||||
|
||||
@@ -495,11 +495,16 @@ public class ContextUtils {
|
||||
}
|
||||
return itemMap;
|
||||
}
|
||||
|
||||
private static Set<String> missingContexts = new HashSet<>();
|
||||
|
||||
public static void clearMissingContextCache() {
|
||||
missingContexts.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get the repository context item,now contextId can be either joblet node or context node.
|
||||
*/
|
||||
* get the repository context item, now contextId can be either joblet node or context node.
|
||||
*/
|
||||
public static Item getRepositoryContextItemById(String contextId) {
|
||||
if (IContextParameter.BUILT_IN.equals(contextId)) {
|
||||
return null;
|
||||
@@ -507,6 +512,9 @@ public class ContextUtils {
|
||||
if (checkObject(contextId)) {
|
||||
return null;
|
||||
}
|
||||
if (missingContexts.contains(contextId)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>();
|
||||
possibleTypes.add(ERepositoryObjectType.CONTEXT);
|
||||
@@ -521,6 +529,8 @@ public class ContextUtils {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
missingContexts.add(contextId);
|
||||
ExceptionHandler.log("Can't find Context item[id=" + contextId + "].");
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -831,6 +841,7 @@ public class ContextUtils {
|
||||
ItemContextLink itemContextLink) {
|
||||
Map<String, String> renamedMap = new HashMap<String, String>();
|
||||
Map<String, Item> tempItemMap = new HashMap<String, Item>();
|
||||
clearMissingContextCache();
|
||||
for (ContextType contextType : contextTypeList) {
|
||||
for (Object obj : contextType.getContextParameter()) {
|
||||
if (obj instanceof ContextParameterType) {
|
||||
@@ -893,6 +904,7 @@ public class ContextUtils {
|
||||
*/
|
||||
public static Map<String, String> calculateRenamedMapFromLinkFile(String projectLabel, String itemId,
|
||||
List<IContext> contextList) {
|
||||
clearMissingContextCache();
|
||||
Map<String, String> renamedMap = new HashMap<String, String>();
|
||||
Map<String, Item> idToItemMap = new HashMap<String, Item>();
|
||||
try {
|
||||
@@ -951,6 +963,14 @@ public class ContextUtils {
|
||||
params.add(param);
|
||||
}
|
||||
|
||||
public boolean remove(Item item, String param) {
|
||||
Set<String> params = map.get(item);
|
||||
if (params != null && params.contains(param)) {
|
||||
return params.remove(param);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Set<String> get(Item item) {
|
||||
Set<String> params = map.get(item);
|
||||
|
||||
@@ -299,6 +299,7 @@ public class JobContextManager implements IContextManager {
|
||||
}
|
||||
List<ContextItem> contextItemList = ContextUtils.getAllContextItem();
|
||||
boolean setDefault = false;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (int i = 0; i < contextTypeList.size(); i++) {
|
||||
contextType = (ContextType) contextTypeList.get(i);
|
||||
String name = contextType.getName();
|
||||
@@ -526,6 +527,7 @@ public class JobContextManager implements IContextManager {
|
||||
|
||||
EList newcontextTypeList = new BasicEList();
|
||||
Map<String, Item> idToItemMap = new HashMap<String, Item>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (int i = 0; i < listContext.size(); i++) {
|
||||
IContext context = listContext.get(i);
|
||||
String contextGroupName = renameGroupContext.get(context);
|
||||
|
||||
@@ -51,6 +51,7 @@ public abstract class AbstractItemContextLinkService implements IItemContextLink
|
||||
itemContextLink.setItemId(itemId);
|
||||
Map<String, Item> tempCache = new HashMap<String, Item>();
|
||||
if (contextTypeList != null && contextTypeList.size() > 0) {
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (Object object : contextTypeList) {
|
||||
if (object instanceof ContextType) {
|
||||
ContextType jobContextType = (ContextType) object;
|
||||
|
||||
@@ -206,6 +206,7 @@ public class ContextLinkService {
|
||||
Map<String, Map<String, String>> changedContextParameterId) throws PersistenceException {
|
||||
List<Relation> relationList = RelationshipItemBuilder.getInstance()
|
||||
.getItemsHaveRelationWith(sourceId, RelationshipItemBuilder.LATEST_VERSION, false);
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (Relation relation : relationList) {
|
||||
String id = relation.getId();
|
||||
IFile linkFile = calContextLinkFile(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), id);
|
||||
|
||||
@@ -194,6 +194,10 @@ public interface IMetadataConnection extends IMetadata {
|
||||
public String getContextName();
|
||||
|
||||
public void setContextName(String contextName);
|
||||
|
||||
public boolean isSupportNLS();
|
||||
|
||||
public void setSupportNLS(boolean newSupportNLS);
|
||||
|
||||
/**
|
||||
* Returns the value that you stored in the data collection by the key. Normally, it is like this key-value. For
|
||||
|
||||
@@ -254,6 +254,7 @@ public final class ConvertionHelper {
|
||||
result.setContentModel(connection.isContextMode());
|
||||
result.setContextId(sourceConnection.getContextId());
|
||||
result.setContextName(sourceConnection.getContextName());
|
||||
result.setSupportNLS(sourceConnection.isSupportNLS());
|
||||
// handle oracle database connnection of general_jdbc.
|
||||
result.setSchema(getMeataConnectionSchema(result));
|
||||
convertOtherParameters(result, connection);
|
||||
|
||||
@@ -113,6 +113,7 @@ public class MetadataConnection implements IMetadataConnection {
|
||||
|
||||
private String contextName;
|
||||
|
||||
private boolean supportNLS = false;
|
||||
// ~
|
||||
|
||||
private String comment;
|
||||
@@ -729,6 +730,14 @@ public class MetadataConnection implements IMetadataConnection {
|
||||
public void setContextName(String contextName) {
|
||||
this.contextName = contextName;
|
||||
}
|
||||
|
||||
public boolean isSupportNLS() {
|
||||
return supportNLS;
|
||||
}
|
||||
|
||||
public void setSupportNLS(boolean supportNLS) {
|
||||
this.supportNLS = supportNLS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -1225,6 +1225,11 @@ public class RepositoryToComponentProperty {
|
||||
return value2;
|
||||
|
||||
}
|
||||
|
||||
if(value.equals("SUPPORT_NLS")) {
|
||||
return connection.isSupportNLS();
|
||||
}
|
||||
|
||||
if (value.equals("CDC_TYPE_MODE")) { //$NON-NLS-1$
|
||||
return new Boolean(CDCTypeMode.LOG_MODE.getName().equals(connection.getCdcTypeMode()));
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.commons.utils.generation.CodeGenerationUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.metadata.types.JavaType;
|
||||
@@ -37,6 +38,7 @@ import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.model.utils.SQLPatternUtils;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.service.IDesignerXMLMapperService;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
@@ -293,8 +295,7 @@ public final class ElementParameterParser {
|
||||
|
||||
List<IElementParameter> params = (List<IElementParameter>) element.getElementParametersWithChildrens();
|
||||
if (params != null && !params.isEmpty()) {
|
||||
for (int i = 0; i < params.size(); i++) {
|
||||
IElementParameter param = params.get(i);
|
||||
for (IElementParameter param : params) {
|
||||
if (text.indexOf(param.getVariableName()) != -1
|
||||
|| (param.getVariableName() != null && param.getVariableName().contains(text))) {
|
||||
if (param.getFieldType() == EParameterFieldType.TABLE) {
|
||||
@@ -422,8 +423,8 @@ public final class ElementParameterParser {
|
||||
}
|
||||
IElementParameter param;
|
||||
|
||||
for (int i = 0; i < element.getElementParameters().size(); i++) {
|
||||
param = element.getElementParameters().get(i);
|
||||
for (IElementParameter element2 : element.getElementParameters()) {
|
||||
param = element2;
|
||||
if (text.indexOf(param.getVariableName()) != -1) {
|
||||
if (param.getFieldType() == EParameterFieldType.TABLE) {
|
||||
return createTableValuesXML((List<Map<String, Object>>) param.getValue(), param);
|
||||
@@ -483,7 +484,21 @@ public final class ElementParameterParser {
|
||||
if (element instanceof INode) {
|
||||
INode node = (INode) element;
|
||||
if (node.getExternalNode() != null) {
|
||||
return EcoreUtil.copy(node.getExternalNode().getExternalEmfData());
|
||||
Object obj = null;
|
||||
if (node.isVirtualGenerateNode()) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerXMLMapperService.class)) {
|
||||
final IDesignerXMLMapperService service = GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerXMLMapperService.class);
|
||||
if (service != null) {
|
||||
obj = service.rebuildXmlMapData(node.getExternalNode());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj != null) {
|
||||
return obj;
|
||||
} else {
|
||||
return EcoreUtil.copy(node.getExternalNode().getExternalEmfData());
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -496,8 +511,8 @@ public final class ElementParameterParser {
|
||||
}
|
||||
IElementParameter param;
|
||||
newText = text;
|
||||
for (int i = 0; i < element.getElementParameters().size(); i++) {
|
||||
param = element.getElementParameters().get(i);
|
||||
for (IElementParameter element2 : element.getElementParameters()) {
|
||||
param = element2;
|
||||
if (newText.contains(param.getVariableName())) {
|
||||
String value = getDisplayValue(param);
|
||||
newText = newText.replace(param.getVariableName(), value);
|
||||
|
||||
@@ -728,8 +728,8 @@ public final class ProcessUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isRoute(Property property) {
|
||||
|
||||
public static boolean isRoute(Property property) {
|
||||
return property!= null && (ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE) ||
|
||||
ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE));
|
||||
}
|
||||
@@ -768,6 +768,39 @@ public final class ProcessUtils {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public static boolean isRouteWithRoutelets(Item item) {
|
||||
if (item!= null && item instanceof ProcessItem) {
|
||||
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
|
||||
if (obj instanceof NodeType) {
|
||||
if (isRouteletNode((NodeType) obj)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRouteletNode(NodeType node) {
|
||||
String jobIds = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_PROCESS");
|
||||
String jobVersion = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(jobIds, jobVersion);
|
||||
if (processItem != null) {
|
||||
return ERepositoryObjectType.getType(processItem.getProperty()).equals(
|
||||
ERepositoryObjectType.PROCESS_ROUTELET);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getParameterValue(EList<ElementParameterType> listParamType, String paramName) {
|
||||
for (ElementParameterType pType : listParamType) {
|
||||
if (pType != null && paramName.equals(pType.getName())) {
|
||||
return pType.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getAssertAmount(IProcess process) {
|
||||
int count = 0;
|
||||
@@ -1058,6 +1091,28 @@ public final class ProcessUtils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isChildRouteProcess(Item item) {
|
||||
|
||||
if (item!= null && item instanceof ProcessItem) {
|
||||
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
|
||||
if (obj instanceof NodeType) {
|
||||
if (((NodeType) obj).getComponentName().equals("tRouteInput")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public static boolean isRoutelet(Property p) {
|
||||
if (p != null) {
|
||||
return ERepositoryObjectType.getType(p).equals(ERepositoryObjectType.PROCESS_ROUTELET);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String escapeJava(String input) {
|
||||
return StringEscapeUtils.escapeJava(input);
|
||||
|
||||
@@ -79,4 +79,8 @@ public final class TalendPropertiesUtil {
|
||||
public static String getProductApp() {
|
||||
return System.getProperty(PROD_APP);
|
||||
}
|
||||
|
||||
public static boolean isEnabledUseShortJobletName() {
|
||||
return isEnabled("talend.job.build.useShortJobletName"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
|
||||
/**
|
||||
* created by wchen on 2015年6月16日 Detailled comment
|
||||
@@ -255,7 +256,7 @@ public class TalendLibsServerManager {
|
||||
if (enableProxyFlag) {
|
||||
serverBean.setServer(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_URL));
|
||||
serverBean.setUserName(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_USERNAME));
|
||||
serverBean.setPassword(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_PASSWORD));
|
||||
serverBean.setPassword(StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_PASSWORD)));
|
||||
serverBean.setRepositoryId(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_REPOSITORY_ID));
|
||||
serverBean.setType(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_TYPE));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public interface IDynamicDistributionManager {
|
||||
|
||||
public void reloadAllDynamicDistributions(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
public void reset(IProgressMonitor monitor);
|
||||
|
||||
public boolean isLoaded();
|
||||
|
||||
public void load(IProgressMonitor monitor, boolean resetModulesCache) throws Exception;
|
||||
|
||||
@@ -42,6 +42,8 @@ public class JobInfoProperties extends Properties {
|
||||
public static final String PROJECT_NAME = "project"; //$NON-NLS-1$
|
||||
|
||||
public static final String JOB_ID = "jobId"; //$NON-NLS-1$
|
||||
|
||||
public static final String JOB_PARENT_ID = "jobParentId"; //$NON-NLS-1$
|
||||
|
||||
public static final String JOB_NAME = "job"; //$NON-NLS-1$
|
||||
|
||||
@@ -92,6 +94,10 @@ public class JobInfoProperties extends Properties {
|
||||
setProperty(BRANCH, branchSelection);
|
||||
}
|
||||
|
||||
if (processItem.getProperty() != null && processItem.getProperty().getParentItem() != null) {
|
||||
setProperty(JOB_PARENT_ID, processItem.getProperty().getParentItem().getProperty().getId());
|
||||
}
|
||||
|
||||
setProperty(JOB_ID, jobInfo.getJobId());
|
||||
setProperty(JOB_NAME, jobInfo.getJobName());
|
||||
String jobType = processItem.getProcess().getJobType();
|
||||
|
||||
@@ -22,6 +22,8 @@ public interface IBuildParametes {
|
||||
static final String SERVICE = "Service"; //$NON-NLS-1$
|
||||
|
||||
static final String ITEM = "Item"; //$NON-NLS-1$
|
||||
|
||||
static final String PARENT_ITEM = "ParentItem"; //$NON-NLS-1$
|
||||
|
||||
static final String VERSION = "Version"; //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -30,4 +30,6 @@ public interface IDesignerXMLMapperService extends IService {
|
||||
*/
|
||||
public boolean isVirtualComponent(final INode node);
|
||||
|
||||
public Object rebuildXmlMapData(final INode node);
|
||||
|
||||
}
|
||||
|
||||
@@ -26,5 +26,7 @@ public interface IUpdateService extends IService {
|
||||
public String getSharedStudioMissingPatchVersion();
|
||||
|
||||
public boolean updateArtifactsFileSha256Hex(IProgressMonitor monitor, String studioArtifactsFileShaCodeHex);
|
||||
|
||||
public void installComponents(IProgressMonitor monitor);
|
||||
|
||||
}
|
||||
|
||||
@@ -648,6 +648,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
helper.initHelper(contextManager);
|
||||
Map<String, Item> items = new HashMap<String, Item>();
|
||||
boolean needRefresh = false;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter param : contextManager.getDefaultContext().getContextParameterList()) {
|
||||
if (!param.isBuiltIn()) {
|
||||
String source = param.getSource();
|
||||
|
||||
@@ -522,6 +522,7 @@ public class SelectRepositoryContextDialog extends SelectionDialog {
|
||||
// remove the params which is unchecked
|
||||
Set<String> jobletIds = new HashSet<String>();
|
||||
Set<String> chekedIds = new HashSet<String>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter param : existParas) {
|
||||
if (param.isBuiltIn()) {
|
||||
continue;
|
||||
|
||||
@@ -185,6 +185,7 @@ public class AddRepositoryContextGroupCommand extends Command {
|
||||
// remove the params which is unchecked
|
||||
Set<String> jobletIds = new HashSet<String>();
|
||||
Set<String> chekedIds = new HashSet<String>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter param : existParas) {
|
||||
if (param.isBuiltIn()) {
|
||||
continue;
|
||||
|
||||
@@ -92,6 +92,7 @@ public class ContextNatTableUtils {
|
||||
List<ContextTableTabParentModel> output = new ArrayList<ContextTableTabParentModel>();
|
||||
if (!contextDatas.isEmpty()) {
|
||||
int i = 0;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter para : contextDatas) {
|
||||
String sourceId = para.getSource();
|
||||
if (IContextParameter.BUILT_IN.equals(sourceId)) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.ui.branding.IBrandingConfiguration;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,7 @@ public class Contexts {
|
||||
public void run() {
|
||||
if (cxtView != null) {
|
||||
updateTitle(cxtView);
|
||||
ContextUtils.clearMissingContextCache();
|
||||
cxtView.refresh(part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ public class RoutinesFunctionProposal implements IContentProposal {
|
||||
message += Messages.getString("RoutinesFunctionProposal.CreatedBy");
|
||||
message += Messages.getString("RoutinesFunctionProposal.ReturnType");
|
||||
message += Messages.getString("RoutinesFunctionProposal.VariableName");
|
||||
message = message.replaceAll("\n", System.getProperty("line.separator", "\n")); // for display on Windows platform
|
||||
|
||||
MessageFormat format = new MessageFormat(message);
|
||||
Object[] args = new Object[] { function.getDescription(),
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.util.SharedStudioUtils;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.daikon.token.TokenGenerator;
|
||||
@@ -41,6 +42,8 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
|
||||
|
||||
private static final TokenKey OS = new TokenKey("os"); //$NON-NLS-1$
|
||||
|
||||
private static final TokenKey SHARE_MODE = new TokenKey("share.mode"); //$NON-NLS-1$
|
||||
|
||||
public static final String COLLECTOR_SYNC_NB = "COLLECTOR_SYNC_NB"; //$NON-NLS-1$
|
||||
|
||||
public DefaultTokenCollector() {
|
||||
@@ -70,7 +73,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
|
||||
|
||||
// typeStudio
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
|
||||
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
|
||||
IBrandingService brandingService = GlobalServiceRegister.getDefault().getService(
|
||||
IBrandingService.class);
|
||||
tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getAcronym());
|
||||
// tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getShortProductName());
|
||||
@@ -92,6 +95,8 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
|
||||
tokenStudioObject.put(STOP_COLLECTOR.getKey(), "0"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// Share mode
|
||||
tokenStudioObject.put(SHARE_MODE.getKey(), SharedStudioUtils.isSharedStudioMode());
|
||||
return tokenStudioObject;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public final class TokenInforUtil {
|
||||
targetArray = new JSONArray();
|
||||
Map<String,List<JSONObject>> objectMap = new HashMap<String,List<JSONObject>>();
|
||||
for (Object obj : data) {
|
||||
if((obj instanceof JSONObject) && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
|
||||
if((obj instanceof JSONObject) && ((JSONObject)obj).has("component_name") && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
|
||||
List<JSONObject> dataList = new ArrayList<JSONObject>();
|
||||
String componentName = (String) ((JSONObject)obj).get("component_name");//$NON-NLS-1$
|
||||
if(objectMap.containsKey(componentName)){
|
||||
|
||||
@@ -54,7 +54,9 @@ Export-Package: org.talend.core,
|
||||
org.talend.core.services.resource,
|
||||
org.talend.core.views,
|
||||
org.talend.designer.runprocess
|
||||
Import-Package: org.apache.commons.collections4.map
|
||||
Import-Package: org.apache.commons.collections4.map,
|
||||
org.eclipse.m2e.core,
|
||||
org.eclipse.m2e.core.embedder
|
||||
Bundle-ClassPath: .,
|
||||
lib/log4j-api-2.17.1.jar,
|
||||
lib/log4j-core-2.17.1.jar
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.spi.LoggerFactory;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.eclipse.m2e.core.embedder.IMaven;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.i18n.Messages;
|
||||
import org.talend.utils.io.FilesUtils;
|
||||
|
||||
abstract public class BaseComponentInstallerTask implements IComponentInstallerTask {
|
||||
|
||||
private static final String SYS_PROP_TCOMPV0 = "tcompv0.update";
|
||||
private static final String SYS_PROP_OVERWRITE = "m2.overwrite";
|
||||
private static final String SYS_PROP_OVERWRITE_DEFAULT = Boolean.FALSE.toString();
|
||||
|
||||
private static final String SYS_CUSTOM_MAVEN_REPO = "maven.local.repository";
|
||||
|
||||
private int order;
|
||||
|
||||
private int componentType = -1;
|
||||
|
||||
private Set<ComponentGAV> gavs = new HashSet<ComponentGAV>();
|
||||
|
||||
protected boolean overWriteM2() {
|
||||
/**
|
||||
* force to overwrite, since need to sync maven-metadata-local.xml
|
||||
*/
|
||||
String prop = System.getProperty(SYS_PROP_OVERWRITE, Boolean.TRUE.toString());
|
||||
return Boolean.valueOf(prop);
|
||||
}
|
||||
|
||||
protected boolean updateTcompv0() {
|
||||
String prop = System.getProperty(SYS_PROP_TCOMPV0, SYS_PROP_OVERWRITE_DEFAULT);
|
||||
return Boolean.valueOf(prop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComponentType() {
|
||||
return componentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setComponentType(int componentType) {
|
||||
this.componentType = componentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ComponentGAV> getComponentGAV() {
|
||||
return gavs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addComponentGAV(ComponentGAV gav) {
|
||||
gavs.add(gav);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ComponentGAV> getComponentGAV(int componentType) {
|
||||
return this.gavs.stream().filter(gav -> (gav.getComponentType() & componentType) > 0)
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get implementation class of installer
|
||||
*
|
||||
* @return implementation class of installer
|
||||
*/
|
||||
abstract protected Class<? extends BaseComponentInstallerTask> getInstallerClass();
|
||||
|
||||
/**
|
||||
* Get jar file directory
|
||||
*
|
||||
* @return jar file directory
|
||||
*/
|
||||
protected File getJarFileDir() {
|
||||
URL jarFolder = FileLocator.find(FrameworkUtil.getBundle(getInstallerClass()), new Path("repository"), null);
|
||||
File jarFileDir = null;
|
||||
if (jarFolder != null) {
|
||||
try {
|
||||
jarFileDir = new File(FileLocator.toFileURL(jarFolder).getPath());
|
||||
|
||||
if (jarFileDir.isDirectory()) {
|
||||
return jarFileDir;
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*Implementation of unzipping files into studio local m2 directory
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Override
|
||||
public boolean needInstall() {
|
||||
|
||||
if (this.updateTcompv0()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean toInstall = false;
|
||||
Set<ComponentGAV> tcompv0Gavs = this.getComponentGAV(COMPONENT_TYPE_TCOMPV0);
|
||||
|
||||
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
|
||||
.getService(ILibraryManagerService.class);
|
||||
if (librairesManagerService != null) {
|
||||
for (ComponentGAV gav : tcompv0Gavs) {
|
||||
File jarFile = librairesManagerService.resolveStatusLocally(gav.toMavenUri());
|
||||
if (jarFile == null) {
|
||||
toInstall = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (toInstall) {
|
||||
}
|
||||
return toInstall;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean install(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
|
||||
if (monitor == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
|
||||
if (!this.needInstall()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File jarDir = getJarFileDir();
|
||||
|
||||
if (jarDir == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File m2Dir = getM2RepositoryPath();
|
||||
if (m2Dir == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File[] files = jarDir.listFiles();
|
||||
Set<File> zipFiles = Stream.of(files).filter(f -> f.getName().endsWith(".zip")).collect(Collectors.toSet());
|
||||
boolean installed = true;
|
||||
|
||||
monitor.beginTask(Messages.getString("BaseComponentInstallerTask.installComponent", getMonitorText()),
|
||||
zipFiles.size());
|
||||
|
||||
for (File zf : zipFiles) {
|
||||
try {
|
||||
FilesUtils.unzip(zf.getAbsolutePath(), m2Dir.getAbsolutePath(), this.overWriteM2());
|
||||
} catch (Exception e) {
|
||||
installed = false;
|
||||
}
|
||||
monitor.worked(1);
|
||||
}
|
||||
|
||||
return installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get studio local maven repository path
|
||||
*
|
||||
* @return local maven repository path
|
||||
*/
|
||||
protected File getM2RepositoryPath() {
|
||||
|
||||
String mavenRepo = System.getProperty(SYS_CUSTOM_MAVEN_REPO);
|
||||
|
||||
File m2Repo = null;
|
||||
|
||||
if (StringUtils.isEmpty(mavenRepo)) {
|
||||
final IMaven maven = MavenPlugin.getMaven();
|
||||
try {
|
||||
maven.reloadSettings();
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
String localRepository = maven.getLocalRepositoryPath();
|
||||
|
||||
if (!StringUtils.isEmpty(localRepository)) {
|
||||
m2Repo = new File(localRepository);
|
||||
}
|
||||
} else {
|
||||
m2Repo = new File(mavenRepo);
|
||||
}
|
||||
|
||||
if (m2Repo != null && !m2Repo.exists()) {
|
||||
m2Repo.mkdirs();
|
||||
}
|
||||
return m2Repo;
|
||||
}
|
||||
|
||||
protected String getMonitorText() {
|
||||
Set<ComponentGAV> tcompv0Gavs = this.getComponentGAV(COMPONENT_TYPE_TCOMPV0);
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
tcompv0Gavs.forEach(gav -> {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(gav.getArtifactId());
|
||||
});
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.utils;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
|
||||
public class ComponentGAV {
|
||||
|
||||
private String groupId;
|
||||
|
||||
private String artifactId;
|
||||
|
||||
private String version;
|
||||
|
||||
private String classifier;
|
||||
|
||||
private String type;
|
||||
|
||||
private int componentType;
|
||||
|
||||
/**
|
||||
* @return the groupId
|
||||
*/
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param groupId the groupId to set
|
||||
*/
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the artifactId
|
||||
*/
|
||||
public String getArtifactId() {
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param artifactId the artifactId to set
|
||||
*/
|
||||
public void setArtifactId(String artifactId) {
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the version
|
||||
*/
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param version the version to set
|
||||
*/
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the classifier
|
||||
*/
|
||||
public String getClassifier() {
|
||||
return classifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param classifier the classifier to set
|
||||
*/
|
||||
public void setClassifier(String classifier) {
|
||||
this.classifier = classifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type the type to set
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the componentType
|
||||
*/
|
||||
public int getComponentType() {
|
||||
return componentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param componentType the componentType to set
|
||||
*/
|
||||
public void setComponentType(int componentType) {
|
||||
this.componentType = componentType;
|
||||
}
|
||||
|
||||
public String toMavenUri() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("mvn:");
|
||||
sb.append(toStr("/"));
|
||||
|
||||
sb.append("/");
|
||||
if (!StringUtils.isEmpty(type)) {
|
||||
sb.append(type);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String toCoordinateStr() {
|
||||
return toStr(":");
|
||||
}
|
||||
|
||||
private String toStr(String sep) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
if (!StringUtils.isEmpty(groupId)) {
|
||||
sb.append(this.groupId);
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(artifactId)) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(sep);
|
||||
}
|
||||
sb.append(this.artifactId);
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(version)) {
|
||||
sb.append(sep);
|
||||
sb.append(this.version);
|
||||
}
|
||||
if (!StringUtils.isEmpty(classifier)) {
|
||||
sb.append(sep);
|
||||
sb.append(this.classifier);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ComponentGAV)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ComponentGAV thatObj = (ComponentGAV) obj;
|
||||
|
||||
if (!StringUtils.equals(this.getGroupId(), thatObj.getGroupId())) {
|
||||
return false;
|
||||
}
|
||||
if (!StringUtils.equals(this.getArtifactId(), thatObj.getArtifactId())) {
|
||||
return false;
|
||||
}
|
||||
if (!StringUtils.equals(this.getVersion(), thatObj.getVersion())) {
|
||||
return false;
|
||||
}
|
||||
if (!StringUtils.equals(this.getType(), thatObj.getType())) {
|
||||
return false;
|
||||
}
|
||||
if (!StringUtils.equals(this.getClassifier(), thatObj.getClassifier())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.getComponentType() == thatObj.getComponentType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (this.getGroupId() == null ? 0 : this.getGroupId().hashCode());
|
||||
result = prime * result + (this.getArtifactId() == null ? 0 : this.getArtifactId().hashCode());
|
||||
result = prime * result + (this.getVersion() == null ? 0 : this.getVersion().hashCode());
|
||||
result = prime * result + (this.getType() == null ? 0 : this.getType().hashCode());
|
||||
result = prime * result + (this.getClassifier() == null ? 0 : this.getClassifier().hashCode());
|
||||
result = prime * result + this.getComponentType();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GAV [groupId=" + this.groupId + ", artifactId=" + this.artifactId + ", version=" + this.version + ", classifier=" + this.classifier + ", type=" + this.type + ", componentType="
|
||||
+ this.componentType + "]";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.utils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
|
||||
public interface IComponentInstallerTask {
|
||||
|
||||
int COMPONENT_TYPE_TCOMPV0 = 1;
|
||||
|
||||
int COMPONENT_TYPE_TCOMPV1 = 2;
|
||||
|
||||
int COMPONENT_TYPE_MAVEN_REPO = 4;
|
||||
|
||||
/**
|
||||
* Order of the task, smaller means higher priority
|
||||
*
|
||||
* @return Order of the task
|
||||
*/
|
||||
int getOrder();
|
||||
|
||||
/**
|
||||
* Set order of the task
|
||||
*
|
||||
* @param order
|
||||
*/
|
||||
void setOrder(int order);
|
||||
|
||||
/**
|
||||
* Get all component gavs
|
||||
*
|
||||
* @return Set<ComponentGAV>
|
||||
*/
|
||||
Set<ComponentGAV> getComponentGAV();
|
||||
|
||||
/**
|
||||
* @param componentType 1 - tcompv0, 2 - tcompv1
|
||||
* @return Set<ComponentGAV>
|
||||
*/
|
||||
Set<ComponentGAV> getComponentGAV(int componentType);
|
||||
|
||||
/**
|
||||
* Add component gav
|
||||
*
|
||||
* @param gav
|
||||
*/
|
||||
void addComponentGAV(ComponentGAV gav);
|
||||
|
||||
/**
|
||||
* Whether it is necessary to install the component
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean needInstall();
|
||||
|
||||
/**
|
||||
* Install the component
|
||||
*
|
||||
* @param monitor
|
||||
* @throws InvocationTargetException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
boolean install(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException;
|
||||
|
||||
/**
|
||||
* @return the componentType
|
||||
*/
|
||||
int getComponentType();
|
||||
|
||||
/**
|
||||
* @param componentType the componentType to set
|
||||
*/
|
||||
void setComponentType(int componentType);
|
||||
}
|
||||
@@ -288,6 +288,7 @@ public class ProcessorUtilities {
|
||||
exportAsOSGI = false;
|
||||
exportTimeStamp = null;
|
||||
exportJobAsMicroService = false;
|
||||
needExportItemsForDQ = false;
|
||||
}
|
||||
|
||||
public static String getInterpreter() {
|
||||
@@ -1607,6 +1608,11 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
|
||||
// if (isCIMode() && "Routelets".equals(node.getComponent().getOriginalFamilyName())) {
|
||||
if ("Routelets".equals(node.getComponent().getOriginalFamilyName())) {
|
||||
processItem.getProperty().setParentItem(ItemCacheManager.getProcessItem(currentProcess.getId(), currentProcess.getVersion()));
|
||||
}
|
||||
|
||||
int subJobOption = GENERATE_ALL_CHILDS;
|
||||
if (BitwiseOptionUtils.containOption(option, GENERATE_WITH_FIRST_CHILD)) {
|
||||
subJobOption = GENERATE_MAIN_ONLY;
|
||||
@@ -2546,7 +2552,7 @@ public class ProcessorUtilities {
|
||||
return jobInfos;
|
||||
}
|
||||
|
||||
private static boolean isRouteletNode(NodeType node) {
|
||||
public static boolean isRouteletNode(NodeType node) {
|
||||
String jobIds = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_PROCESS");
|
||||
String jobVersion = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(jobIds, jobVersion);
|
||||
@@ -2944,4 +2950,12 @@ public class ProcessorUtilities {
|
||||
public static boolean isNeedExportItemsForDQ() {
|
||||
return needExportItemsForDQ;
|
||||
}
|
||||
|
||||
public static boolean isMicroservice(Item item) {
|
||||
if (item == null || item.getProperty() == null || item.getProperty().getAdditionalProperties() == null) {
|
||||
return false;
|
||||
}
|
||||
return "ROUTE_MICROSERVICE".equals(item.getProperty().getAdditionalProperties()
|
||||
.get(TalendProcessArgumentConstant.ARG_BUILD_TYPE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ import org.talend.designer.maven.aether.util.TalendAetherProxySelector;
|
||||
*/
|
||||
public class RepositorySystemFactory {
|
||||
|
||||
private static Boolean ignoreArtifactDescriptorRepositories;
|
||||
|
||||
private static Map<LocalRepository, DefaultRepositorySystemSession> sessions = new HashMap<LocalRepository, DefaultRepositorySystemSession>();
|
||||
|
||||
private static DefaultRepositorySystemSession newRepositorySystemSession(String localRepositoryPath)
|
||||
@@ -61,6 +63,8 @@ public class RepositorySystemFactory {
|
||||
repositorySystemSession.setTransferListener(new ChainedTransferListener());
|
||||
repositorySystemSession.setRepositoryListener(new ChainedRepositoryListener());
|
||||
repositorySystemSession.setProxySelector(new TalendAetherProxySelector());
|
||||
repositorySystemSession.setIgnoreArtifactDescriptorRepositories(
|
||||
RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
|
||||
sessions.put(localRepo, repositorySystemSession);
|
||||
}
|
||||
|
||||
@@ -157,4 +161,13 @@ public class RepositorySystemFactory {
|
||||
doDeploy(content, pomFile, localRepository, repositoryId, repositoryUrl, userName, password, groupId, artifactId,
|
||||
classifier, extension, version);
|
||||
}
|
||||
|
||||
public static boolean isIgnoreArtifactDescriptorRepositories() {
|
||||
if (ignoreArtifactDescriptorRepositories == null) {
|
||||
ignoreArtifactDescriptorRepositories = Boolean.valueOf(
|
||||
System.getProperty("talend.studio.aether.ignoreArtifactDescriptorRepositories", Boolean.TRUE.toString()));
|
||||
}
|
||||
return ignoreArtifactDescriptorRepositories;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.designer.maven.aether.DummyDynamicMonitor;
|
||||
import org.talend.designer.maven.aether.IDynamicMonitor;
|
||||
import org.talend.designer.maven.aether.RepositorySystemFactory;
|
||||
import org.talend.designer.maven.aether.node.DependencyNode;
|
||||
import org.talend.designer.maven.aether.node.ExclusionNode;
|
||||
import org.talend.designer.maven.aether.selector.DynamicDependencySelector;
|
||||
@@ -513,6 +514,7 @@ public class DynamicDistributionAetherUtils {
|
||||
LocalRepository localRepo = new LocalRepository(repositoryPath);
|
||||
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
|
||||
session.setProxySelector(new TalendAetherProxySelector());
|
||||
session.setIgnoreArtifactDescriptorRepositories(RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
|
||||
|
||||
updateDependencySelector(session, monitor);
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.codehaus.plexus.PlexusContainerException;
|
||||
import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
|
||||
import org.eclipse.aether.impl.DefaultServiceLocator;
|
||||
@@ -57,6 +56,7 @@ import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.core.nexus.NexusConstants;
|
||||
import org.talend.core.nexus.TalendLibsServerManager;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.designer.maven.aether.RepositorySystemFactory;
|
||||
|
||||
public class MavenLibraryResolverProvider {
|
||||
|
||||
@@ -283,8 +283,9 @@ public class MavenLibraryResolverProvider {
|
||||
LocalRepository localRepo = new LocalRepository( /* "target/local-repo" */target);
|
||||
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
|
||||
session.setProxySelector(new TalendAetherProxySelector());
|
||||
session.setIgnoreArtifactDescriptorRepositories(RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
|
||||
|
||||
return session;
|
||||
return session;
|
||||
}
|
||||
|
||||
private String getLocalMVNRepository() {
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -39,12 +39,22 @@
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
@@ -88,10 +98,35 @@
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-io</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<exclusions><!-- fix CVE to plexus-io:3.2.0-->
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
@@ -104,6 +139,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
|
||||
@@ -26,12 +26,16 @@
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -39,6 +43,16 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -19,8 +19,17 @@
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
@@ -48,7 +57,7 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -56,6 +65,16 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
@@ -98,7 +103,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.6.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-codec</groupId>
|
||||
@@ -107,15 +112,23 @@
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
</exclusion>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -126,7 +139,42 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
<version>2.22.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-annotations</artifactId>
|
||||
<version>1.7.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-api</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-booter</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit4</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
@@ -139,10 +187,30 @@
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache-extras.beanshell</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
<version>2.0b6</version>
|
||||
</dependency>
|
||||
<groupId>org.apache-extras.beanshell</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
<version>2.0b6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.marshalling</groupId>
|
||||
<artifactId>jboss-marshalling</artifactId>
|
||||
<version>2.0.12.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20140107</version>
|
||||
<version>20231013</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
@@ -151,6 +151,12 @@
|
||||
<groupId>org.talend.components</groupId>
|
||||
<artifactId>components-marklogic-runtime</artifactId>
|
||||
<version>${components.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.components</groupId>
|
||||
@@ -210,6 +216,16 @@
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<module>zip/pom.xml</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<m2.fasterxml.jackson.version>2.13.2</m2.fasterxml.jackson.version>
|
||||
<m2.fasterxml.jackson.version>2.13.4</m2.fasterxml.jackson.version>
|
||||
<jackson-codehaus.version>1.9.16-TALEND</jackson-codehaus.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.27.10</tacokit.components.version>
|
||||
<tacokit.components.version>1.27.28</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.38.6</tcomp.version>
|
||||
<tcomp.version>1.38.12</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Talend OpenSource Release</id>
|
||||
<id>talend_open</id>
|
||||
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@@ -10,10 +10,11 @@ ProjectPomProjectSettingPage_ConfirmMessage=Will apply and update for project PO
|
||||
ProjectPomProjectSettingPage_FilterPomLabel=Filter to use to generate poms:
|
||||
ProjectPomProjectSettingPage_FilterErrorMessage=Invalid filter: {0}
|
||||
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=> Generate only the job named "myJob" with version 0.2\n!((label=myJob)and(version=0.1)) \t=> Generate every jobs except the "myJob" version 0.1
|
||||
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
|
||||
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.allowRecursiveJobs=Allow recursive jobs (Not recommended)
|
||||
BuildProjectSettingPage.allowRecursiveJobs=Allow recursive jobs (Not recommended)
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.talend.core.runtime.projectsetting.AbstractProjectSettingPage;
|
||||
import org.talend.core.runtime.services.IFilterService;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -169,7 +170,25 @@ 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$
|
||||
@@ -203,4 +222,12 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
|
||||
return displayVersion;
|
||||
}
|
||||
|
||||
private static boolean isSyncBuildTypeAllowed() {
|
||||
return Boolean.getBoolean("talend.builtype.syncallowed");
|
||||
}
|
||||
|
||||
private MavenProjectSettingPage getCurrentPage() {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.core.runtime,
|
||||
org.talend.common.ui.runtime,
|
||||
org.talend.core.runtime,
|
||||
org.eclipse.jface,
|
||||
org.talend.core.repository
|
||||
org.talend.core.repository,
|
||||
org.talend.core
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: org.talend.designer.maven,
|
||||
org.talend.designer.maven.launch,
|
||||
|
||||
@@ -44,7 +44,17 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-io</artifactId>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -64,13 +74,18 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -93,6 +108,11 @@
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -103,9 +123,14 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.21</version>
|
||||
@@ -118,12 +143,12 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-io</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
@@ -135,6 +160,11 @@
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<archive>
|
||||
@@ -145,7 +175,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.6.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
@@ -155,7 +185,12 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -170,19 +205,24 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.12.4</version>
|
||||
<version>2.22.2</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
@@ -190,15 +230,35 @@
|
||||
<version>3.0.24</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
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 ();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.talend.designer.maven.migration.tasks;
|
||||
|
||||
import org.talend.migration.IProjectMigrationTask;
|
||||
|
||||
public interface ICorrectBuildTypeMigrationTask extends IProjectMigrationTask {
|
||||
public void clear ();
|
||||
}
|
||||
@@ -45,6 +45,7 @@ public enum ETalendMavenVariables {
|
||||
JobletName,
|
||||
|
||||
JobId,
|
||||
JobParentId,
|
||||
JobName,
|
||||
JobType,
|
||||
JobFinalName,
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -35,7 +34,6 @@ import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
@@ -58,6 +56,7 @@ import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.MojoType;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
@@ -67,6 +66,7 @@ import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProjectReference;
|
||||
@@ -99,6 +99,7 @@ import org.talend.designer.maven.utils.MavenProjectUtils;
|
||||
import org.talend.designer.maven.utils.PomIdsHelper;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
@@ -631,9 +632,37 @@ public class AggregatorPomsHelper {
|
||||
public String getJobProjectName(Property property) {
|
||||
return projectTechName + "_" + getJobProjectFolderName(property).toUpperCase(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static String getJobLabel(Property property) {
|
||||
|
||||
if (property == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (property.getParentItem() != null) {
|
||||
Property parentProperty = property.getParentItem().getProperty();
|
||||
return parentProperty.getLabel() + "_" + parentProperty.getVersion().replace(".", "_") + "_" + property.getLabel();
|
||||
}
|
||||
|
||||
return property.getLabel();
|
||||
}
|
||||
|
||||
public static String getJobId(Property property) {
|
||||
|
||||
if (property == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (property.getParentItem() != null) {
|
||||
Property parentProperty = property.getParentItem().getProperty();
|
||||
return property.getId() + "_" + parentProperty.getId() + "_" + parentProperty.getVersion().replace(".", "_");
|
||||
}
|
||||
|
||||
return property.getId();
|
||||
}
|
||||
|
||||
public static String getJobProjectFolderName(Property property) {
|
||||
return getJobProjectFolderName(property.getLabel(), property.getVersion());
|
||||
return getJobProjectFolderName(getJobLabel(property), property.getVersion());
|
||||
}
|
||||
|
||||
public static String getJobProjectFolderName(String label, String version) {
|
||||
@@ -642,7 +671,7 @@ public class AggregatorPomsHelper {
|
||||
|
||||
public static String getJobProjectId(Property property) {
|
||||
String _projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
|
||||
return getJobProjectId(_projectTechName, property.getId(), property.getVersion());
|
||||
return getJobProjectId(_projectTechName, getJobId(property), property.getVersion());
|
||||
}
|
||||
|
||||
public static String getJobProjectId(String projectTechName, String id, String version) {
|
||||
@@ -683,7 +712,7 @@ public class AggregatorPomsHelper {
|
||||
AggregatorPomsHelper helper = new AggregatorPomsHelper(projectTechName);
|
||||
IPath itemRelativePath = getItemRelativePath.apply(property);
|
||||
String version = realVersion == null ? property.getVersion() : realVersion;
|
||||
String jobFolderName = getJobProjectFolderName(property.getLabel(), version);
|
||||
String jobFolderName = getJobProjectFolderName(getJobLabel(property), version);
|
||||
ERepositoryObjectType type = ERepositoryObjectType.getItemType(property.getItem());
|
||||
IFolder jobFolder = null;
|
||||
if (PomIdsHelper.skipFolders()) {
|
||||
@@ -978,6 +1007,12 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
Item item = object.getProperty().getItem();
|
||||
if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
|
||||
|
||||
// remove original child routelets projects as they will be created during parent Route generation
|
||||
if (ProcessUtils.isRoutelet(item.getProperty())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
monitor.subTask("Synchronize job pom: " + item.getProperty().getLabel() //$NON-NLS-1$
|
||||
+ "_" + item.getProperty().getVersion()); //$NON-NLS-1$
|
||||
if (runProcessService != null) {
|
||||
@@ -993,11 +1028,92 @@ public class AggregatorPomsHelper {
|
||||
modules.add(getModulePath(pomFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Generate individual routelet projects/poms for each Route (CI mode only)
|
||||
|
||||
if (ProcessUtils.isRoute(item.getProperty()) && ProcessUtils.isRouteWithRoutelets(item)) {
|
||||
|
||||
Set<JobInfo> allJobInfos = ProcessorUtilities.getChildrenJobInfo(item, true, true);
|
||||
|
||||
for (JobInfo childJob : allJobInfos) {
|
||||
|
||||
if (childJob.getProcessItem() != null && childJob.getProcessItem().getProperty() != null ) {
|
||||
|
||||
if (!ProcessUtils.isRoutelet(childJob.getProcessItem().getProperty())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Property childJobProperty = childJob.getProcessItem().getProperty();
|
||||
String jobGroupID = (String) childJob.getProcessItem().getProperty().getAdditionalProperties().get(MavenConstants.NAME_GROUP_ID);
|
||||
String jobCustomVersion = (String) childJob.getProcessItem().getProperty().getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
|
||||
boolean jobUseSnapshot = childJob.getProcessItem().getProperty().getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
|
||||
|
||||
Property routeProperty = item.getProperty();
|
||||
String routeGroupID = PomIdsHelper.getJobGroupId(routeProperty);
|
||||
String routeVersion = VersionUtils.getPublishVersion(routeProperty.getVersion());
|
||||
String routeCustomVersion = (String) routeProperty.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
|
||||
boolean routeUseSnapshot = routeProperty.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
|
||||
|
||||
IFile routePomFile = getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
|
||||
// Inherit child job parameters from parent route
|
||||
|
||||
childJobProperty.setParentItem(item);
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_GROUP_ID, routeGroupID);
|
||||
|
||||
if (routeCustomVersion != null) {
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_USER_VERSION, routeCustomVersion);
|
||||
} else {
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_USER_VERSION, routeVersion);
|
||||
}
|
||||
|
||||
if (routeUseSnapshot) {
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT, "true");
|
||||
} else {
|
||||
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
|
||||
}
|
||||
|
||||
|
||||
runProcessService.generatePom(childJob.getProcessItem(), TalendProcessOptionConstants.GENERATE_POM_NO_FILTER);
|
||||
|
||||
IFile childPomFile = getItemPomFolder(childJobProperty).getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
if (childPomFile.getProject().getName().equalsIgnoreCase(routePomFile.getProject().getName())) {
|
||||
modules.add(getModulePath(childPomFile));
|
||||
}
|
||||
|
||||
// restore original Job parameters
|
||||
childJobProperty.setParentItem(null);
|
||||
|
||||
if ( jobGroupID!= null) {
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_GROUP_ID, jobGroupID);
|
||||
}else {
|
||||
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_GROUP_ID);
|
||||
}
|
||||
|
||||
if (jobUseSnapshot) {
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT, "true");
|
||||
}else {
|
||||
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
|
||||
}
|
||||
|
||||
if (jobCustomVersion!=null) {
|
||||
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_USER_VERSION, jobCustomVersion);
|
||||
} else {
|
||||
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_USER_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// sync project pom again with all modules.
|
||||
monitor.subTask("Synchronize project pom with modules"); //$NON-NLS-1$
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
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();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -149,10 +149,30 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobGroupId, PomIdsHelper.getJobGroupId(property));
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobVersion, PomIdsHelper.getJobVersion(property));
|
||||
}
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, PomIdsHelper.getJobArtifactId(property));
|
||||
variablesValuesMap.put(ETalendMavenVariables.TalendJobVersion, property.getVersion());
|
||||
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
|
||||
if(ProcessUtils.isRoutelet(property)) {
|
||||
if(property.getParentItem() != null) {
|
||||
String routeArtifactID = PomIdsHelper.getJobArtifactId(property.getParentItem().getProperty());
|
||||
String jobArtifactID = PomIdsHelper.getJobArtifactId(property);
|
||||
String routeVersion = property.getParentItem().getProperty().getVersion().replace(".", "_");
|
||||
|
||||
String jobName = (jobArtifactID.startsWith(routeArtifactID))? jobArtifactID :
|
||||
routeArtifactID + "_" + routeVersion + "_" + jobArtifactID;
|
||||
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobGroupId, PomIdsHelper.getJobGroupId(property.getParentItem().getProperty()));
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, jobName);
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobVersion, PomIdsHelper.getJobVersion(property.getParentItem().getProperty()));
|
||||
} else {
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, PomIdsHelper.getJobArtifactId(property));
|
||||
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
|
||||
}
|
||||
} else {
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, PomIdsHelper.getJobArtifactId(property));
|
||||
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
|
||||
}
|
||||
|
||||
if (property != null) {
|
||||
Project currentProject = ProjectManager.getInstance().getProject(property);
|
||||
|
||||
@@ -267,6 +267,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
jobInfoProp.getProperty(JobInfoProperties.CONTEXT_NAME, context.getName()));
|
||||
checkPomProperty(properties, "talend.job.id", ETalendMavenVariables.JobId,
|
||||
jobInfoProp.getProperty(JobInfoProperties.JOB_ID, process.getId()));
|
||||
checkPomProperty(properties, "talend.job.parent.id", ETalendMavenVariables.JobParentId,
|
||||
jobInfoProp.getProperty(JobInfoProperties.JOB_PARENT_ID, ""));
|
||||
checkPomProperty(properties, "talend.job.type", ETalendMavenVariables.JobType,
|
||||
jobInfoProp.getProperty(JobInfoProperties.JOB_TYPE));
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?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-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"/>
|
||||
@@ -8,6 +9,5 @@
|
||||
<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>
|
||||
|
||||
@@ -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.1.jar
|
||||
lib/commons-text-1.10.0.jar
|
||||
Export-Package: org.apache.commons.cli2,
|
||||
org.apache.commons.cli2.builder,
|
||||
org.apache.commons.cli2.commandline,
|
||||
|
||||
@@ -7,4 +7,4 @@ bin.includes = META-INF/,\
|
||||
lib/commons-math3-3.3.jar,\
|
||||
lib/commons-validator-1.5.1.jar,\
|
||||
lib/commons-pool2-2.4.2.jar,\
|
||||
lib/commons-text-1.1.jar
|
||||
lib/commons-text-1.10.0.jar
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -62,6 +62,11 @@
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.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>
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
<classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.3.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/istack-commons-runtime-3.0.12.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.3.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-6.2.6.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.4.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-6.4.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.5.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-1.2.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-api-1.2.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.annotation-api-1.3.5.jar"/>
|
||||
|
||||
@@ -5,22 +5,22 @@ Bundle-SymbolicName: org.talend.libraries.apache.cxf;singleton:=true
|
||||
Bundle-Version: 7.3.1.qualifier
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .,
|
||||
lib/cxf-core-3.4.7.jar,
|
||||
lib/cxf-rt-bindings-soap-3.4.7.jar,
|
||||
lib/cxf-rt-bindings-xml-3.4.7.jar,
|
||||
lib/cxf-rt-databinding-jaxb-3.4.7.jar,
|
||||
lib/cxf-rt-features-clustering-3.4.7.jar,
|
||||
lib/cxf-rt-frontend-jaxrs-3.4.7.jar,
|
||||
lib/cxf-rt-frontend-jaxws-3.4.7.jar,
|
||||
lib/cxf-rt-frontend-simple-3.4.7.jar,
|
||||
lib/cxf-rt-rs-client-3.4.7.jar,
|
||||
lib/cxf-rt-security-3.4.7.jar,
|
||||
lib/cxf-rt-security-saml-3.4.7.jar,
|
||||
lib/cxf-rt-transports-http-3.4.7.jar,
|
||||
lib/cxf-rt-ws-addr-3.4.7.jar,
|
||||
lib/cxf-rt-wsdl-3.4.7.jar,
|
||||
lib/cxf-rt-ws-security-3.4.7.jar,
|
||||
lib/cxf-rt-ws-policy-3.4.7.jar,
|
||||
lib/cxf-core-3.5.5.jar,
|
||||
lib/cxf-rt-bindings-soap-3.5.5.jar,
|
||||
lib/cxf-rt-bindings-xml-3.5.5.jar,
|
||||
lib/cxf-rt-databinding-jaxb-3.5.5.jar,
|
||||
lib/cxf-rt-features-clustering-3.5.5.jar,
|
||||
lib/cxf-rt-frontend-jaxrs-3.5.5.jar,
|
||||
lib/cxf-rt-frontend-jaxws-3.5.5.jar,
|
||||
lib/cxf-rt-frontend-simple-3.5.5.jar,
|
||||
lib/cxf-rt-rs-client-3.5.5.jar,
|
||||
lib/cxf-rt-security-3.5.5.jar,
|
||||
lib/cxf-rt-security-saml-3.5.5.jar,
|
||||
lib/cxf-rt-transports-http-3.5.5.jar,
|
||||
lib/cxf-rt-ws-addr-3.5.5.jar,
|
||||
lib/cxf-rt-wsdl-3.5.5.jar,
|
||||
lib/cxf-rt-ws-security-3.5.5.jar,
|
||||
lib/cxf-rt-ws-policy-3.5.5.jar,
|
||||
lib/istack-commons-runtime-3.0.12.jar,
|
||||
lib/jakarta.activation-1.2.2.jar,
|
||||
lib/jakarta.activation-api-1.2.2.jar,
|
||||
@@ -35,7 +35,7 @@ Bundle-ClassPath: .,
|
||||
lib/stax2-api-4.2.1.jar,
|
||||
lib/txw2-2.3.4.jar,
|
||||
lib/xmlschema-core-2.2.5.jar,
|
||||
lib/woodstox-core-6.2.6.jar,
|
||||
lib/woodstox-core-6.4.0.jar,
|
||||
lib/wsdl4j-1.6.3.jar
|
||||
Export-Package: javax.jws,
|
||||
javax.ws.rs,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<cxf.version>3.4.7</cxf.version>
|
||||
<cxf.version>3.5.5</cxf.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
@@ -170,7 +170,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>6.2.6</version>
|
||||
<version>6.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ws.xmlschema</groupId>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-core-3.0.3.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.11.2.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="class"/>
|
||||
|
||||
@@ -4,22 +4,38 @@ Bundle-Name: Lucene plug-in
|
||||
Bundle-SymbolicName: org.talend.libraries.apache.lucene
|
||||
Bundle-Version: 7.3.1.qualifier
|
||||
Bundle-Vendor: .Talend SA.
|
||||
Bundle-ClassPath: lib/lucene-core-3.0.3.jar,
|
||||
Bundle-ClassPath: lib/lucene-core-8.11.2.jar,
|
||||
.
|
||||
Export-Package: org.apache.lucene,
|
||||
org.apache.lucene.analysis,
|
||||
org.apache.lucene.analysis.standard,
|
||||
org.apache.lucene.analysis.tokenattributes,
|
||||
org.apache.lucene.codecs,
|
||||
org.apache.lucene.codecs.blocktree,
|
||||
org.apache.lucene.codecs.compressing,
|
||||
org.apache.lucene.codecs.lucene50,
|
||||
org.apache.lucene.codecs.lucene60,
|
||||
org.apache.lucene.codecs.lucene80,
|
||||
org.apache.lucene.codecs.lucene84,
|
||||
org.apache.lucene.codecs.lucene86,
|
||||
org.apache.lucene.codecs.lucene87,
|
||||
org.apache.lucene.codecs.perfield,
|
||||
org.apache.lucene.document,
|
||||
org.apache.lucene.geo,
|
||||
org.apache.lucene.index,
|
||||
org.apache.lucene.messages,
|
||||
org.apache.lucene.queryParser,
|
||||
org.apache.lucene.search,
|
||||
org.apache.lucene.search.function,
|
||||
org.apache.lucene.search.payloads,
|
||||
org.apache.lucene.search.comparators,
|
||||
org.apache.lucene.search.similarities,
|
||||
org.apache.lucene.search.spans,
|
||||
org.apache.lucene.store,
|
||||
org.apache.lucene.util,
|
||||
org.apache.lucene.util.cache
|
||||
org.apache.lucene.util.automaton,
|
||||
org.apache.lucene.util.bkd,
|
||||
org.apache.lucene.util.compress,
|
||||
org.apache.lucene.util.fst,
|
||||
org.apache.lucene.util.graph,
|
||||
org.apache.lucene.util.hppc,
|
||||
org.apache.lucene.util.mutable,
|
||||
org.apache.lucene.util.packed
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-BundleShape: dir
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
output.. = class/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/lucene-core-2.9.3.jar,\
|
||||
lib/lucene-core-3.0.3.jar
|
||||
lib/lucene-core-8.11.2.jar
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,4 +9,36 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.lucene</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<lucene.version>8.11.2</lucene.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-core</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-8.3.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.3.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-8.3.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-8.3.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-8.11.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-backward-codecs-8.11.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-core-8.11.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-8.11.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-8.11.2.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
|
||||
@@ -5,10 +5,11 @@ Bundle-SymbolicName: org.talend.libraries.apache.lucene8
|
||||
Bundle-Version: 7.3.1.qualifier
|
||||
Bundle-Vendor: .Talend SA.
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: lib/lucene-analyzers-common-8.3.1.jar,
|
||||
lib/lucene-core-8.3.1.jar,
|
||||
lib/lucene-queries-8.3.1.jar,
|
||||
lib/lucene-queryparser-8.3.1.jar
|
||||
Bundle-ClassPath: lib/lucene-analyzers-common-8.11.2.jar,
|
||||
lib/lucene-backward-codecs-8.11.2.jar,
|
||||
lib/lucene-core-8.11.2.jar,
|
||||
lib/lucene-queries-8.11.2.jar,
|
||||
lib/lucene-queryparser-8.11.2.jar
|
||||
Export-Package: org.apache.lucene,
|
||||
org.apache.lucene.analysis,
|
||||
org.apache.lucene.analysis.ar,
|
||||
@@ -78,6 +79,8 @@ Export-Package: org.apache.lucene,
|
||||
org.apache.lucene.codecs.lucene60,
|
||||
org.apache.lucene.codecs.lucene70,
|
||||
org.apache.lucene.codecs.lucene80,
|
||||
org.apache.lucene.codecs.lucene84,
|
||||
org.apache.lucene.codecs.lucene86,
|
||||
org.apache.lucene.codecs.perfield,
|
||||
org.apache.lucene.collation,
|
||||
org.apache.lucene.collation.tokenattributes,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/lucene-analyzers-common-8.3.1.jar,\
|
||||
lib/lucene-core-8.3.1.jar,\
|
||||
lib/lucene-queries-8.3.1.jar,\
|
||||
lib/lucene-queryparser-8.3.1.jar
|
||||
lib/lucene-analyzers-common-8.11.2.jar,\
|
||||
lib/lucene-backward-codecs-8.11.2.jar,\
|
||||
lib/lucene-core-8.11.2.jar,\
|
||||
lib/lucene-queries-8.11.2.jar,\
|
||||
lib/lucene-queryparser-8.11.2.jar
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,4 +9,57 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.lucene8</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<lucene.version>8.11.2</lucene.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-analyzers-common</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-backward-codecs</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-core</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-queries</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-queryparser</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<!-- same as xercesImpl.jar-->
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.12.2</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.ws.xmlschema</groupId>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user