Compare commits
3 Commits
release/7.
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97849034bc | ||
|
|
afaf4646a1 | ||
|
|
6f5ae02eed |
@@ -12,28 +12,16 @@
|
||||
// ============================================================================
|
||||
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/>
|
||||
@@ -48,10 +36,6 @@ 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.
|
||||
*/
|
||||
@@ -182,17 +166,9 @@ 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) {
|
||||
@@ -220,32 +196,6 @@ 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".
|
||||
*
|
||||
|
||||
@@ -872,38 +872,25 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
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.
|
||||
}
|
||||
}
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
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);
|
||||
}
|
||||
// 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$
|
||||
}
|
||||
if (size == 1) {
|
||||
} else if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void computePropertyMaxInformationLevel(Property property) {
|
||||
|
||||
@@ -2199,7 +2199,6 @@ 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
|
||||
|
||||
@@ -16,7 +16,6 @@ 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;
|
||||
|
||||
@@ -155,8 +154,6 @@ 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,6 +380,5 @@ 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.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" })),
|
||||
"jackcess-2.1.0.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.1.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"jackcess-encrypt-2.1.0.jar", "bcprov-jdk15on-1.51.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
|
||||
ACCESS_2003(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2003", "Access_2003")), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ACCESS_2007(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2007", "Access_2007")), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// oracle
|
||||
@@ -88,8 +88,8 @@ public enum EDatabaseVersion4Drivers {
|
||||
"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.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" })),
|
||||
"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" })),
|
||||
|
||||
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$
|
||||
@@ -171,10 +171,8 @@ public enum EDatabaseVersion4Drivers {
|
||||
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", //$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$
|
||||
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$
|
||||
"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,10 +38,7 @@ public class HadoopClassLoaderFactory2 {
|
||||
public static ClassLoader getHDFSClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
|
||||
return getClassLoader(relatedClusterId, EHadoopCategory.HDFS, distribution, version, useKrb);
|
||||
}
|
||||
public static ClassLoader getHDFSKnoxClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
|
||||
return HadoopClassLoaderFactory2.getClassLoader(relatedClusterId, EHadoopCategory.HDFS, distribution, version, useKrb,
|
||||
IHadoopArgs.HDFS_ARG_KNOX);
|
||||
}
|
||||
|
||||
public static ClassLoader getMRClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
|
||||
return getClassLoader(relatedClusterId, EHadoopCategory.MAP_REDUCE, distribution, version, useKrb);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,4 @@ public interface IHadoopArgs {
|
||||
|
||||
public static final String HIVE_ARG_STANDALONE = "STANDALONE"; //$NON-NLS-1$
|
||||
|
||||
public static final String HDFS_ARG_KNOX = "USE_KNOX"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
||||
@@ -495,16 +495,11 @@ 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;
|
||||
@@ -512,9 +507,6 @@ public class ContextUtils {
|
||||
if (checkObject(contextId)) {
|
||||
return null;
|
||||
}
|
||||
if (missingContexts.contains(contextId)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>();
|
||||
possibleTypes.add(ERepositoryObjectType.CONTEXT);
|
||||
@@ -529,8 +521,6 @@ public class ContextUtils {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
missingContexts.add(contextId);
|
||||
ExceptionHandler.log("Can't find Context item[id=" + contextId + "].");
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -841,7 +831,6 @@ 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) {
|
||||
@@ -904,7 +893,6 @@ 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 {
|
||||
@@ -963,14 +951,6 @@ 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,7 +299,6 @@ 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();
|
||||
@@ -527,7 +526,6 @@ 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,7 +51,6 @@ 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,7 +206,6 @@ 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,10 +194,6 @@ public interface IMetadataConnection extends IMetadata {
|
||||
public String getContextName();
|
||||
|
||||
public void setContextName(String contextName);
|
||||
|
||||
public boolean isSupportNLS();
|
||||
|
||||
public void setSupportNLS(boolean newSupportNLS);
|
||||
|
||||
/**
|
||||
* Returns the value that you stored in the data collection by the key. Normally, it is like this key-value. For
|
||||
|
||||
@@ -254,7 +254,6 @@ public final class ConvertionHelper {
|
||||
result.setContentModel(connection.isContextMode());
|
||||
result.setContextId(sourceConnection.getContextId());
|
||||
result.setContextName(sourceConnection.getContextName());
|
||||
result.setSupportNLS(sourceConnection.isSupportNLS());
|
||||
// handle oracle database connnection of general_jdbc.
|
||||
result.setSchema(getMeataConnectionSchema(result));
|
||||
convertOtherParameters(result, connection);
|
||||
|
||||
@@ -113,7 +113,6 @@ public class MetadataConnection implements IMetadataConnection {
|
||||
|
||||
private String contextName;
|
||||
|
||||
private boolean supportNLS = false;
|
||||
// ~
|
||||
|
||||
private String comment;
|
||||
@@ -730,14 +729,6 @@ public class MetadataConnection implements IMetadataConnection {
|
||||
public void setContextName(String contextName) {
|
||||
this.contextName = contextName;
|
||||
}
|
||||
|
||||
public boolean isSupportNLS() {
|
||||
return supportNLS;
|
||||
}
|
||||
|
||||
public void setSupportNLS(boolean supportNLS) {
|
||||
this.supportNLS = supportNLS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -1225,11 +1225,6 @@ public class RepositoryToComponentProperty {
|
||||
return value2;
|
||||
|
||||
}
|
||||
|
||||
if(value.equals("SUPPORT_NLS")) {
|
||||
return connection.isSupportNLS();
|
||||
}
|
||||
|
||||
if (value.equals("CDC_TYPE_MODE")) { //$NON-NLS-1$
|
||||
return new Boolean(CDCTypeMode.LOG_MODE.getName().equals(connection.getCdcTypeMode()));
|
||||
}
|
||||
|
||||
@@ -728,8 +728,8 @@ public final class ProcessUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isRoute(Property property) {
|
||||
|
||||
private static boolean isRoute(Property property) {
|
||||
return property!= null && (ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE) ||
|
||||
ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE));
|
||||
}
|
||||
@@ -768,39 +768,6 @@ 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;
|
||||
@@ -1091,28 +1058,6 @@ 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,8 +79,4 @@ 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$
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ 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$
|
||||
|
||||
@@ -94,10 +92,6 @@ 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,8 +22,6 @@ 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$
|
||||
|
||||
|
||||
@@ -26,7 +26,5 @@ public interface IUpdateService extends IService {
|
||||
public String getSharedStudioMissingPatchVersion();
|
||||
|
||||
public boolean updateArtifactsFileSha256Hex(IProgressMonitor monitor, String studioArtifactsFileShaCodeHex);
|
||||
|
||||
public void installComponents(IProgressMonitor monitor);
|
||||
|
||||
}
|
||||
|
||||
@@ -648,7 +648,6 @@ 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,7 +522,6 @@ 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,7 +185,6 @@ 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,7 +92,6 @@ 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,7 +21,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -52,7 +51,6 @@ public class Contexts {
|
||||
public void run() {
|
||||
if (cxtView != null) {
|
||||
updateTitle(cxtView);
|
||||
ContextUtils.clearMissingContextCache();
|
||||
cxtView.refresh(part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ 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(),
|
||||
|
||||
@@ -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).has("component_name") && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
|
||||
if((obj instanceof JSONObject) && ((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,9 +54,7 @@ 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,
|
||||
org.eclipse.m2e.core,
|
||||
org.eclipse.m2e.core.embedder
|
||||
Import-Package: org.apache.commons.collections4.map
|
||||
Bundle-ClassPath: .,
|
||||
lib/log4j-api-2.17.1.jar,
|
||||
lib/log4j-core-2.17.1.jar
|
||||
|
||||
@@ -1,255 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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 + "]";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
@@ -1608,11 +1608,6 @@ 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;
|
||||
@@ -2552,7 +2547,7 @@ public class ProcessorUtilities {
|
||||
return jobInfos;
|
||||
}
|
||||
|
||||
public static boolean isRouteletNode(NodeType node) {
|
||||
private 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);
|
||||
@@ -2950,12 +2945,4 @@ 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,8 +46,6 @@ 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)
|
||||
@@ -63,8 +61,6 @@ public class RepositorySystemFactory {
|
||||
repositorySystemSession.setTransferListener(new ChainedTransferListener());
|
||||
repositorySystemSession.setRepositoryListener(new ChainedRepositoryListener());
|
||||
repositorySystemSession.setProxySelector(new TalendAetherProxySelector());
|
||||
repositorySystemSession.setIgnoreArtifactDescriptorRepositories(
|
||||
RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
|
||||
sessions.put(localRepo, repositorySystemSession);
|
||||
}
|
||||
|
||||
@@ -161,13 +157,4 @@ 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,7 +63,6 @@ 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;
|
||||
@@ -514,7 +513,6 @@ 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,6 +34,7 @@ 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;
|
||||
@@ -56,7 +57,6 @@ 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,9 +283,8 @@ 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() {
|
||||
|
||||
@@ -126,42 +126,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<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>
|
||||
<version>2.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
@@ -174,15 +139,10 @@
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<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>
|
||||
<groupId>org.apache-extras.beanshell</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
<version>2.0b6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20230227</version>
|
||||
<version>20140107</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
@@ -151,12 +151,6 @@
|
||||
<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>
|
||||
@@ -216,11 +210,6 @@
|
||||
<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>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<module>zip/pom.xml</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<m2.fasterxml.jackson.version>2.13.4</m2.fasterxml.jackson.version>
|
||||
<m2.fasterxml.jackson.version>2.13.2</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.26</tacokit.components.version>
|
||||
<tacokit.components.version>1.27.13</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.38.11</tcomp.version>
|
||||
<tcomp.version>1.38.6</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
<version>2.12.4</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
@@ -190,16 +190,6 @@
|
||||
<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>
|
||||
|
||||
@@ -45,7 +45,6 @@ public enum ETalendMavenVariables {
|
||||
JobletName,
|
||||
|
||||
JobId,
|
||||
JobParentId,
|
||||
JobName,
|
||||
JobType,
|
||||
JobFinalName,
|
||||
|
||||
@@ -25,6 +25,7 @@ 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;
|
||||
@@ -34,6 +35,7 @@ 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;
|
||||
@@ -56,7 +58,6 @@ 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;
|
||||
@@ -66,7 +67,6 @@ 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,7 +99,6 @@ 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;
|
||||
@@ -632,37 +631,9 @@ 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(getJobLabel(property), property.getVersion());
|
||||
return getJobProjectFolderName(property.getLabel(), property.getVersion());
|
||||
}
|
||||
|
||||
public static String getJobProjectFolderName(String label, String version) {
|
||||
@@ -671,7 +642,7 @@ public class AggregatorPomsHelper {
|
||||
|
||||
public static String getJobProjectId(Property property) {
|
||||
String _projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
|
||||
return getJobProjectId(_projectTechName, getJobId(property), property.getVersion());
|
||||
return getJobProjectId(_projectTechName, property.getId(), property.getVersion());
|
||||
}
|
||||
|
||||
public static String getJobProjectId(String projectTechName, String id, String version) {
|
||||
@@ -712,7 +683,7 @@ public class AggregatorPomsHelper {
|
||||
AggregatorPomsHelper helper = new AggregatorPomsHelper(projectTechName);
|
||||
IPath itemRelativePath = getItemRelativePath.apply(property);
|
||||
String version = realVersion == null ? property.getVersion() : realVersion;
|
||||
String jobFolderName = getJobProjectFolderName(getJobLabel(property), version);
|
||||
String jobFolderName = getJobProjectFolderName(property.getLabel(), version);
|
||||
ERepositoryObjectType type = ERepositoryObjectType.getItemType(property.getItem());
|
||||
IFolder jobFolder = null;
|
||||
if (PomIdsHelper.skipFolders()) {
|
||||
@@ -1007,12 +978,6 @@ 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) {
|
||||
@@ -1028,92 +993,11 @@ public class AggregatorPomsHelper {
|
||||
modules.add(getModulePath(pomFile));
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// sync project pom again with all modules.
|
||||
monitor.subTask("Synchronize project pom with modules"); //$NON-NLS-1$
|
||||
|
||||
@@ -149,30 +149,10 @@ 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());
|
||||
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);
|
||||
}
|
||||
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
|
||||
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
|
||||
|
||||
if (property != null) {
|
||||
Project currentProject = ProjectManager.getInstance().getProject(property);
|
||||
|
||||
@@ -267,8 +267,6 @@ 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,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/commons-text-1.10.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/commons-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"/>
|
||||
@@ -9,5 +8,6 @@
|
||||
<classpathentry exported="true" kind="lib" path="lib/commons-digester-2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/commons-cli-2.0-SNAPSHOT.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.15.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/commons-text-1.1.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -10,7 +10,7 @@ Bundle-ClassPath: .,
|
||||
lib/commons-math3-3.3.jar,
|
||||
lib/commons-validator-1.5.1.jar,
|
||||
lib/commons-pool2-2.4.2.jar,
|
||||
lib/commons-text-1.10.0.jar
|
||||
lib/commons-text-1.1.jar
|
||||
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.10.0.jar
|
||||
lib/commons-text-1.1.jar
|
||||
|
||||
Binary file not shown.
@@ -62,11 +62,6 @@
|
||||
<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.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/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/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.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/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/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.4.0.jar,
|
||||
lib/woodstox-core-6.2.6.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.5.5</cxf.version>
|
||||
<cxf.version>3.4.7</cxf.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
@@ -170,7 +170,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>6.4.0</version>
|
||||
<version>6.2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ws.xmlschema</groupId>
|
||||
|
||||
BIN
main/plugins/org.talend.libraries.jdbc.hsql/lib/hsqldb.jar
Normal file
BIN
main/plugins/org.talend.libraries.jdbc.hsql/lib/hsqldb.jar
Normal file
Binary file not shown.
@@ -6,42 +6,9 @@ COPYRIGHTS AND LICENSES
|
||||
|
||||
ORIGINAL LICENSE (a.k.a. "hypersonic_lic.txt")
|
||||
|
||||
For work developed by the HSQL Development Group:
|
||||
For content, code, and products originally developed by Thomas Mueller and the Hypersonic SQL Group:
|
||||
|
||||
Copyright (c) 2001-2022, The HSQL Development Group
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of the HSQL Development Group nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
|
||||
For work originally developed by the Hypersonic SQL Group:
|
||||
|
||||
Copyright (c) 1995-2000, The Hypersonic SQL Group.
|
||||
Copyright (c) 1995-2000 by the Hypersonic SQL Group.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -70,12 +37,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This software consists of voluntary contributions made by many individuals
|
||||
on behalf of the Hypersonic SQL Group.
|
||||
This software consists of voluntary contributions made by many individuals on behalf of the
|
||||
Hypersonic SQL Group.
|
||||
|
||||
For work added by the HSQL Development Group (a.k.a. hsqldb_lic.txt):
|
||||
|
||||
Copyright (c) 2001-2022, The HSQL Development Group
|
||||
Copyright (c) 2001-2005, The HSQL Development Group
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
29
main/plugins/org.talend.libraries.jdbc.hsql/pom.xml
Executable file → Normal file
29
main/plugins/org.talend.libraries.jdbc.hsql/pom.xml
Executable file → Normal file
@@ -9,33 +9,4 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.jdbc.hsql</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>2.7.1</version>
|
||||
<classifier>jdk8</classifier>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<destFileName>hsqldb.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/advancedPersistentLookupLib-1.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/advancedPersistentLookupLib-1.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"/>
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: org.talend.libraries.persist.lookup
|
||||
Bundle-SymbolicName: org.talend.libraries.persist.lookup
|
||||
Bundle-Version: 7.3.1.qualifier
|
||||
Bundle-ClassPath: .,
|
||||
lib/advancedPersistentLookupLib-1.4.jar
|
||||
Bundle-ClassPath: lib/advancedPersistentLookupLib-1.2.jar,
|
||||
.
|
||||
Export-Package: org.talend.commons.utils.data.map,
|
||||
org.talend.commons.utils.time,
|
||||
org.talend.core.model.process,
|
||||
|
||||
@@ -2,6 +2,4 @@ source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/advancedPersistentLookupLib-1.4.jar,\
|
||||
lib/advancedPersistentLookupLib-1.3.jar,\
|
||||
lib/advancedPersistentLookupLib-1.2.jar
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<jardesc>
|
||||
<jar path="D:/studio_code/tcommon-studio-se/main/plugins/org.talend.libraries.persist.lookup/lib/advancedPersistentLookupLib-1.4.jar"/>
|
||||
<jar path="D:/studio_code/tcommon-studio-se/main/plugins/org.talend.libraries.persist.lookup/lib/advancedPersistentLookupLib-1.2.jar"/>
|
||||
<options buildIfNeeded="true" compress="true" descriptionLocation="/org.talend.libraries.persist.lookup/export_advancedPersistentLookupLib.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="false" storeRefactorings="false" useSourceFolders="false"/>
|
||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||
<selectedProjects/>
|
||||
|
||||
Binary file not shown.
@@ -2,7 +2,6 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="src" path="resources/java"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jboss-marshalling-2.0.12.Final.jar"/>
|
||||
<classpathentry kind="lib" path="lib/crypto-utils.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-api-1.7.25.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
|
||||
@@ -28,8 +28,7 @@ Eclipse-LazyStart: true
|
||||
Bundle-ClassPath: .,
|
||||
lib/crypto-utils.jar,
|
||||
lib/slf4j-api-1.7.25.jar
|
||||
Export-Package: org.jboss.marshalling,
|
||||
org.talend.librariesmanager.emf.librariesindex,
|
||||
Export-Package: org.talend.librariesmanager.emf.librariesindex,
|
||||
org.talend.librariesmanager.librarydata,
|
||||
org.talend.librariesmanager.maven,
|
||||
org.talend.librariesmanager.model,
|
||||
@@ -41,5 +40,3 @@ Export-Package: org.jboss.marshalling,
|
||||
Import-Package: org.eclipse.emf.ecore.xmi.impl,
|
||||
org.talend.osgi.hook.notification
|
||||
Eclipse-BundleShape: dir
|
||||
Bundle-ClassPath: lib/jboss-marshalling-2.0.12.Final.jar,
|
||||
.
|
||||
|
||||
@@ -69,12 +69,6 @@
|
||||
name="crypto-utils-0.31.12.jar">
|
||||
</library>
|
||||
</systemRoutine>
|
||||
<systemRoutine
|
||||
name="IPersistableLookupRow">
|
||||
<library
|
||||
name="mvn:org.jboss.marshalling/jboss-marshalling/2.0.12.Final">
|
||||
</library>
|
||||
</systemRoutine>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.talend.core.runtime.artifact_handler">
|
||||
|
||||
@@ -51,11 +51,6 @@
|
||||
<version>1.7.25</version>
|
||||
<overWrite>true</overWrite>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.jboss.marshalling</groupId>
|
||||
<artifactId>jboss-marshalling</artifactId>
|
||||
<version>2.0.12.Final</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
@@ -467,13 +467,13 @@ public class TalendDate {
|
||||
*
|
||||
* {Category} TalendDate
|
||||
*
|
||||
* {param} String("2008/11/24 12:15:25") string : date represent in string
|
||||
* {param} String("") string : date represent in string
|
||||
*
|
||||
* {param} String("yyyy/MM/dd HH:mm:ss") pattern : date pattern
|
||||
* {param} String("yyyy-MM-dd") pattern : date pattern
|
||||
*
|
||||
* {param} int(5) nb : the added value
|
||||
* {param} int(addValue) nb : the added value
|
||||
*
|
||||
* {param} String("dd") dateType : the part to add
|
||||
* {param} date("MM") dateType : the part to add
|
||||
*
|
||||
* {examples}
|
||||
*
|
||||
@@ -1216,19 +1216,8 @@ public class TalendDate {
|
||||
}
|
||||
|
||||
/**
|
||||
* Format date to mssql 2008 type datetimeoffset ISO 8601 string with local time zone format string : yyyy-MM-dd
|
||||
* HH:mm:ss.SSSXXX (JDK7 support it)
|
||||
*
|
||||
* @param date the time value to be formatted into a time string.
|
||||
* @return the formatted time string.
|
||||
*
|
||||
* {talendTypes} String
|
||||
*
|
||||
* {Category} TalendDate
|
||||
*
|
||||
* {param} date(new Date()) date : the time value to be formatted into a time string
|
||||
*
|
||||
* {example} formatDatetimeoffset(new Date()) #
|
||||
* format date to mssql 2008 type datetimeoffset ISO 8601 string with local time zone format string : yyyy-MM-dd
|
||||
* HH:mm:ss.SSSXXX(JDK7 support it)
|
||||
*/
|
||||
public static String formatDatetimeoffset(Date date) {
|
||||
String dateString = formatDate("yyyy-MM-dd HH:mm:ss.SSSZ", date);// keep the max precision in java
|
||||
@@ -1357,28 +1346,14 @@ public class TalendDate {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a formatted string to date
|
||||
*
|
||||
*
|
||||
* @param string Must be a string datatype. Passes the values that you want to convert.
|
||||
* @param format Enter a valid TO_DATE format string. The format string must match the parts of the string argument
|
||||
* default format is "MM/DD/yyyy HH:mm:ss.sss" if not specified.
|
||||
*
|
||||
* default formate is "MM/DD/yyyy HH:mm:ss.sss" if not specified.
|
||||
* @return Date
|
||||
* @throws ParseException
|
||||
*
|
||||
* {talendTypes} Date
|
||||
*
|
||||
* {Category} TalendDate
|
||||
*
|
||||
* {param} String("2015-11-21 13:23:45") string : string Must be a string datatype. Passes the values that you want
|
||||
* to convert.
|
||||
*
|
||||
* {param} String("yyyy-MM-dd HH:mm:ss") format : Enter a valid TO_DATE format string. The format string must match
|
||||
* the parts of the string argument default format is "MM/DD/yyyy HH:mm:ss.sss" if not specified.
|
||||
*
|
||||
*
|
||||
* {example} TO_DATE("1464576463231", "J") #Mon May 30 10:47:43 CST 2016 {example} TO_DATE("2015-11-21
|
||||
* 13:23:45","yyyy-MM-dd HH:mm:ss") #Sat Nov 21 13:23:45 CST 2015
|
||||
* {example} TO_DATE("1464576463231", "J") #Mon May 30 10:47:43 CST 2016
|
||||
* {example} TO_DATE("2015-11-21 13:23:45","yyyy-MM-dd HH:mm:ss") #Sat Nov 21 13:23:45 CST 2015
|
||||
*
|
||||
*/
|
||||
public static Date TO_DATE(String string, String format) throws ParseException {
|
||||
@@ -1399,24 +1374,6 @@ public class TalendDate {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a formatted string to date with default format as ""MM/DD/yyyy HH:mm:ss.sss"
|
||||
*
|
||||
* @param string Must be a string datatype. Passes the values that you want to convert.
|
||||
* @return Date
|
||||
* @throws ParseException
|
||||
*
|
||||
* {talendTypes} Date
|
||||
*
|
||||
* {Category} TalendDate
|
||||
*
|
||||
* {param} String("11/21/2015 13:23:45.111") string : string Must be a string datatype. Passes the values that you
|
||||
* want to convert.
|
||||
*
|
||||
* {example} TO_DATE("11/21/2015 13:23:45.111") #Sat Nov 21 13:23:45.111 CST 2015
|
||||
*
|
||||
*/
|
||||
|
||||
public static Date TO_DATE(String string) throws ParseException {
|
||||
return TO_DATE(string, null);
|
||||
}
|
||||
@@ -1453,25 +1410,13 @@ public class TalendDate {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add values to the specified portion of the date
|
||||
*
|
||||
* @param date Passes the values you want to change
|
||||
* @param format A format string specifying the portion of the date value you want to change.For example, 'mm'.
|
||||
* @param amount An integer value specifying the amount of years, months, days, hours, and so on by which you want
|
||||
* to change the date value.
|
||||
* @return Date NULL if a null value is passed as an argument to the function.
|
||||
* @throws ParseException
|
||||
*
|
||||
* {talendTypes} Date
|
||||
*
|
||||
* {Category} TalendDate
|
||||
*
|
||||
* {param} Date(new Date()) date :
|
||||
*
|
||||
* {param} String("HH") format :
|
||||
*
|
||||
* {param} int(2) amount :
|
||||
*
|
||||
* @param date Passes the values you want to change
|
||||
* @param format A format string specifying the portion of the date value you want to change.For example, 'mm'.
|
||||
* @param amount An integer value specifying the amount of years, months, days, hours,
|
||||
* and so on by which you want to change the date value.
|
||||
* @return Date NULL if a null value is passed as an argument to the function.
|
||||
* @throws ParseException
|
||||
* {example} ADD_TO_DATE(new Date(1464576463231l), "HH",2) #Mon May 30 12:47:43 CST 2016
|
||||
*/
|
||||
public static Date ADD_TO_DATE(Date date, String format, int amount) throws ParseException{
|
||||
@@ -1540,21 +1485,10 @@ public class TalendDate {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a Date to a formatted character string.
|
||||
*
|
||||
* @param date the date value you want to convert to character strings.
|
||||
* @param format the format of the return value,
|
||||
* @return String. NULL if a value passed to the function is NULL.
|
||||
*
|
||||
* {talendTypes} String
|
||||
*
|
||||
* {Category} TalendDate
|
||||
*
|
||||
* {param} Date(new Date()) date : the date value you want to convert to character strings.
|
||||
*
|
||||
* {param} String("MM/DD/YYYY HH24:MI:SS") format : the format of the return value,
|
||||
*
|
||||
* {example} TO_CHAR(new Date(),"MM/DD/YYYY HH24:MI:SS") #
|
||||
* @param date Date/Time datatype. Passes the date values you want to convert to character strings.
|
||||
* @param format Enter a valid TO_CHAR format string. The format string defines the format of the return value,
|
||||
* @return String. NULL if a value passed to the function is NULL.
|
||||
*/
|
||||
|
||||
public static String TO_CHAR(Date date, String format) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -14,6 +14,7 @@ package routines.system;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.dom4j.Element;
|
||||
@@ -109,31 +110,26 @@ public class GetJarsToRegister {
|
||||
private String addLibsPath(String line, java.util.Map<String, String> crcMap) {
|
||||
for (java.util.Map.Entry<String, String> entry : crcMap.entrySet()) {
|
||||
line = adaptLibPaths(line, entry);
|
||||
if (new java.io.File(line).exists()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
||||
private String adaptLibPaths(String line, java.util.Map.Entry<String, String> entry) {
|
||||
line = line.replace("\\", "/");
|
||||
String jarName = entry.getValue();
|
||||
String crc = entry.getKey();
|
||||
String libStringFinder = "../lib/" + jarName;
|
||||
String libStringFinder2 = "./" + jarName; // for the job jar itself.
|
||||
String replacement = "../../../cache/lib/" + crc + "/" + jarName;
|
||||
|
||||
if (line.contains(libStringFinder)) {
|
||||
line = line.replace(libStringFinder, replacement);
|
||||
line = line.replace(libStringFinder, "../../../cache/lib/" + crc + "/" + jarName);
|
||||
} else if (line.toLowerCase().contains(libStringFinder2)) {
|
||||
line = line.toLowerCase().replace(libStringFinder2, replacement);
|
||||
} else if (line.equalsIgnoreCase(jarName)) {
|
||||
line = replacement;
|
||||
line = line.toLowerCase().replace(libStringFinder2, "../../../cache/lib/" + crc + "/" + jarName);
|
||||
} else if (line.toLowerCase().equals(jarName)) {
|
||||
line = "../../../cache/lib/" + crc + "/" + jarName;
|
||||
} else if (line.contains(":$ROOT_PATH/" + jarName + ":")) {
|
||||
line = line.replace(":$ROOT_PATH/" + jarName + ":", ":$ROOT_PATH/" + replacement + ":");
|
||||
line = line.replace(":$ROOT_PATH/" + jarName + ":", ":$ROOT_PATH/../../../cache/lib/" + crc + "/" + jarName + ":");
|
||||
} else if (line.contains(";" + jarName + ";")) {
|
||||
line = line.replace(";" + jarName + ";", ";" + replacement + ";");
|
||||
line = line.replace(";" + jarName + ";", ";../../../cache/lib/" + crc + "/" + jarName + ";");
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,6 @@ import java.io.DataOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
||||
import org.jboss.marshalling.Marshaller;
|
||||
import org.jboss.marshalling.Unmarshaller;
|
||||
|
||||
public interface IPersistableLookupRow<R> {
|
||||
|
||||
public void writeKeysData(ObjectOutputStream out);
|
||||
@@ -22,25 +19,4 @@ public interface IPersistableLookupRow<R> {
|
||||
|
||||
public void copyKeysDataTo(R other);
|
||||
|
||||
default public void writeKeysData(Marshaller marshaller){
|
||||
//sub-class need to override this method
|
||||
throw new UnsupportedOperationException("Method need to be override");
|
||||
}
|
||||
|
||||
default public void readKeysData(Unmarshaller in){
|
||||
throw new UnsupportedOperationException("Method need to be override");
|
||||
}
|
||||
|
||||
default public void writeValuesData(DataOutputStream dataOut, Marshaller objectOut){
|
||||
throw new UnsupportedOperationException("Method need to be override");
|
||||
}
|
||||
|
||||
default public void readValuesData(DataInputStream dataIn, Unmarshaller objectIn){
|
||||
throw new UnsupportedOperationException("Method need to be override");
|
||||
}
|
||||
|
||||
default public boolean supportMarshaller(){
|
||||
//Override this method to return true after implement the Jboss methods above
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,28 +3,10 @@ package routines.system;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
||||
import org.jboss.marshalling.Marshaller;
|
||||
import org.jboss.marshalling.Unmarshaller;
|
||||
|
||||
public interface IPersistableRow<R> {
|
||||
|
||||
public void writeData(ObjectOutputStream out);
|
||||
|
||||
public void readData(ObjectInputStream in);
|
||||
|
||||
|
||||
default public void writeData(Marshaller marshaller){
|
||||
//sub-class need to override this method
|
||||
throw new UnsupportedOperationException("Method need to be override");
|
||||
}
|
||||
|
||||
default public void readData(Unmarshaller in){
|
||||
throw new UnsupportedOperationException("Method need to be override");
|
||||
}
|
||||
|
||||
default public boolean supportJboss(){
|
||||
//Override this method to return true after implement the Jboss methods above
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -520,13 +520,9 @@ public class ResumeUtil {
|
||||
|
||||
private String lineSeparator = System.getProperty("line.separator");
|
||||
|
||||
private final int capibility = 2 << 22; //8M
|
||||
|
||||
private final int FLUSH_FACTOR = 6 *1024 *1024; //6M
|
||||
|
||||
private final int SUBSTRING_SIZE = 2 << 20; //2M
|
||||
|
||||
private int capibility = 2 << 22; //8M
|
||||
|
||||
private int FLUSH_FACTOR = 6 *1024 *1024; //6M
|
||||
|
||||
|
||||
public SimpleCsvWriter(FileChannel channel) {
|
||||
@@ -557,16 +553,6 @@ public class ResumeUtil {
|
||||
content = replace(content, "" + TextQualifier, "" + TextQualifier + TextQualifier);
|
||||
}
|
||||
|
||||
if (content.length() > SUBSTRING_SIZE) { //2M
|
||||
int index = 0;
|
||||
for (; content.length() - index > SUBSTRING_SIZE; index += SUBSTRING_SIZE) {
|
||||
flush(true);
|
||||
final String substring = content.substring(index, index + SUBSTRING_SIZE);
|
||||
buf.put(substring.getBytes());
|
||||
}
|
||||
content = content.substring(index);
|
||||
}
|
||||
|
||||
byte[] contentByte = content.getBytes();
|
||||
if(contentByte.length > capibility - buf.position()) {
|
||||
flush(true);
|
||||
|
||||
@@ -1319,81 +1319,11 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
saveMavenIndex(mavenURIMap, monitorWrap);
|
||||
savePlatfromURLIndex(platformURLMap, monitorWrap);
|
||||
|
||||
if (service != null) {
|
||||
deployLibsFromCustomComponents(service, platformURLMap);
|
||||
}
|
||||
return mavenURIMap;
|
||||
}
|
||||
|
||||
public void deployLibsFromCustomComponents(File componentFolder, List<ModuleNeeded> modulesNeeded) {
|
||||
if (modulesNeeded == null || modulesNeeded.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<File, Set<MavenArtifact>> needToDeploy = new HashMap<File, Set<MavenArtifact>>();
|
||||
modulesNeeded.forEach(module -> {
|
||||
if (module != null) {
|
||||
boolean needDeploy = false;
|
||||
String mvnUri = module.getMavenUri();
|
||||
String jarPathFromMaven = getJarPathFromMaven(StringUtils.isNotBlank(mvnUri) ? mvnUri : module.getModuleName());
|
||||
if (StringUtils.isBlank(jarPathFromMaven)) {
|
||||
needDeploy = true;
|
||||
} else {
|
||||
File jarFromMaven = new File(jarPathFromMaven);
|
||||
if (!jarFromMaven.exists()) {
|
||||
needDeploy = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (needDeploy) {
|
||||
File deployFile = getDeployJarFileByModule(componentFolder, module);
|
||||
if (deployFile != null) {
|
||||
|
||||
install(deployFile, mvnUri, false, true, null);
|
||||
|
||||
if (needToDeploy.get(deployFile) == null) {
|
||||
needToDeploy.put(deployFile, new HashSet<MavenArtifact>());
|
||||
}
|
||||
if (StringUtils.isNotBlank(mvnUri)) {
|
||||
MavenArtifact mavenArtifact = MavenUrlHelper.parseMvnUrl(mvnUri);
|
||||
needToDeploy.get(deployFile).add(mavenArtifact);
|
||||
} else {
|
||||
Map<String, String> sourceAndMavenUri = new HashMap<>();
|
||||
guessMavenRUIFromIndex(deployFile, true, sourceAndMavenUri);
|
||||
Set<MavenArtifact> MavenArtifactSet = new HashSet<MavenArtifact>();
|
||||
sourceAndMavenUri.keySet().forEach(mavenUri -> {
|
||||
if (StringUtils.isNotBlank(mvnUri)) {
|
||||
MavenArtifactSet.add(MavenUrlHelper.parseMvnUrl(mavenUri));
|
||||
}
|
||||
});
|
||||
needToDeploy.get(deployFile).addAll(MavenArtifactSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!needToDeploy.isEmpty()) {
|
||||
ShareComponentsLibsJob shareJob = new ShareComponentsLibsJob(
|
||||
Messages.getString("LocalLibraryManager.shareLibsForCustomponents"), needToDeploy, deployer);
|
||||
shareJob.schedule();
|
||||
}
|
||||
}
|
||||
|
||||
private File getDeployJarFileByModule(File componentFolder, ModuleNeeded module) {
|
||||
String mvnUri = module.getMavenUri();
|
||||
if (StringUtils.isNotBlank(mvnUri)) {
|
||||
MavenArtifact mavenArtifact = MavenUrlHelper.parseMvnUrl(mvnUri);
|
||||
String fileName = mavenArtifact.getFileName();
|
||||
File jarFile = new File(componentFolder, fileName);
|
||||
if (jarFile.exists()) {
|
||||
return jarFile;
|
||||
}
|
||||
|
||||
}
|
||||
// try module name
|
||||
File jarFile = new File(componentFolder, module.getModuleName());
|
||||
if (jarFile.exists()) {
|
||||
return jarFile;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1452,6 +1382,86 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
return false;
|
||||
}
|
||||
|
||||
private void deployLibsFromCustomComponents(IComponentsService service, Map<String, String> platformURLMap) {
|
||||
boolean deployToRemote = true;
|
||||
if (!LibrariesManagerUtils.shareLibsAtStartup()) {
|
||||
log.info("Skip deploying libs from custom components");
|
||||
deployToRemote = false;
|
||||
}
|
||||
|
||||
Map<File, Set<MavenArtifact>> needToDeploy = new HashMap<File, Set<MavenArtifact>>();
|
||||
List<ComponentProviderInfo> componentsFolders = service.getComponentsFactory().getComponentsProvidersInfo();
|
||||
for (ComponentProviderInfo providerInfo : componentsFolders) {
|
||||
String id = providerInfo.getId();
|
||||
try {
|
||||
File file = new File(providerInfo.getLocation());
|
||||
if (isExtComponentProvider(id)) {
|
||||
if (file.isDirectory()) {
|
||||
List<File> jarFiles = FilesUtils.getJarFilesFromFolder(file, null);
|
||||
if (jarFiles.size() > 0) {
|
||||
for (File jarFile : jarFiles) {
|
||||
String name = jarFile.getName();
|
||||
if (!canDeployFromCustomComponentFolder(name) || platformURLMap.get(name) != null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
collectLibModules(jarFile, needToDeploy);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!canDeployFromCustomComponentFolder(file.getName()) || platformURLMap.get(file.getName()) != null) {
|
||||
continue;
|
||||
}
|
||||
collectLibModules(file, needToDeploy);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// first install them locally
|
||||
needToDeploy.forEach((k, v) -> {
|
||||
try {
|
||||
// install as release version if can't find mvn url from index
|
||||
install(k, null, false, true);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
});
|
||||
|
||||
if (!deployToRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
ShareComponentsLibsJob shareJob = new ShareComponentsLibsJob(
|
||||
Messages.getString("LocalLibraryManager.shareLibsForCustomponents"), needToDeploy, deployer);
|
||||
shareJob.schedule();
|
||||
}
|
||||
|
||||
private void collectLibModules(File jarFile, Map<File, Set<MavenArtifact>> needToDeploy) {
|
||||
Map<String,String> mavenUris = new HashMap<String,String>();
|
||||
guessMavenRUIFromIndex(jarFile, true, mavenUris);
|
||||
|
||||
Set<MavenArtifact> artifacts = new HashSet<MavenArtifact>();
|
||||
for(String uri: mavenUris.keySet()) {
|
||||
MavenArtifact art = MavenUrlHelper.parseMvnUrl(uri);
|
||||
if(art!=null) {
|
||||
artifacts.add(art);
|
||||
}
|
||||
}
|
||||
|
||||
needToDeploy.put(jarFile, artifacts);
|
||||
}
|
||||
|
||||
private boolean canDeployFromCustomComponentFolder(String fileName) {
|
||||
if (isSystemCacheFile(fileName) || isComponentDefinitionFileType(fileName)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void warnDuplicated(List<ModuleNeeded> modules, Set<String> duplicates, String type) {
|
||||
for (String lib : duplicates) {
|
||||
Set<String> components = new HashSet<>();
|
||||
|
||||
@@ -893,7 +893,6 @@ public final class DBConnectionContextUtils {
|
||||
managerConnection.setValue(0, dbType, urlConnection, server, username, password, sidOrDatabase, port, filePath,
|
||||
datasource, schemaOracle, additionParam, driverClassName, driverJarPath, dbVersionString);
|
||||
managerConnection.setDbRootPath(dbRootPath);
|
||||
managerConnection.setSupportNLS(dbConn.isSupportNLS());
|
||||
|
||||
return urlConnection;
|
||||
}
|
||||
@@ -1059,12 +1058,6 @@ public final class DBConnectionContextUtils {
|
||||
cloneConn.setSQLMode(true);
|
||||
}
|
||||
|
||||
if(dbConn.isSetSupportNLS()) {
|
||||
cloneConn.setSupportNLS(dbConn.isSupportNLS());
|
||||
} else {
|
||||
cloneConn.setSupportNLS(false);
|
||||
}
|
||||
|
||||
// cloneConn.setProperties(dbConn.getProperties());
|
||||
// cloneConn.setCdcConns(dbConn.getCdcConns());
|
||||
// cloneConn.setQueries(dbConn.getQueries());
|
||||
|
||||
@@ -166,8 +166,7 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
KnoxUrl,
|
||||
KnoxUsername,
|
||||
KnoxPassword,
|
||||
KnoxDirectory,
|
||||
KnoxTimeout
|
||||
KnoxDirectory
|
||||
}
|
||||
|
||||
static List<IContextParameter> getContextVariables(final String prefixName, Connection conn, Set<IConnParamName> paramSet) {
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
context="plugin:org.talend.metadata.managment"
|
||||
language="java"
|
||||
message="Needed for create snowflake connection"
|
||||
mvn_uri="mvn:net.snowflake/snowflake-jdbc/3.13.29"
|
||||
name="snowflake-jdbc-3.13.29.jar"
|
||||
required="true">
|
||||
mvn_uri="mvn:net.snowflake/snowflake-jdbc/3.11.0"
|
||||
name="snowflake-jdbc-3.11.0.jar"
|
||||
required="false">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.metadata.managment"
|
||||
@@ -132,49 +132,6 @@
|
||||
required="true"
|
||||
uripath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-lang-2.4.jar">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.libraries.jdbc.oracle"
|
||||
language="java"
|
||||
message="Needed for Oracle jdbc plugin National Language Support (NLS)."
|
||||
mvn_uri="mvn:com.oracle.database.nls/orai18n/19.3.0.0/jar"
|
||||
name="orai18n-19.3.0.0.jar"
|
||||
required="true">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.metadata.managment"
|
||||
language="java"
|
||||
message="Needed for plugin org.talend.metadata.managment"
|
||||
name="hsqldb.jar" mvn_uri="mvn:org.hsqldb/hsqldb/2.7.1"
|
||||
required="true"
|
||||
uripath="platform:/plugin/org.talend.libraries.jdbc.hsql/lib/hsqldb.jar">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.metadata.managment"
|
||||
language="java"
|
||||
message="Needed for create Microsoft SQL Server db connection"
|
||||
mvn_uri="mvn:net.minidev/json-smart/2.4.11"
|
||||
name="json-smart-2.4.11.jar"
|
||||
required="true"
|
||||
uripath="platform:/plugin/org.talend.libraries.tis.custom/lib/json-smart-2.4.11.jar">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.metadata.managment"
|
||||
language="java"
|
||||
message="Needed for create Microsoft SQL Server db connection"
|
||||
mvn_uri="mvn:net.minidev/accessors-smart/2.4.11"
|
||||
name="accessors-smart-2.4.11.jar"
|
||||
required="true"
|
||||
uripath="platform:/plugin/org.talend.libraries.tis.custom/lib/accessors-smart-2.4.11.jar">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.metadata.managment"
|
||||
language="java"
|
||||
message="Needed for create Microsoft SQL Server db connection"
|
||||
mvn_uri="mvn:org.ow2.asm/asm/9.5"
|
||||
name="asm-9.5.jar"
|
||||
required="true"
|
||||
uripath="platform:/plugin/org.talend.libraries.tis.custom/lib/asm-9.5.jar">
|
||||
</libraryNeeded>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.talend.core.migrationTask">
|
||||
|
||||
@@ -19,6 +19,8 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.talend.cwm.helper.ColumnSetHelper;
|
||||
@@ -27,7 +29,6 @@ import org.talend.metadata.managment.utils.MetadataConnectionUtils;
|
||||
import org.talend.utils.sql.metadata.constants.GetTable;
|
||||
import org.talend.utils.sql.metadata.constants.TableType;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
import orgomg.cwm.resource.relational.NamedColumnSet;
|
||||
|
||||
/**
|
||||
@@ -176,9 +177,9 @@ public abstract class AbstractTableBuilder<T extends NamedColumnSet> extends Cwm
|
||||
String tableComment = tablesSet.getString(GetTable.REMARKS.name());
|
||||
if (StringUtils.isBlank(tableComment)) {
|
||||
String dbProductName = getConnectionMetadata(connection).getDatabaseProductName();
|
||||
String selectRemarkOnTable = MetadataConnectionUtils.getCommonQueryStr(dbProductName);
|
||||
String selectRemarkOnTable = MetadataConnectionUtils.getCommonQueryStr(dbProductName, tableName);
|
||||
if (selectRemarkOnTable != null) {
|
||||
tableComment = executeGetCommentStatement(selectRemarkOnTable, tableName);
|
||||
tableComment = executeGetCommentStatement(selectRemarkOnTable);
|
||||
}
|
||||
}
|
||||
return tableComment;
|
||||
|
||||
@@ -14,14 +14,14 @@ package org.talend.core.model.metadata.builder.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import java.sql.Statement;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @author scorreia
|
||||
*
|
||||
@@ -73,48 +73,14 @@ abstract class CwmBuilder {
|
||||
*/
|
||||
protected String executeGetCommentStatement(String queryStmt) {
|
||||
String comment = null;
|
||||
PreparedStatement statement = null;
|
||||
Statement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
statement = connection.prepareStatement(queryStmt);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
if (resultSet != null) {
|
||||
while (resultSet.next()) {
|
||||
comment = (String) resultSet.getObject(1);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
// do nothing here
|
||||
} finally {
|
||||
// -- release resources
|
||||
if (resultSet != null) {
|
||||
try {
|
||||
resultSet.close();
|
||||
} catch (SQLException e) {
|
||||
log.error(e, e);
|
||||
}
|
||||
}
|
||||
if (statement != null) {
|
||||
try {
|
||||
statement.close();
|
||||
} catch (SQLException e) {
|
||||
log.error(e, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return comment;
|
||||
}
|
||||
|
||||
protected String executeGetCommentStatement(String queryStmt, String tableName) {
|
||||
String comment = null;
|
||||
PreparedStatement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
statement = connection.prepareStatement(queryStmt);
|
||||
statement.setString(1, tableName);
|
||||
resultSet = statement.executeQuery();
|
||||
statement = connection.createStatement();
|
||||
statement.execute(queryStmt);
|
||||
|
||||
// get the results
|
||||
resultSet = statement.getResultSet();
|
||||
if (resultSet != null) {
|
||||
while (resultSet.next()) {
|
||||
comment = (String) resultSet.getObject(1);
|
||||
|
||||
@@ -291,7 +291,6 @@ public class ExtractMetaDataFromDataBase {
|
||||
* DOC cantoine. Method to test DataBaseConnection.
|
||||
*
|
||||
* @param dbVersionString
|
||||
* @param supportNLS
|
||||
*
|
||||
* @param String driverClass
|
||||
* @param String urlString pwd
|
||||
@@ -300,14 +299,14 @@ public class ExtractMetaDataFromDataBase {
|
||||
* @return ConnectionStatus : the result of connection(boolean Result, String messageException)
|
||||
*/
|
||||
public static ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema,
|
||||
final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam, boolean supportNLS) {
|
||||
final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam) {
|
||||
return testConnection(dbType, url, username, pwd, schema, driverClassName, driverJarPath, dbVersionString,
|
||||
additionalParam, supportNLS, null, null);
|
||||
additionalParam, null, null);
|
||||
}
|
||||
|
||||
public static ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema,
|
||||
final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam,
|
||||
boolean supportNLS, StringBuffer retProposedSchema, String sidOrDatabase) {
|
||||
StringBuffer retProposedSchema, String sidOrDatabase) {
|
||||
Connection connection = null;
|
||||
ConnectionStatus connectionStatus = new ConnectionStatus();
|
||||
connectionStatus.setResult(false);
|
||||
@@ -316,7 +315,7 @@ public class ExtractMetaDataFromDataBase {
|
||||
List list = new ArrayList();
|
||||
|
||||
list = ExtractMetaDataUtils.getInstance().connect(dbType, url, username, pwd, driverClassName, driverJarPath,
|
||||
dbVersionString, additionalParam, supportNLS);
|
||||
dbVersionString, additionalParam);
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i) instanceof Connection) {
|
||||
@@ -499,7 +498,7 @@ public class ExtractMetaDataFromDataBase {
|
||||
List list = metaData.getConnection(iMetadataConnection.getDbType(), url, iMetadataConnection.getUsername(),
|
||||
iMetadataConnection.getPassword(), iMetadataConnection.getDatabase(), iMetadataConnection.getSchema(),
|
||||
iMetadataConnection.getDriverClass(), iMetadataConnection.getDriverJarPath(),
|
||||
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams(), iMetadataConnection.isSupportNLS());
|
||||
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams());
|
||||
Connection conn = null;
|
||||
DriverShim wapperDriver = null;
|
||||
|
||||
@@ -583,7 +582,7 @@ public class ExtractMetaDataFromDataBase {
|
||||
List list = extractMeta.getConnection(iMetadataConnection.getDbType(), iMetadataConnection.getUrl(),
|
||||
iMetadataConnection.getUsername(), iMetadataConnection.getPassword(), iMetadataConnection.getDatabase(),
|
||||
iMetadataConnection.getSchema(), iMetadataConnection.getDriverClass(), iMetadataConnection.getDriverJarPath(),
|
||||
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams(), iMetadataConnection.isSupportNLS());
|
||||
iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams());
|
||||
DriverShim wapperDriver = null;
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
||||
@@ -121,12 +121,10 @@ public class ExtractMetaDataUtils {
|
||||
|
||||
private String[] ORACLE_SSL_JARS = new String[] { "oraclepki-12.2.0.1.jar", "osdt_cert-12.2.0.1.jar", //$NON-NLS-1$//$NON-NLS-2$
|
||||
"osdt_core-12.2.0.1.jar" }; //$NON-NLS-1$
|
||||
|
||||
private String ORACLE_NLS_JARS = "orai18n-19.3.0.0.jar";
|
||||
|
||||
public static final String SNOWFLAKE = "Snowflake"; //$NON-NLS-1$
|
||||
|
||||
public static final String SNOWFLAKE_DRIVER_JAR = "snowflake-jdbc-3.13.29.jar"; //$NON-NLS-1$
|
||||
public static final String SNOWFLAKE_DRIVER_JAR = "snowflake-jdbc-3.11.0.jar"; //$NON-NLS-1$
|
||||
|
||||
private ExtractMetaDataUtils() {
|
||||
}
|
||||
@@ -831,11 +829,6 @@ public class ExtractMetaDataUtils {
|
||||
*/
|
||||
public List getConnection(String dbType, String url, String username, String pwd, String dataBase, String schemaBase,
|
||||
final String driverClassName, final String driverJarPath, String dbVersion, String additionalParams) {
|
||||
return getConnection(dbType, url, username, pwd, dataBase, schemaBase, driverClassName, driverJarPath, dbVersion, additionalParams, false);
|
||||
}
|
||||
|
||||
public List getConnection(String dbType, String url, String username, String pwd, String dataBase, String schemaBase,
|
||||
final String driverClassName, final String driverJarPath, String dbVersion, String additionalParams, boolean supportNLS) {
|
||||
boolean isColsed = false;
|
||||
List conList = new ArrayList();
|
||||
try {
|
||||
@@ -853,7 +846,7 @@ public class ExtractMetaDataUtils {
|
||||
closeConnection(true); // colse before connection.
|
||||
checkDBConnectionTimeout();
|
||||
|
||||
list = connect(dbType, url, username, pwd, driverClassName, driverJarPath, dbVersion, additionalParams, supportNLS);
|
||||
list = connect(dbType, url, username, pwd, driverClassName, driverJarPath, dbVersion, additionalParams);
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i) instanceof Connection) {
|
||||
@@ -945,7 +938,7 @@ public class ExtractMetaDataUtils {
|
||||
* @throws Exception
|
||||
*/
|
||||
public List connect(String dbType, String url, String username, String pwd, final String driverClassNameArg,
|
||||
final String driverJarPathArg, String dbVersion, String additionalParams, boolean supportNLS) throws Exception {
|
||||
final String driverJarPathArg, String dbVersion, String additionalParams) throws Exception {
|
||||
Connection connection = null;
|
||||
DriverShim wapperDriver = null;
|
||||
List conList = new ArrayList();
|
||||
@@ -960,18 +953,11 @@ public class ExtractMetaDataUtils {
|
||||
if ((driverJarPathArg == null || driverJarPathArg.equals(""))) { //$NON-NLS-1$
|
||||
List<String> driverNames = EDatabaseVersion4Drivers.getDrivers(dbType, dbVersion);
|
||||
if (driverNames != null) {
|
||||
if(EDatabaseTypeName.ORACLEFORSID.getProduct().equals(EDatabaseTypeName.getTypeFromDbType(dbType).getProduct())) {
|
||||
if(supportNLS){
|
||||
driverNames.add(ORACLE_NLS_JARS);
|
||||
}
|
||||
}
|
||||
|
||||
if (EDatabaseTypeName.ORACLE_CUSTOM.getDisplayName().equals(dbType)
|
||||
&& StringUtils.isNotEmpty(additionalParams)) {
|
||||
if (additionalParams.contains(SSLPreferenceConstants.TRUSTSTORE_TYPE)) {
|
||||
driverNames.addAll(Arrays.asList(ORACLE_SSL_JARS));
|
||||
}
|
||||
|
||||
} else if (SNOWFLAKE.equals(dbType)) { // $NON-NLS-1$
|
||||
// TDQ-17294 msjian Support of Snowflake for DQ Datamart
|
||||
driverNames.add(SNOWFLAKE_DRIVER_JAR);
|
||||
@@ -1299,7 +1285,7 @@ public class ExtractMetaDataUtils {
|
||||
List list = getConnection(metadataConnection.getDbType(), metadataConnection.getUrl(), metadataConnection.getUsername(),
|
||||
metadataConnection.getPassword(), metadataConnection.getDatabase(), metadataConnection.getSchema(),
|
||||
metadataConnection.getDriverClass(), metadataConnection.getDriverJarPath(),
|
||||
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
|
||||
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams());
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.nio.charset.Charset;
|
||||
import java.security.Provider;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Driver;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -167,11 +166,6 @@ public class JDBCDriverLoader {
|
||||
info.put("charSet", systemCharset.displayName()); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
//TUP-37016:Upgrade hsqldb to 2.7.1
|
||||
if (dbType.equals(EDatabaseTypeName.ACCESS.getXmlName()) || ConnectionUtils.isHsql(url)) {
|
||||
System.setProperty("hsqldb.method_class_names", "net.ucanaccess.converters.*");
|
||||
}
|
||||
|
||||
if (additionalParams != null && !"".equals(additionalParams) && dbType.toUpperCase().contains("ORACLE")) {//$NON-NLS-1$//$NON-NLS-2$
|
||||
if (additionalParams.contains(SSLPreferenceConstants.TRUSTSTORE_TYPE)) {
|
||||
@@ -204,20 +198,10 @@ public class JDBCDriverLoader {
|
||||
}
|
||||
connection = wapperDriver.connect(url, info);
|
||||
}
|
||||
|
||||
try {
|
||||
ResultSet schemas = connection.getMetaData().getSchemas();
|
||||
if(schemas.next()) {
|
||||
schemas.getString(1);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
// }
|
||||
// DriverManager.deregisterDriver(wapperDriver);
|
||||
// bug 9162
|
||||
list.add(connection);
|
||||
|
||||
list.add(wapperDriver);
|
||||
return list;
|
||||
} catch (Throwable e) {
|
||||
|
||||
@@ -470,7 +470,7 @@ public class ExtractManager {
|
||||
metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(),
|
||||
metadataConnection.getSchema(), metadataConnection.getDriverClass(),
|
||||
metadataConnection.getDriverJarPath(), metadataConnection.getDbVersionString(),
|
||||
metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
|
||||
metadataConnection.getAdditionalParams());
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i) instanceof Driver) {
|
||||
@@ -574,7 +574,7 @@ public class ExtractManager {
|
||||
metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(),
|
||||
metadataConnection.getSchema(), metadataConnection.getDriverClass(),
|
||||
metadataConnection.getDriverJarPath(), metadataConnection.getDbVersionString(),
|
||||
metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
|
||||
metadataConnection.getAdditionalParams());
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i) instanceof DriverShim) {
|
||||
@@ -1064,7 +1064,7 @@ public class ExtractManager {
|
||||
List connList = extractMeta.getConnection(metadataConnection.getDbType(), metadataConnection.getUrl(),
|
||||
metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(),
|
||||
metadataConnection.getSchema(), metadataConnection.getDriverClass(), metadataConnection.getDriverJarPath(),
|
||||
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS());
|
||||
metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams());
|
||||
try {
|
||||
if (!tableInfoParameters.isUsedName()) {
|
||||
if (tableInfoParameters.getSqlFiter() != null && !"".equals(tableInfoParameters.getSqlFiter())) { //$NON-NLS-1$
|
||||
|
||||
@@ -40,7 +40,7 @@ public enum EHiveWithTezJars {
|
||||
"api-asn1-api-1.0.0-M20.jar", "api-util-1.0.0-M20.jar", "asm-3.1.jar", "avro-1.7.4.jar",
|
||||
"commons-beanutils-1.7.0.jar", "commons-beanutils-core-1.8.0.jar", "commons-compress-1.4.1.jar",
|
||||
"commons-configuration-1.6.jar", "commons-digester-1.8.jar", "commons-net-3.1.jar", "curator-client-2.6.0.jar",
|
||||
"curator-framework-2.6.0.jar", "curator-recipes-2.6.0.jar", "gson-2.9.0.jar", "guice-3.0.jar",
|
||||
"curator-framework-2.6.0.jar", "curator-recipes-2.6.0.jar", "gson-2.2.4.jar", "guice-3.0.jar",
|
||||
"guice-servlet-3.0.jar", "hadoop-auth-2.6.0.2.2.0.0-2041.jar", "hadoop-common-2.6.0.2.2.0.0-2041.jar",
|
||||
"hadoop-hdfs-2.6.0.2.2.0.0-2041.jar", "hadoop-yarn-api-2.6.0.2.2.0.0-2041.jar",
|
||||
"hadoop-yarn-client-2.6.0.2.2.0.0-2041.jar", "hadoop-yarn-common-2.6.0.2.2.0.0-2041.jar", "htrace-core-3.0.4.jar",
|
||||
@@ -56,7 +56,7 @@ public enum EHiveWithTezJars {
|
||||
"api-asn1-api-1.0.0-M20.jar", "api-util-1.0.0-M20.jar", "asm-3.2.jar", "avro-1.7.5.jar",
|
||||
"commons-beanutils-1.7.0.jar", "commons-beanutils-core-1.8.0.jar", "commons-compress-1.4.1.jar",
|
||||
"commons-configuration-1.6.jar", "commons-digester-1.8.jar", "commons-net-3.1.jar", "curator-client-2.7.1.jar",
|
||||
"curator-framework-2.7.1.jar", "curator-recipes-2.7.1.jar", "gson-2.9.0.jar", "guice-3.0.jar",
|
||||
"curator-framework-2.7.1.jar", "curator-recipes-2.7.1.jar", "gson-2.2.4.jar", "guice-3.0.jar",
|
||||
"guice-servlet-3.0.jar", "hadoop-auth-2.7.1.2.3.2.0-2950.jar", "hadoop-common-2.7.1.2.3.2.0-2950.jar",
|
||||
"hadoop-hdfs-2.7.1.2.3.2.0-2950.jar", "hadoop-yarn-api-2.7.1.2.3.2.0-2950.jar",
|
||||
"hadoop-yarn-client-2.7.1.2.3.2.0-2950.jar", "hadoop-yarn-common-2.7.1.2.3.2.0-2950.jar",
|
||||
|
||||
@@ -83,7 +83,6 @@ import org.talend.metadata.managment.connection.manager.HiveConnectionManager;
|
||||
import org.talend.metadata.managment.hive.EmbeddedHiveDataBaseMetadata;
|
||||
import org.talend.metadata.managment.repository.ManagerConnection;
|
||||
import org.talend.metadata.managment.utils.DatabaseConstant;
|
||||
import org.talend.metadata.managment.utils.EDataBaseType;
|
||||
import org.talend.metadata.managment.utils.ManagementTextUtils;
|
||||
import org.talend.metadata.managment.utils.MetadataConnectionUtils;
|
||||
import org.talend.utils.sql.ConnectionUtils;
|
||||
@@ -1039,12 +1038,8 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
// for CDH4 HIVE2 , the table type are MANAGED_TABLE and EXTERNAL_TABLE ......
|
||||
// tableType = null;
|
||||
}
|
||||
Map<String,String> tableComments = null;
|
||||
if (!isOracle8i) {
|
||||
tableComments = this.getTableComments(dbJDBCMetadata, catalogName, schemaPattern);
|
||||
}
|
||||
ResultSet tables = dbJDBCMetadata.getTables(catalogName, schemaPattern, tablePattern, tableType);
|
||||
boolean hasRemarksCol = hasRemarksColumn(tables);
|
||||
|
||||
while (tables.next()) {
|
||||
String coloumnName = GetTable.TABLE_SCHEM.name();
|
||||
if (schemaPattern != null) {
|
||||
@@ -1069,13 +1064,8 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
// if (!isOracle && !isOracle8i && !isOracleJdbc && tableName.startsWith("/")) { //$NON-NLS-1$
|
||||
// continue;
|
||||
// }
|
||||
if (hasRemarksCol) {
|
||||
tableComment = getRemarksFromResultSet(tables);
|
||||
}
|
||||
if (tableComments != null) {
|
||||
if (StringUtils.isEmpty(tableComment)) {
|
||||
tableComment = tableComments.get(tableName);
|
||||
}
|
||||
if (!isOracle8i) {
|
||||
tableComment = getTableComment(dbJDBCMetadata, tables, tableName, catalogName, schemaPattern);
|
||||
}
|
||||
MetadataTable metadatatable = null;
|
||||
if (TableType.VIEW.toString().equals(temptableType) || ETableTypes.VIRTUAL_VIEW.getName().equals(temptableType)) {
|
||||
@@ -1219,69 +1209,6 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
}
|
||||
return tableComment;
|
||||
}
|
||||
|
||||
private Map<String, String> getTableComments(DatabaseMetaData dbJDBCMetadata, String catalogName, String schemaPattern) {
|
||||
Map<String, String> ret = new HashMap<String, String>();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String productName = dbJDBCMetadata.getDatabaseProductName();
|
||||
if (StringUtils.isEmpty(productName)) {
|
||||
return ret;
|
||||
}
|
||||
productName = productName.replaceAll(" ", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
EDataBaseType eDataBaseType = null;
|
||||
try {
|
||||
eDataBaseType = EDataBaseType.valueOf(productName);
|
||||
} catch (Exception e) {
|
||||
eDataBaseType = EDataBaseType.Microsoft_SQL_Server;
|
||||
}
|
||||
|
||||
String sqlStr = ""; //$NON-NLS-1$
|
||||
switch (eDataBaseType) {
|
||||
case Oracle:
|
||||
sqlStr = "SELECT TABLE_NAME,COMMENTS FROM ALL_TAB_COMMENTS WHERE OWNER=?";
|
||||
ps = dbJDBCMetadata.getConnection().prepareStatement(sqlStr);
|
||||
ps.setString(1, schemaPattern.toUpperCase());
|
||||
break;
|
||||
case MySQL:
|
||||
sqlStr = "SELECT TABLE_NAME,TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA=?";
|
||||
ps = dbJDBCMetadata.getConnection().prepareStatement(sqlStr);
|
||||
ps.setString(1, catalogName);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (ps != null) {
|
||||
rs = ps.executeQuery();
|
||||
while (rs != null && rs.next()) {
|
||||
String comment = rs.getString(2);
|
||||
if (!StringUtils.isEmpty(comment)) {
|
||||
ret.put(rs.getString(1), comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error(e, e);
|
||||
} finally {
|
||||
if (ps != null) {
|
||||
try {
|
||||
ps.close();
|
||||
} catch (SQLException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
if (rs != null) {
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the Column Comment especially for oracle type.
|
||||
@@ -1368,12 +1295,9 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, String> tableComments = null;
|
||||
if (!flag) {
|
||||
tableComments = this.getTableComments(dbJDBCMetadata, catalogName, schemaPattern);
|
||||
}
|
||||
|
||||
ResultSet tables = dbJDBCMetadata.getTables(catalogName, schemaPattern, tablePattern, tableType);
|
||||
boolean hasRemarksCol = hasRemarksColumn(tables);
|
||||
|
||||
while (tables.next()) {
|
||||
String tableName = getStringFromResultSet(tables, GetTable.TABLE_NAME.name());
|
||||
String temptableType = getStringFromResultSet(tables, GetTable.TABLE_TYPE.name());
|
||||
@@ -1392,13 +1316,8 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
if (tableName == null || tablesToFilter.contains(tableName) || tableName.startsWith("/")) { //$NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
if (hasRemarksCol) {
|
||||
tableComment = getRemarksFromResultSet(tables);
|
||||
}
|
||||
if (tableComments != null) {
|
||||
if (StringUtils.isEmpty(tableComment)) {
|
||||
tableComment = tableComments.get(tableName);
|
||||
}
|
||||
if (!flag) {
|
||||
tableComment = getTableComment(dbJDBCMetadata, tables, tableName, catalogName, schemaPattern);
|
||||
}
|
||||
// create table
|
||||
TdTable table = RelationalFactory.eINSTANCE.createTdTable();
|
||||
@@ -1448,17 +1367,8 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
}
|
||||
}
|
||||
try {
|
||||
boolean flag = true;
|
||||
if (pack != null) {
|
||||
Connection c = ConnectionHelper.getConnection(pack);
|
||||
flag = MetadataConnectionUtils.isOracle8i(c);
|
||||
}
|
||||
Map<String, String> tableComments = null;
|
||||
if (!flag) {
|
||||
tableComments = this.getTableComments(dbJDBCMetadata, catalogName, schemaPattern);
|
||||
}
|
||||
|
||||
ResultSet tables = dbJDBCMetadata.getTables(catalogName, schemaPattern, viewPattern, tableType);
|
||||
boolean hasRemarksCol = hasRemarksColumn(tables);
|
||||
while (tables.next()) {
|
||||
|
||||
String tableName = getStringFromResultSet(tables, GetTable.TABLE_NAME.name());
|
||||
@@ -1469,14 +1379,14 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
continue;
|
||||
}
|
||||
// common
|
||||
boolean flag = true;
|
||||
String tableComment = null;
|
||||
if (hasRemarksCol) {
|
||||
tableComment = getRemarksFromResultSet(tables);
|
||||
if (pack != null) {
|
||||
Connection c = ConnectionHelper.getConnection(pack);
|
||||
flag = MetadataConnectionUtils.isOracle8i(c);
|
||||
}
|
||||
if (tableComments != null) {
|
||||
if (StringUtils.isEmpty(tableComment)) {
|
||||
tableComment = tableComments.get(tableName);
|
||||
}
|
||||
if (!flag) {
|
||||
tableComment = getTableComment(dbJDBCMetadata, tables, tableName, catalogName, schemaPattern);
|
||||
}
|
||||
// create table
|
||||
TdView table = RelationalFactory.eINSTANCE.createTdView();
|
||||
@@ -1515,24 +1425,6 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
return valueOfString;
|
||||
}
|
||||
|
||||
private boolean hasRemarksColumn(ResultSet resultSet) {
|
||||
try {
|
||||
if (resultSet == null || resultSet.getMetaData() == null) {
|
||||
return false;
|
||||
}
|
||||
int numOfCols = resultSet.getMetaData().getColumnCount();
|
||||
for (int i = 1; i < numOfCols + 1; i++) {
|
||||
String colName = resultSet.getMetaData().getColumnLabel(i);
|
||||
if (StringUtils.equals(colName, GetColumn.REMARKS.name())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getRemarksFromResultSet(ResultSet resultSet) {
|
||||
String valueOfString = null;
|
||||
try {
|
||||
|
||||
@@ -90,8 +90,6 @@ public class ManagerConnection {
|
||||
Integer id = null;
|
||||
|
||||
String additionalParams;
|
||||
|
||||
private boolean supportNLS;
|
||||
|
||||
private String schemaOracle;
|
||||
|
||||
@@ -290,7 +288,7 @@ public class ManagerConnection {
|
||||
}
|
||||
// test the connection
|
||||
testConnection = ExtractMetaDataFromDataBase.testConnection(dbTypeString, urlConnectionString, username, password,
|
||||
schemaName, driverClassName, driverJarPath, dbVersionString, additionalParams, supportNLS, retProposedSchema,
|
||||
schemaName, driverClassName, driverJarPath, dbVersionString, additionalParams, retProposedSchema,
|
||||
sidOrDatabase);
|
||||
isValide = testConnection.getResult();
|
||||
messageException = testConnection.getMessageException();
|
||||
@@ -390,7 +388,7 @@ public class ManagerConnection {
|
||||
metadataConnection.getUrl(), metadataConnection.getUsername(), metadataConnection.getPassword(),
|
||||
metadataConnection.getSchema(), metadataConnection.getDriverClass(),
|
||||
metadataConnection.getDriverJarPath(), metadataConnection.getDbVersionString(),
|
||||
metadataConnection.getAdditionalParams(), metadataConnection.isSupportNLS(), retProposedSchema, metadataConnection.getDatabase());
|
||||
metadataConnection.getAdditionalParams(), retProposedSchema, metadataConnection.getDatabase());
|
||||
}
|
||||
// qli
|
||||
// record this metadataConnection as old connection.
|
||||
@@ -477,13 +475,4 @@ public class ManagerConnection {
|
||||
this.isValide = isValide;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the supportNLS.
|
||||
* @param supportNLS the supportNLS to set
|
||||
*/
|
||||
public void setSupportNLS(boolean supportNLS) {
|
||||
this.supportNLS = supportNLS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public class MetadataConnectionUtils {
|
||||
}
|
||||
list = ExtractMetaDataUtils.getInstance().connect(metadataBean.getDbType(), metadataBean.getUrl(),
|
||||
metadataBean.getUsername(), metadataBean.getPassword(), metadataBean.getDriverClass(),
|
||||
metadataBean.getDriverJarPath(), metadataBean.getDbVersionString(), metadataBean.getAdditionalParams(), metadataBean.isSupportNLS());
|
||||
metadataBean.getDriverJarPath(), metadataBean.getDbVersionString(), metadataBean.getAdditionalParams());
|
||||
} catch (Exception e) {
|
||||
rc.setMessage("fail to connect database!"); //$NON-NLS-1$
|
||||
CommonExceptionHandler.process(e);
|
||||
@@ -274,7 +274,6 @@ public class MetadataConnectionUtils {
|
||||
String dataBase = databaseConnection.getSID();
|
||||
String dbVersionString = databaseConnection.getDbVersionString();
|
||||
String additionalParams = databaseConnection.getAdditionalParams();
|
||||
boolean supportNLS = databaseConnection.isSupportNLS();
|
||||
|
||||
// MOD qiongli 2011-9-6,TDQ 3317.handle context mode
|
||||
if (databaseConnection.isContextMode()) {
|
||||
@@ -314,7 +313,6 @@ public class MetadataConnectionUtils {
|
||||
metadataConnection.setUsername(userName);
|
||||
metadataConnection.setPassword(password);
|
||||
metadataConnection.setUrl(dbUrl);
|
||||
metadataConnection.setSupportNLS(supportNLS);
|
||||
|
||||
// TDQ-12299: transfer the OtherParameters to metadataConnection, because create impala connection use that
|
||||
// values
|
||||
@@ -805,33 +803,6 @@ public class MetadataConnectionUtils {
|
||||
|
||||
}
|
||||
|
||||
public static String getCommonQueryStr(String productName) {
|
||||
if (productName == null) {
|
||||
return null;
|
||||
}
|
||||
productName = productName.replaceAll(" ", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
EDataBaseType eDataBaseType = null;
|
||||
try {
|
||||
eDataBaseType = EDataBaseType.valueOf(productName);
|
||||
} catch (Exception e) {
|
||||
eDataBaseType = EDataBaseType.Microsoft_SQL_Server;
|
||||
}
|
||||
String sqlStr = ""; //$NON-NLS-1$
|
||||
switch (eDataBaseType) {
|
||||
case Oracle:
|
||||
sqlStr = "SELECT COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME= ? "; //$NON-NLS-1$
|
||||
break;
|
||||
case MySQL:
|
||||
sqlStr = "SELECT TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_NAME= ? "; //$NON-NLS-1$
|
||||
break;
|
||||
default:
|
||||
sqlStr = null;
|
||||
|
||||
}
|
||||
return sqlStr;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get Comment Query Str.
|
||||
*
|
||||
@@ -1341,7 +1312,7 @@ public class MetadataConnectionUtils {
|
||||
return ExtractMetaDataUtils.getInstance().getConnection(metadataBean.getDbType(), metadataBean.getUrl(),
|
||||
metadataBean.getUsername(), metadataBean.getPassword(), metadataBean.getDatabase(), metadataBean.getSchema(),
|
||||
metadataBean.getDriverClass(), metadataBean.getDriverJarPath(), metadataBean.getDbVersionString(),
|
||||
metadataBean.getAdditionalParams(), metadataBean.isSupportNLS());
|
||||
metadataBean.getAdditionalParams());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
@@ -241,14 +240,20 @@ public class MigrationToolService implements IMigrationToolService {
|
||||
sortMigrationTasks(toExecute);
|
||||
|
||||
final List<MigrationTask> done = new ArrayList<MigrationTask>(storedMigrations);
|
||||
boolean hasTaskToExecute = toExecute.stream()
|
||||
.anyMatch(task -> !task.isDeprecated() && MigrationUtil.findMigrationTask(done, task) == null);
|
||||
int nbMigrationsToDo = 0;
|
||||
for (IProjectMigrationTask task : toExecute) {
|
||||
MigrationTask mgTask = MigrationUtil.findMigrationTask(done, task);
|
||||
if (mgTask == null && !task.isDeprecated()) {
|
||||
nbMigrationsToDo++;
|
||||
}
|
||||
}
|
||||
|
||||
// force to redo the migration task for the relations only if user ask for "clean" or if relations is empty
|
||||
// or if there is at least another migration to do.
|
||||
if (!beforeLogon && (!RelationshipItemBuilder.INDEX_VERSION.equals(project.getEmfProject().getItemsRelationVersion())
|
||||
|| hasTaskToExecute)) {
|
||||
if (!beforeLogon
|
||||
&& (!RelationshipItemBuilder.INDEX_VERSION.equals(project.getEmfProject().getItemsRelationVersion()) || nbMigrationsToDo > 0)) {
|
||||
// force to redo this migration task, to make sure the relationship is done correctly
|
||||
// done.remove(RELATION_TASK);
|
||||
MigrationUtil.removeMigrationTaskById(done, RELATION_TASK);
|
||||
RelationshipItemBuilder.getInstance().unloadRelations();
|
||||
|
||||
@@ -259,37 +264,41 @@ public class MigrationToolService implements IMigrationToolService {
|
||||
RelationshipItemBuilder.JOBLET_RELATION, true);
|
||||
// reset
|
||||
RelationshipItemBuilder.getInstance().unloadRelations();
|
||||
hasTaskToExecute = true;
|
||||
}
|
||||
|
||||
boolean checkDupContext = !beforeLogon && Boolean.getBoolean("duplicate.context.reference.check");
|
||||
if (!hasTaskToExecute && !checkDupContext) {
|
||||
nbMigrationsToDo++;
|
||||
}
|
||||
if (nbMigrationsToDo == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkDupContext) {
|
||||
MigrationUtil.removeMigrationTaskById(done,
|
||||
"org.talend.repository.model.migration.RemoveDuplicateContextReferencesMigrationTask");
|
||||
}
|
||||
if (hasTaskToExecute) {
|
||||
// force execute migration in case user copy-past items with diffrent path on the file system and refresh
|
||||
// the studio,it may cause bug TDI-19229
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.FixProjectResourceLink");
|
||||
// force to re-generate all job poms
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.GenerateJobPomMigrationTask");
|
||||
// force execute migration in case user copy-past items with diffrent path on the file system and refresh
|
||||
// the studio,it may cause bug TDI-19229
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.FixProjectResourceLink");
|
||||
// force to re-generate all job poms
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.GenerateJobPomMigrationTask");
|
||||
|
||||
if (beforeLogon) {
|
||||
// for every migration, force reset to default maven template
|
||||
MigrationUtil.removeMigrationTaskById(done,
|
||||
"org.talend.repository.model.migration.ResetMavenTemplateMigrationTask");
|
||||
if (beforeLogon) {
|
||||
// for every migration, force reset to default maven template
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.ResetMavenTemplateMigrationTask");
|
||||
}
|
||||
|
||||
boolean haveAnyBinFolder = false; // to avoid some problems of migration, sometimes
|
||||
for (ERepositoryObjectType type : (ERepositoryObjectType[]) ERepositoryObjectType.values()) {
|
||||
if (!type.hasFolder()) {
|
||||
continue;
|
||||
}
|
||||
boolean hasBinFolder = Stream.of((ERepositoryObjectType[]) ERepositoryObjectType.values())
|
||||
.filter(type -> type.hasFolder()).map(ERepositoryObjectType::getFolderName).filter(StringUtils::isNotBlank)
|
||||
.map(folderName -> fsProject.getFolder(folderName))
|
||||
.anyMatch(folder -> folder.exists() && folder.getFolder("bin").exists());
|
||||
if (hasBinFolder) {
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.RemoveBinFolderMigrationTask");
|
||||
String folderName = ERepositoryObjectType.getFolderName(type);
|
||||
if (folderName == null || "".equals(folderName)) {
|
||||
continue;
|
||||
}
|
||||
IFolder folder = fsProject.getFolder(folderName);
|
||||
if (folder.exists() && folder.getFolder("bin").exists()) { //$NON-NLS-1$
|
||||
haveAnyBinFolder = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (haveAnyBinFolder) {
|
||||
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.RemoveBinFolderMigrationTask");
|
||||
}
|
||||
|
||||
final SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitorWrap, toExecute.size());
|
||||
|
||||
@@ -80,7 +80,6 @@ public class DatabaseConnectionItemProvider extends ConnectionItemProvider imple
|
||||
addCdcTypeModePropertyDescriptor(object);
|
||||
addSQLModePropertyDescriptor(object);
|
||||
addUiSchemaPropertyDescriptor(object);
|
||||
addSupportNLSPropertyDescriptor(object);
|
||||
}
|
||||
return itemPropertyDescriptors;
|
||||
}
|
||||
@@ -469,22 +468,6 @@ public class DatabaseConnectionItemProvider extends ConnectionItemProvider imple
|
||||
false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This adds a property descriptor for the Support NLS feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void addSupportNLSPropertyDescriptor(Object object) {
|
||||
itemPropertyDescriptors
|
||||
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
|
||||
getResourceLocator(), getString("_UI_DatabaseConnection_supportNLS_feature"),
|
||||
getString("_UI_PropertyDescriptor_description", "_UI_DatabaseConnection_supportNLS_feature",
|
||||
"_UI_DatabaseConnection_type"),
|
||||
ConnectionPackage.Literals.DATABASE_CONNECTION__SUPPORT_NLS, true, false, false,
|
||||
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
|
||||
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
|
||||
@@ -575,7 +558,6 @@ public class DatabaseConnectionItemProvider extends ConnectionItemProvider imple
|
||||
case ConnectionPackage.DATABASE_CONNECTION__CDC_TYPE_MODE:
|
||||
case ConnectionPackage.DATABASE_CONNECTION__SQL_MODE:
|
||||
case ConnectionPackage.DATABASE_CONNECTION__UI_SCHEMA:
|
||||
case ConnectionPackage.DATABASE_CONNECTION__SUPPORT_NLS:
|
||||
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
||||
return;
|
||||
case ConnectionPackage.DATABASE_CONNECTION__CDC_CONNS:
|
||||
|
||||
@@ -348,8 +348,6 @@
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="UiSchema" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1"
|
||||
eType="#//AdditionalProperties" containment="true"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="supportNLS" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
|
||||
defaultValueLiteral="false" unsettable="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="SAPConnection" eSuperTypes="#//Connection">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Host" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user