Compare commits

..

1 Commits

Author SHA1 Message Date
Chao MENG
6775da2599 chore: fix customURIObject null issue 2020-11-20 10:08:39 +08:00
150 changed files with 543 additions and 2148 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -166,7 +166,6 @@ public enum ECoreImage implements IImage {
RECYCLE_BIN_OVERLAY("/icons1/recycle_bin_overlay.gif"), //$NON-NLS-1$
DELETED_OVERLAY("/icons1/deleted_overlay.gif"), //$NON-NLS-1$
IMPORT_JAR("/icons1/importjar.gif"), //$NON-NLS-1$
SHARE_LIBS("/icons1/share.png"), //$NON-NLS-1$
REFERENCED_ICON("/icons1/referenced.png"), //$NON-NLS-1$
CDC_ADDED_OVERLAY("/icons1/cdc_added_overlay.png"), //$NON-NLS-1$

View File

@@ -16,8 +16,6 @@ import org.eclipse.core.internal.runtime.InternalPlatform;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.BundleContext;
/**
*
* DOC root class global comment. Detailled comment <br/>
@@ -54,9 +52,5 @@ public class WindowSystem {
public static boolean isOSX() {
return Platform.WS_CARBON.equals(ws) || Platform.WS_COCOA.equals(ws);
}
public static boolean isBigSurOrLater () {
return isOSX() && ("10.16".compareTo(System.getProperty("os.version","0")) <= 0);
}
}

View File

@@ -148,7 +148,7 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
}
// For Calculation View
if (ArrayUtils.contains(neededTypes, NEEDED_TYPES[3]) && "_SYS_BIC".equalsIgnoreCase(schemaPattern)) { //$NON-NLS-1$
if (ArrayUtils.contains(neededTypes, NEEDED_TYPES[3])) {
// check if the type is contained is in the types needed.
String sqlcv = "SELECT OBJECT_NAME,PACKAGE_ID FROM _SYS_REPO.ACTIVE_OBJECT WHERE OBJECT_SUFFIX = 'calculationview'"; //$NON-NLS-1$
if (tableNamePattern != null && !tableNamePattern.equals("%")) { //$NON-NLS-1$
@@ -171,7 +171,7 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
packageId = packageId.trim();
}
String name = packageId + "/" + objectName; //$NON-NLS-1$
String[] r = new String[] { "", schemaPattern, name, NEEDED_TYPES[3], "", packageId }; //$NON-NLS-1$ //$NON-NLS-2$
String[] r = new String[] { "", "_SYS_BIC", name, NEEDED_TYPES[3], "", packageId }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
listcv.add(r);
}
} catch (SQLException e) {
@@ -355,16 +355,4 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
tableResultSet.setData(list);
return tableResultSet;
}
@Override
public String getDatabaseProductName() throws SQLException {
return this.connection.getMetaData().getDatabaseProductName();
}
@Override
public String getDatabaseProductVersion() throws SQLException {
return this.connection.getMetaData().getDatabaseProductVersion();
}
}

View File

@@ -240,11 +240,7 @@ public class BackgroundRefresher implements IBackgroundRefresher {
gc.dispose();
if (WindowSystem.isBigSurOrLater()) {
drawableComposite.refreshBgDrawableCompsite(newImage);
} else {
drawableComposite.getBgDrawableComposite().setBackgroundImage(newImage);
}
drawableComposite.getBgDrawableComposite().setBackgroundImage(newImage);
clearImage(oldImage);
oldImage = newImage;

View File

@@ -13,7 +13,6 @@
package org.talend.commons.ui.swt.drawing.background;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
@@ -29,8 +28,6 @@ public interface IBgDrawableComposite {
public Composite getBgDrawableComposite();
public void refreshBgDrawableCompsite(Image image);
public void setOffset(Point offsetPoint);
public Point getOffset();

View File

@@ -26,7 +26,6 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.talend.commons.ui.runtime.ws.WindowSystem;
/**
* Create a Label and a Text.
@@ -154,14 +153,7 @@ public class LabelledText {
});
GridDataFactory.swtDefaults().applyTo(label);
// For Big Sur, to avoid the password autofill dialog.
if (WindowSystem.isBigSurOrLater() && ((styleField & SWT.PASSWORD) != 0)) {
styleField ^= SWT.PASSWORD;
text = new Text(composite, styleField);
text.setEchoChar('*');
} else {
text = new Text(composite, styleField);
}
text = new Text(composite, styleField);
text.selectAll(); // enable fast erase use
int gridDataStyle = SWT.NONE;
if (isFill) {

View File

@@ -12,12 +12,7 @@
// ============================================================================
package org.talend.commons.ui.swt.linking;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.talend.commons.ui.swt.drawing.background.IBgDrawableComposite;
@@ -33,8 +28,6 @@ public abstract class BgDrawableComposite implements IBgDrawableComposite {
private Composite commonParent;
private Point offsetPoint = new Point(0, 0);
private Image backgroundImage;
/**
* DOC amaumont DrawableBackground constructor comment.
@@ -43,36 +36,9 @@ public abstract class BgDrawableComposite implements IBgDrawableComposite {
*/
public BgDrawableComposite(Composite commonParent) {
this.commonParent = commonParent;
this.commonParent.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent arg0) {
if (backgroundImage != null) {
arg0.gc.drawImage(backgroundImage, 0, 0);
}
}
});
this.commonParent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent arg0) {
if (backgroundImage != null && !backgroundImage.isDisposed()) {
backgroundImage.dispose();
}
}
});
}
@Override
public void refreshBgDrawableCompsite(Image image) {
if (backgroundImage != null) {
backgroundImage.dispose();
}
backgroundImage = image;
this.commonParent.redraw();
}
/*
/*
* (non-Javadoc)
*
* @see org.talend.commons.ui.swt.drawing.background.IDrawableComposite#drawBackground(org.eclipse.swt.graphics.GC)

View File

@@ -15,7 +15,6 @@ package org.talend.commons.ui.swt.linking;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -78,8 +77,6 @@ public class TreeToTablesLinker<D1, D2> extends BgDrawableComposite implements I
private List<LinkableTable> linkableTableList;
private HashMap<Table, Point> tableToCommonPointMap = new HashMap<Table, Point>();
/**
* DOC amaumont TreeToTableLinker constructor comment.
*
@@ -261,34 +258,8 @@ public class TreeToTablesLinker<D1, D2> extends BgDrawableComposite implements I
Point offset = getOffset();
if (WindowSystem.isBigSurOrLater()) {
if (yStraight < tree.getBounds().y + treeItemHeight) {
yStraight = tree.getBounds().y + treeItemHeight;
}
if (yStraight > tree.getBounds().height + tree.getBounds().y + treeItemHeight) {
yStraight = tree.getBounds().height + tree.getBounds().y + treeItemHeight;
}
pointEndStraight = new Point(treeToCommonPoint.x + tree.getClientArea().width, yStraight);
if (tableToCommonPointMap.get(table) == null) {
tableToCommonPointMap.put(table, display.map(table, getBgDrawableComposite(), new Point(0, 0)));
}
// scroll issue for table
if (tableToCommonPoint.y != tableToCommonPointMap.get(table).y) {
pointEndCentralCurve.y = tableToCommonPoint.y + tableItemBounds.y
+ table.getItemHeight() / 2;
}
if (pointEndCentralCurve.y < tableToCommonPointMap.get(table).y) {
pointEndCentralCurve.y = tableToCommonPointMap.get(table).y;
}
if (pointEndCentralCurve.y > tableToCommonPointMap.get(table).y + tableBounds.height - table.getBorderWidth()
- table.getHeaderHeight()) {
pointEndCentralCurve.y = tableToCommonPointMap.get(table).y + tableBounds.height - table.getBorderWidth()
- table.getHeaderHeight();
}
} else {
gc.drawLine(pointStartStraight.x + offset.x, pointStartStraight.y + offset.y, pointEndStraight.x + offset.x,
pointEndStraight.y + offset.y);
}
gc.drawLine(pointStartStraight.x + offset.x, pointStartStraight.y + offset.y, pointEndStraight.x + offset.x,
pointEndStraight.y + offset.y);
pointEndStraight.x += offset.x;
pointEndStraight.y += offset.y;

View File

@@ -109,8 +109,4 @@ public interface FileConstants {
String SPRING_FOLDER_NAME = "META-INF/spring"; //$NON-NLS-1$
String TALEND_FOLDER_NAME = "TALEND-INF"; //$NON-NLS-1$
String MAVEN_FOLDER_NAME = "MAVEN-INF";
}

View File

@@ -135,7 +135,6 @@ import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.core.runtime.services.IGenericWizardService;
import org.talend.core.runtime.services.IMavenUIService;
import org.talend.core.runtime.util.ItemDateParser;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.service.ICoreUIService;
import org.talend.core.service.IUpdateService;
import org.talend.cwm.helper.SubItemHelper;
@@ -1800,12 +1799,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
* @throws PersistenceException
*/
private void emptyTempFolder(Project project) throws PersistenceException {
try {
String str = SharedStudioUtils.getTempFolderPath().toPortableString();
FilesUtils.deleteFolder(new File(str), false);
}catch (Exception ex) {
ExceptionHandler.process(ex);
}
String str = (System.getProperty("eclipse.home.location") + "temp").substring(5);
FilesUtils.deleteFolder(new File(str), false);
long start = System.currentTimeMillis();
IProject fsProject = ResourceUtils.getProject(project);
IFolder folder = ResourceUtils.getFolder(fsProject, RepositoryConstants.TEMP_DIRECTORY, false);
@@ -2205,14 +2201,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
TimeMeasurePerformance.step("logOnProject", "Sync components libraries"); //$NON-NLS-1$
}
try {
// for new added mapping file, sync to project mapping folder
MetadataTalendType.syncNewMappingFileToProject();
} catch (SystemException e) {
// ignore
ExceptionHandler.process(e);
}
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask("Execute before logon migrations tasks", 1); //$NON-NLS-1$
ProjectManager.getInstance().getMigrationRecords().clear();
@@ -2314,6 +2302,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
// set the project mappings url
System.setProperty("talend.mappings.url", url.toString()); // $NON-NLS-1$
}
// for new added mapping file, sync to project mapping folder
MetadataTalendType.syncNewMappingFileToProject();
} catch (SystemException e) {
// ignore
ExceptionHandler.process(e);

View File

@@ -205,27 +205,6 @@ public class StandaloneConnectionContextUtils {
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_ADDITIONAL_JDBC_SETTINGS,
getOriginalValue(contextProperties, additionalJDBCSettings));
String dataprocProjectId = cloneConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_PROJECT_ID);
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_PROJECT_ID,
getOriginalValue(contextProperties, dataprocProjectId));
String dataprocClusterId = cloneConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_CLUSTER_ID);
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_CLUSTER_ID,
getOriginalValue(contextProperties, dataprocClusterId));
String dataprocRegion = cloneConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_REGION);
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_REGION,
getOriginalValue(contextProperties, dataprocRegion));
String dataprocJarsBucket = cloneConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_JARS_BUCKET);
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_JARS_BUCKET,
getOriginalValue(contextProperties, dataprocJarsBucket));
String dataprocPathToCredentials = cloneConn.getParameters()
.get(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_PATH_TO_GOOGLE_CREDENTIALS);
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_PATH_TO_GOOGLE_CREDENTIALS,
getOriginalValue(contextProperties, dataprocPathToCredentials));
String hiveEnableHa = cloneConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_ENABLE_HA);
cloneConn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_ENABLE_HA,
getOriginalValue(contextProperties, hiveEnableHa));

View File

@@ -122,8 +122,7 @@ Require-Bundle: org.eclipse.jdt.core,
org.talend.components.api,
org.apache.servicemix.bundles.avro,
jackson-core-asl,
org.talend.libraries.jackson,
org.talend.libraries.apache.common
org.talend.libraries.jackson
Bundle-Activator: org.talend.core.runtime.CoreRuntimePlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,

View File

@@ -94,6 +94,4 @@ public interface IESBService extends IService {
* @return
*/
public IProcessor createOSGIJavaProcessor(IProcess process, Property property, boolean filenameFromLabel);
public boolean isSOAPServiceProvider(Item item);
}

View File

@@ -126,8 +126,6 @@ public class PluginChecker {
public static final String BDEE_PLUGIN_ID = "org.talend.designer.bigdata"; //$NON-NLS-1$
public static final String BD_ROUTINE_PLUGIN_ID = "org.talend.designer.routines.bigdata"; //$NON-NLS-1$
public static final String DOCKER_PLUGIN_ID = "org.talend.designer.docker"; //$NON-NLS-1$
public static final String HELP_DI_EE_PLUGIN_ID = "org.talend.help.dataprep"; //$NON-NLS-1$
@@ -366,10 +364,6 @@ public class PluginChecker {
return isPluginLoaded(ESBSE_PLUGIN_ID);
}
public static boolean isBigdataRoutineLoaded() {
return isPluginLoaded(BD_ROUTINE_PLUGIN_ID);
}
public static String getBundlePath(String bundleName) {
String bundlePath = ""; //$NON-NLS-1$
Bundle refBundle = Platform.getBundle(bundleName);

View File

@@ -163,18 +163,6 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_DURATION = "CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_DURATION";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_GOOGLE_PROJECT_ID = "CONN_PARA_KEY_HIVE_GOOGLE_PROJECT_ID";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_GOOGLE_CLUSTER_ID = "CONN_PARA_KEY_HIVE_GOOGLE_CLUSTER_ID";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_GOOGLE_REGION = "CONN_PARA_KEY_HIVE_GOOGLE_REGION";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_GOOGLE_JARS_BUCKET = "CONN_PARA_KEY_HIVE_GOOGLE_JARS_BUCKET";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_AUTHENTICATION_DEFINE_PATH_TO_GOOGLE_CREDENTIALS = "CONN_PARA_KEY_HIVE_AUTHENTICATION_DEFINE_PATH_TO_GOOGLE_CREDENTIALS";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_AUTHENTICATION_PATH_TO_GOOGLE_CREDENTIALS = "CONN_PARA_KEY_HIVE_AUTHENTICATION_PATH_TO_GOOGLE_CREDENTIALS";//$NON-NLS-1$
/**
* The key is for metastore server.
*/

View File

@@ -58,7 +58,7 @@ public enum EDatabaseVersion4Drivers {
HSQLDB_SERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_SERVER, "hsqldb.jar")), //$NON-NLS-1$
HSQLDB_WEBSERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_WEBSERVER, "hsqldb.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-1.4.198.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-1.3.160.jar")), //$NON-NLS-1$
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$

View File

@@ -20,8 +20,6 @@ package org.talend.core.hadoop;
public class HadoopConstants {
public static final String SPARK_LOCAL_MODE = "SPARK_LOCAL_MODE";
public static final String SPARK_LOCAL_VERSION = "SPARK_LOCAL_VERSION";
public static final String SPARK_MODE = "SPARK_MODE";

View File

@@ -72,7 +72,7 @@ public class ContextUtils {
"static", "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", "native", "super", "while")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$
private static final Set<String> SECURE_SENSITIVE_CONTEXT_NAMES_EXP = new HashSet<String>(Arrays.asList("resource_flow_temp_folder", "resource_webhook_payload", "resource_file_[\\w]+",
"resource_directory_[\\w]+", "connection_[a-zA-Z0-9]+_[\\w]+"));
"resource_directory_[\\w]+", "connection_[a-zA-Z0-9]+_[\\w]"));
/**

View File

@@ -1769,38 +1769,6 @@ public class RepositoryToComponentProperty {
if ("IMPALA_DRIVER".equals(value)) {
return connection.getParameters().get(ConnParameterKeys.IMPALA_DRIVER);
}
if (value.equals("GOOGLE_PROJECT_ID")) {
String projectId = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_PROJECT_ID);
return getAppropriateValue(connection, projectId);
}
if (value.equals("GOOGLE_CLUSTER_ID")) {
String clusterId = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_CLUSTER_ID);
return getAppropriateValue(connection, clusterId);
}
if (value.equals("GOOGLE_REGION")) {
String region = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_REGION);
return getAppropriateValue(connection, region);
}
if (value.equals("GOOGLE_JARS_BUCKET")) {
String jarsBucket = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_GOOGLE_JARS_BUCKET);
return getAppropriateValue(connection, jarsBucket);
}
if (value.equals("DEFINE_PATH_TO_GOOGLE_CREDENTIALS")) {
String usePathToCredentials = connection.getParameters()
.get(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_DEFINE_PATH_TO_GOOGLE_CREDENTIALS);
return Boolean.parseBoolean(usePathToCredentials);
}
if (value.equals("PATH_TO_GOOGLE_CREDENTIALS")) {
String pathToCredentials = connection.getParameters()
.get(ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_PATH_TO_GOOGLE_CREDENTIALS);
return getAppropriateValue(connection, pathToCredentials);
}
return null;
}

View File

@@ -232,6 +232,4 @@ public interface IElementParameter {
public boolean isSerialized();
public void setSerialized(boolean isSerialized);
public boolean isSelectedFromItemValue();
}

View File

@@ -131,6 +131,4 @@ public interface IProcess extends IElement {
public void checkStartNodes();
public String getComponentsType();
public INode getNodeByUniqueName(String uniqueName);
}

View File

@@ -21,7 +21,6 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.VersionUtils;
@@ -54,7 +53,6 @@ import org.talend.core.utils.BitwiseOptionUtils;
import org.talend.designer.core.IDesignerCoreService;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.MetadataType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
@@ -62,7 +60,6 @@ import org.talend.designer.core.model.utils.emf.talendfile.RoutinesParameterType
import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.apache.commons.text.StringEscapeUtils;
/**
* DOC bqian class global comment. Detailled comment
@@ -1006,49 +1003,12 @@ public final class ProcessUtils {
}
return false;
}
public static boolean isChildRouteProcess(IProcess process) {
if (process != null) {
for (INode node : process.getGraphicalNodes()) {
if ((node.getComponent().getName() != null) &&
(node.getComponent().getName().compareTo("tRouteInput") == 0)) {
return true;
}
}
List n = process.getNodesOfType("tRouteInput");
if (n!=null && n.size()!=0) {
return true;
}
return false;
}
public static String escapeJava(String input) {
return StringEscapeUtils.escapeJava(input);
}
public static boolean hasJettyEndpoint(ProcessType process) {
EList<NodeType> nodesList = process.getNode();
boolean hasJettyEndpoint = hasJettyEndpoint(nodesList);
return hasJettyEndpoint;
}
private static boolean hasJettyEndpoint(EList<NodeType> nodesList) {
for (NodeType node : nodesList) {
if ("cMessagingEndpoint".equals(node.getComponentName())) {
for (Object elementParameter : node.getElementParameter()) {
ElementParameterType elementParameterType = (ElementParameterType)elementParameter;
String name = elementParameterType.getName();
String value = elementParameterType.getValue();
if ("URI".equals(name) && (value != null && StringUtils.startsWith(value.trim(), "\"jetty:"))) {
return true;
}
}
}
}
return false;
}
}

View File

@@ -231,12 +231,7 @@ public class TalendLibsServerManager {
return canConnect;
}
public boolean isProxyArtifactRepoConfigured() {
ArtifactRepositoryBean serverBean = getProxyArtifactServer();
return serverBean == null ? false : true;
}
public ArtifactRepositoryBean getProxyArtifactServer() {
public ArtifactRepositoryBean getTalentArtifactServer() {
ArtifactRepositoryBean serverBean = new ArtifactRepositoryBean();
// get from ini file first
String url = System.getProperty(NEXUS_PROXY_URL);
@@ -260,16 +255,9 @@ public class TalendLibsServerManager {
serverBean.setType(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_TYPE));
}
}
if (StringUtils.isNotEmpty(serverBean.getServer())) {
return serverBean;
}
return null;
}
public ArtifactRepositoryBean getTalentArtifactServer() {
ArtifactRepositoryBean serverBean = getProxyArtifactServer();
if (serverBean == null) {
serverBean = new ArtifactRepositoryBean();
hasProxySetting = StringUtils.isNotEmpty(serverBean.getServer());
// use default
if (!hasProxySetting) {
serverBean.setServer(TALEND_LIB_SERVER);
serverBean.setUserName(TALEND_LIB_USER);
serverBean.setPassword(TALEND_LIB_PASSWORD);

View File

@@ -208,8 +208,4 @@ public interface ITalendCorePrefConstants {
public static final int ARTIFACT_PROXY_SETTING = 1;
public static final String NEXUS_SHARE_LIBS = "NEXUS_SHARE_LIBS";
public static final boolean NEXUS_SHARE_LIBS_DEFAULT = false;
}

View File

@@ -30,7 +30,5 @@ public interface IHDistribution {
IHDistributionVersion getHDVersion(String v, boolean byDisplay);
boolean useCustom();
boolean isSparkLocal();
}

View File

@@ -46,8 +46,6 @@ public interface MavenConstants {
static final String EXCLUDE_DELETED_ITEMS = "EXCLUDE_DELETED_ITEMS";
static final String SKIP_FOLDERS = "SKIP_FOLDERS";
/*
* for lib
*/

View File

@@ -51,8 +51,6 @@ public interface TalendProcessArgumentConstant {
static final String ARG_NEED_XMLMAPPINGS = "NEED_XMLMAPPINGS";
static final String ARG_NEED_RULES = "NEED_RULES";
static final String ARG_NEED_JETTY_SERVER = "NEED_JETTY_SERVER";
static final String ARG_ENABLE_WATCH = "ENABLE_WATCH";

View File

@@ -13,10 +13,7 @@
package org.talend.core.runtime.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -28,7 +25,6 @@ import org.talend.core.model.components.IComponentsFactory;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.service.IUpdateService;
import org.talend.utils.io.FilesUtils;
import org.talend.utils.string.DigestUtil;
public class SharedStudioUtils {
@@ -88,29 +84,6 @@ public class SharedStudioUtils {
return false;
}
public static boolean isNeedCleanOnSharedMode() {
if (SharedStudioUtils.isSharedStudioMode()) {
boolean isNeedClean = installedPatch();
String studioArtifactsFileSha256Hex = getStudioArtifactsFileSha256Hex();
if (updateArtifactsFileSha256Hex(studioArtifactsFileSha256Hex)) {
isNeedClean = true;
}
return isNeedClean;
}
return false;
}
public static boolean updateArtifactsFileSha256Hex(String studioArtifactsFileSha256Hex) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IUpdateService.class)) {
IUpdateService updateService = GlobalServiceRegister.getDefault().getService(IUpdateService.class);
try {
return updateService.updateArtifactsFileSha256Hex(new NullProgressMonitor(), studioArtifactsFileSha256Hex);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return false;
}
public static boolean installedPatch() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IUpdateService.class)) {
IUpdateService updateService = GlobalServiceRegister.getDefault().getService(IUpdateService.class);
@@ -135,37 +108,4 @@ public class SharedStudioUtils {
File extchangeFolder = new File (componentFolder, path.toOSString());
return extchangeFolder;
}
public static IPath getTempFolderPath() {
if (SharedStudioUtils.isSharedStudioMode()) {
Path wsPath = new Path(Platform.getInstanceLocation().getURL().getPath());
return wsPath.append("temp");
} else {
return new Path(System.getProperty("user.dir")).append("temp");
}
}
public static String getStudioArtifactsFileSha256Hex() {
File studioArtifactsFile = new File(Platform.getInstallLocation().getURL().getPath(), "artifacts.xml");//$NON-NLS-1$
if (studioArtifactsFile.exists()) {
InputStream inputStream = null;
try {
inputStream = new FileInputStream(studioArtifactsFile);
return DigestUtil.sha256Hex(inputStream);
} catch (FileNotFoundException e) {
ExceptionHandler.process(e);
} catch (IOException e) {
ExceptionHandler.process(e);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException ex) {
ExceptionHandler.process(ex);
}
}
}
}
return "";
}
}

View File

@@ -38,12 +38,4 @@ public interface IDQComponentService extends IService {
* @param node The node which need to be modified
*/
void correctlyCustomMatcherParameter(NodeType node);
/**
* Change the attribute of MatchingData and use Integer value instead of double value.
*
* @param node The node which need to be modified
*/
void covertConfindWeight2Int(NodeType node);
}

View File

@@ -17,11 +17,9 @@ import java.nio.file.Path;
import java.util.Set;
import java.util.stream.Stream;
import org.eclipse.swt.graphics.Image;
import org.talend.core.IService;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
/**
* For documentation, see implementation in org.talend.sdk.component.studio-integration plugin
@@ -35,6 +33,4 @@ public interface ITaCoKitDependencyService extends IService {
Stream<IComponent> getJobComponents(Item item);
Path findM2Path();
Image getTaCoKitImageByRepositoryType(ERepositoryObjectType repObjType);
}

View File

@@ -24,7 +24,5 @@ public interface IUpdateService extends IService {
public boolean syncSharedStudioLibraryInPatch(IProgressMonitor monitor) throws Exception;
public String getSharedStudioMissingPatchVersion();
public boolean updateArtifactsFileSha256Hex(IProgressMonitor monitor, String studioArtifactsFileShaCodeHex);
}

View File

@@ -20,7 +20,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.IFile;
@@ -95,8 +94,6 @@ public final class ProjectManager {
private Set<Project> tempProjects;
private WeakHashMap<IRepositoryViewObject, Boolean> cachedObjects = new WeakHashMap<IRepositoryViewObject, Boolean>();
private ProjectManager() {
beforeLogonRecords = new HashSet<String>();
logonRecords = new HashSet<String>();
@@ -454,15 +451,9 @@ public final class ProjectManager {
if (object == null) {
return true;
}
if (cachedObjects.containsKey(object)) {
return cachedObjects.get(object);
}
org.talend.core.model.properties.Project emfProject = getProject(object.getProperty().getItem());
org.talend.core.model.properties.Project curProject = curP.getEmfProject();
boolean ret = emfProject.equals(curProject);
cachedObjects.put(object, ret);
return ret;
return emfProject.equals(curProject);
} else {
IProjectRepositoryNode root = node.getRoot();

View File

@@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.talend.core.IService;
import org.talend.core.model.components.IComponentsFactory;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.process.IContextManager;
@@ -145,8 +144,4 @@ public interface IRepositoryService extends IService {
public void setShouldCheckRepoViewCommonNavigatorDirty(IRepositoryView repView, boolean shouldFlag);
boolean isProjectLevelLog4j2();
List<ModuleNeeded> getLog4j2Modules();
}

View File

@@ -40,7 +40,6 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.update.PreferenceKeys;
import org.talend.commons.ui.runtime.utils.ZipFileUtils;
import org.talend.commons.ui.swt.advanced.dataeditor.LabelFieldEditor;
import org.talend.commons.ui.utils.workbench.preferences.OneLineComboFieldEditor;
@@ -541,7 +540,6 @@ public abstract class I18nPreferencePage extends FieldEditorPreferencePage imple
boolean ok = super.performOk();
saveLanguageType();
CorePlugin.getDefault().savePluginPreferences();
PlatformUI.getPreferenceStore().setValue(PreferenceKeys.NEED_OSGI_CLEAN, true);
if (isBabiliButtonClicked) {
refreshAll();
}
@@ -559,13 +557,6 @@ public abstract class I18nPreferencePage extends FieldEditorPreferencePage imple
protected void performApply() {
saveLanguageType();
CorePlugin.getDefault().savePluginPreferences();
PlatformUI.getPreferenceStore().setValue(PreferenceKeys.NEED_OSGI_CLEAN, true);
}
@Override
protected void performDefaults() {
super.performDefaults();
PlatformUI.getPreferenceStore().setValue(PreferenceKeys.NEED_OSGI_CLEAN, true);
}
/**

View File

@@ -102,9 +102,7 @@ public class HorizontalTabFactory {
* @param descriptors
*/
public void setInput(List<TalendPropertyTabDescriptor> descriptors) {
if (tabbedPropertyViewer != null && tabbedPropertyViewer.getControl() != null && !tabbedPropertyViewer.getControl().isDisposed()) {
tabbedPropertyViewer.setInput(descriptors);
}
tabbedPropertyViewer.setInput(descriptors);
}
public List<TalendPropertyTabDescriptor> getInput() {

View File

@@ -12,7 +12,6 @@
// ============================================================================
package org.talend.core;
import org.apache.logging.log4j.message.ThreadDumpMessage;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -209,8 +208,4 @@ public class CorePlugin extends Plugin {
return (ICreateXtextProcessService) GlobalServiceRegister.getDefault().getService(ICreateXtextProcessService.class);
}
public static String threadDump(String message) {
return new ThreadDumpMessage(message).toString();
}
}

View File

@@ -13,7 +13,6 @@
package org.talend.core.model.metadata.query.generator;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.model.metadata.QueryUtil;
import org.talend.core.model.metadata.query.AbstractQueryGenerator;
import org.talend.core.model.process.IElement;
@@ -39,23 +38,4 @@ public class PostgreQueryGenerator extends AbstractQueryGenerator {
}
return super.getSchema(elem);
}
@Override
protected String getTableNameWithDBAndSchema(final String dbName, final String schema, String tableName) {
if (tableName == null || EMPTY.equals(tableName.trim())) {
tableName = QueryUtil.DEFAULT_TABLE_NAME;
}
final StringBuffer tableNameWithDBAndSchema = new StringBuffer();
// postgres do not support db.schema.table_name, so only need schema.table_name
if (schema != null && !EMPTY.equals(schema)) {
tableNameWithDBAndSchema.append(checkContextAndAddQuote(schema));
tableNameWithDBAndSchema.append(getSQLFieldConnector());
}
//
tableNameWithDBAndSchema.append(checkContextAndAddQuote(tableName));
return tableNameWithDBAndSchema.toString();
}
}

View File

@@ -1046,10 +1046,4 @@ public class ObjectElementParameter implements IElementParameter {
public void setSerialized(boolean isSerialized) {
// TODO Auto-generated method stub
}
@Override
public boolean isSelectedFromItemValue() {
// TODO Auto-generated method stub
return false;
}
}

View File

@@ -16,13 +16,13 @@ import java.io.File;
import java.util.Locale;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.talend.core.CorePlugin;
import org.talend.core.prefs.GeneralParametersProvider.GeneralParameters;
import org.talend.core.runtime.util.SharedStudioUtils;
/**
* Intializer of core preferences. <br/>
@@ -54,7 +54,7 @@ public class CorePreferenceInitializer extends AbstractPreferenceInitializer {
IEclipsePreferences node = new DefaultScope().getNode(CorePlugin.getDefault().getBundle().getSymbolicName());
// Building temporary files directory path
IPath tempPath = SharedStudioUtils.getTempFolderPath();
IPath tempPath = new Path(System.getProperty("user.dir")).append("temp"); // NON-NLS-1$// NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-2$
File tempFile = tempPath.toFile();
if (!tempFile.exists()) {
tempFile.mkdirs();

View File

@@ -30,7 +30,6 @@ import java.util.Map;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.stream.Collectors;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
@@ -60,7 +59,6 @@ import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
import org.talend.commons.utils.PasswordEncryptUtil;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.commons.utils.time.TimeMeasure;
@@ -622,7 +620,7 @@ public class ProcessorUtilities {
*/
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
copyDependenciedResources(currentProcess, progressMonitor);
copyDependenciedResources(currentProcess);
return processor;
}
@@ -1012,8 +1010,7 @@ public class ProcessorUtilities {
checkedContext = checkCleanSecureContextParameterValue(checkedContext, jobInfo);
processor.setContext(checkedContext); // generate current context.
} else {
IContext checkedContext = checkCleanSecureContextParameterValue(context, jobInfo);
processor.setContext(checkedContext);
processor.setContext(context);
}
LastGenerationInfo.getInstance().getContextPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()).add(
context.getName());
@@ -1085,8 +1082,8 @@ public class ProcessorUtilities {
}
private static IContext checkCleanSecureContextParameterValue(IContext currentContext, JobInfo jobInfo) {
JobInfo job = null;
JobInfo job = null;
if (jobInfo.getFatherJobInfo() == null) {
job = jobInfo;
@@ -1098,10 +1095,10 @@ public class ProcessorUtilities {
return currentContext;
}
}
if (job.getArgumentsMap() == null
|| job.getArgumentsMap().get(TalendProcessArgumentConstant.ARG_CLEAR_PASSWORD_CONTEXT_PARAMETERS) == null
|| !Boolean.parseBoolean((ProcessUtils.getOptionValue(job.getArgumentsMap(), TalendProcessArgumentConstant.ARG_CLEAR_PASSWORD_CONTEXT_PARAMETERS,
if (job.getArgumentsMap() == null
|| job.getArgumentsMap().get(TalendProcessArgumentConstant.ARG_CLEAR_PASSWORD_CONTEXT_PARAMETERS) == null
|| !Boolean.parseBoolean((ProcessUtils.getOptionValue(job.getArgumentsMap(), TalendProcessArgumentConstant.ARG_CLEAR_PASSWORD_CONTEXT_PARAMETERS,
(String) null)))) {
return currentContext;
}
@@ -1372,7 +1369,7 @@ public class ProcessorUtilities {
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
TimeMeasure.step(idTimer, "generateBuildInfo");
copyDependenciedResources(currentProcess, progressMonitor);
copyDependenciedResources(currentProcess);
return processor;
} finally {
@@ -1385,40 +1382,7 @@ public class ProcessorUtilities {
}
}
private static void syncContextResourcesForParentJob(IProcess currentProcess, IProgressMonitor progressMonitor) {
ITalendProcessJavaProject processJavaProject = mainJobInfo.getProcessor().getTalendJavaProject();
final IFolder mainResourcesFolder = processJavaProject.getExternalResourcesFolder();
final File targetFolder = mainResourcesFolder.getLocation().toFile();
final Set<JobInfo> dependenciesItems = mainJobInfo.getProcessor().getBuildChildrenJobs();
final IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
IRunProcessService.class);
List<ProcessItem> dependenciesItemsFiltered = dependenciesItems.stream().filter(jobInfo -> !jobInfo.isJoblet())
.map(JobInfo::getProcessItem).collect(Collectors.toList());
if (dependenciesItemsFiltered.size() > 0) {
dependenciesItemsFiltered.forEach(item -> {
ITalendProcessJavaProject childJavaProject = runProcessService.getTalendJobJavaProject(item.getProperty());
if (childJavaProject != null) {
final IFolder childResourcesFolder = childJavaProject.getExternalResourcesFolder();
if (childResourcesFolder.exists()) {
FileCopyUtils.syncFolder(childResourcesFolder.getLocation().toFile(), targetFolder, false);
}
}
});
try {
mainResourcesFolder.refreshLocal(IResource.DEPTH_INFINITE, progressMonitor);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
private static Set<ModuleNeeded> getAllJobTestcaseModules(ProcessItem selectedProcessItem) {
private static Set<ModuleNeeded> getAllJobTestcaseModules(ProcessItem selectedProcessItem) {
Set<ModuleNeeded> neededLibraries = new HashSet<>();
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testcontainerService =
@@ -1552,7 +1516,7 @@ public class ProcessorUtilities {
*
* @param currentProcess
*/
private static void copyDependenciedResources(IProcess currentProcess, IProgressMonitor progressMonitor) {
private static void copyDependenciedResources(IProcess currentProcess) {
if (!(currentProcess instanceof IProcess2)) {
return;
}
@@ -1609,7 +1573,6 @@ public class ProcessorUtilities {
}
}
}
syncContextResourcesForParentJob(currentProcess, progressMonitor);
}
/**

View File

@@ -126,16 +126,16 @@ public class MavenLibraryResolverProvider {
}
public ArtifactResult resolveArtifact(MavenArtifact artifact, boolean is4Parent) throws Exception {
public ArtifactResult resolveArtifact(MavenArtifact aritfact, boolean is4Parent) throws Exception {
ArtifactRequest artifactRequest = new ArtifactRequest();
RemoteRepository remoteRepo = getRemoteRepositroy(artifact);
RemoteRepository remoteRepo = getRemoteRepositroy(aritfact);
artifactRequest.addRepository(remoteRepo);
if (is4Parent) {
artifactRequest.addRepository(dynamicRemoteRepository);
}
// Classifier must not be specified if type is pom
artifactRequest.setArtifact(new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(), "pom".equals(artifact.getType()) ? "" : artifact.getClassifier(),
artifact.getType(), artifact.getVersion()));
Artifact artifact = new DefaultArtifact(aritfact.getGroupId(), aritfact.getArtifactId(), aritfact.getClassifier(),
aritfact.getType(), aritfact.getVersion());
artifactRequest.setArtifact(artifact);
ArtifactResult result = null;
if (is4Parent) {
result = dynamicRepoSystem.resolveArtifact(dynamicRepoSystemSession, artifactRequest);

View File

@@ -135,12 +135,6 @@
<groupId>org.talend.components</groupId>
<artifactId>components-marketo-runtime</artifactId>
<version>${components.version}</version>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>txw2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.talend.components</groupId>

View File

@@ -10,7 +10,7 @@
<artifactId>studio-tacokit-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<tacokit.components.version>1.17.1</tacokit.components.version>
<tacokit.components.version>1.15.0</tacokit.components.version>
</properties>
<repositories>
<repository>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.29.1</tcomp.version>
<tcomp.version>1.1.25</tcomp.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

View File

@@ -14,5 +14,4 @@ AbstractPersistentProjectSettingPage.syncAllPoms=Do you want to update all poms?
MavenProjectSettingPage.filterExampleMessage=Filter examples:\nlabel=myJob \t\t\t\t=> Generate only the job named "myJob"\n!(label=myJob) \t\t\t\t=> Generate any job except the one named "myJob"\n(path=folder1/folder2) \t\t\t=> Generate any job in the folder "folder1/folder2"\n(path=folder1/folder2)or(label=myJob)\t=> Generate any job in the folder "folder1/folder2" or named "myJob"\n(label=myJob)and(version=0.2) \t=> Generate only the job named "myJob" with version 0.2\n!((label=myJob)and(version=0.1)) \t=> Generate every jobs except the "myJob" version 0.1
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
MavenProjectSettingPage.excludeDeletedItems=Exclude deleted items
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize poms button to apply the new settings.
MavenProjectSettingPage.skipFolders=Skip folders
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize poms button to apply the new settings.

View File

@@ -55,8 +55,6 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
private Button excludeDeletedItemsCheckbox;
private Button skipFoldersCheckbox;
public MavenProjectSettingPage() {
noDefaultAndApplyButton();
}
@@ -113,17 +111,6 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
}
});
skipFoldersCheckbox = new Button(parent, SWT.CHECK);
skipFoldersCheckbox.setText(Messages.getString("MavenProjectSettingPage.skipFolders")); //$NON-NLS-1$
skipFoldersCheckbox.setSelection(preferenceStore.getBoolean(MavenConstants.SKIP_FOLDERS));
skipFoldersCheckbox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
addSyncWarning();
}
});
filterText.setText(filter);
filterText.addModifyListener(new ModifyListener() {
@@ -182,7 +169,6 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
preferenceStore.setValue(MavenConstants.POM_FILTER, getRealVersionFilter(filter));
preferenceStore.setValue(MavenConstants.USE_PROFILE_MODULE, useProfileModuleCheckbox.getSelection());
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, excludeDeletedItemsCheckbox.getSelection());
preferenceStore.setValue(MavenConstants.SKIP_FOLDERS, skipFoldersCheckbox.getSelection());
}
return ok;
}

View File

@@ -52,7 +52,6 @@ import org.eclipse.swt.widgets.Display;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.ILibraryManagerService;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
@@ -169,10 +168,6 @@ public class AggregatorPomsHelper {
}
public void updateCodeProjects(IProgressMonitor monitor, boolean forceBuild) {
updateCodeProjects(monitor, forceBuild, false);
}
public void updateCodeProjects(IProgressMonitor monitor, boolean forceBuild, boolean ignoreM2Cache) {
RepositoryWorkUnit workUnit = new RepositoryWorkUnit<Object>("update code project") { //$NON-NLS-1$
@Override
@@ -180,11 +175,8 @@ public class AggregatorPomsHelper {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
for (ERepositoryObjectType codeType : ERepositoryObjectType.getAllTypesOfCodes()) {
try {
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
if (ERepositoryObjectType.ROUTINES == codeType) {
PomUtil.checkExistingLog4j2Dependencies4RoutinePom(projectTechName, codeProject.getProjectPom());
}
if (ignoreM2Cache || CodeM2CacheManager.needUpdateCodeProject(currentProject, codeType)) {
if (CodeM2CacheManager.needUpdateCodeProject(currentProject, codeType)) {
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
CodeM2CacheManager.updateCodeProjectCache(currentProject, codeType);
@@ -352,9 +344,14 @@ public class AggregatorPomsHelper {
private static boolean checkIfCanAddToParentModules(Property property, boolean checkFilter) {
// Check relation for ESB service job, should not be added into main pom
if (property != null) {
if (isSOAPServiceProvider(property)) {
return false;
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(property.getId(),
property.getVersion(), RelationshipItemBuilder.JOB_RELATION);
for (Relation relation : relations) {
if (RelationshipItemBuilder.SERVICES_RELATION.equals(relation.getType())) {
return false;
}
}
// for import won't add for exclude option
if (property.getItem() != null && property.getItem().getState() != null && property.getItem().getState().isDeleted()
&& PomIdsHelper.getIfExcludeDeletedItems(property)) {
@@ -607,12 +604,7 @@ public class AggregatorPomsHelper {
String version = realVersion == null ? property.getVersion() : realVersion;
String jobFolderName = getJobProjectFolderName(property.getLabel(), version);
ERepositoryObjectType type = ERepositoryObjectType.getItemType(property.getItem());
IFolder jobFolder = null;
if (PomIdsHelper.skipFolders()) {
jobFolder = helper.getProcessFolder(type).getFolder(jobFolderName);
} else {
jobFolder = helper.getProcessFolder(type).getFolder(itemRelativePath).getFolder(jobFolderName);
}
IFolder jobFolder = helper.getProcessFolder(type).getFolder(itemRelativePath).getFolder(jobFolderName);
List<ERepositoryObjectType> allTypesOfProcess2 = ERepositoryObjectType.getAllTypesOfProcess2();
if (allTypesOfProcess2.contains(type)) {
createFoldersIfNeeded(jobFolder);
@@ -868,7 +860,7 @@ public class AggregatorPomsHelper {
}
// codes pom
monitor.subTask("Synchronize code poms"); //$NON-NLS-1$
updateCodeProjects(monitor, true, true);
updateCodeProjects(monitor, true);
monitor.worked(1);
if (monitor.isCanceled()) {
return;
@@ -904,7 +896,7 @@ public class AggregatorPomsHelper {
}
IFile pomFile = getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
// filter esb data service node
if (!isSOAPServiceProvider(object.getProperty()) && pomFile.exists()) {
if (!isDataServiceOperation(object.getProperty()) && pomFile.exists()) {
modules.add(getModulePath(pomFile));
}
}
@@ -945,7 +937,7 @@ public class AggregatorPomsHelper {
* @param property
* @return
*/
private static boolean isSOAPServiceProvider(Property property) {
private boolean isDataServiceOperation(Property property) {
if (property != null) {
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(property.getId(),
property.getVersion(), RelationshipItemBuilder.JOB_RELATION);
@@ -954,14 +946,6 @@ public class AggregatorPomsHelper {
return true;
}
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
IESBService service = GlobalServiceRegister.getDefault().getService(IESBService.class);
if (service != null) {
if (service.isSOAPServiceProvider(property.getItem())) {
return true;
}
}
}
}
return false;
}

View File

@@ -101,7 +101,7 @@ public class CodeM2CacheManager {
}
}
public static File getCacheFile(String projectTechName, ERepositoryObjectType codeType) {
private static File getCacheFile(String projectTechName, ERepositoryObjectType codeType) {
String cacheFileName = PomIdsHelper.getProjectGroupId(projectTechName) + "." + codeType.name().toLowerCase() + "-" //$NON-NLS-1$ //$NON-NLS-2$
+ PomIdsHelper.getCodesVersion(projectTechName) + ".cache"; // $NON-NLS-1$
return new File(MavenPlugin.getMaven().getLocalRepositoryPath(), cacheFileName);

View File

@@ -118,8 +118,6 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
}
if (isDeployed) {
dependency = PomUtil.createModuleDependency(module.getMavenUri());
if (module.isExcluded())
dependency.setScope("provided");
}
if (dependency != null) {
existedDependencies.add(dependency);

View File

@@ -12,7 +12,6 @@
// ============================================================================
package org.talend.designer.maven.tools.creator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -47,6 +46,7 @@ import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.runtime.process.LastGenerationInfo;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.core.runtime.projectsetting.IProjectSettingTemplateConstants;
import org.talend.core.runtime.repository.build.IMavenPomCreator;
import org.talend.core.ui.ITestContainerProviderService;
@@ -284,11 +284,6 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
}
protected void addCodesDependencies(final List<Dependency> dependencies) {
dependencies.addAll(getCodesDependencies());
}
protected List<Dependency> getCodesDependencies() {
List<Dependency> dependencies = new ArrayList<Dependency>();
String projectTechName = ProjectManager.getInstance().getProject(getJobProcessor().getProperty()).getTechnicalLabel();
String codeVersion = PomIdsHelper.getCodesVersion(projectTechName);
@@ -305,7 +300,6 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
Dependency beansDependency = PomUtil.createDependency(beansGroupId, beansArtifactId, codeVersion, null);
dependencies.add(beansDependency);
}
return dependencies;
}
protected void addChildrenDependencies(final List<Dependency> dependencies) {
@@ -327,7 +321,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
artifactId = PomIdsHelper.getJobArtifactId(jobInfo);
JobInfo lastMainJob = LastGenerationInfo.getInstance().getLastMainJob();
if (lastMainJob != null && JobUtils.isJob(jobInfo) && JobUtils.isRoute(getJobProcessor().getProperty())) {
if (lastMainJob != null && JobUtils.isJob(jobInfo)) {
groupId = PomIdsHelper.getJobGroupId(lastMainJob.getProcessor().getProperty());
version = PomIdsHelper.getJobVersion(lastMainJob.getProcessor().getProperty());
} else {

View File

@@ -668,16 +668,14 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
List<Dependency> dependencies = new ArrayList<>();
// codes
List<Dependency> codeDependencies = getCodesDependencies();
dependencies.addAll(codeDependencies);
addCodesDependencies(dependencies);
// codes dependencies (optional)
ERepositoryObjectType.getAllTypesOfCodes().forEach(t -> dependencies.addAll(PomUtil.getCodesDependencies(t)));
// libraries of talend/3rd party
Set<Dependency> parentJobDependencies = processor.getNeededModules(TalendProcessOptionConstants.MODULES_EXCLUDE_SHADED).stream()
.filter(m -> !m.isExcluded()).map(m -> createDenpendency(m, false))
.collect(Collectors.toSet());
.filter(m -> !m.isExcluded()).map(m -> createDenpendency(m, false)).collect(Collectors.toSet());
dependencies.addAll(parentJobDependencies);
// missing modules from the job generation of children
@@ -707,7 +705,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|| _3rdLibCoordinate.contains(coordinate)) {
return;
}
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(groupId) || codeDependencies.contains(d)) {
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(groupId) || groupId.startsWith(projectGroupId)) {
if (!optional) {
talendLibCoordinate.add(coordinate);
}
@@ -763,7 +761,6 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
}
// remove duplicate job dependencies and only keep the latest one
// keep high priority dependencies if set by tLibraryLoad
// FIXME not used now since tacokit component use specific dependency version. so we must include all job dependencies.

View File

@@ -12,18 +12,16 @@
// ============================================================================
package org.talend.designer.maven.tools.creator;
import java.util.HashSet;
import java.util.Collections;
import java.util.Set;
import org.apache.maven.model.Model;
import org.eclipse.core.resources.IFile;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.PluginChecker;
import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.designer.maven.template.MavenTemplateManager;
import org.talend.repository.model.IRepositoryService;
/**
* DOC ggu class global comment. Detailled comment
@@ -48,18 +46,13 @@ public class CreateMavenRoutinePom extends AbstractMavenCodesTemplatePom {
// Set<ModuleNeeded> runningModules = routiensService.getRunningModules();
// return runningModules;
// }
Set<ModuleNeeded> runningModules = new HashSet<>();
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
ILibrariesService libService = (ILibrariesService) GlobalServiceRegister.getDefault().getService(
ILibrariesService.class);
runningModules.addAll(libService.getCodesModuleNeededs(ERepositoryObjectType.ROUTINES));
Set<ModuleNeeded> runningModules = libService.getCodesModuleNeededs(ERepositoryObjectType.ROUTINES);
return runningModules;
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
IRepositoryService repositoryService = GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
if (PluginChecker.isBigdataRoutineLoaded() && repositoryService.isProjectLevelLog4j2()) {
runningModules.addAll(repositoryService.getLog4j2Modules());
}
}
return runningModules;
return Collections.emptySet();
}
}

View File

@@ -317,12 +317,6 @@ public class PomIdsHelper {
return PREFIX_DEFAULT_GROUPID + projectName.toLowerCase();
}
public static boolean skipFolders() {
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
ProjectPreferenceManager manager = getPreferenceManager(projectTechName);
return manager.getBoolean(MavenConstants.SKIP_FOLDERS);
}
public static boolean isValidGroupId(String text) {
if (text != null && text.matches("[\\w\\.]+")) { //$NON-NLS-1$
return true;

View File

@@ -76,7 +76,6 @@ import org.talend.commons.utils.io.FilesUtils;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.PluginChecker;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.JobInfo;
@@ -99,12 +98,10 @@ import org.talend.designer.maven.model.TalendJavaProjectConstants;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.maven.template.MavenTemplateManager;
import org.talend.designer.maven.tools.AggregatorPomsHelper;
import org.talend.designer.maven.tools.CodeM2CacheManager;
import org.talend.designer.maven.tools.ProcessorDependenciesManager;
import org.talend.designer.runprocess.IProcessor;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IRepositoryService;
import org.talend.utils.xml.XmlUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMImplementation;
@@ -1181,7 +1178,7 @@ public class PomUtil {
IRunProcessService runProcessService = GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
try {
Model model = MODEL_MANAGER.readMavenModel(runProcessService.getTalendCodeJavaProject(codeType).getProjectPom());
return model.getDependencies().stream().filter(d -> !"provided".equals(d.getScope())).map(
return model.getDependencies().stream().map(
d -> createDependency(d.getGroupId(), d.getArtifactId(), d.getVersion(), d.getType(), d.getClassifier()))
.peek(d -> ((SortableDependency) d).setAssemblyOptional(true)).collect(Collectors.toSet());
} catch (CoreException e) {
@@ -1191,49 +1188,4 @@ public class PomUtil {
return Collections.emptySet();
}
public static void checkExistingLog4j2Dependencies4RoutinePom(String projectTechName, IFile pomFile) {
if (!PluginChecker.isBigdataRoutineLoaded()) {
return;
}
try {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
Model model = MODEL_MANAGER.readMavenModel(pomFile);
IRepositoryService service = GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
boolean isLog4j2 = service.isProjectLevelLog4j2();
Map<String, MavenArtifact> GAVMap = service.getLog4j2Modules().stream()
.map(m -> MavenUrlHelper.parseMvnUrl(m.getMavenUri()))
.collect(Collectors.toMap(MavenArtifact::getArtifactId, MavenArtifact -> MavenArtifact));
long existingDependenciesSize = model.getDependencies().stream()
.filter(d -> GAVMap.containsKey(d.getArtifactId())
&& GAVMap.get(d.getArtifactId()).getGroupId().equals(d.getGroupId())
&& GAVMap.get(d.getArtifactId()).getVersion().equals(d.getVersion()))
.count();
boolean clean = false;
// CAUTION
// with this fix, project level log4j2 user can use log4j2 api in routine directly in BD project
// user should NEVER manually setup log4j2 in routine dependencies
// or else routine install cache could always be cleaned
if (isLog4j2 && existingDependenciesSize != GAVMap.size()) {
// if project level log4j1 -> log4j2
// if first time add log4j2 dependencies
// if log4j2 upgrade version
// then clean cache to add
clean = true;
} else if (!isLog4j2 && existingDependenciesSize > 0) {
// if project level log4j2 -> log4j1
// then clean cache to remove
clean = true;
}
if (clean) {
File cacheFile = CodeM2CacheManager.getCacheFile(projectTechName, ERepositoryObjectType.ROUTINES);
if (cacheFile.exists()) {
cacheFile.delete();
}
}
}
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}

View File

@@ -96,14 +96,10 @@ public final class TalendCodeProjectUtil {
return true;
}
try {
// because some cases, the project is not opened.
if (!codeProject.isOpen()) {
// if not opened, will have exception when check nature or such
codeProject.open(monitor);
}
} catch (Exception e) {
return true;
// because some cases, the project is not opened.
if (!codeProject.isOpen()) {
// if not opened, will have exception when check nature or such
codeProject.open(monitor);
}
codeProject.refreshLocal(IResource.DEPTH_ONE, monitor);

View File

@@ -44,7 +44,6 @@ Export-Package: org.apache.commons.cli2,
org.apache.commons.math3.stat.descriptive;version="3.3.0",
org.apache.commons.math3.stat.descriptive.rank;version="3.3.0",
org.apache.commons.math3.util;version="3.3.0",
org.apache.commons.text,
org.apache.commons.text.similarity,
org.apache.commons.validator;version="1.5.1",
org.apache.commons.validator.routines;version="1.5.1"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.talend.libraries.apache.google</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Google
Bundle-SymbolicName: org.talend.libraries.apache.google
Bundle-Version: 7.3.1.qualifier
Eclipse-BundleShape: dir

View File

@@ -0,0 +1 @@
jarprocessor.exclude.children=true

View File

@@ -0,0 +1,4 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>7.3.1-PATCH</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.libraries.apache.google</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/h2-1.4.198.jar"/>
<classpathentry exported="true" kind="lib" path="lib/h2-1.3.160.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -4,7 +4,7 @@ Bundle-Name: H2
Bundle-SymbolicName: org.talend.libraries.jdbc.h2
Bundle-Version: 7.3.1.qualifier
Bundle-ClassPath: .,
lib/h2-1.4.198.jar
lib/h2-1.3.160.jar
Export-Package: org.h2,
org.h2.api;uses:="org.h2.command.ddl,org.h2.table",
org.h2.bnf;uses:="org.h2.server.web",

View File

@@ -1,4 +1,6 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/h2-1.4.198.jar
lib/h2-1.3.160.jar,\
lib/h2-1.2.139.jar,\
lib/h2-1.2.132.jar

View File

@@ -9,32 +9,4 @@
</parent>
<artifactId>org.talend.libraries.jdbc.h2</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<excludeTransitive>true</excludeTransitive>
<artifactItems>
<artifactItem>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.198</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -72,8 +72,7 @@ download.external.dialog.desciption=List of modules to be downloaded automatical
download.external.dialog.help.url=https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products
download.external.dialog.warning=Warning
download.external.dialog.message=Select at least one module not installed.
Module.view.sharelibsAction.title=Share libraries
Module.view.sharelibsAction.info=Libraries sharing finished successfully.
AcceptModuleLicensesWizard.title=Download external modules
AcceptModuleLicensesWizardDialog.button.acceptAll=Accept all

View File

@@ -0,0 +1,136 @@
// ============================================================================
//
// 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
//
// 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.librariesmanager.ui.actions;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.librariesmanager.ui.LibManagerUiPlugin;
import org.talend.librariesmanager.ui.views.ModulesViewComposite;
/**
* qzhang class global comment. Detailled comment <br/>
*
*/
public class RemoveExternalJarAction extends Action {
/**
* qzhang RemoveExternalJarAction constructor comment.
*/
public RemoveExternalJarAction() {
super();
setText("Remove external JARs"); //$NON-NLS-1$
setDescription("Remove external JARs"); //$NON-NLS-1$
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
setEnabled(true);
init();
}
List<ModuleNeeded> modules;
public void init() {
modules = new ArrayList<ModuleNeeded>();
if (ModulesViewComposite.getTableViewerCreator() != null) {
ModulesViewComposite.getTableViewerCreator().getTable().addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
@Override
public void widgetSelected(SelectionEvent e) {
modules.clear();
TableItem[] selection = ModulesViewComposite.getTableViewerCreator().getTable().getSelection();
for (TableItem tableItem : selection) {
ModuleNeeded needed = (ModuleNeeded) tableItem.getData();
if (ModuleNeeded.UNKNOWN.equals(needed.getContext())) {
modules.add(needed);
} else {
setEnabled(false);
return;
}
}
setEnabled(true);
}
});
setEnabled(false);
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
@Override
public void run() {
for (ModuleNeeded module : modules) {
try {
LibManagerUiPlugin.getDefault().getLibrariesService().undeployLibrary(module.getModuleName());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
// no use since use maven
// if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
// IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
// IRunProcessService.class);
// ITalendProcessJavaProject talendProcessJavaProject = processService.getTalendProcessJavaProject();
// if (talendProcessJavaProject != null) {
// IJavaProject javaProject = talendProcessJavaProject.getJavaProject();
// List<IClasspathEntry> projectLibraries = new ArrayList<IClasspathEntry>();
// try {
// IClasspathEntry[] resolvedClasspath = javaProject.getResolvedClasspath(true);
// projectLibraries.addAll(Arrays.asList(resolvedClasspath));
// for (ModuleNeeded module : modules) {
// IClasspathEntry foundEntry = null;
// for (IClasspathEntry entry : resolvedClasspath) {
// if (entry.getPath().toPortableString().contains(module.getModuleName())) {
// foundEntry = entry;
// break;
// }
// }
// if (foundEntry != null) {
// projectLibraries.remove(foundEntry);
// }
// }
// javaProject.setRawClasspath(projectLibraries.toArray(new IClasspathEntry[projectLibraries.size()]),
// null);
// setEnabled(false);
// } catch (JavaModelException e) {
// ExceptionHandler.process(e);
// }
// }
// }
}
});
}
}

View File

@@ -1,110 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.librariesmanager.ui.actions;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.talend.commons.ui.runtime.image.ECoreImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.IRepositoryArtifactHandler;
import org.talend.core.nexus.RepositoryArtifactHandlerManager;
import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.librariesmanager.ui.i18n.Messages;
import org.talend.librariesmanager.ui.startup.ShareLibsJob;
/*
* Created by bhe on Dec 17, 2020
*/
public class ShareLibsAction extends Action {
public ShareLibsAction() {
super();
this.setText(Messages.getString("Module.view.sharelibsAction.title")); //$NON-NLS-1$
this.setDescription(Messages.getString("Module.view.sharelibsAction.title")); //$NON-NLS-1$
this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.SHARE_LIBS));
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
ShareLibsJob job = new ShareLibsJob();
job.addJobChangeListener(new IJobChangeListener() {
@Override
public void scheduled(IJobChangeEvent event) {
ShareLibsAction.this.setEnabled(false);
}
@Override
public void running(IJobChangeEvent event) {
ShareLibsAction.this.setEnabled(false);
}
@Override
public void done(IJobChangeEvent event) {
ShareLibsAction.this.setEnabled(true);
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
MessageDialog.open(MessageDialog.INFORMATION, Display.getDefault().getActiveShell(), "",
Messages.getString("Module.view.sharelibsAction.info"), SWT.NONE);
}
});
}
@Override
public void awake(IJobChangeEvent event) {
ShareLibsAction.this.setEnabled(false);
}
@Override
public void aboutToRun(IJobChangeEvent event) {
ShareLibsAction.this.setEnabled(false);
}
@Override
public void sleeping(IJobChangeEvent event) {
ShareLibsAction.this.setEnabled(false);
}
});
job.schedule();
}
public boolean show() {
boolean ret = false;
try {
ArtifactRepositoryBean customNexusServer = TalendLibsServerManager.getInstance().getCustomNexusServer();
IRepositoryArtifactHandler customerRepHandler = RepositoryArtifactHandlerManager
.getRepositoryHandler(customNexusServer);
if (customerRepHandler != null) {
ret = customerRepHandler.checkConnection();
}
} catch (Exception e) {
}
return ret;
}
}

View File

@@ -1,67 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.librariesmanager.ui.startup;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.MojoType;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.nexus.TalendMavenResolver;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.librariesmanager.ui.i18n.Messages;
/*
* Created by bhe on Dec 24, 2020
*/
public class ShareCIJarsOnStartup extends ShareMavenArtifactsOnStartup {
@Override
public Map<ModuleNeeded, File> getFilesToShare(IProgressMonitor monitor) {
SubMonitor mainSubMonitor = SubMonitor.convert(monitor, 1);
mainSubMonitor.setTaskName(Messages.getString("ShareLibsJob.getFilesToShare")); //$NON-NLS-1$
Map<ModuleNeeded, File> files = new HashMap<>();
// get plugin artifacts to share
Stream.of(MojoType.values()).forEach(m -> {
String mvnUrl = MavenUrlHelper.generateMvnUrl(TalendMavenConstants.DEFAULT_CI_GROUP_ID, m.getArtifactId(),
VersionUtils.getMojoVersion(m), null, null);
// try to resolve locally
String localMvnUrl = mvnUrl.replace(MavenUrlHelper.MVN_PROTOCOL,
MavenUrlHelper.MVN_PROTOCOL + MavenConstants.LOCAL_RESOLUTION_URL + MavenUrlHelper.REPO_SEPERATOR);
File file = null;
try {
file = TalendMavenResolver.resolve(localMvnUrl);
} catch (IOException | RuntimeException e) {
ExceptionHandler.process(e);
}
if (file != null) {
ModuleNeeded module = new ModuleNeeded("", mvnUrl, "", true);
files.put(module, file);
}
});
mainSubMonitor.worked(1);
return files;
}
}

View File

@@ -1,37 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.librariesmanager.ui.startup;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;
/*
* Created by bhe on Dec 24, 2020
*/
public class ShareCILibsJob extends Job {
/**
* @param name
*/
public ShareCILibsJob() {
super("");
}
@Override
protected IStatus run(IProgressMonitor monitor) {
ShareCIJarsOnStartup task = new ShareCIJarsOnStartup();
return task.shareLibs(this, monitor);
}
}

View File

@@ -22,6 +22,10 @@ import org.eclipse.core.runtime.jobs.Job;
*/
public class ShareLibsJob extends Job {
private final String TYPE_NEXUS = "nexus";
private final String TYPE_SVN = "svn";
/**
* DOC Talend ShareLibsJob constructor comment.
*

View File

@@ -14,17 +14,12 @@ package org.talend.librariesmanager.ui.startup;
import org.eclipse.ui.IStartup;
import java.util.logging.Logger;
import org.talend.librariesmanager.prefs.LibrariesManagerUtils;
/**
* created by wchen on 2015-6-15 Detailled comment
*
*/
public class ShareLibsSynchronizer implements IStartup {
private static final Logger LOGGER = Logger.getLogger(ShareLibsSynchronizer.class.getCanonicalName());
/*
* (non-Javadoc)
*
@@ -32,16 +27,8 @@ public class ShareLibsSynchronizer implements IStartup {
*/
@Override
public void earlyStartup() {
// share ci jars anyway
ShareCILibsJob ciJob = new ShareCILibsJob();
ciJob.schedule();
if (LibrariesManagerUtils.shareLibsAtStartup()) {
ShareLibsJob job = new ShareLibsJob();
job.schedule();
} else {
LOGGER.info("Skip sharing libraries");
}
ShareLibsJob job = new ShareLibsJob();
job.schedule();
}
}

View File

@@ -91,6 +91,25 @@ public class ShareMavenArtifactsOnStartup extends ShareLibrareisHelper {
}
}
// get plugin artifacts to share
Stream.of(MojoType.values()).forEach(m -> {
String mvnUrl = MavenUrlHelper.generateMvnUrl(TalendMavenConstants.DEFAULT_CI_GROUP_ID, m.getArtifactId(),
VersionUtils.getMojoVersion(m), null, null);
// try to resolve locally
String localMvnUrl = mvnUrl.replace(MavenUrlHelper.MVN_PROTOCOL,
MavenUrlHelper.MVN_PROTOCOL + MavenConstants.LOCAL_RESOLUTION_URL + MavenUrlHelper.REPO_SEPERATOR);
File file = null;
try {
file = TalendMavenResolver.resolve(localMvnUrl);
} catch (IOException | RuntimeException e) {
ExceptionHandler.process(e);
}
if (file != null) {
ModuleNeeded module = new ModuleNeeded("", mvnUrl, "", true);
files.put(module, file);
}
});
mainSubMonitor.worked(1);
return files;
}

View File

@@ -31,7 +31,7 @@ import org.talend.librariesmanager.ui.actions.DownloadExternalJarAction;
import org.talend.librariesmanager.ui.actions.ExportCustomSettingsAction;
import org.talend.librariesmanager.ui.actions.ImportCustomSettingsAction;
import org.talend.librariesmanager.ui.actions.ImportExternalJarAction;
import org.talend.librariesmanager.ui.actions.ShareLibsAction;
import org.talend.librariesmanager.ui.actions.RemoveExternalJarAction;
/**
* DOC nrousseau class global comment. Detailled comment <br/>
@@ -129,16 +129,12 @@ public class ModulesView extends ViewPart {
manager.add(importSettingAction);
ExportCustomSettingsAction exportSettingAction = new ExportCustomSettingsAction();
manager.add(exportSettingAction);
RemoveExternalJarAction removeAction = new RemoveExternalJarAction();
manager.add(removeAction);
ImportExternalJarAction importAction = new ImportExternalJarAction();
manager.add(importAction);
DownloadExternalJarAction downloadAcion = new DownloadExternalJarAction(this);
manager.add(downloadAcion);
ShareLibsAction shareAction = new ShareLibsAction();
if (shareAction.show()) {
manager.add(shareAction);
}
return;
}

View File

@@ -16,8 +16,6 @@ import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.lang.String;
import java.util.Dictionary;
public final class BundleUtils {
@@ -63,23 +61,6 @@ public final class BundleUtils {
}
}
public static Object getService(String svcClass) {
if (BUNDLE == null) {
return null;
}
try {
Method getBundleContext = BUNDLE.getClass().getMethod("getBundleContext");
Object context = getBundleContext.invoke(BUNDLE);
Class<?> ctxClass = context.getClass();
Method getServiceReference = ctxClass.getMethod("getServiceReference", String.class);
Object serviceReference = getServiceReference.invoke(context, svcClass);
Method getService = ctxClass.getMethod("getService", SERVICE_REFERENCE_CLASS);
return (Object)getService.invoke(context, serviceReference);
} catch (Exception e) {
return null;
}
}
public static <T> T getService(Class<T> svcClass, Object bundleContext) {
if (BUNDLE_CONTEXT_CLASS == null || bundleContext == null) {
return null;
@@ -121,25 +102,7 @@ public final class BundleUtils {
return services;
}
}
public static Dictionary<String, Object> getJobProperties(String jobName) {
try {
Object configAdminObject = getService("org.osgi.service.cm.ConfigurationAdmin");
Method getConfigurationMethod = configAdminObject.getClass().getMethod("getConfiguration", String.class);
Object configAdminJobConfiguration = getConfigurationMethod.invoke(configAdminObject, jobName);
Method getPropertiesMethod = configAdminJobConfiguration.getClass().getMethod("getProperties", null);
Dictionary<String, Object> jobProperties = (Dictionary<String, Object>)getPropertiesMethod.invoke(configAdminJobConfiguration, null);
return jobProperties;
} catch(Exception e) {
return null;
}
}
public static boolean inOSGi() {
return BUNDLE != null;

View File

@@ -1,23 +0,0 @@
<%
EXTRACT(__GROUPBY__);
EXTRACT(__OPERATION__);
String operation = "";
boolean flag=false;
for(int i=0; i < __OPERATION_INPUT_COLUMN__.length; i++){
if(flag){
operation += ",";
}else{
flag=true;
}
if (__OPERATION_FUNCTION__[i]!= null && __OPERATION_FUNCTION__[i].indexOf("@COLUMN") != -1) {
operation += __OPERATION_FUNCTION__[i].replaceAll("@COLUMN", __OPERATION_INPUT_COLUMN__[i]);
} else {
operation += (__OPERATION_FUNCTION__[i] + "(" + __OPERATION_INPUT_COLUMN__[i] + ")");
}
}
%>
INSERT INTO <%=__DATABASE_NAME__%>.<%=__TABLE_NAME_TARGET__%>
SELECT <%= operation %>, <%= StringUtils.list(__GROUPBY_INPUT_COLUMN__, ",") %> FROM <%=__DATABASE_NAME__%>.<%= __TABLE_NAME__ %>
GROUP BY <%=StringUtils.list(__GROUPBY_INPUT_COLUMN__, ",", "", "") %>;

View File

@@ -1,29 +0,0 @@
<%
EXTRACT(__SCHEMA__);
String fieldsCreated = "";
boolean flagCreated=false;
for(int i=0; i < __SCHEMA__.length; i++){
if(flagCreated){
fieldsCreated += ",";
}else{
flagCreated=true;
}
if(__SCHEMA_DBTYPE__[i].contains("VARCHAR")) {
__SCHEMA_DBTYPE__[i] = "STRING";
}
if( __SCHEMA_DBTYPE__[i].equals("DECIMAL")){
fieldsCreated += (__SCHEMA_NAME__[i] + " " + __SCHEMA_DBTYPE__[i] +" ("+ __SCHEMA_LENGTH__[i] +","+ __SCHEMA_PRECISION__[i] +") ");
} else {
fieldsCreated += (__SCHEMA_NAME__[i] + " " + __SCHEMA_DBTYPE__[i]);
}
if(__SCHEMA_NULLABLE__[i].equals("false")){
fieldsCreated += " NOT NULL";
}
}
%>
CREATE TABLE <%=__DATABASE_NAME__%>.<%= __TABLE_NAME__ %>
(
<%= fieldsCreated %>
) USING DELTA;

View File

@@ -1,29 +0,0 @@
<%
EXTRACT(__SCHEMA__);
String fieldsCreated = "";
boolean flagCreated=false;
for(int i=0; i < __SCHEMA__.length; i++){
if(flagCreated){
fieldsCreated += ",";
}else{
flagCreated=true;
}
if(__SCHEMA_DBTYPE__[i].contains("VARCHAR")) {
__SCHEMA_DBTYPE__[i] = "STRING";
}
if( __SCHEMA_DBTYPE__[i].equals("DECIMAL")){
fieldsCreated += (__SCHEMA_NAME__[i] + " " + __SCHEMA_DBTYPE__[i] +" ("+ __SCHEMA_LENGTH__[i] +","+ __SCHEMA_PRECISION__[i] +") ");
} else {
fieldsCreated += (__SCHEMA_NAME__[i] + " " + __SCHEMA_DBTYPE__[i]);
}
if(__SCHEMA_NULLABLE__[i].equals("false")){
fieldsCreated += " NOT NULL";
}
}
%>
CREATE TABLE <%=__DATABASE_NAME__%>.<%= __TABLE_NAME__ %>
(
<%= fieldsCreated %>
);

View File

@@ -1,2 +0,0 @@
-- DROP SOURCE TABLE
DROP TABLE <%=__DATABASE_NAME__%>.<%= __TABLE_NAME__ %>;

View File

@@ -1,15 +0,0 @@
<%
EXTRACT(__TABLE_SCHEMA__);
String fields = "";
boolean flag=false;
for(int i=0; i < __TABLE_SCHEMA_LENGTH__; i++){
if(__TABLE_SCHEMA_KEY_ATTRIBUTE__[i].equals("true")){
fields += __TABLE_SCHEMA_SCHEMA_COLUMN__[i] +",";
}
}
if(!fields.equals("") && fields.length()>0){
fields = fields.substring(0,fields.length()-1);
}
%>
INSERT INTO <%=__DATABASE_NAME__%>.<%=__TABLE_NAME_TARGET__%>
SELECT <%= fields %> FROM <%=__DATABASE_NAME__%>.<%= __TABLE_NAME__ %>;

View File

@@ -1,7 +0,0 @@
<%
EXTRACT(__SCHEMA__);
EXTRACT(__SCHEMA_TARGET__);
%>
INSERT INTO <%=__DATABASE_NAME__%>.<%=__TABLE_NAME_TARGET__%>
SELECT <%= StringUtils.list(__SCHEMA_NAME__, ",") %> FROM <%=__DATABASE_NAME__%>.<%= __TABLE_NAME__ %>
WHERE <%=__WHERE_CLAUSE__%>;

View File

@@ -1,101 +0,0 @@
-- This pattern generates a merge statement for Snowflake
--(c) 2019 Talend Inc.
<%
EXTRACT(__MERGE_ON__);
EXTRACT(__UPDATE_MAPPING__);
EXTRACT(__ADDITIONAL_UPDATE_COLUMNS__);
EXTRACT(__INSERT_MAPPING__);
EXTRACT(__ADDITIONAL_INSERT_COLUMNS__);
String dbType = "__DBTYPE__";
boolean hasUpdateClause = __USE_UPDATE__;
boolean hasAddtionalUpdateColumns = __SPECIFY_ADDITIONAL_UPDATE_COLUMNS__;
boolean hasUpdateWhereClause = __SPECIFY_UPDATE_WHERE_CLAUSE__;
boolean hasInsertClause = __USE_INSERT__;
boolean hasAdditionalInsertColumns = __SPECIFY_ADDITIONAL_INSERT_COLUMNS__;
boolean hasInsertWhereClause = __SPECIFY_INSERT_WHERE_CLAUSE__;
boolean flag = false;
String mergeOnStr = "";
for(int i=0; i < __MERGE_ON_SRC_COLUMN__.length; i++){
if (flag) {
mergeOnStr += " AND ";
} else {
flag = true;
}
mergeOnStr += (__TARGET_TABLE__ + "." + __MERGE_ON_TRG_COLUMN__[i] + " = " + __SOURCE_TABLE__ + "." + __MERGE_ON_SRC_COLUMN__[i]);
}
String updateStr = "";
String updateWhereStr = "";
flag = false;
if (hasUpdateClause) {
for(int i=0; i < __UPDATE_MAPPING_SRC_COLUMN__.length; i++) {
if (flag) {
updateStr += ",";
} else {
flag = true;
}
updateStr += (__TARGET_TABLE__ + "." + __UPDATE_MAPPING_TRG_COLUMN__[i] + " = " + __SOURCE_TABLE__ + "." + __UPDATE_MAPPING_SRC_COLUMN__[i]);
}
if (hasAddtionalUpdateColumns) {
for(int i=0; i < __ADDITIONAL_UPDATE_COLUMNS_TRG_COLUMN_VALUE__.length; i++) {
if (flag) {
updateStr += ",";
} else {
flag = true;
}
updateStr += (__TARGET_TABLE__ + "." + __ADDITIONAL_UPDATE_COLUMNS_TRG_COLUMN_NAME__[i] + " = " + __ADDITIONAL_UPDATE_COLUMNS_TRG_COLUMN_VALUE__[i]);
}
}
if (hasUpdateWhereClause) {
updateWhereStr = " " + __UPDATE_WHERE_CLAUSE__ + " ";
}
}
String insertColumnsStr = "";
String insertValuesStr = "";
String insertWhereStr = "";
String insertStr = "";
flag = false;
if (hasInsertClause) {
for(int i=0; i < __INSERT_MAPPING_TRG_COLUMN__.length; i++) {
if (flag) {
insertColumnsStr += ",";
insertValuesStr += ",";
} else {
flag = true;
}
insertColumnsStr += (__TARGET_TABLE__ + "." + __INSERT_MAPPING_TRG_COLUMN__[i]);
insertValuesStr += (__SOURCE_TABLE__ + "." + __INSERT_MAPPING_SRC_COLUMN__[i]);
}
if (hasAdditionalInsertColumns) {
for(int i=0; i < __ADDITIONAL_INSERT_COLUMNS_TRG_COLUMN_NAME__.length; i++) {
if (flag) {
insertColumnsStr += ",";
insertValuesStr += ",";
} else {
flag = true;
}
insertColumnsStr += (__TARGET_TABLE__ + "." + __ADDITIONAL_INSERT_COLUMNS_TRG_COLUMN_NAME__[i]);
insertValuesStr += (__ADDITIONAL_INSERT_COLUMNS_TRG_COLUMN_VALUE__[i]);
}
}
if (hasInsertWhereClause) {
insertWhereStr = " " + __INSERT_WHERE_CLAUSE__ + " ";
}
insertStr = "(" + insertColumnsStr + ") VALUES (" + insertValuesStr + ")";
}
String mergeString = "";
if (hasInsertClause || hasUpdateClause) {
mergeString = "MERGE INTO " + __TARGET_TABLE__ + " USING " + __SOURCE_TABLE__ +
" ON (" + mergeOnStr + ")" +
(hasUpdateClause ? (" WHEN MATCHED " + (hasUpdateWhereClause ? ("AND " + updateWhereStr) : "") + " THEN UPDATE SET " + updateStr) : "") +
(hasInsertClause ? (" WHEN NOT MATCHED " + (hasInsertWhereClause ? ("AND " + insertWhereStr) : "") + " THEN INSERT " + insertStr) : "");
} else {
mergeString = "DELETE FROM " + __TARGET_TABLE__ + " WHERE 1=0";
}
%>
<%=mergeString%>;

View File

@@ -54,112 +54,114 @@ public abstract class ShareLibrareisHelper {
// deploy to maven if needed and share to custom nexus
try {
setJobName(job, Messages.getString("ShareLibsJob.message", TYPE_NEXUS));
Map<String, List<MavenArtifact>> snapshotArtifactMap = new HashMap<String, List<MavenArtifact>>();
Map<String, List<MavenArtifact>> releaseArtifactMap = new HashMap<String, List<MavenArtifact>>();
ArtifactRepositoryBean customNexusServer = TalendLibsServerManager.getInstance().getCustomNexusServer();
IRepositoryArtifactHandler customerRepHandler = RepositoryArtifactHandlerManager
.getRepositoryHandler(customNexusServer);
if (customerRepHandler != null) {
filesToShare = getFilesToShare(monitor);
if (filesToShare == null) {
return Status.CANCEL_STATUS;
}
ArtifactRepositoryBean proxyServer = TalendLibsServerManager.getInstance().getProxyArtifactServer();
IRepositoryArtifactHandler proxyArtifactHandler = RepositoryArtifactHandlerManager.getRepositoryHandler(proxyServer);
if (customerRepHandler == null) {
return Status.CANCEL_STATUS;
}
filesToShare = getFilesToShare(monitor);
if (filesToShare == null || filesToShare.isEmpty()) {
return Status.CANCEL_STATUS;
}
// collect groupId to search
Set<String> snapshotGroupIdSet = new HashSet<String>();
Set<String> releaseGroupIdSet = new HashSet<String>();
checkCancel(monitor);
for (ModuleNeeded module : filesToShare.keySet()) {
checkCancel(monitor);
if (module.getMavenUri() != null) {
MavenArtifact parseMvnUrl = MavenUrlHelper.parseMvnUrl(module.getMavenUri());
if (parseMvnUrl != null) {
if (isSnapshotVersion(parseMvnUrl.getVersion())) {
snapshotGroupIdSet.add(parseMvnUrl.getGroupId());
} else {
releaseGroupIdSet.add(parseMvnUrl.getGroupId());
// collect groupId to search
Set<String> groupIds = new HashSet<String>();
Map<String, List<MavenArtifact>> snapshotArtifactMap = new HashMap<String, List<MavenArtifact>>();
Map<String, List<MavenArtifact>> releaseArtifactMap = new HashMap<String, List<MavenArtifact>>();
Set<String> snapshotGroupIdSet = new HashSet<String>();
Set<String> releaseGroupIdSet = new HashSet<String>();
for (ModuleNeeded module : filesToShare.keySet()) {
checkCancel(monitor);
if (module.getMavenUri() != null) {
MavenArtifact parseMvnUrl = MavenUrlHelper.parseMvnUrl(module.getMavenUri());
if (parseMvnUrl != null) {
groupIds.add(parseMvnUrl.getGroupId());
if (isSnapshotVersion(parseMvnUrl.getVersion())) {
snapshotGroupIdSet.add(parseMvnUrl.getGroupId());
} else {
releaseGroupIdSet.add(parseMvnUrl.getGroupId());
}
}
}
}
}
// search from custom artifact repositories if any
seachArtifacts(monitor, customerRepHandler, snapshotArtifactMap, releaseArtifactMap, snapshotGroupIdSet,
releaseGroupIdSet);
try {
// search from proxy artifact repository if any
seachArtifacts(monitor, proxyArtifactHandler, snapshotArtifactMap, releaseArtifactMap, snapshotGroupIdSet,
releaseGroupIdSet);
} catch (Exception e) {
ExceptionHandler.process(e);
}
checkCancel(monitor);
Iterator<ModuleNeeded> iterator = filesToShare.keySet().iterator();
Map<File, MavenArtifact> shareFiles = new HashMap<>();
while (iterator.hasNext()) {
checkCancel(monitor);
ModuleNeeded next = iterator.next();
File file = filesToShare.get(next);
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(next.getMavenUri());
if (artifact == null) {
continue;
}
// If from custom component definition file
if (LocalLibraryManager.isSystemCacheFile(file.getName())
|| (LocalLibraryManager.isComponentDefinitionFileType(file.getName())
&& isTalendLibraryGroupId(artifact))) {
continue;
}
try {
Integer.parseInt(artifact.getType());
// FIXME unexpected type if it's an integer, should fix it in component module definition.
continue;
} catch (NumberFormatException e) {
//
}
boolean isSnapshotVersion = isSnapshotVersion(artifact.getVersion());
String key = ShareLibrariesUtil.getArtifactKey(artifact, isSnapshotVersion);
List<MavenArtifact> artifactList = null;
if (isSnapshotVersion) {
artifactList = snapshotArtifactMap.get(key);
} else {
artifactList = releaseArtifactMap.get(key);
// skip checksum for release artifact.
if (artifactList != null && artifactList.contains(artifact)
&& !Boolean.getBoolean("force_libs_release_update")) {
continue;
List<MavenArtifact> searchResults = new ArrayList<MavenArtifact>();
for (String groupId : groupIds) {
checkCancel(monitor);
if (releaseGroupIdSet.contains(groupId)) {
searchResults = customerRepHandler.search(groupId, null, null, true, false);
if (searchResults != null) {
for (MavenArtifact result : searchResults) {
checkCancel(monitor);
ShareLibrariesUtil.putArtifactToMap(result, releaseArtifactMap, false);
}
}
}
checkCancel(monitor);
if (snapshotGroupIdSet.contains(groupId)) {
searchResults = customerRepHandler.search(groupId, null, null, false, true);
if (searchResults != null) {
for (MavenArtifact result : searchResults) {
checkCancel(monitor);
ShareLibrariesUtil.putArtifactToMap(result, snapshotArtifactMap, true);
}
}
}
}
if (artifactList != null && artifactList.size() > 0) {
if (ShareLibrariesUtil.isSameFileWithRemote(file, artifactList, customNexusServer, customerRepHandler,
isSnapshotVersion)) {
Iterator<ModuleNeeded> iterator = filesToShare.keySet().iterator();
Map<File, MavenArtifact> shareFiles = new HashMap<>();
while (iterator.hasNext()) {
checkCancel(monitor);
ModuleNeeded next = iterator.next();
File file = filesToShare.get(next);
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(next.getMavenUri());
if (artifact == null) {
continue;
}
// If from custom component definition file
if (LocalLibraryManager.isSystemCacheFile(file.getName())
|| (LocalLibraryManager.isComponentDefinitionFileType(file.getName())
&& isTalendLibraryGroupId(artifact))) {
continue;
}
try {
Integer.parseInt(artifact.getType());
// FIXME unexpected type if it's an integer, should fix it in component module definition.
continue;
} catch (NumberFormatException e) {
//
}
boolean isSnapshotVersion = isSnapshotVersion(artifact.getVersion());
String key = ShareLibrariesUtil.getArtifactKey(artifact, isSnapshotVersion);
List<MavenArtifact> artifactList = null;
if (isSnapshotVersion) {
artifactList = snapshotArtifactMap.get(key);
} else {
artifactList = releaseArtifactMap.get(key);
// skip checksum for release artifact.
if (artifactList != null && artifactList.contains(artifact)
&& !Boolean.getBoolean("force_libs_release_update")) {
continue;
}
}
if (artifactList != null && artifactList.size() > 0) {
if (ShareLibrariesUtil.isSameFileWithRemote(file, artifactList, customNexusServer, customerRepHandler,
isSnapshotVersion)) {
continue;
}
}
shareFiles.put(file, artifact);
}
shareFiles.put(file, artifact);
}
SubMonitor mainSubMonitor = SubMonitor.convert(monitor, shareFiles.size());
for (Map.Entry<File, MavenArtifact> entry : shareFiles.entrySet()) {
checkCancel(monitor);
try {
File k = entry.getKey();
MavenArtifact v = entry.getValue();
mainSubMonitor.setTaskName(Messages.getString("ShareLibsJob.sharingLibraries", k.getName()));
shareToRepository(k, v);
mainSubMonitor.worked(1);
} catch (Exception e) {
ExceptionHandler.process(e);
SubMonitor mainSubMonitor = SubMonitor.convert(monitor, shareFiles.size());
for (Map.Entry<File, MavenArtifact> entry : shareFiles.entrySet()) {
checkCancel(monitor);
try {
File k = entry.getKey();
MavenArtifact v = entry.getValue();
mainSubMonitor.setTaskName(Messages.getString("ShareLibsJob.sharingLibraries", k.getName()));
shareToRepository(k, v);
mainSubMonitor.worked(1);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
} catch (InterruptedException e) {
@@ -173,38 +175,6 @@ public abstract class ShareLibrareisHelper {
}
/**
* Search artifacts based on given snapshotGroupIdSet and releaseGroupIdSet from remote artifact repositories
* represented by artifactHandler, the search results are put to snapshotArtifactMap and releaseArtifactMap
*/
protected void seachArtifacts(IProgressMonitor monitor, IRepositoryArtifactHandler artifactHandler,
Map<String, List<MavenArtifact>> snapshotArtifactMap, Map<String, List<MavenArtifact>> releaseArtifactMap,
Set<String> snapshotGroupIdSet, Set<String> releaseGroupIdSet) throws Exception {
if (artifactHandler != null) {
checkCancel(monitor);
List<MavenArtifact> searchResults = new ArrayList<MavenArtifact>();
for (String groupId : releaseGroupIdSet) {
searchResults = artifactHandler.search(groupId, null, null, true, false);
if (searchResults != null) {
for (MavenArtifact result : searchResults) {
checkCancel(monitor);
ShareLibrariesUtil.putArtifactToMap(result, releaseArtifactMap, false);
}
}
}
checkCancel(monitor);
for (String groupId : snapshotGroupIdSet) {
searchResults = artifactHandler.search(groupId, null, null, false, true);
if (searchResults != null) {
for (MavenArtifact result : searchResults) {
checkCancel(monitor);
ShareLibrariesUtil.putArtifactToMap(result, snapshotArtifactMap, true);
}
}
}
}
}
private boolean isTalendLibraryGroupId(MavenArtifact artifact) {
if ("org.talend.libraries".equalsIgnoreCase(artifact.getGroupId())) {
return true;

View File

@@ -714,9 +714,11 @@ public class ModulesNeededProvider {
isRequired);
toAdd.setMavenUri(currentImport.getMVN());
if (!isRequired) {
toAdd.getExtraAttributes().put("IS_OSGI_EXCLUDED", Boolean.TRUE);
if ("BeanItem".equals(routine.eClass().getName())) {
toAdd.getExtraAttributes().put("IS_OSGI_EXCLUDED", Boolean.TRUE);
}
if ("RoutineItem".equals(routine.eClass().getName())) {
toAdd.setExcluded(true);
continue;
}
}
// toAdd.setStatus(ELibraryInstallStatus.INSTALLED);

View File

@@ -28,6 +28,7 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -60,10 +61,25 @@ public class CustomUriManager {
private final Object reloadingLock = new Object();
private CustomUriManager() {
IFolder resourcePath = getResourcePath();
try {
customURIObject = loadResources(getResourcePath(), RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
Assert.isNotNull(resourcePath);
customURIObject = loadResources(resourcePath, RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
} catch (Exception e) {
ExceptionHandler.process(e);
try {
if (resourcePath != null) {
customURIObject = loadResources(resourcePath.getLocation().toPortableString(),
RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
}
} catch (Exception e1) {
ExceptionHandler.process(e1);
/**
* Seems dangrous to load an empty json here, because it may overwrite the existing one
*/
// customURIObject = new JSONObject();
}
}
}
@@ -263,10 +279,14 @@ public class CustomUriManager {
public void reloadCustomMapping() {
try {
if (isNeedReload) {
if (isNeedReload || customURIObject == null) {
synchronized (reloadingLock) {
if (isNeedReload) {
customURIObject.clear();
if (isNeedReload || customURIObject == null) {
if (customURIObject == null) {
customURIObject = new JSONObject();
} else {
customURIObject.clear();
}
JSONObject loadResources = loadResources(getResourcePath(),
RepositoryConstants.PROJECT_SETTINGS_CUSTOM_URI_MAP);
customURIObject.putAll(loadResources);

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