Compare commits

..

5 Commits

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

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

View File

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

View File

@@ -9,7 +9,4 @@
</parent>
<artifactId>org.talend.utils.feature</artifactId>
<packaging>eclipse-feature</packaging>
<properties>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>
</project>

View File

@@ -4,6 +4,4 @@ bin.includes = META-INF/,\
plugin.xml,\
icons/,\
icons1/,\
.,\
resources/
.

View File

@@ -1,17 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.e4.ui.css.swt.theme">
<stylesheet
uri="resources/theme/light_preferencestyle.css">
<themeid
refid="org.talend.themes.css.talend.default"></themeid>
</stylesheet>
<stylesheet
uri="resources/theme/dark_preferencestyle.css">
<themeid
refid="org.eclipse.e4.ui.css.theme.e4_dark"></themeid>
</stylesheet>
</extension>
</plugin>

View File

@@ -1,8 +0,0 @@
/* ############################## Eclipse UI properties ############################## */
IEclipsePreferences#org-talend-common-ui-runtime:org-talend-common-ui-runtime { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */
preferences:
'table.background=#org-eclipse-ui-workbench-DARK_BACKGROUND'
'table.foreground=#org-eclipse-ui-workbench-DARK_FOREGROUND'
}

View File

@@ -1,8 +0,0 @@
/* ############################## Eclipse UI properties ############################## */
IEclipsePreferences#org-talend-common-ui-runtime:org-talend-common-ui-runtime { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */
preferences:
'table.background=COLOR-LIST-BACKGROUND'
'table.foreground=COLOR_LIST_FOREGROUND'
}

View File

@@ -12,22 +12,14 @@
// ============================================================================
package org.talend.commons.ui.runtime;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
/**
* DOC cmeng class global comment. Detailled comment
*/
public interface ColorConstants {
static final String BUNDLE_ID_COMMON_UI_RUNTIME = "org.talend.common.ui.runtime";
static final String KEY_TABLE_BACKGROUND = "table.background";
static final String KEY_TABLE_FOREGROUND = "table.foreground";
static final Color WHITE_COLOR = new Color(null, 255, 255, 255);
static final Color GREY_COLOR = new Color(null, 215, 215, 215);
@@ -37,8 +29,6 @@ public interface ColorConstants {
static final Color YELLOW_COLOR = new Color(null, 255, 173, 37);// 254, 182, 84
static final Color RED_COLOR = new Color(null, new RGB(204, 87, 89));// 255
static final Color ERROR_FONT_COLOR = new Color(null, new RGB(255, 0, 0));// 255
static final Color VERTICAL_SEPERATOR_LINE_COLOR = new Color(null, 162, 179, 195);
@@ -55,14 +45,4 @@ public interface ColorConstants {
static final Color SUCCEED_COLOR = new Color(null, 221, 242, 217);
static Color getTableBackgroundColor() {
return ITalendThemeService.getColor(ColorConstants.BUNDLE_ID_COMMON_UI_RUNTIME, ColorConstants.KEY_TABLE_BACKGROUND)
.orElse(WHITE_COLOR);
}
static Color getTableForegroundColor() {
return ITalendThemeService.getColor(ColorConstants.BUNDLE_ID_COMMON_UI_RUNTIME, ColorConstants.KEY_TABLE_FOREGROUND)
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
}
}

View File

@@ -23,8 +23,6 @@ import org.talend.commons.ui.runtime.exception.ExceptionServiceImpl;
public class CommonUIPlugin implements BundleActivator {
public static String BUNDLE_ID = "org.talend.common.ui.runtime";
private static Boolean fullyHeadless = null;
/*

View File

@@ -1,149 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.ui.runtime;
import java.util.Optional;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.swt.graphics.Color;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
import org.talend.commons.exception.ExceptionHandler;
/**
* DOC cmeng class global comment. Detailled comment
*/
public interface ITalendThemeService {
public static String DEFAULT_PREFERENCE_ID = "org.eclipse.ui.workbench";
/**
* Get color from instance scope preference of default bundleId, which managed by theme; the standard way eclipse
* uses
*
* @param prop
* @return the Color, <font color="red">please <b>DON'T</b> dispose it, it is managed by JFaceResources</font>
*/
static Optional<Color> getColor(String prop) {
return getColor(DEFAULT_PREFERENCE_ID, prop);
}
/**
* Get color from instance scope preference of bundleId, which managed by theme; the standard way eclipse uses
*
* @param bundleId the instance scope preference which stores the prop
* @param prop
* @return the Color, <font color="red">please <b>DON'T</b> dispose it, it is managed by JFaceResources</font>
*/
static Optional<Color> getColor(String bundleId, String prop) {
ITalendThemeService theme = get();
if (theme != null) {
return Optional.ofNullable(theme.getColorForTheme(bundleId, prop));
}
return Optional.ofNullable(null);
}
Color getColorForTheme(String bundleId, String prop);
/**
* Get property from instance scope preference of default bundleId, which managed by theme; the standard way eclipse
* uses
*
* @param key
* @return
*/
static Optional<String> getProperty(String key) {
return getProperty(DEFAULT_PREFERENCE_ID, key);
}
/**
* Get property from instance scope preference of bundleId, which managed by theme; the standard way eclipse uses
*
* @param bundleId the instance scope preference which stores the key
* @param key
* @return
*/
static Optional<String> getProperty(String bundleId, String key) {
ITalendThemeService theme = get();
String value = null;
if (theme != null) {
value = theme.getPropertyForTheme(bundleId, key);
}
if (StringUtils.isBlank(value)) {
return Optional.ofNullable(null);
} else {
return Optional.ofNullable(value);
}
}
String getPropertyForTheme(String bundleId, String key);
static void addPropertyChangeListener(IPropertyChangeListener listener) {
ITalendThemeService theme = get();
if (theme != null) {
theme.addPropertyChangeListenerFor(DEFAULT_PREFERENCE_ID, listener);
}
}
static void addPropertyChangeListener(String bundleId, IPropertyChangeListener listener) {
ITalendThemeService theme = get();
if (theme != null) {
theme.addPropertyChangeListenerFor(bundleId, listener);
}
}
void addPropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
static boolean containsPropertyChangeListener(String bundleId, IPropertyChangeListener listener) {
ITalendThemeService theme = get();
if (theme != null) {
return theme.containsPropertyChangeListenerFor(bundleId, listener);
}
return false;
}
boolean containsPropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
static void removePropertyChangeListener(IPropertyChangeListener listener) {
ITalendThemeService theme = get();
if (theme != null) {
theme.removePropertyChangeListenerFor(DEFAULT_PREFERENCE_ID, listener);
}
}
static void removePropertyChangeListener(String bundleId, IPropertyChangeListener listener) {
ITalendThemeService theme = get();
if (theme != null) {
theme.removePropertyChangeListenerFor(bundleId, listener);
}
}
void removePropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
static ITalendThemeService get() {
try {
BundleContext bc = FrameworkUtil.getBundle(ITalendThemeService.class).getBundleContext();
ServiceReference<ITalendThemeService> serviceReference = bc.getServiceReference(ITalendThemeService.class);
if (serviceReference == null) {
return null;
}
return bc.getService(serviceReference);
} catch (Exception e) {
ExceptionHandler.process(e);
}
return null;
}
}

View File

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

View File

@@ -96,7 +96,7 @@ ProposalUtils.CtrlProposal.ErrorMsg=\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5236\u
RemovePushButton.RemoveButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u524A\u9664
ResetDBTypesButton.ResetDBTypesButton.Tip=DB\u30BF\u30A4\u30D7\u3092\u30EA\u30BB\u30C3\u30C8
Rule.rule=\u30EB\u30FC\u30EB[{0}]
SaveAsGenericSchemaPushButton.saveAsSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
SaveAsGenericSchemaPushButton.saveAsSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
SelectContextVariablesPushButton.Label=\u30B3\u30F3\u30C6\u30AF\u30B9\u30C8\u5909\u6570\u3092\u9078\u629E
SWTCalendarWithTime.contentEvening=\u5915\u65B9
SWTCalendarWithTime.contentHr=\u6642:
@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u3067\u3059
TableViewerCreator.TableColumn.AssertMsg=idProperty'{0}'\u304C\u3042\u308BTableEditorColumn\u306ETableColumn\u306B\u306F\u3001\u6B63\u3057\u3044\u89AA\u30C6\u30FC\u30D6\u30EB\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093
TreeToTablesLinker.Type.Unsupported=currentControl\u306E\u3053\u306E\u30BF\u30A4\u30D7\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
commons.error=\u30A8\u30E9\u30FC
exception.message={0}\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
exception.errorOccured=\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Message=\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\uFF11\u3064\u9078\u629E\u3059\u308B\u304B\u3001\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3

View File

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

View File

@@ -57,8 +57,6 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.talend.commons.ui.runtime.ColorConstants;
import org.talend.commons.ui.runtime.ITalendThemeService;
import org.talend.commons.ui.runtime.i18n.Messages;
import org.talend.commons.ui.runtime.swt.proposal.IShowInvisibleCellEditorMethods;
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.DefaultHeaderColumnSelectionListener;
@@ -293,8 +291,7 @@ public class TableViewerCreatorNotModifiable<B> {
public TableViewerCreatorNotModifiable(Composite compositeParent) {
super();
this.compositeParent = compositeParent;
this.emptyZoneColor = ITalendThemeService.getColor("org.talend.commons.ui.BgColorForEmptyArea")
.orElse(compositeParent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
this.emptyZoneColor = compositeParent.getDisplay().getSystemColor(SWT.COLOR_WHITE);
}
@@ -672,22 +669,8 @@ public class TableViewerCreatorNotModifiable<B> {
table.addListener(SWTFacade.Paint, paintListener);
}
Color prefBackgroundColor = backgroundColor;
if (prefBackgroundColor == null) {
prefBackgroundColor = ColorConstants.getTableBackgroundColor();
if (prefBackgroundColor == null) {
prefBackgroundColor = table.getDisplay().getSystemColor(SWT.COLOR_WHITE);
}
}
Color prefForegroundColor = foregroundColor;
if (prefForegroundColor == null) {
prefForegroundColor = ColorConstants.getTableForegroundColor();
if (prefForegroundColor == null) {
prefForegroundColor = table.getDisplay().getSystemColor(SWT.COLOR_BLACK);
}
}
setBackgroundColor(prefBackgroundColor);
setForegroundColor(prefForegroundColor);
setBackgroundColor(backgroundColor != null ? backgroundColor : table.getDisplay().getSystemColor(SWT.COLOR_WHITE));
setForegroundColor(foregroundColor != null ? foregroundColor : table.getDisplay().getSystemColor(SWT.COLOR_BLACK));
if (useCustomItemColoring) {
setUseCustomItemColoring(true);

View File

@@ -12,14 +12,9 @@
// ============================================================================
package org.talend.commons.ui.runtime.utils;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.DataFormatException;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
/**
@@ -107,16 +102,4 @@ public class TalendColorPalette {
public static final java.awt.Color TERTIARY_ORANGE_AWT = new java.awt.Color(244, 175, 128);
public static final java.awt.Color TERTIARY_YELLOW_AWT = new java.awt.Color(255, 217, 143);
public static Color convertToColor(String rgbStr) throws DataFormatException {
ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
Color color = colorRegistry.get(rgbStr);
if (color != null) {
return color;
}
RGB rgb = StringConverter.asRGB(rgbStr);
colorRegistry.put(rgbStr, rgb);
return colorRegistry.get(rgbStr);
}
}

View File

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

View File

@@ -283,7 +283,6 @@
<KEYWORD1>smallint</KEYWORD1>
<KEYWORD1>smallmoney</KEYWORD1>
<KEYWORD1>text</KEYWORD1>
<KEYWORD1>TIME</KEYWORD1>
<KEYWORD1>timestamp</KEYWORD1>
<KEYWORD1>tinyint</KEYWORD1>
<KEYWORD1>uniqueidentifier</KEYWORD1>

View File

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

View File

@@ -1,85 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.runtime.model.emf;
import java.util.Iterator;
import java.util.Map;
import java.util.StringJoiner;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.XMLSave;
import org.eclipse.emf.ecore.xmi.impl.XMISaveImpl;
import org.eclipse.emf.ecore.xmi.impl.XMLString;
/**
* DOC jding class global comment. Detailled comment
*/
public class CustomXMIResource extends TalendXMIResource {
public static final String ENCODING = "UTF-8"; //$NON-NLS-1$
CustomXMISave xmiSave;
public CustomXMIResource() {
super();
}
public CustomXMIResource(URI uri) {
super(uri);
}
@Override
protected void init() {
super.init();
encoding = ENCODING;
}
@Override
protected XMLSave createXMLSave() {
xmiSave = new CustomXMISave(createXMLHelper());
return xmiSave;
}
public String getResourceContent(Map<?, ?> options) {
if (xmiSave == null) {
createXMLSave();
}
return xmiSave.getXMLContent(this, options);
}
}
class CustomXMISave extends XMISaveImpl {
public CustomXMISave(XMLHelper helper) {
super(helper);
}
public String getXMLContent(XMLResource resource, Map<?, ?> options) {
StringJoiner strJoin = new StringJoiner("");
super.init(resource, options);
super.traverse(resource.getContents());
XMLString xmlString = this.doc;
Iterator<String> iterator = xmlString.stringIterator();
while (iterator.hasNext()) {
String string = (String) iterator.next();
if (string != null) {
strJoin.add(string);
}
}
return strJoin.toString();
}
}

View File

@@ -16,7 +16,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -264,12 +263,4 @@ public class EmfHelper {
return result;
}
public static String getEmfModelContent(EObject model) throws Exception {
String content = "";
CustomXMIResource xmiResource = new CustomXMIResource();
xmiResource.getContents().add(model);
content = xmiResource.getResourceContent(Collections.EMPTY_MAP);
return content;
}
}

View File

@@ -120,7 +120,7 @@ public class NetworkUtil {
if (StringUtils.isNotBlank(customUrl)) {
return customUrl;
} else {
return "https://talend-update.talend.com/nexus/content/groups/studio-libraries/";
return "https://talend-update.talend.com/nexus/content/repositories/libraries/";
}
}

View File

@@ -92,7 +92,7 @@ ProposalUtils.CtrlProposal.ErrorMsg=\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5236\u
RemovePushButton.RemoveButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u524A\u9664
ResetDBTypesButton.ResetDBTypesButton.Tip=DB\u30BF\u30A4\u30D7\u3092\u30EA\u30BB\u30C3\u30C8
Rule.rule=\u30EB\u30FC\u30EB[{0}]
SaveAsGenericSchemaPushButton.saveAsSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
SaveAsGenericSchemaPushButton.saveAsSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
SelectContextVariablesPushButton.Label=\u30B3\u30F3\u30C6\u30AF\u30B9\u30C8\u5909\u6570\u3092\u9078\u629E
SWTCalendarWithTime.contentEvening=\u5915\u65B9
SWTCalendarWithTime.contentHr=\u6642:

View File

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

View File

@@ -20,14 +20,12 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.talend.commons.ui.runtime.ITalendThemeService;
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorNotModifiable.LAYOUT_MODE;
import org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener;
import org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent;
@@ -158,7 +156,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
final Table table = getTableViewerCreator().getTable();
final ILineSelectionListener beforeLineSelectionListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (e.selectionByMethod && !selectionHelper.isMouseSelectionning() && !forceExecuteSelectionEvent) {
executeSelectionEvent = false;
@@ -169,7 +166,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
};
final ILineSelectionListener afterLineSelectionListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
executeSelectionEvent = true;
}
@@ -179,7 +175,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
DisposeListener disposeListener = new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
selectionHelper.removeBeforeSelectionListener(beforeLineSelectionListener);
selectionHelper.removeAfterSelectionListener(afterLineSelectionListener);
@@ -190,7 +185,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
table.addListener(SWT.KeyUp, new Listener() {
@Override
public void handleEvent(Event event) {
if (event.character == '\u0001') { // CTRL + A
@@ -257,9 +251,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
newTableViewerCreator.setLazyLoad(TableViewerCreator.getRecommandLazyLoad());
newTableViewerCreator.setFirstVisibleColumnIsSelection(false);
newTableViewerCreator.setCheckboxInFirstColumn(false);
Color bgColorForEmptyArea = ITalendThemeService.getColor("org.talend.commons.ui.BgColorForEmptyArea")
.orElse(getParentComposite().getDisplay().getSystemColor(SWT.COLOR_WHITE));
newTableViewerCreator.setBgColorForEmptyArea(bgColorForEmptyArea);
newTableViewerCreator.setBgColorForEmptyArea(getParentComposite().getDisplay().getSystemColor(SWT.COLOR_WHITE));
}
/**
@@ -279,7 +271,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
getExtendedTableModel().addBeforeOperationListListener(1, new IListenableListListener() {
@Override
public void handleEvent(ListenableListEvent event) {
handleBeforeListenableListOperationEvent(event);
}
@@ -288,7 +279,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
getExtendedTableModel().addAfterOperationListListener(1, new IListenableListListener() {
@Override
public void handleEvent(ListenableListEvent event) {
handleAfterListenableListOperationEvent(event);
}
@@ -297,7 +287,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
getExtendedTableModel().addAfterOperationListListener(100, new IListenableListListener<B>() {
@Override
public void handleEvent(ListenableListEvent<B> event) {
if (tableViewerCreator.getTable() != null && !tableViewerCreator.getTable().isDisposed()) {
// tableViewerCreator.getTable().forceFocus();
@@ -379,7 +368,6 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
tableViewerCreator.setInputList(getBeansList());
new AsynchronousThreading(100, true, tableViewerCreator.getTable().getDisplay(), new Runnable() {
@Override
public void run() {
tableViewerCreator.layout();
}

View File

@@ -285,30 +285,6 @@
type="INFORMIX">
</DBType>
</RepositoryComponent>
<RepositoryComponent
name="INGRES"
withSchema="true"
input="tIngresInput"
output="tIngresOutput">
<Item
clazz="org.talend.core.model.properties.DatabaseConnectionItem">
</Item>
<DBType
type="INGRES">
</DBType>
</RepositoryComponent>
<RepositoryComponent
name="VECTORWISE"
withSchema="true"
input="tVectorWiseInput"
output="tVectorWiseOutput">
<Item
clazz="org.talend.core.model.properties.DatabaseConnectionItem">
</Item>
<DBType
type="VECTORWISE">
</DBType>
</RepositoryComponent>
<RepositoryComponent
name="JAVADB"
withSchema="true"

View File

@@ -204,4 +204,3 @@ RenameFolderAction.warning.cannotFind.title=Action not available
ConvertJobsUtil.warning.title=Warning
ConvertJobsUtil.warning.message=The target framework is not fully supported for this release.
SyncLibrariesLoginTask.createStatsLogAndImplicitParamter=Create stats log and implicit parameters
WizardPageAPIDefinition_operationIdMissing=API is missing operationIds. operationIds are used to initialize tRESTRequest/cRest output flows. See tRESTRequest/cRest online help.

View File

@@ -56,7 +56,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
PropertiesWizardPage.Description=\u8AAC\u660E
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
PropertiesWizardPage.Name=\u540D\u524D
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002
@@ -156,7 +156,7 @@ ProjectRepositoryNode.invalidItem=\u7121\u52B9\u306A\u30A2\u30A4\u30C6\u30E0
ProjectRepositoryNode.columns=\u30AB\u30E9\u30E0
ProjectRepositoryNode.validationRules=\u691C\u8A3C\u30EB\u30FC\u30EB
ProjectRepositoryNode.cdcFoundation=CDC Foundation
ProjectRepositoryNode.genericSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE
ProjectRepositoryNode.genericSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE
ProjectRepositoryNode.queries=\u30AF\u30A8\u30EA\u30FC
ProjectRepositoryNode.synonymSchemas=\u30B7\u30CE\u30CB\u30E0\u30B9\u30AD\u30FC\u30DE
ProjectRepositoryNode.calculationViewSchemas=\u8A08\u7B97\u30D3\u30E5\u30FC\u30B9\u30AD\u30FC\u30DE

View File

@@ -67,7 +67,6 @@ import org.talend.core.model.repository.Folder;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.repository.LockInfo;
import org.talend.core.model.repository.RepositoryViewObject;
import org.talend.core.model.routines.RoutinesUtil;
import org.talend.core.repository.i18n.Messages;
import org.talend.core.repository.utils.XmiResourceManager;
import org.talend.core.runtime.CoreRuntimePlugin;
@@ -261,7 +260,6 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
if (type == ERepositoryObjectType.METADATA_CON_TABLE) {
return false;
}
boolean isAllowMultipleName = (type == ERepositoryObjectType.SQLPATTERNS || type == ERepositoryObjectType.METADATA_FILE_XML);
String path = "";
if (item.getState() != null) {

View File

@@ -27,6 +27,10 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.ICoreService;
import org.talend.core.PluginChecker;
@@ -35,22 +39,22 @@ import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.properties.SQLPatternItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.PendoDataTrackFactory;
import org.talend.core.pendo.PendoItemSignatureUtil;
import org.talend.core.pendo.PendoItemSignatureUtil.SignatureStatus;
import org.talend.core.pendo.PendoItemSignatureUtil.TOSProdNameEnum;
import org.talend.core.pendo.PendoItemSignatureUtil.ValueEnum;
import org.talend.core.pendo.PendoTrackDataUtil;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoSignLogonProperties;
import org.talend.utils.migration.MigrationTokenUtil;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoItemSignatureManager extends AbstractPendoTrackManager {
public class PendoItemSignatureManager {
private PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
private static PendoItemSignatureManager manager;
@@ -59,7 +63,7 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
static {
manager = new PendoItemSignatureManager();
try {
isTrackAvailable = PluginChecker.isTIS() && PendoDataTrackFactory.getInstance().isTrackSendAvailable();
isTrackAvailable = PluginChecker.isTIS() && PendoTrackSender.getInstance().isTrackSendAvailable();
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
@@ -83,12 +87,11 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
}
}
public IPendoDataProperties collectProperties() {
public void collectProperties() {
ICoreService coreService = ICoreService.get();
if (coreService == null || !isTrackAvailable) {
return null;
return;
}
PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
try {
itemSignProperties.setSignByMigration(signByLoginMigrationItems.size());
@@ -185,7 +188,6 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
return itemSignProperties;
}
@@ -256,12 +258,23 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
if (!isTrackAvailable) {
return;
}
super.sendTrackToPendo();
}
Job job = new Job("send pendo track") {
@Override
public TrackEvent getTrackEvent() {
return TrackEvent.ITEM_SIGNATURE;
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
collectProperties();
PendoTrackSender.getInstance().sendTrackData(TrackEvent.ITEM_SIGNATURE, itemSignProperties);
} catch (Exception e) {
// warning only
ExceptionHandler.process(e, Level.WARN);
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
}

View File

@@ -153,7 +153,6 @@ import org.talend.core.runtime.services.IMavenUIService;
import org.talend.core.runtime.util.ItemDateParser;
import org.talend.core.runtime.util.JavaHomeUtil;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.service.IComponentJsonformGeneratorService;
import org.talend.core.service.ICoreUIService;
import org.talend.core.service.IDetectCVEService;
import org.talend.core.utils.CodesJarResourceCache;
@@ -2380,22 +2379,11 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
}
String str[] = new String[] { getRepositoryContext().getUser() + "", projectManager.getCurrentProject() + "" }; //$NON-NLS-1$ //$NON-NLS-2$
log.info(Messages.getString("ProxyRepositoryFactory.log.loggedOn", str)); //$NON-NLS-1$
// no performance impact for studio or commandline
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentJsonformGeneratorService.class)) {
IComponentJsonformGeneratorService jsonformSvc = GlobalServiceRegister.getDefault().getService(IComponentJsonformGeneratorService.class);
if (jsonformSvc != null && IComponentJsonformGeneratorService.isEnabled()) {
jsonformSvc.generate(null);
}
}
} catch (LoginException e) {
if (!LoginException.RESTART.equals(e.getKey())) {
try {
logOffProject();
} catch (Exception e1) {
ExceptionHandler.process(e1);
}
try {
logOffProject();
} catch (Exception e1) {
ExceptionHandler.process(e1);
}
throw e;
} catch (PersistenceException e) {
@@ -2573,6 +2561,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
public void logOffProject() {
// getRepositoryContext().setProject(null);
repositoryFactoryFromProvider.logOffProject();
if (!CommonsPlugin.isHeadless()) {
ProjectRepositoryNode root = ProjectRepositoryNode.getInstance();
if (root != null) {
@@ -2628,7 +2617,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ReferenceProjectProvider.clearTacReferenceList();
ReferenceProjectProblemManager.getInstance().clearAll();
repositoryFactoryFromProvider.logOffProject();
fullLogonFinished = false;
}

View File

@@ -52,8 +52,6 @@ public interface IGitInfoService extends IService {
public Map<String, String> getGitInfo(Property property) throws Exception;
public boolean isPushedToRemote(Property property) throws Exception;
public String getProjectBranch(Project project)throws Exception;
public static IGitInfoService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGitInfoService.class)) {

View File

@@ -17,20 +17,14 @@ import java.util.Map;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.talend.commons.runtime.model.repository.ECDCStatus;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.ui.runtime.ITalendThemeService;
import org.talend.commons.ui.runtime.image.ECoreImage;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.IImage;
@@ -83,19 +77,13 @@ import org.talend.utils.string.DigestUtil;
*/
public class RepositoryLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
private static final String MERGED_PREFERENCED_ITEMS = "org.talend.core.repository.REPO_MERGED_REFERENCED_ITEMS_COLOR";
private static final String LOCKED_ENTRY = "org.talend.core.repository.REPO_LOCKED_ENTRY";
private static final String STABLE_PRIMARY_ENTRY = "org.talend.core.repository.REPO_STABLE_PRIMARY_ENTRY_COLOR";
private static final String STABLE_SECONDARY_ENTRY = "org.talend.core.repository.REPO_STABLE_SECONDARY_ENTRY_COLOR";
private static final Color STABLE_SECONDARY_ENTRY_COLOR = new Color(null, 100, 100, 100);
private static final Color STABLE_PRIMARY_ENTRY_COLOR = new Color(null, 0, 0, 0);
protected static final Color INACTIVE_ENTRY_COLOR = new Color(null, 200, 200, 200);
private static final Color LOCKED_ENTRY_COLOR = new Color(null, 200, 0, 0);
private static final Color LOCKED_ENTRY = new Color(null, 200, 0, 0);
private static final Color MERGED_REFERENCED_ITEMS_COLOR = new Color(null, 120, 120, 120);
@@ -112,18 +100,6 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
return view;
}
private Color getStableSecondaryEntryColor() {
return ITalendThemeService.getColor(STABLE_SECONDARY_ENTRY).orElse(STABLE_SECONDARY_ENTRY_COLOR);
}
private Color getLockedEntryColor() {
return ITalendThemeService.getColor(LOCKED_ENTRY).orElse(LOCKED_ENTRY_COLOR);
}
private Color getMergedReferencedItemsColor() {
return ITalendThemeService.getColor(MERGED_PREFERENCED_ITEMS).orElse(MERGED_REFERENCED_ITEMS_COLOR);
}
public String getText(IRepositoryViewObject object) {
StringBuffer string = new StringBuffer();
string.append(object.getLabel());
@@ -506,13 +482,23 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
RepositoryNode node = (RepositoryNode) element;
switch (node.getType()) {
case REFERENCED_PROJECT:
return STABLE_PRIMARY_ENTRY_COLOR;
case STABLE_SYSTEM_FOLDER:
if (node.getLabel().equals(ERepositoryObjectType.SNIPPETS.toString())) {
return INACTIVE_ENTRY_COLOR;
}
if (node.getContentType() == ERepositoryObjectType.METADATA) {
return STABLE_PRIMARY_ENTRY_COLOR;
}
case SYSTEM_FOLDER:
return getStableSecondaryEntryColor();
if (node.getContentType() == ERepositoryObjectType.PROCESS) {
return STABLE_PRIMARY_ENTRY_COLOR;
}
return STABLE_SECONDARY_ENTRY_COLOR;
default:
ERepositoryStatus repositoryStatus = node.getObject().getRepositoryStatus();
if (repositoryStatus == ERepositoryStatus.LOCK_BY_OTHER) {
return getLockedEntryColor();
return LOCKED_ENTRY;
} else {
if (PluginChecker.isRefProjectLoaded()) {
IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault()
@@ -524,7 +510,7 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
.getCurrentProject().getEmfProject();
String projectLabel = object.getProjectLabel();
if (!mainProject.getLabel().equals(projectLabel)) {
return getMergedReferencedItemsColor();
return MERGED_REFERENCED_ITEMS_COLOR;
}
}
}
@@ -550,43 +536,4 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
refreshProperty = refresh;
}
public static IPropertyChangeListener createPropertyChangeListener(TreeViewer treeViewer) {
return new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property == null) {
return;
}
boolean changed = false;
switch (property) {
case RepositoryLabelProvider.STABLE_PRIMARY_ENTRY:
// case RepositoryLabelProvider.INACTIVE_ENTRY:
// case RepositoryLabelProvider.LOCKED_ENTRY:
// case RepositoryLabelProvider.MERGED_PREFERENCED_ITEMS:
// case RepositoryLabelProvider.STABLE_SECONDARY_ENTRY:
changed = true;
break;
default:
break;
}
if (changed) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
if (treeViewer != null) {
Control control = treeViewer.getControl();
if (!control.isDisposed()) {
treeViewer.refresh();
}
}
}
});
}
}
};
}
}

View File

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

View File

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

View File

@@ -139,5 +139,3 @@ Bundle-ClassPath: .,
lib/delight-rhino-sandbox-0.0.15.jar,
lib/rhino-1.7.13.jar
Eclipse-RegisterBuddy: org.talend.testutils
Import-Package: org.eclipse.equinox.p2.repository,
org.eclipse.equinox.security.storage

View File

@@ -21,8 +21,7 @@ bin.includes = META-INF/,\
plugin_ja.properties,\
plugin_ru.properties,\
plugin_swtbot.properties,\
plugin_zh_CN.properties,\
resources/
plugin_zh_CN.properties
src.includes = META-INF/,\
mappingMetadataTypes.xml,\
mappings/,\

View File

@@ -1,216 +0,0 @@
<?xml version="1.0"?>
<mapping>
<dbms product="INGRES" id="ingres_id" label="Mapping Ingres"
default="true">
<dbTypes>
<dbType type="ANSIDATE" ignoreLen="true" ignorePre="true" />
<dbType type="BOOLEAN" ignoreLen="true" ignorePre="true" />
<dbType type="BIGINT" ignoreLen="true" ignorePre="true" />
<dbType type="BYTE" ignoreLen="true" ignorePre="true" />
<dbType type="BYTE VARYING" ignoreLen="true" ignorePre="true" />
<dbType type="C" ignoreLen="true" ignorePre="true" />
<dbType type="CHAR" ignorePre="true" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT4" ignoreLen="true" ignorePre="true" />
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
<dbType type="INGRESDATE" ignoreLen="true" ignorePre="true" />
<dbType type="INTERVAL" ignoreLen="true" ignorePre="true" />
<dbType type="LONG NVARCHAR" ignorePre="true" />
<dbType type="LONG VARCHAR" ignoreLen="true" ignorePre="true" />
<dbType type="MONEY" ignoreLen="true" ignorePre="true" />
<dbType type="NCHAR" ignorePre="true" defaultLength="10"/>
<dbType type="NVARCHAR" ignorePre="true" defaultLength="10"/>
<dbType type="OBJECT_KEY" ignoreLen="true" ignorePre="true"/>
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
<dbType type="TINYINT" ignoreLen="true" ignorePre="true" />
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true"/>
<dbType type="TABLE_KEY" ignoreLen="true" ignorePre="true" />
<dbType type="VARCHAR" default="true" defaultLength="1200" ignorePre="true"/>
</dbTypes>
<language name="java">
<talendToDbTypes><!-- Adviced mappings -->
<talendType type="id_List"/>
<talendType type="id_Boolean">
<dbType type="BOOLEAN" default="true" />
</talendType>
<talendType type="id_Byte">
<dbType type="BYTE" default="true" />
<dbType type="BYTE VARYING" />
</talendType>
<talendType type="id_byte[]">
</talendType>
<talendType type="id_Character">
<dbType type="CHAR" default="true" />
<dbType type="VARCHAR"/>
<dbType type="C"/>
<dbType type="TEXT"/>
<dbType type="LONG VARCHAR"/>
<dbType type="NCHAR"/>
<dbType type="NVARCHAR"/>
<dbType type="LONG NVARCHAR"/>
</talendType>
<talendType type="id_Date">
<dbType type="DATE" default="true" />
<dbType type="ANSIDATE" />
<dbType type="INGRESDATE" />
<dbType type="TIME" />
<dbType type="TIMESTAMP" />
<dbType type="INTERVAL"/>
</talendType>
<talendType type="id_BigDecimal">
<dbType type="DECIMAL" default="true" />
<dbType type="FLOAT4" />
<dbType type="FLOAT"/>
<dbType type="MONEY"/>
</talendType>
<talendType type="id_Double">
<dbType type="FLOAT" default="true" />
<dbType type="FLOAT4" />
<dbType type="DECIMAL"/>
<dbType type="MONEY"/>
</talendType>
<talendType type="id_Float">
<dbType type="FLOAT4" default="true" />
<dbType type="FLOAT"/>
<dbType type="DECIMAL" />
<dbType type="MONEY"/>
</talendType>
<talendType type="id_Integer">
<dbType type="INTEGER" default="true" />
<dbType type="BIGINT" />
<dbType type="SMALLINT"/>
<dbType type="TINYINT"/>
</talendType>
<talendType type="id_Long">
<dbType type="BIGINT" default="true" />
<dbType type="INTEGER"/>
<dbType type="SMALLINT"/>
<dbType type="TINYINT"/>
</talendType>
<talendType type="id_Object">
<dbType type="MONEY" default="true"/>
<dbType type="OBJECT_KEY" />
<dbType type="TABLE_KEY" />
</talendType>
<talendType type="id_Short">
<dbType type="SMALLINT" default="true" />
<dbType type="INTEGER" />
<dbType type="BIGINT"/>
<dbType type="TINYINT" />
</talendType>
<talendType type="id_String">
<dbType type="VARCHAR" default="true" />
<dbType type="LONG VARCHAR" />
<dbType type="NCHAR"/>
<dbType type="NVARCHAR" />
<dbType type="LONG NVARCHAR" />
<dbType type="TEXT" />
<dbType type="C"/>
<dbType type="CHAR"/>
</talendType>
</talendToDbTypes>
<dbToTalendTypes>
<dbType type="ANSIDATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="BOOLEAN">
<talendType type="id_Boolean" default="true" />
</dbType>
<dbType type="BIGINT">
<talendType type="id_Long" default="true" />
</dbType>
<dbType type="BYTE">
<talendType type="id_Byte" default="true" />
</dbType>
<dbType type="BYTE VARYING">
<talendType type="id_Byte" default="true" />
</dbType>
<dbType type="C">
<talendType type="id_String" default="true" />
<talendType type="id_Character"/>
</dbType>
<dbType type="CHAR">
<talendType type="id_String" default="true" />
<talendType type="id_Character"/>
</dbType>
<dbType type="DECIMAL">
<talendType type="id_Float"/>
<talendType type="id_BigDecimal" default="true"/>
</dbType>
<dbType type="DATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="FLOAT">
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="FLOAT4">
<talendType type="id_Float" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="INTEGER">
<talendType type="id_Integer" default="true" />
<talendType type="id_Long"/>
<talendType type="id_Short"/>
</dbType>
<dbType type="INGRESDATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="INTERVAL">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="LONG NVARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="LONG VARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="MONEY">
<talendType type="id_Float" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="NCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="NVARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="OBJECT_KEY">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="SMALLINT">
<talendType type="id_Short" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Long"/>
</dbType>
<dbType type="TEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="TINYINT">
<talendType type="id_Byte" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Short"/>
<talendType type="id_Long" />
</dbType>
<dbType type="TIME">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="TIMESTAMP">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="TABLE_KEY">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="VARCHAR">
<talendType type="id_String" default="true" />
</dbType>
</dbToTalendTypes>
</language>
</dbms>
</mapping>

View File

@@ -1,211 +0,0 @@
<?xml version="1.0"?>
<mapping>
<dbms product="VECTORWISE" id="vectorwise_id" label="Mapping VectorWise"
default="true">
<dbTypes>
<dbType type="ANSIDATE" ignoreLen="true" ignorePre="true" />
<dbType type="BIGINT" ignoreLen="true" ignorePre="true" />
<dbType type="BYTE" ignoreLen="true" ignorePre="true" />
<dbType type="BYTE VARYING" ignoreLen="true" ignorePre="true" />
<dbType type="C" ignoreLen="true" ignorePre="true" />
<dbType type="CHAR" ignorePre="true" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT4" ignoreLen="true" ignorePre="true" />
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
<dbType type="INGRESDATE" ignoreLen="true" ignorePre="true" />
<dbType type="INTERVAL" ignoreLen="true" ignorePre="true" />
<dbType type="LONG NVARCHAR" ignorePre="true" />
<dbType type="LONG VARCHAR" ignoreLen="true" ignorePre="true" />
<dbType type="MONEY" ignoreLen="true" ignorePre="true" />
<dbType type="NCHAR" ignorePre="true" defaultLength="10"/>
<dbType type="NVARCHAR" ignorePre="true" defaultLength="10"/>
<dbType type="OBJECT_KEY" ignoreLen="true" ignorePre="true"/>
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
<dbType type="TINYINT" ignoreLen="true" ignorePre="true" />
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true"/>
<dbType type="TABLE_KEY" ignoreLen="true" ignorePre="true" />
<dbType type="VARCHAR" default="true" defaultLength="1200" ignorePre="true"/>
</dbTypes>
<language name="java">
<talendToDbTypes><!-- Adviced mappings -->
<talendType type="id_List"/>
<talendType type="id_Boolean">
</talendType>
<talendType type="id_Byte">
<dbType type="BYTE" default="true" />
<dbType type="BYTE VARYING" />
</talendType>
<talendType type="id_byte[]">
</talendType>
<talendType type="id_Character">
<dbType type="CHAR" default="true" />
<dbType type="VARCHAR"/>
<dbType type="C"/>
<dbType type="TEXT"/>
<dbType type="LONG VARCHAR"/>
<dbType type="NCHAR"/>
<dbType type="NVARCHAR"/>
<dbType type="LONG NVARCHAR"/>
</talendType>
<talendType type="id_Date">
<dbType type="ANSIDATE" default="true"/>
<dbType type="DATE"/>
<dbType type="INGRESDATE" />
<dbType type="TIME" />
<dbType type="TIMESTAMP" />
<dbType type="INTERVAL"/>
</talendType>
<talendType type="id_BigDecimal">
<dbType type="DECIMAL" default="true" />
<dbType type="FLOAT4" />
<dbType type="FLOAT"/>
<dbType type="MONEY"/>
</talendType>
<talendType type="id_Double">
<dbType type="FLOAT" default="true" />
<dbType type="FLOAT4" />
<dbType type="DECIMAL"/>
<dbType type="MONEY"/>
</talendType>
<talendType type="id_Float">
<dbType type="FLOAT4" default="true" />
<dbType type="FLOAT"/>
<dbType type="DECIMAL" />
<dbType type="MONEY"/>
</talendType>
<talendType type="id_Integer">
<dbType type="INTEGER" default="true" />
<dbType type="BIGINT" />
<dbType type="SMALLINT"/>
<dbType type="TINYINT"/>
</talendType>
<talendType type="id_Long">
<dbType type="BIGINT" default="true" />
<dbType type="INTEGER"/>
<dbType type="SMALLINT"/>
<dbType type="TINYINT"/>
</talendType>
<talendType type="id_Object">
<dbType type="MONEY" default="true"/>
<dbType type="OBJECT_KEY" />
<dbType type="TABLE_KEY" />
</talendType>
<talendType type="id_Short">
<dbType type="SMALLINT" default="true" />
<dbType type="INTEGER" />
<dbType type="BIGINT"/>
<dbType type="TINYINT" />
</talendType>
<talendType type="id_String">
<dbType type="VARCHAR" default="true" />
<dbType type="LONG VARCHAR" />
<dbType type="NCHAR"/>
<dbType type="NVARCHAR" />
<dbType type="LONG NVARCHAR" />
<dbType type="TEXT" />
<dbType type="C"/>
<dbType type="CHAR"/>
</talendType>
</talendToDbTypes>
<dbToTalendTypes>
<dbType type="ANSIDATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="BIGINT">
<talendType type="id_Long" default="true" />
</dbType>
<dbType type="BYTE">
<talendType type="id_Byte" default="true" />
</dbType>
<dbType type="BYTE VARYING">
<talendType type="id_Byte" default="true" />
</dbType>
<dbType type="C">
<talendType type="id_String" default="true" />
<talendType type="id_Character"/>
</dbType>
<dbType type="CHAR">
<talendType type="id_String" default="true" />
<talendType type="id_Character"/>
</dbType>
<dbType type="DECIMAL">
<talendType type="id_Float"/>
<talendType type="id_BigDecimal" default="true"/>
</dbType>
<dbType type="DATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="FLOAT">
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="FLOAT4">
<talendType type="id_Float" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="INTEGER">
<talendType type="id_Integer" default="true" />
<talendType type="id_Long"/>
<talendType type="id_Short"/>
</dbType>
<dbType type="INGRESDATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="INTERVAL">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="LONG NVARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="LONG VARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="MONEY">
<talendType type="id_Float" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="NCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="NVARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="OBJECT_KEY">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="SMALLINT">
<talendType type="id_Short" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Long"/>
</dbType>
<dbType type="TEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="TINYINT">
<talendType type="id_Byte" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Short"/>
<talendType type="id_Long" />
</dbType>
<dbType type="TIME">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="TIMESTAMP">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="TABLE_KEY">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="VARCHAR">
<talendType type="id_String" default="true" />
</dbType>
</dbToTalendTypes>
</language>
</dbms>
</mapping>

View File

@@ -1,59 +0,0 @@
# Component
tSnowflakeConnection=java.base/java.nio
tSnowflakeClose=java.base/java.nio
tSnowflakeCommit=java.base/java.nio
tSnowflakeInput=java.base/java.nio
tSnowflakeOutput=java.base/java.nio
tSnowflakeOutputBulk=java.base/java.nio
tSnowflakeOutputBulkExec=java.base/java.nio
tSnowflakeRow=java.base/java.nio
tSnowflakeBulkExec=java.base/java.nio
tSnowflakeRollback=java.base/java.nio
tCouchbaseInput=java.base/java.lang.invoke
tCouchbaseOutput=java.base/java.lang.invoke
tCouchbaseDCPInput=java.base/java.lang.invoke
tCouchbaseDCPOutput=java.base/java.lang.invoke
tWriteJSONField=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
tFTPClose=java.base/sun.security.ssl,java.base/sun.security.util
tFTPConnection=java.base/sun.security.ssl,java.base/sun.security.util
tFTPDelete=java.base/sun.security.ssl,java.base/sun.security.util
tFTPFileExist=java.base/sun.security.ssl,java.base/sun.security.util
tFTPFileList=java.base/sun.security.ssl,java.base/sun.security.util
tFTPFileProperties=java.base/sun.security.ssl,java.base/sun.security.util
tFTPGet=java.base/sun.security.ssl,java.base/sun.security.util
tFTPPut=java.base/sun.security.ssl,java.base/sun.security.util
tFTPRename=java.base/sun.security.ssl,java.base/sun.security.util
tFTPTruncate=java.base/sun.security.ssl,java.base/sun.security.util
tNeo4jBatchOutput=java.base/java.lang,java.base/sun.nio.ch
tNeo4jBatchOutputRelationship=java.base/java.lang,java.base/sun.nio.ch
tNeo4jBatchSchema=java.base/java.lang,java.base/sun.nio.ch
tNeo4jClose=java.base/java.lang,java.base/sun.nio.ch
tNeo4jConnection=java.base/java.lang,java.base/sun.nio.ch
tNeo4jImportTool=java.base/java.lang,java.base/sun.nio.ch
tNeo4jInput=java.base/java.lang,java.base/sun.nio.ch
tNeo4jRow=java.base/java.lang,java.base/sun.nio.ch
tMongoDBOutput=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
tCosmosDBOutput=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
tMatchGroup=java.base/java.io
tRuleSurvivorship=java.base/java.lang
tRecordMatching=java.base/java.io
tDqReportRun=java.base/java.lang,java.base/java.nio
tWebService=java.base/java.lang
tWebServiceInput=java.base/java.lang
# TCK framework
TCK_COMMON_ARGS=java.base/java.io,java.base/java.lang.invoke,java.base/java.lang.reflect,java.base/java.lang,java.base/java.net,java.base/java.nio,java.base/java.util,java.base/sun.nio.ch
# BigData distribution
SPARK_3_3_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
SPARK_3_2_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
SPARK_3_1_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
SPARK_2_4_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar

View File

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

View File

@@ -1,43 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.analysistask;
import java.util.List;
import java.util.Set;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
/**
* created by hcyi on Oct 26, 2022
* Detailled comment
*
*/
public class DefaultItemsAnalysisTask extends AbstractItemAnalysisTask {
public DefaultItemsAnalysisTask() {
}
@Override
public Set<ERepositoryObjectType> getRepositoryObjectTypeScope() {
return null;
}
@Override
public List<AnalysisReportRecorder> execute(Item item) {
// TODO Auto-generated method stub
return null;
}
}

View File

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

View File

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

View File

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

View File

@@ -58,10 +58,6 @@ public final class JavaUtils {
public static final List<String> AVAILABLE_VERSIONS = Arrays.asList(JavaCore.VERSION_1_8 );
public static final String ALLOW_JAVA_INTERNAL_ACCESS = "allow.java.internal.access"; //$NON-NLS-1$
public static final String CUSTOM_ACCESS_SETTINGS = "custom.access.settings"; //$NON-NLS-1$
public static final String PROCESSOR_TYPE = "javaProcessor"; //$NON-NLS-1$
public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$

View File

@@ -16,7 +16,6 @@ import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -158,7 +157,7 @@ public interface ILibraryManagerService extends IService {
public void clearCache(boolean cleanIndex);
public void deployLibsFromCustomComponents(File componentFolder, List<ModuleNeeded> modulesNeeded);
public void deployLibsFromCustomComponents();
@Deprecated
public Set<String> list(boolean withComponent, IProgressMonitor... monitorWrap);

View File

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

View File

@@ -34,9 +34,6 @@ public enum EDatabase4DriverClassName {
INFORMIX(EDatabaseTypeName.INFORMIX, "com.informix.jdbc.IfxDriver"), //$NON-NLS-1$
INGRES(EDatabaseTypeName.INGRES, "com.ingres.jdbc.IngresDriver"),
VECTORWISE(EDatabaseTypeName.VECTORWISE, "com.ingres.jdbc.IngresDriver"),
JAVADB_DERBYCLIENT(EDatabaseTypeName.JAVADB_DERBYCLIENT, "org.apache.derby.jdbc.ClientDriver"), //$NON-NLS-1$
JAVADB_EMBEDED(EDatabaseTypeName.JAVADB_EMBEDED, "org.apache.derby.jdbc.EmbeddedDriver"), //$NON-NLS-1$
JAVADB_JCCJDBC(EDatabaseTypeName.JAVADB_JCCJDBC, "com.ibm.db2.jcc.DB2Driver"), //$NON-NLS-1$

View File

@@ -347,7 +347,8 @@ public enum EDatabaseTypeName {
isSupport = isSupportODBC;
} else if (EDatabaseTypeName.SAS == this) {
isSupport = false;
} else if (EDatabaseTypeName.INTERBASE == this || EDatabaseTypeName.PARACCEL == this) {
} else if (EDatabaseTypeName.INGRES == this || EDatabaseTypeName.INTERBASE == this || EDatabaseTypeName.VECTORWISE == this
|| EDatabaseTypeName.PARACCEL == this) {
return false;
}

View File

@@ -24,7 +24,7 @@ import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
*/
public enum ERedshiftDriver {
DRIVER_V2("Driver v2", new String[] { "redshift-jdbc42-2.1.0.10.jar" }),
DRIVER_V2("Driver v2", new String[] { "redshift-jdbc42-2.1.0.3.jar" }),
DRIVER_V1("Driver v1", new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar" });
private String displayName;

View File

@@ -366,57 +366,7 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION="CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION";
public static final String CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER="CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER";
/**kubernetes*/
public static final String CONN_PARA_KEY_K8S_SUBMIT_MODE="CONN_PARA_KEY_K8S_SUBMIT_MODE";
public static final String CONN_PARA_KEY_K8S_MASTER="CONN_PARA_KEY_K8S_MASTER";
public static final String CONN_PARA_KEY_K8S_INSTANCES="CONN_PARA_KEY_K8S_INSTANCES";
public static final String CONN_PARA_KEY_K8S_REGISTRYSECRET_CHECK="CONN_PARA_KEY_K8S_REGISTRYSECRET_CHECK";
public static final String CONN_PARA_KEY_K8S_REGISTRYSECRET="CONN_PARA_KEY_K8S_REGISTRYSECRET";
public static final String CONN_PARA_KEY_K8S_IMAGE="CONN_PARA_KEY_K8S_IMAGE";
public static final String CONN_PARA_KEY_K8S_NAMESPACE="CONN_PARA_KEY_K8S_NAMESPACE";
public static final String CONN_PARA_KEY_K8S_SERVICEACCOUNT="CONN_PARA_KEY_K8S_SERVICEACCOUNT";
public static final String CONN_PARA_KEY_K8S_DISTUPLOAD="CONN_PARA_KEY_K8S_DISTUPLOAD";
public static final String CONN_PARA_KEY_K8S_S3BUCKET="CONN_PARA_KEY_K8S_S3BUCKET";
public static final String CONN_PARA_KEY_K8S_S3FOLDER="CONN_PARA_KEY_K8S_S3FOLDER";
public static final String CONN_PARA_KEY_K8S_S3CREDENTIALS="CONN_PARA_KEY_K8S_S3CREDENTIALS";
public static final String CONN_PARA_KEY_K8S_S3ACCESSKEY="CONN_PARA_KEY_K8S_S3ACCESSKEY";
public static final String CONN_PARA_KEY_K8S_S3SECRETKEY="CONN_PARA_KEY_K8S_S3SECRETKEY";
public static final String CONN_PARA_KEY_K8S_BLOBACCOUNT="CONN_PARA_KEY_K8S_BLOBACCOUNT";
public static final String CONN_PARA_KEY_K8S_BLOBCONTAINER="CONN_PARA_KEY_K8S_BLOBCONTAINER";
public static final String CONN_PARA_KEY_K8S_BLOBSECRETKEY="CONN_PARA_KEY_K8S_BLOBSECRETKEY";
public static final String CONN_PARA_KEY_K8S_AZUREACCOUNT="CONN_PARA_KEY_K8S_AZUREACCOUNT";
public static final String CONN_PARA_KEY_K8S_AZURECREDENTIALS="CONN_PARA_KEY_K8S_AZURECREDENTIALS";
public static final String CONN_PARA_KEY_K8S_AZURECONTAINER="CONN_PARA_KEY_K8S_AZURECONTAINER";
public static final String CONN_PARA_KEY_K8S_AZURESECRETKEY="CONN_PARA_KEY_K8S_AZURESECRETKEY";
public static final String CONN_PARA_KEY_K8S_AZUREAADKEY="CONN_PARA_KEY_K8S_AZUREAADKEY";
public static final String CONN_PARA_KEY_K8S_AZUREAADCLIENTID="CONN_PARA_KEY_K8S_AZUREAADCLIENTID";
public static final String CONN_PARA_KEY_K8S_AZUREAADDIRECTORYID="CONN_PARA_KEY_K8S_AZUREAADDIRECTORYID";
/**
* Override hadoop configuration
*/

View File

@@ -112,13 +112,6 @@ public enum EDatabaseConnTemplate {
SQLITE(new DbConnStr(EDatabaseTypeName.SQLITE, //
"jdbc:sqlite:/<filename>")), //$NON-NLS-1$
INGRES(new DbConnStr(EDatabaseTypeName.INGRES, //
"jdbc:ingres://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"II7")), //$NON-NLS-1$
VECTORWISE(new DbConnStr(EDatabaseTypeName.VECTORWISE, //
"jdbc:ingres://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"II7")),
FIREBIRD(new DbConnStr(EDatabaseTypeName.FIREBIRD, //
"jdbc:firebirdsql:<host>/<port>:<filename>?<property>", //$NON-NLS-1$
"3050")), //$NON-NLS-1$
@@ -428,8 +421,6 @@ public enum EDatabaseConnTemplate {
case PSQL:
case PLUSPSQL:
case GREENPLUM:
case INGRES:
case VECTORWISE:
case FIREBIRD:
case JAVADB_EMBEDED:
case JAVADB_JCCJDBC:
@@ -456,8 +447,6 @@ public enum EDatabaseConnTemplate {
case SYBASEASE_16_SA:
case IBMDB2:
case IBMDB2_ZOS:
case INGRES:
case VECTORWISE:
case MSSQL:
case INFORMIX:
case TERADATA:

View File

@@ -27,20 +27,25 @@ import org.talend.core.database.conn.DatabaseConnConstants;
public enum EDatabaseVersion4Drivers {
// access
ACCESS_JDBC(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, new String[] {
"jackcess-2.1.12.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.3.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackcess-encrypt-2.1.4.jar", "bcprov-jdk15on-1.70.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
"jackcess-2.1.0.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.1.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackcess-encrypt-2.1.0.jar", "bcprov-jdk15on-1.51.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
ACCESS_2003(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2003", "Access_2003")), //$NON-NLS-1$ //$NON-NLS-2$
ACCESS_2007(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2007", "Access_2007")), //$NON-NLS-1$ //$NON-NLS-2$
// oracle
ORACLE_18(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 18 and above", "ORACLE_18", "ojdbc8-19.3.0.0.jar")),
ORACLE_12(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 12 (Deprecated)", "ORACLE_12",
"ojdbc7.jar")),
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 12", "ORACLE_12", "ojdbc7.jar")),
ORACLE_11(new DbVersion4DriversForOracle11(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID,
EDatabaseTypeName.ORACLESN, EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM },
"Oracle 11 (Deprecated)", "ORACLE_11", new String[] { DbVersion4DriversForOracle11.DRIVER_1_5, //$NON-NLS-1$ //$NON-NLS-2$
"Oracle 11", "ORACLE_11", new String[] { DbVersion4DriversForOracle11.DRIVER_1_5, //$NON-NLS-1$ //$NON-NLS-2$
DbVersion4DriversForOracle11.DRIVER_1_6 })),
ORACLE_10(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 10", "ORACLE_10", "ojdbc14.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
ORACLE_9(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 9", "ORACLE_9", "ojdbc14-9i.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
ORACLE_8(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 8", "ORACLE_8", "ojdbc12.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// AS400
AS400_V7R1_V7R3(new DbVersion4Drivers(EDatabaseTypeName.AS400, "V7R1 to V7R3", "AS400_V7R1_V7R3", "jt400-9.8.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
AS400_V6R1_V7R2(new DbVersion4Drivers(EDatabaseTypeName.AS400, "V6R1 to V7R2", "AS400_V6R1_V7R2", "jt400_V6R1.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -55,7 +60,7 @@ public enum EDatabaseVersion4Drivers {
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlite-jdbc-3.40.0.0.jar")), //$NON-NLS-1$
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlitejdbc-v056.jar")), //$NON-NLS-1$
FIREBIRD(new DbVersion4Drivers(EDatabaseTypeName.FIREBIRD, "jaybird-full-2.1.1.jar")), //$NON-NLS-1$
TERADATA(new DbVersion4Drivers(EDatabaseTypeName.TERADATA,
new String[] { "terajdbc4-17.10.00.27.jar" })), //$NON-NLS-1$
@@ -64,9 +69,9 @@ public enum EDatabaseVersion4Drivers {
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
SAS_9_1(new DbVersion4Drivers(EDatabaseTypeName.SAS, "SAS 9.1", "SAS_9.1", new String[] { "sas.core.jar", //$NON-NLS-1$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
// MYSQL, add for 9594
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -78,9 +83,9 @@ public enum EDatabaseVersion4Drivers {
"Microsoft SQL Server 2012", "Microsoft SQL Server 2012", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.34.jar", "slf4j-reload4j-1.7.34.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.22.jar", "jackson-core-2.13.4.jar",
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "jcip-annotations-1.0-1.jar",
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.19.jar", "jackson-core-2.13.2.jar",
"jackson-databind-2.13.2.2.jar", "jackson-annotations-2.13.2.jar", "jcip-annotations-1.0-1.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",
"content-type-2.1.jar", "lang-tag-1.5.jar" })),
@@ -108,8 +113,6 @@ public enum EDatabaseVersion4Drivers {
EXASOL(new DbVersion4Drivers(EDatabaseTypeName.EXASOL, "exajdbc-6.0.9302.jar")), //$NON-NLS-1$
MAXDB(new DbVersion4Drivers(EDatabaseTypeName.MAXDB, "sapdbc.jar")), //$NON-NLS-1$
INGRES(new DbVersion4Drivers(EDatabaseTypeName.INGRES, "iijdbc-10.2-4.1.10.jar")),
VECTORWISE(new DbVersion4Drivers(EDatabaseTypeName.VECTORWISE, "iijdbc-10.2-4.1.10.jar")),
// HIVE(new DbVersion4Drivers(EDatabaseTypeName.HIVE, "STANDALONE", "STANDALONE", new String[] {
// "hive-jdbc-0.8.1.jar",
// "hive-metastore-0.8.1.jar", "hive-exec-0.8.1.jar", "hive-service-0.8.1.jar", "libfb303_new.jar",
@@ -150,11 +153,10 @@ public enum EDatabaseVersion4Drivers {
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "jackson-core-2.13.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"httpclient-4.5.13.jar", "joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"aws-java-sdk-redshift-internal-1.12.x.jar", "aws-java-sdk-core-1.12.315.jar", //$NON-NLS-1$ //$NON-NLS-2$
"aws-java-sdk-sts-1.12.315.jar", "aws-java-sdk-redshift-1.12.315.jar", "jmespath-java-1.12.315.jar" })), //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"jackson-databind-2.11.4.jar", "jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"aws-java-sdk-redshift-internal-1.12.x.jar" })), //$NON-NLS-1$
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.49.jar")); //$NON-NLS-1$

View File

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

View File

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

View File

@@ -153,52 +153,6 @@ public enum EHadoopProperties {
DATABRICKS_TOKEN,
DATABRICKS_DBFS_DEP_FOLDER,
K8S_SUBMIT_MODE,
K8S_MASTER,
K8S_INSTANCES,
K8S_REGISTRYSECRET,
K8S_IMAGE,
K8S_NAMESPACE,
K8S_SERVICEACCOUNT,
K8S_DISTUPLOAD,
K8S_S3BUCKET,
K8S_S3FOLDER,
K8S_S3CREDENTIALS,
K8S_S3ACCESSKEY,
K8S_S3SECRETKEY,
K8S_BLOBACCOUNT,
K8S_BLOBCONTAINER,
K8S_BLOBSECRETKEY,
K8S_AZUREACCOUNT,
K8S_AZURECREDENTIALS,
K8S_AZURECONTAINER,
K8S_AZURESECRETKEY,
K8S_AZUREAADKEY,
K8S_AZUREAADCLIENTID,
K8S_AZUREAADDIRECTORYID,
DATABRICKS_NODE_TYPE,

View File

@@ -20,7 +20,7 @@ import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.pendo.PendoDataTrackFactory;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.runtime.i18n.Messages;
import org.talend.core.service.ICloudSignOnService;
import org.talend.repository.model.RepositoryConstants;
@@ -254,7 +254,7 @@ public class ConnectionBean implements Cloneable {
String user = conDetails.getString(USER);
if (isToken()) {
String url = getDynamicFields().get(RepositoryConstants.REPOSITORY_URL);
user = PendoDataTrackFactory.getInstance().getTmcUser(url, getPassword());
user = PendoTrackSender.getInstance().getTmcUser(url, getPassword());
if (StringUtils.isNotBlank(user)) {
setUser(user);
}

View File

@@ -293,8 +293,7 @@ public final class MetadataToolHelper {
boolean isKeyword = KeywordsValidator.isKeyword(originalColumnName);
StringBuilder sb = new StringBuilder();
// keep charBit length align with the length of originalColumnName (StringBuilder)
int[] charBit = new int[originalColumnName.length()];
int[] charBit = new int[columnName.length()];
if (!isKeyword) {
boolean isAllowSpecific = isAllowSpecificCharacters();

View File

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

View File

@@ -433,16 +433,6 @@ public class ComponentToRepositoryProperty {
connection.setDatabaseType(EDatabaseTypeName.IBMDB2.getDisplayName());
connection.setProductId(EDatabaseTypeName.IBMDB2.getProduct());
}
// Ingres
else if (EDatabaseTypeName.INGRES.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
connection.setDatabaseType(EDatabaseTypeName.INGRES.getDisplayName());
connection.setProductId(EDatabaseTypeName.INGRES.getProduct());
}
// VECTORWISE
else if (EDatabaseTypeName.VECTORWISE.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
connection.setDatabaseType(EDatabaseTypeName.VECTORWISE.getDisplayName());
connection.setProductId(EDatabaseTypeName.VECTORWISE.getProduct());
}
// Sqlite
else if (EDatabaseTypeName.SQLITE.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
connection.setDatabaseType(EDatabaseTypeName.SQLITE.getDisplayName());

View File

@@ -1115,9 +1115,7 @@ public class RepositoryToComponentProperty {
|| EDatabaseConnTemplate.SAPHana.getDBDisplayName().equals(databaseType)
|| EDatabaseConnTemplate.MSSQL.getDBDisplayName().equals(databaseType)) {
if (dbVersionString != null) {
if (EDatabaseVersion4Drivers.getDbVersionName(databaseType, dbVersionString) != null) {
driverValue = dbVersionString.toUpperCase();
}
driverValue = dbVersionString.toUpperCase();
}
}
if (isContextMode(connection, dbVersionString)) {

View File

@@ -18,7 +18,6 @@ import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import org.apache.commons.codec.binary.StringUtils;
import org.talend.components.api.properties.ComponentProperties;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IMultipleComponentManager;
@@ -510,7 +509,7 @@ public abstract class AbstractNode implements INode {
}
for (String key : childParameters.keySet()) {
IElementParameter param = childParameters.get(key);
if (StringUtils.equals(name, param.getName())) {
if (param.getName().equals(name)) {
return param;
}
}
@@ -677,8 +676,7 @@ public abstract class AbstractNode implements INode {
return null;
}
for (IMetadataTable table : metadataList) {
String attachedConnector = table.getAttachedConnector();
if (attachedConnector != null && attachedConnector.equals(connector)) {
if (table.getAttachedConnector().equals(connector)) {
return table;
}
}

View File

@@ -38,7 +38,6 @@ public enum EParameterFieldType {
SCHEMA_XPATH_QUERYS,
QUERYSTORE_TYPE,
GUESS_SCHEMA,
DYNAMIC_GUESS_SCHEMA,
PROPERTY_TYPE,
EXTERNAL,
FILE,

View File

@@ -85,7 +85,7 @@ public class TalendLibsServerManager {
public static final String TALEND_LIB_PASSWORD = "";//$NON-NLS-1$
public static final String TALEND_LIB_REPOSITORY = "studio-libraries";//$NON-NLS-1$
public static final String TALEND_LIB_REPOSITORY = "libraries";//$NON-NLS-1$
private static TalendLibsServerManager manager = null;

View File

@@ -1,73 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.service.ICoreTisRuntimeService;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoDataTrackFactory {
private static PendoDataTrackFactory instance;
private static ICoreTisRuntimeService coreRuntimeService;
static {
instance = new PendoDataTrackFactory();
coreRuntimeService = ICoreTisRuntimeService.get();
}
private PendoDataTrackFactory() {
}
public static PendoDataTrackFactory getInstance() {
return instance;
}
public boolean isTrackSendAvailable() throws Exception {
if (coreRuntimeService != null) {
return coreRuntimeService.isPendoTrackAvailable();
}
return false;
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
if (coreRuntimeService != null) {
coreRuntimeService.sendPendoTrackData(event, properties);
}
}
public void sendProjectLoginTrack() {
if (coreRuntimeService != null) {
AbstractPendoTrackManager pendoProjectLoginManager = coreRuntimeService.getPendoProjectLoginManager();
pendoProjectLoginManager.sendTrackToPendo();
}
}
public void sendGenericTrack(TrackEvent event, IPendoDataProperties properties) {
if (coreRuntimeService != null) {
AbstractPendoTrackManager genericManager = coreRuntimeService.getPendoGenericManager(event, properties);
genericManager.sendTrackToPendo();
}
}
public String getTmcUser(String url, String token) {
if (coreRuntimeService != null) {
return coreRuntimeService.getTmcUser(url, token);
}
return "";
}
}

View File

@@ -12,12 +12,26 @@
// ============================================================================
package org.talend.core.pendo;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.properties.PendoLoginProperties;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.service.IStudioLiteP2Service;
import org.talend.core.service.IStudioLiteP2Service.UpdateSiteConfig;
import org.talend.core.ui.IInstalledPatchService;
import org.talend.repository.ProjectManager;
import org.talend.utils.json.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -50,6 +64,47 @@ public class PendoTrackDataUtil {
return content;
}
public static IPendoDataProperties getLoginEventProperties() {
String studioPatch = getLatestPatchInstalledVersion();
PendoLoginProperties loginEvent = new PendoLoginProperties();
IStudioLiteP2Service studioLiteP2Service = IStudioLiteP2Service.get();
try {
if (studioLiteP2Service != null) {
List<String> enabledFeatures = new ArrayList<String>();
List<String> enabledFeaturesList = studioLiteP2Service.getCurrentProjectEnabledFeatures();
enabledFeaturesList.stream().forEach(feature -> {
String result = feature;
if (result.startsWith(FEATURE_PREFIX)) {
result = result.substring(FEATURE_PREFIX.toCharArray().length);
}
if (result.endsWith(FEATURE_TAIL)) {
result = result.substring(0, result.lastIndexOf(FEATURE_TAIL));
}
enabledFeatures.add(result);
});
loginEvent.setEnabledFeatures(enabledFeatures);
}
setUpRefProjectsStructure(loginEvent);
loginEvent.setIsOneClickLogin(Boolean.FALSE.toString());
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
loginEvent.setIsOneClickLogin(Boolean.TRUE.toString());
}
loginEvent.setManagedUpdate(Boolean.FALSE.toString());
if (IStudioLiteP2Service.get() != null) {
IProgressMonitor monitor = new NullProgressMonitor();
UpdateSiteConfig config = IStudioLiteP2Service.get().getUpdateSiteConfig(monitor);
if (config.isEnableTmcUpdateSettings(monitor) && !config.isOverwriteTmcUpdateSettings(monitor)) {
loginEvent.setManagedUpdate(Boolean.TRUE.toString());
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
loginEvent.setStudioVersion(VersionUtils.getInternalMajorVersion());
loginEvent.setStudioPatch(studioPatch);
return loginEvent;
}
public static String getLatestPatchInstalledVersion() {
String studioPatch = "";
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
@@ -59,6 +114,52 @@ public class PendoTrackDataUtil {
return studioPatch;
}
private static void setUpRefProjectsStructure(PendoLoginProperties loginEvent) {
ProjectManager projectManager = ProjectManager.getInstance();
Project currentProject = projectManager.getCurrentProject();
Map<String, Project> teclabelProjectMap = new HashMap<String, Project>();
List<Project> allReferencedProjects = projectManager.getAllReferencedProjects();
allReferencedProjects.forEach(refProject -> {
String technicalLabel = refProject.getTechnicalLabel();
if (StringUtils.isNotBlank(technicalLabel)) {
teclabelProjectMap.put(technicalLabel, refProject);
}
});
int[] refCount = new int[] {0};
List<String> resultList = new ArrayList<String>();
Map<String, String> desensitiveLabelMap = new HashMap<String, String>();
findReferencePorjectPath(currentProject, "Main", resultList, refCount, desensitiveLabelMap, teclabelProjectMap);
loginEvent.setRefProjectList(resultList);
loginEvent.setRefProjectCount(String.valueOf(desensitiveLabelMap.keySet().size()));
}
public static void findReferencePorjectPath(Project currentProject, String path, List<String> resultList, int[] refCount,
Map<String, String> desensitiveLabelMap, Map<String, Project> teclabelProjectMap) {
List<ProjectReference> projectReferenceList = currentProject.getProjectReferenceList();
for (ProjectReference projectReference : projectReferenceList) {
String structPath = path;
if (projectReference.getReferencedProject() == null) {
continue;
}
String technicalLabel = projectReference.getReferencedProject().getTechnicalLabel();
Project refProject = teclabelProjectMap.get(technicalLabel);
if (StringUtils.isBlank(technicalLabel) || refProject == null) {
continue;
}
String desensitiveLabel = desensitiveLabelMap.get(technicalLabel);
if (StringUtils.isBlank(desensitiveLabel)) {
refCount[0] = refCount[0] + 1;
desensitiveLabel = "Ref" + refCount[0];
desensitiveLabelMap.put(technicalLabel, desensitiveLabel);
}
structPath = structPath + "/" + desensitiveLabel;
resultList.add(structPath);
findReferencePorjectPath(refProject, structPath, resultList, refCount, desensitiveLabelMap, teclabelProjectMap);
}
}
public static String convertEntityJsonString(Object entity) {
ObjectMapper mapper = new ObjectMapper();
try {
@@ -72,4 +173,30 @@ public class PendoTrackDataUtil {
return "";
}
public enum TrackEvent {
PROJECT_LOGIN("Project Login"),
IMPORT_API_DEF("Import API Definition"),
UPDATE_API_DEF("Update API Definition"),
USE_API_DEF("Use API Definition"),
OPEN_IN_APIDesigner("Open in API Designer"),
OPEN_IN_APITester("Open in API Tester"),
OPEN_API_DOCUMENTATION("Open API Documentation"),
AUTOMAP("tMap Automap"),
TMAP("tMap"),
ITEM_IMPORT("Import items"),
ITEM_SIGNATURE("Item Signature");
private String event;
TrackEvent(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}
}

View File

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

View File

@@ -1,79 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo;
/**
* DOC jding class global comment. Detailled comment
*/
public enum TrackEvent {
/**
* create by TUP-33421 update by TUP-34791, TUP-35523, TUP-36780
*/
PROJECT_LOGIN("Project Login"),
/**
* create by TUP-33990
*/
IMPORT_API_DEF("Import API Definition"),
/**
* create by TUP-33990
*/
UPDATE_API_DEF("Update API Definition"),
/**
* create by TUP-33990
*/
USE_API_DEF("Use API Definition"),
/**
* create by TUP-33990
*/
OPEN_IN_APIDesigner("Open in API Designer"),
/**
* create by TUP-33990
*/
OPEN_IN_APITester("Open in API Tester"),
/**
* create by TUP-33990
*/
OPEN_API_DOCUMENTATION("Open API Documentation"),
/**
* create by TUP-35644
*/
AUTOMAP("tMap Automap"),
/**
* create by TUP-35644 update by TUP-36710
*/
TMAP("tMap"),
/**
* create by TUP-35712 update by TUP-36893
*/
ITEM_IMPORT("Import items"),
/**
* create by TUP-35712
*/
ITEM_SIGNATURE("Item Signature");
private String event;
TrackEvent(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}

View File

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

View File

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

View File

@@ -0,0 +1,171 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo.properties;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoLoginProperties implements IPendoDataProperties {
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("studio_patch")
private String studioPatch;
@JsonProperty("enabled_features")
private List<String> enabledFeatures;
@JsonProperty("referenced_project_number")
private String refProjectCount;
@JsonProperty("referenced_projects")
private List<String> refProjectList;
@JsonProperty("one_click_login")
private String isOneClickLogin;
@JsonProperty("managed_update")
private String managedUpdate;
/**
* Getter for studio_version.
*
* @return the studio_version
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studio_version.
*
* @param studio_version the studio_version to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for studio_patch.
*
* @return the studio_patch
*/
public String getStudioPatch() {
return studioPatch;
}
/**
* Sets the studio_patch.
*
* @param studio_patch the studio_patch to set
*/
public void setStudioPatch(String studioPatch) {
this.studioPatch = studioPatch;
}
/**
* Getter for enabled_features.
*
* @return the enabled_features
*/
public List<String> getEnabledFeatures() {
return enabledFeatures;
}
/**
* Sets the enabled_features.
*
* @param enabled_features the enabled_features to set
*/
public void setEnabledFeatures(List<String> enabledFeatures) {
this.enabledFeatures = enabledFeatures;
}
/**
* Getter for refProjectCount.
*
* @return the refProjectCount
*/
public String getRefProjectCount() {
return refProjectCount;
}
/**
* Sets the refProjectCount.
*
* @param refProjectCount the refProjectCount to set
*/
public void setRefProjectCount(String refProjectCount) {
this.refProjectCount = refProjectCount;
}
/**
* Getter for refProjectList.
*
* @return the refProjectList
*/
public List<String> getRefProjectList() {
return refProjectList;
}
/**
* Sets the refProjectList.
*
* @param refProjectList the refProjectList to set
*/
public void setRefProjectList(List<String> refProjectList) {
this.refProjectList = refProjectList;
}
/**
* Getter for isOneClickLogin.
*
* @return the isOneClickLogin
*/
public String getIsOneClickLogin() {
return isOneClickLogin;
}
/**
* Sets the isOneClickLogin.
*
* @param isOneClickLogin the isOneClickLogin to set
*/
public void setIsOneClickLogin(String isOneClickLogin) {
this.isOneClickLogin = isOneClickLogin;
}
/**
* Getter for managedUpdate.
*
* @return the managedUpdate
*/
public String getManagedUpdate() {
return managedUpdate;
}
/**
* Sets the managedUpdate.
*
* @param managedUpdate the managedUpdate to set
*/
public void setManagedUpdate(String managedUpdate) {
this.managedUpdate = managedUpdate;
}
}

View File

@@ -203,12 +203,4 @@ public interface ITalendCorePrefConstants {
public static final boolean NEXUS_SHARE_LIBS_DEFAULT = false;
public static final String PERSPECTIVE_PERSIST_SCOPE = "PERSPECTIVE_PERSIST_SCOPE"; //$NON-NLS-1$
public static final String PERSPECTIVE_PERSIST_SCOPE_PROJECT_AND_BRANCH = "PROJECT_AND_BRANCH"; //$NON-NLS-1$
public static final String PERSPECTIVE_PERSIST_SCOPE_STUDIO = "STUDIO"; //$NON-NLS-1$
public static final String PERSPECTIVE_PERSIST_SCOPE_DEFAULT = PERSPECTIVE_PERSIST_SCOPE_PROJECT_AND_BRANCH;
}

View File

@@ -655,9 +655,4 @@ ItemAnalysisReportManager.Warning.message=Can't run a new analysis now. Wait for
AnalysisReportAccessDialog.shellTitle=Project analysis
AnalysisReportAccessDialog.generateSuccess=Project analysis completed successfully.
AnalysisReportAccessDialog.completeReportAvailable=Check the report
AnalysisReportAccessDialog.accessReport=here
AbstractPomTemplateProjectSettingPage.defaultTabLabel=Default
AbstractPomTemplateProjectSettingPage.customTabLabel=Custom
AbstractPomTemplateProjectSettingPage.previewButton=Preview
AbstractPomTemplateProjectSettingPage.previewButtonTip=Preview the complete customized project POM settings.
AbstractPomTemplateProjectSettingPage.learnMoreLink=Learn more
AnalysisReportAccessDialog.accessReport=here

View File

@@ -656,7 +656,3 @@ AnalysisReportAccessDialog.shellTitle=Analyse du projet
AnalysisReportAccessDialog.generateSuccess=Analyse du projet termin\u00E9e.
AnalysisReportAccessDialog.completeReportAvailable=Consulter le rapport
AnalysisReportAccessDialog.accessReport=ici
AbstractPomTemplateProjectSettingPage.defaultTabLabel=Par d\u00E9faut
AbstractPomTemplateProjectSettingPage.customTabLabel=Personnalis\u00E9
AbstractPomTemplateProjectSettingPage.previewButton=Aper\u00E7u
AbstractPomTemplateProjectSettingPage.learnMoreLink=En savoir plus

View File

@@ -281,7 +281,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
PropertiesWizardPage.Description=\u8AAC\u660E
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
PropertiesWizardPage.Name=\u540D\u524D
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002
@@ -637,8 +637,8 @@ DynamicPlugin.addExtension.empty=ExtensionPoint\u307E\u305F\u306FID\u304C\u7A7A\
BigDataBasicUtil.loadDynamicDistribution.IDynamicDistributionManager.notFound={0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
TalendLibsServerManager.connectUserLibraryFailureMessage=\u7BA1\u7406\u8005\u30E2\u30FC\u30C9\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u304C\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002{0}\u3078\u306E\u63A5\u7D9A\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F
TalendLibsServerManager.cannotGetUserLibraryServer=\u30EA\u30E2\u30FC\u30C8\u7BA1\u7406\u8005\u304B\u3089\u30E6\u30FC\u30B6\u30FC\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u30B5\u30FC\u30D0\u30FC\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093
MigrationReportAccessDialog.title=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9805\u76EE\u3092\u79FB\u884C
MigrationReportAccessDialog.migrateSuccess=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9805\u76EE\u304C\u6B63\u3057\u304F\u79FB\u884C\u3055\u308C\u307E\u3057\u305F\u3002
MigrationReportAccessDialog.title=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30A2\u30A4\u30C6\u30E0\u3092\u79FB\u884C
MigrationReportAccessDialog.migrateSuccess=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30A2\u30A4\u30C6\u30E0\u304C\u6B63\u3057\u304F\u79FB\u884C\u3055\u308C\u307E\u3057\u305F\u3002
MigrationReportAccessDialog.completeReportAvailable=\u30EC\u30DD\u30FC\u30C8\u3092\u30C1\u30A7\u30C3\u30AF
MigrationReportAccessDialog.accessReport=\u3053\u3061\u3089
MigrationReportAccessDialog.provideAnalysisTool=\u4ECA\u3059\u3050\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5206\u6790\u3092\u5B9F\u884C\u3057\u3066\u3001\u79FB\u884C\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u5206\u6790\u3067\u304D\u307E\u3059\u3002\u3053\u306E\u8A66\u9A13\u7684\u306A\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u3001\u4EE5\u4E0B\u304C\u542B\u307E\u308C\u308B\u30EC\u30DD\u30FC\u30C8\u304C\u751F\u6210\u3055\u308C\u307E\u3059:
@@ -656,7 +656,3 @@ AnalysisReportAccessDialog.shellTitle=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5206
AnalysisReportAccessDialog.generateSuccess=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5206\u6790\u304C\u6B63\u3057\u304F\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002
AnalysisReportAccessDialog.completeReportAvailable=\u30EC\u30DD\u30FC\u30C8\u3092\u30C1\u30A7\u30C3\u30AF
AnalysisReportAccessDialog.accessReport=\u3053\u3061\u3089
AbstractPomTemplateProjectSettingPage.defaultTabLabel=\u30C7\u30D5\u30A9\u30EB\u30C8
AbstractPomTemplateProjectSettingPage.customTabLabel=\u30AB\u30B9\u30BF\u30E0
AbstractPomTemplateProjectSettingPage.previewButton=\u30D7\u30EC\u30D3\u30E5\u30FC
AbstractPomTemplateProjectSettingPage.learnMoreLink=\u8A73\u7D30

View File

@@ -656,7 +656,3 @@ AnalysisReportAccessDialog.shellTitle=\u5DE5\u7A0B\u5206\u6790
AnalysisReportAccessDialog.generateSuccess=\u5DE5\u7A0B\u5206\u6790\u6210\u529F\u5B8C\u6210\u3002
AnalysisReportAccessDialog.completeReportAvailable=\u8BF7\u68C0\u67E5\u62A5\u544A
AnalysisReportAccessDialog.accessReport=\u6B64\u5904
AbstractPomTemplateProjectSettingPage.defaultTabLabel=\u9ED8\u8BA4
AbstractPomTemplateProjectSettingPage.customTabLabel=\u81EA\u5B9A\u4E49
AbstractPomTemplateProjectSettingPage.previewButton=\u9884\u89C8
AbstractPomTemplateProjectSettingPage.learnMoreLink=\u4E86\u89E3\u66F4\u591A

View File

@@ -1,183 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.runtime.projectsetting;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.i18n.Messages;
import org.talend.repository.model.IProxyRepositoryFactory;
public abstract class AbstractPomTemplateProjectSettingPage extends AbstractProjectSettingPage {
private static final Color COLOR_LINK = new Color(null, 0, 0, 255);
protected StyledText defaultText;
protected StyledText customText;
private boolean isDefaultPresentedForScriptTxt = false;
private boolean readonly;
public AbstractPomTemplateProjectSettingPage() {
super();
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
readonly = factory.isUserReadOnlyOnCurrentProject();
}
protected boolean isReadonly() {
return readonly;
}
public void setReadonly(boolean readonly) {
this.readonly = readonly;
}
protected abstract String getPreferenceKey();
protected StyledText getScriptTxt() {
return customText;
}
@Override
protected Control createContents(Composite p) {
Composite parent = (Composite) super.createContents(p);
Composite noteComposite = new Composite(parent, SWT.NONE);
noteComposite.setLayout(new GridLayout(2, false));
Label scriptLabel = new Label(noteComposite, SWT.NONE);
String headerMessages = getHeaderMessage();
scriptLabel.setText(headerMessages);
Hyperlink link = new Hyperlink(noteComposite, SWT.NONE);
link.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.learnMoreLink")); //$NON-NLS-1$
link.setUnderlined(true);
link.setForeground(COLOR_LINK);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
Program.launch(getMoreInfoUrl());
}
});
CTabFolder tabFolder = new CTabFolder(parent, SWT.BORDER);
// tabFolder.setTabPosition(SWT.BOTTOM);
tabFolder.setSimple(false);
GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
tabFolder.setLayoutData(data);
data.heightHint = 280;
data.minimumHeight = 280;
data.widthHint = 500;
data.minimumWidth = 500;
CTabItem defaultTabItem = new CTabItem(tabFolder, SWT.NULL);
defaultTabItem.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.defaultTabLabel")); //$NON-NLS-1$
CTabItem customTabItem = new CTabItem(tabFolder, SWT.NULL);
customTabItem.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.customTabLabel")); //$NON-NLS-1$
tabFolder.setSelection(defaultTabItem);
int style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
defaultText = new StyledText(tabFolder, style);
defaultText.setText(getDefaultText());
defaultText.setBackground(new Color(null, 233, 233, 233));
defaultText.setEditable(false);
defaultTabItem.setControl(defaultText);
customText = new StyledText(tabFolder, style);
customText.setText(getCustomText());
customText.setEditable(!isReadonly());
customTabItem.setControl(customText);
customText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
isDefaultPresentedForScriptTxt = false;
}
});
Button preview = new Button(parent, SWT.NONE);
preview.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.previewButton")); //$NON-NLS-1$
preview.setToolTipText(Messages.getString("AbstractPomTemplateProjectSettingPage.previewButtonTip")); //$NON-NLS-1$
preview.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkModel(true);
}
});
return parent;
}
protected abstract String getHeaderMessage();
protected abstract String getDefaultText();
protected String getCustomText() {
return getPreferenceStore().getString(getPreferenceKey());
}
protected abstract boolean checkModel(boolean preview);
protected abstract String getMoreInfoUrl();
@Override
protected void performDefaults() {
super.performDefaults();
if (customText != null && !customText.isDisposed()) {
isDefaultPresentedForScriptTxt = true;
customText.setText(getPreferenceStore().getDefaultString(getPreferenceKey()));
}
}
@Override
public boolean performOk() {
boolean ok = super.performOk();
if (customText != null && !customText.isDisposed()) {
if (isDefaultPresentedForScriptTxt) {
getPreferenceStore().setToDefault(getPreferenceKey());
return ok;
}
if (!checkModel(false)) {
return false;
}
getPreferenceStore().setValue(getPreferenceKey(), customText.getText());
}
return ok;
}
}

View File

@@ -60,8 +60,6 @@ public interface IProjectSettingTemplateConstants {
final static String PROJECT_TEMPLATE_FILE_NAME = "pom_project_template.xml";
final static String PROJECT_CUSTOM_TEMPLATE_FILE_NAME = "pom_project_custom_template.xml";
final static String MAVEN_USER_SETTING_TEMPLATE_FILE_NAME = "maven_user_settings.xml";
/*

View File

@@ -1,66 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.runtime.projectsetting;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
public class PomPreviewDialog extends Dialog {
private String title;
private String content;
public PomPreviewDialog(Shell parentShell, String title, String content) {
super(parentShell);
this.title = title;
this.content = content;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(title);
}
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
data.heightHint = 280;
data.minimumHeight = 1000;
data.widthHint = 500;
data.minimumWidth = 1100;
composite.setLayoutData(data);
StyledText text = new StyledText(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
text.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
text.setText(content);
text.setEditable(false);
return composite;
}
@Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
}
}

View File

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

View File

@@ -1,234 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.runtime.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.ProjectManager;
public class ModuleAccessHelper {
private static final String FORMAT_ADD_OPPENS = "--add-opens=@=ALL-UNNAMED"; //$NON-NLS-1$
private static final String CLASS_PREVIEW_PROCESS = "org.talend.designer.component.preview.shadow.PreviewComponentDataProcess"; //$NON-NLS-1$
private static final String CLASS_GUESS_SCHEMA_PROCESS = "org.talend.designer.core.ui.editor.properties.controllers.AbstractGuessSchemaProcess"; //$NON-NLS-1$
private static Properties PROPS;
public static Properties getProperties() {
if (PROPS == null) {
PROPS = new Properties();
try (InputStream input = getConfigFileURL().openStream()) {
PROPS.load(input);
} catch (IOException e) {
ExceptionHandler.process(e);
}
Optional.ofNullable(System.getProperty("internal.custom.modules")).filter(StringUtils::isNotBlank)
.ifPresent(modules -> put("GLOBAL", modules));
List<Project> allProjects = new ArrayList<>();
allProjects.add(ProjectManager.getInstance().getCurrentProject());
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects(true));
for (Project ref : allProjects) {
ProjectPreferenceManager prefManager = new ProjectPreferenceManager(ref, CoreRuntimePlugin.PLUGIN_ID, false);
String settings = prefManager.getValue(JavaUtils.CUSTOM_ACCESS_SETTINGS);
if (StringUtils.isNotBlank(settings)) {
Properties customProps = new Properties();
try {
customProps.load(new ByteArrayInputStream(settings.getBytes()));
customProps.entrySet().stream().filter(en -> StringUtils.isNotBlank((String) en.getValue()))
.forEach(en -> put((String) en.getKey(), (String) en.getValue()));
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
}
}
return PROPS;
}
private static void put(String key, String value) {
PROPS.put(key, PROPS.containsKey(key) ? PROPS.getProperty(key) + "," + value : value);
}
public static URL getConfigFileURL() {
return Platform.getBundle(CoreRuntimePlugin.PLUGIN_ID).getEntry("resources/module_access.properties"); //$NON-NLS-1$
}
private static boolean containsKey(String key) {
return getProperties().containsKey(key);
}
private static Set<String> getModules(String key) {
String modules = getProperties().getProperty(key);
if (modules != null) {
return Stream.of(modules.split(",")).map(module -> FORMAT_ADD_OPPENS.replace("@", module.trim())) //$NON-NLS-1$ //$NON-NLS-2$
.collect(Collectors.toSet());
}
return Collections.emptySet();
}
private static boolean allowJavaInternalAcess(Property property) {
String allow = System.getProperty(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
if (allow != null) {
return Boolean.valueOf(allow);
}
if (CommonsPlugin.isJUnitTest() || CommonsPlugin.isJunitWorking()) {
return true;
}
Project project;
if (property != null) {
project = ProjectManager.getInstance()
.getProjectFromProjectTechLabel(ProjectManager.getInstance().getProject(property).getTechnicalLabel());
} else {
project = ProjectManager.getInstance().getCurrentProject();
}
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(project, CoreRuntimePlugin.PLUGIN_ID, false);
return preferenceManager.getBoolean(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
}
public static Set<String> getModuleAccessVMArgsForProcessor(IProcessor processor) {
Property property = processor.getProperty();
if (property == null) {
return Collections.emptySet();
}
if (!allowJavaInternalAcess(property)) {
return Collections.emptySet();
}
if (isPreviewProcess(processor)) {
// add all for preview process
return getProperties().entrySet().stream().filter(en -> StringUtils.isNotBlank((String) en.getValue()))
.flatMap(en -> getModules((String) en.getKey()).stream()).collect(Collectors.toSet());
}
ProcessItem mainJobItem = (ProcessItem) property.getItem();
Set<JobInfo> allJobInfos = new HashSet<>();
allJobInfos.add(new JobInfo(mainJobItem, mainJobItem.getProcess().getDefaultContext()));
allJobInfos.addAll(processor.getBuildChildrenJobsAndJoblets());
return ModuleAccessHelper.getModuleAccessVMArgs(property, allJobInfos);
}
@SuppressWarnings("unchecked")
public static Set<String> getModuleAccessVMArgs(Property property, Set<JobInfo> allJobInfos) {
if (property == null || property.getItem() == null || !allowJavaInternalAcess(property)) {
return Collections.emptySet();
}
Set<String> vmArgs = new HashSet<>();
boolean hasTck = false;
for (JobInfo info : allJobInfos) {
EList<NodeType> nodes = null;
EList<ElementParameterType> parameters = null;
if (info.getJobletProperty() != null) {
JobletProcessItem item = (JobletProcessItem) info.getJobletProperty().getItem();
if (item.getJobletProcess() != null) {
nodes = item.getJobletProcess().getNode();
if (item.getJobletProcess().getParameters() != null) {
parameters = item.getJobletProcess().getParameters().getElementParameter();
}
}
} else if (info.getProcessItem() != null && info.getProcessItem().getProcess() != null) {
nodes = info.getProcessItem().getProcess().getNode();
if (info.getProcessItem().getProcess().getParameters() != null) {
parameters = info.getProcessItem().getProcess().getParameters().getElementParameter();
}
}
if (nodes != null) {
nodes.stream().filter(node -> containsKey(node.getComponentName()))
.forEach(node -> vmArgs.addAll(getModules(node.getComponentName())));
}
if (parameters != null) {
// FIXME currently it depends on spark version, refine the condition if needed
Optional<ElementParameterType> optional = parameters.stream()
.filter(p -> "SUPPORTED_SPARK_VERSION".equals(p.getName()) && containsKey(p.getValue())).findFirst();
if (optional.isPresent()) {
vmArgs.addAll(getModules(optional.get().getValue()));
}
}
if (!hasTck) {
hasTck = nodes.stream()
.anyMatch(node -> node.getElementParameter().stream()
.anyMatch(p -> ((ElementParameterType) p).getField() != null
&& EParameterFieldType.TECHNICAL.getName().equals(((ElementParameterType) p).getField())
&& ((ElementParameterType) p).getName().equals("TACOKIT_COMPONENT_ID")));
}
}
if (hasTck) {
vmArgs.addAll(getModules("TCK_COMMON_ARGS"));
}
if (getProperties().containsKey("GLOBAL")) {
vmArgs.addAll(getModules("GLOBAL"));
}
return vmArgs;
}
public static void reset() {
PROPS = null;
}
private static boolean isPreviewProcess(IProcessor processor) {
IProcess process = processor.getProcess();
if (process == null) {
return false;
}
Property property = processor.getProperty();
if ("ID".equals(property.getId()) && "Mock_job_for_Guess_schema".equals(property.getLabel())) {
return true;
}
Class<?> clazz = process.getClass();
// preview process
if (CLASS_PREVIEW_PROCESS.equals(clazz.getName()) || CLASS_PREVIEW_PROCESS.equals(clazz.getSuperclass().getName())) {
return true;
}
// guess schema process
if (CLASS_GUESS_SCHEMA_PROCESS.equals(clazz.getSuperclass().getName())) {
return true;
}
return false;
}
}

View File

@@ -21,6 +21,10 @@ public interface ICloudSignOnService extends IService {
TokenMode getToken(String authCode, String codeVerifier, String dataCenter) throws Exception;
void startHeartBeat() throws Exception;
void stopHeartBeat();
String generateCodeVerifier();
String getCodeChallenge(String seed) throws Exception;
@@ -39,13 +43,11 @@ public interface ICloudSignOnService extends IService {
boolean isNeedShowSSOPage();
public boolean showReloginDialog();
public void showReloginDialog();
public boolean isReloginDialogRunning();
public void reload();
public boolean isRelogined4CurrentTask(String clazz);
public static ICloudSignOnService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICloudSignOnService.class)) {

View File

@@ -1,64 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import java.io.File;
import org.talend.commons.CommonsPlugin;
import org.talend.core.IService;
/**
* @author bhe created on Jan 19, 2023
*
*/
public interface IComponentJsonformGeneratorService extends IService {
/**
* System property to enable whether to generate jsonform or not, not enabled by default
*/
public static final String JSONFORM_GENERATE_PROP = "jsonform.generate";
public static final String JSONFORM_GENERATE_FOLDER_PROP = "jsonform.generate.dir";
public static final String JSONFORM_GENERATE_FOLDER_NAME_PROP = "jsonforms";
/**
* Generate jsonform json files for all of components
*
* <pre>
* Folder structure
*
* targetFolder
* --Category
* ----tRowgenerator.json
* ----tLogRow.json
*
* </pre>
*
* @param targetFolder all of jsonform jsons will be saved into the targetFolder
*/
void generate(File targetFolder);
/**
* If enabled by -Djsonform.generate or by running junit, then generate jsonform for components, otherwise will not generate.
*
* @return enabled or not
*/
public static boolean isEnabled() {
return Boolean.getBoolean(JSONFORM_GENERATE_PROP) || CommonsPlugin.isJUnitTest() || CommonsPlugin.isJunitWorking();
}
public static String getDirectoryFromProperty() {
return System.getProperty(JSONFORM_GENERATE_FOLDER_PROP);
}
}

View File

@@ -1,45 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
/**
* DOC jding class global comment. Detailled comment
*/
public interface ICoreTisRuntimeService extends IService {
String getTmcUser(String url, String token);
AbstractPendoTrackManager getPendoProjectLoginManager();
AbstractPendoTrackManager getPendoGenericManager(TrackEvent event, IPendoDataProperties peoperties);
boolean isPendoTrackAvailable() throws Exception;
void sendPendoTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception;
void sendPTPTrackData(String componentName, String componentUniqName, String jobId, String data);
static ICoreTisRuntimeService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreTisRuntimeService.class)) {
return GlobalServiceRegister.getDefault().getService(ICoreTisRuntimeService.class);
}
return null;
}
}

View File

@@ -75,6 +75,4 @@ public interface IESBMicroService extends IService {
* @return
*/
IBuildJobHandler createBuildJobHandler(ProcessItem itemToExport, String version, String context, Map exportChoiceMap);
public List<String> getExternalizedDependencies();
}

View File

@@ -35,6 +35,10 @@ public interface IRemoteService extends IService {
LoginException, JSONException;
boolean isAuthorized(String value);
boolean isTokenUsed(String adminUrl) throws Exception;
String getPendoKeyFromLicense() throws Exception;
public boolean isCloudConnection();

View File

@@ -12,23 +12,14 @@
// ============================================================================
package org.talend.core.service;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.security.storage.ISecurePreferences;
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.general.Project;
@@ -210,12 +201,6 @@ public interface IStudioLiteP2Service extends IService {
}
public static interface UpdateSiteConfig {
public static final int DEFAULT_TIMEOUT = 4000;
public static final String PROTOCOL_HTTP = "http";
public static final String PROTOCOL_HTTPS = "https";
boolean isReleaseEditable();
@@ -254,79 +239,6 @@ public interface IStudioLiteP2Service extends IService {
boolean isOverwriteTmcUpdateSettings(IProgressMonitor monitor) throws Exception;
void overwriteTmcUpdateSettings(IProgressMonitor monitor, boolean overwrite) throws Exception;
void enableBasicAuth(String uri, boolean enable) throws Exception;
boolean isEnabledBasicAuth(String uri) throws Exception;
public static boolean requireCredentials(URI uri, String nameAndPwd) throws Exception {
String scheme = uri.getScheme();
if (StringUtils.isEmpty(scheme) || (!StringUtils.equals(scheme, PROTOCOL_HTTP) && !StringUtils.equals(scheme, PROTOCOL_HTTPS))) {
return false;
}
URL url = new URL(uri.toString() + "/p2.index");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(DEFAULT_TIMEOUT);
conn.setReadTimeout(DEFAULT_TIMEOUT);
conn.setRequestMethod("HEAD");
if (!StringUtils.isEmpty(nameAndPwd)) {
nameAndPwd = Base64.encodeBase64String(nameAndPwd.getBytes());
conn.addRequestProperty("Authorization", "Basic " + nameAndPwd);
}
int responseCode = conn.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED || responseCode == HttpURLConnection.HTTP_FORBIDDEN) {
return true;
}
return false;
}
public static void saveCredentialsIntoSecureStore(URI uri, String uname, String pwd) throws Exception {
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
String nodeKey = URLEncoder.encode(uri.getHost(), StandardCharsets.UTF_8.name());
String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
ISecurePreferences prefNode = null;
prefNode = securePreferences.node(nodeName);
prefNode.put(IRepository.PROP_USERNAME, uname, true);
prefNode.put(IRepository.PROP_PASSWORD, pwd, true);
securePreferences.flush();
}
public static String[] loadCredentialsFromSecureStore(URI uri) throws Exception {
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
String nodeKey = URLEncoder.encode(uri.getHost(), StandardCharsets.UTF_8.name());
String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
ISecurePreferences prefNode = null;
String[] namePwd = new String[2];
if (!securePreferences.nodeExists(nodeName)) {
return null;
}
prefNode = securePreferences.node(nodeName);
namePwd[0] = prefNode.get(IRepository.PROP_USERNAME, "");
namePwd[1] = prefNode.get(IRepository.PROP_PASSWORD, "");
return namePwd;
}
public static void deleteCredentialsFromSecureStore(URI uri) throws Exception {
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
String nodeKey = URLEncoder.encode(uri.getHost(), StandardCharsets.UTF_8.name());
String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
if (securePreferences.nodeExists(nodeName)) {
securePreferences.remove(nodeName);
securePreferences.flush();
}
}
}

View File

@@ -81,8 +81,6 @@ public interface ITestContainerProviderService extends IService {
public List<ProcessItem> getAllTestContainers(ProcessItem item);
public List<ProcessItem> getAllTestContainers(ProcessItem item, boolean latest, boolean excludeDeleted);
public void copyDataSetFiles(IProcess process, IPath srcPath);
public String getTestDataValue(IProcess process, String instance, String testData);

View File

@@ -438,8 +438,6 @@ public final class TalendQuoteUtils {
return QUOTATION_MARK;
case IBMDB2:
return QUOTATION_MARK;
case INGRES:
return QUOTATION_MARK;
case MSODBC:
return QUOTATION_MARK;
case MSSQL:

View File

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

View File

@@ -560,7 +560,6 @@ ContextNebulaComposite.ContextsUnAvailable=Context view is not available.
ContextNebulaComposite.ContextGroupLabel=Default context environment
ContextTreeTable.PromptToolTips=activate prompt on variable
ContextValidator.ParameterNotValid=parameter name is not valid
ContextValidator.ParameterValueNotMatch=Type/value mismatch: the value of a variable must match its type
WorkspaceMnu.switch.text=Switch &Workspace
WorkspaceMnu.switch.tooltip=Open Workspace
WorkspaceMnu.choose.text=&Choose...

View File

@@ -208,7 +208,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
PropertiesWizardPage.Description=\u8AAC\u660E
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u306E\u7A7A\u767D\u306F\u907F\u3051\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u306E\u7A7A\u767D\u306F\u907F\u3051\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
PropertiesWizardPage.Name=\u540D\u524D
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002
@@ -321,7 +321,7 @@ repository.metadataFileRegexp=\u6B63\u898F\u8868\u73FE\u30D5\u30A1\u30A4\u30EB
repository.metadataFileRegexp.alias=REGX
repository.metadataFileXml=XML\u30D5\u30A1\u30A4\u30EB
repository.metadataFileXml.alias=XML
repository.metadataGenericSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE
repository.metadataGenericSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE
repository.metadataGenericSchema.alias=GENERIC
repository.metadataLDAPSchema=LDAP
repository.metadataLDAPSchema.alias=LDAP

View File

@@ -59,7 +59,6 @@ import org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer;
import org.eclipse.nebula.widgets.nattable.hideshow.command.ColumnHideCommand;
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator;
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
import org.eclipse.nebula.widgets.nattable.layer.config.DefaultColumnHeaderStyleConfiguration;
import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
import org.eclipse.nebula.widgets.nattable.painter.layer.NatGridLayerPainter;
@@ -83,7 +82,6 @@ import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
@@ -91,7 +89,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.ColorConstants;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
@@ -112,7 +109,6 @@ import org.talend.core.ui.context.nattableTree.ContextNatTableStyleConfiguration
import org.talend.core.ui.context.nattableTree.ContextNatTableUtils;
import org.talend.core.ui.context.nattableTree.ContextParaModeChangeMenuConfiguration;
import org.talend.core.ui.context.nattableTree.ContextRowDataListFixture;
import org.talend.core.ui.context.nattableTree.ContextValueLabelAccumulator;
import org.talend.core.ui.context.nattableTree.ExtendedContextColumnPropertyAccessor;
import org.talend.core.ui.i18n.Messages;
import org.talend.repository.ProjectManager;
@@ -274,7 +270,7 @@ public class ContextTreeTable {
final GridLayer gridLayer = new GridLayer(viewportLayer, sortHeaderLayer, rowHeaderLayer, cornerLayer);
// config the column edit configuration
ContextValueLabelAccumulator labelAccumulator = new ContextValueLabelAccumulator(bodyDataLayer, bodyDataProvider, manager.getContextManager(), columnGroupModel);
ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
registerColumnLabels(labelAccumulator, ContextRowDataListFixture.getContexts(manager.getContextManager()));
@@ -310,15 +306,14 @@ public class ContextTreeTable {
attachCheckColumnTip(natTable);
final Color backgroundColor = ColorConstants.getTableBackgroundColor();
// global settings only effect on body and default region, so should set other regions' color separately.
natTable.setBackground(backgroundColor);
natTable.setBackground(GUIHelper.COLOR_WHITE);
natTable.addConfiguration(new AbstractRegistryConfiguration() {
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, backgroundColor);
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL,
GridRegion.COLUMN_HEADER);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL,
@@ -555,8 +550,8 @@ public class ContextTreeTable {
private void addCustomSelectionBehaviour(SelectionLayer layer) {
// need control the selection style when select the rows.
DefaultSelectionStyleConfiguration selectStyleConfig = new DefaultSelectionStyleConfiguration();
selectStyleConfig.selectedHeaderBgColor = ColorConstants.getTableBackgroundColor();
selectStyleConfig.selectedHeaderFgColor = ColorConstants.getTableForegroundColor();
selectStyleConfig.selectedHeaderBgColor = GUIHelper.COLOR_WIDGET_BACKGROUND;
selectStyleConfig.selectedHeaderFgColor = GUIHelper.COLOR_BLACK;
selectStyleConfig.selectedHeaderFont = GUIHelper.DEFAULT_FONT;
layer.addConfiguration(selectStyleConfig);
}
@@ -806,32 +801,12 @@ public class ContextTreeTable {
if (cellValue instanceof Boolean) {
return new Point(col, row);
}
ILayerCell cell = this.nt.getCellByPosition(col, row);
if (cell != null && cell.getConfigLabels() != null
&& cell.getConfigLabels().contains(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE)
&& cell.getConfigLabels().contains(ContextTableConstants.COLUMN_CONTEXT_VALUE)) {
return new Point(col, row);
}
return null;
}
@Override
protected String getText(Event event) {
int col = this.nt.getColumnPositionByX(event.x);
int row = this.nt.getRowPositionByY(event.y);
Object cellValue = this.nt.getDataValueByPosition(col, row);
if (cellValue instanceof Boolean) {
return Messages.getString("ContextTreeTable.PromptToolTips");
}
ILayerCell cell = this.nt.getCellByPosition(col, row);
if (cell != null && cell.getConfigLabels() != null
&& cell.getConfigLabels().contains(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE)
&& cell.getConfigLabels().contains(ContextTableConstants.COLUMN_CONTEXT_VALUE)) {
return Messages.getString("ContextValidator.ParameterValueNotMatch");
}
return null;
return Messages.getString("ContextTreeTable.PromptToolTips"); //$NON-NLS-1$
}
@Override

View File

@@ -24,7 +24,6 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.talend.commons.ui.runtime.ColorConstants;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.swt.calendar.SWTCalendarWithTime;
import org.talend.commons.ui.swt.proposal.ContentProposalAdapterExtended;
@@ -62,7 +61,7 @@ public class PatternCalendar extends SWTCalendarWithTime {
gridLayout.marginHeight = 5;
composite.setLayout(gridLayout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setBackground(ColorConstants.getTableBackgroundColor());
composite.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
Label patternLabel = new Label(composite, SWT.NONE);
patternLabel.setText(Messages.getString("PatternCalendar.pattern")); //$NON-NLS-1$
@@ -72,7 +71,6 @@ public class PatternCalendar extends SWTCalendarWithTime {
patternText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
patternText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
onPatternChange();
}

View File

@@ -28,10 +28,6 @@ public class ContextTableConstants {
public static final String COLUMN_PROMPT_PROPERTY = "Prompt label"; //$NON-NLS-1$
public static final String COLUMN_CONTEXT_VALUE = "Value"; //$NON-NLS-1$
public static final String LABEL_VALUE_NOT_MATCH_TYPE = "LABEL_VALUE_NOT_MATCH_TYPE";
public static final String LABEL_CHANGED_FORCEGROUND = "LABEL_CHANGED_FORCEGROUND";
public static final int DEFAULT_COLUMN_COUNT = 8;
}

View File

@@ -16,7 +16,6 @@ import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
import org.eclipse.nebula.widgets.nattable.style.CellStyleProxy;
import org.eclipse.nebula.widgets.nattable.style.IStyle;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.swt.graphics.GC;
@@ -44,8 +43,12 @@ public class ContextAutoResizeTextPainter extends TextPainter {
@Override
public void setupGCFromConfig(GC gc, IStyle cellStyle) {
super.setupGCFromConfig(gc, cellStyle);
if (containsRowName) {
if (cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR).equals(GUIHelper.COLOR_RED)) {
gc.setForeground(GUIHelper.COLOR_BLACK);
} else if (containsRowName) {
gc.setForeground(GUIHelper.COLOR_RED);
} else if (changeBackgroundColor) {
gc.setForeground(GUIHelper.COLOR_WIDGET_DARK_SHADOW);
}
}

View File

@@ -23,15 +23,12 @@ import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsData
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
import org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter;
import org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
import org.talend.core.ui.context.model.ContextTabChildModel;
import org.talend.core.ui.context.model.ContextTabParentModel;
import org.talend.core.ui.context.model.table.ContextTableConstants;
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
/**
@@ -52,9 +49,18 @@ public class ContextNatTableBackGroudPainter extends BackgroundPainter {
@Override
public void paintCell(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(cell.getRowIndex());
if (rowNode.getTreeData() instanceof ContextTabChildModel) {
if (rowNode.getTreeData() instanceof ContextTableTabParentModel) {
ContextTableTabParentModel rowModel = (ContextTableTabParentModel) rowNode.getTreeData();
Boolean isRepositoryContext = rowModel.hasChildren();
if (isRepositoryContext) {
((ContextAutoResizeTextPainter) getWrappedPainter()).setChangeBackgroundColor(true);
} else {
((ContextAutoResizeTextPainter) getWrappedPainter()).setChangeBackgroundColor(false);
}
} else {
ContextTabChildModel rowChildModel = (ContextTabChildModel) rowNode.getTreeData();
if (rowChildModel != null) {
((ContextAutoResizeTextPainter) getWrappedPainter()).setChangeBackgroundColor(true);
checkContainsRowName(rowNode, rowChildModel);
}
}

View File

@@ -43,7 +43,6 @@ import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.talend.commons.ui.runtime.ColorConstants;
import org.talend.core.PluginChecker;
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
import org.talend.core.model.metadata.types.JavaTypesManager;
@@ -116,7 +115,7 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
private void registerStyleRules(IConfigRegistry configRegistry) {
// register the default cell fg/bg colour for the natTable
Style cellStyleDefault = new Style();
cellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
cellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
ContextTableConstants.COLUMN_TYPE_PROPERTY);
@@ -137,6 +136,7 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
Style cellStyleSelect = new Style();
cellStyleSelect.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_TITLE_INACTIVE_BACKGROUND);
cellStyleSelect.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_RED);
cellStyleSelect.setAttributeValue(CellStyleAttributes.FONT, GUIHelper.DEFAULT_FONT);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
ContextTableConstants.COLUMN_TYPE_PROPERTY);
@@ -160,15 +160,11 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
private void registerValidateRules(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR,
new EventDataValidator(dataProvider, manager), DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR,
new EventDataValueValidator(dataProvider, manager, columnGroupModel), DisplayMode.EDIT, ContextTableConstants.COLUMN_CONTEXT_VALUE);
}
private void registerErrorHandlingStrategies(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(),
DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(),
DisplayMode.EDIT, ContextTableConstants.COLUMN_CONTEXT_VALUE);
}
private IEditableRule getEditRule() {

View File

@@ -21,15 +21,12 @@ import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.LineBorderDecorator;
import org.eclipse.nebula.widgets.nattable.style.BorderStyle;
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
import org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum;
import org.eclipse.nebula.widgets.nattable.style.Style;
import org.eclipse.nebula.widgets.nattable.style.VerticalAlignmentEnum;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.talend.commons.ui.runtime.ColorConstants;
import org.talend.core.ui.context.model.table.ContextTableConstants;
/**
* created by ldong on Aug 26, 2014 Detailled comment
@@ -37,6 +34,12 @@ import org.talend.core.ui.context.model.table.ContextTableConstants;
*/
public class ContextNatTableStyleConfiguration extends AbstractRegistryConfiguration {
public Color bgColor = GUIHelper.COLOR_WHITE;
public Color fgColor = GUIHelper.COLOR_BLACK;
public Color gradientBgColor = GUIHelper.COLOR_WHITE;
public Color gradientFgColor = GUIHelper.getColor(136, 212, 215);
public Font font = GUIHelper.DEFAULT_FONT;
@@ -64,27 +67,17 @@ public class ContextNatTableStyleConfiguration extends AbstractRegistryConfigura
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter);
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, ColorConstants.getTableForegroundColor());
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, bgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, fgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, gradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, gradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, font);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, hAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, vAlign);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, borderStyle);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle);
Style cellStyleValueError = new Style();
cellStyleValueError.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, ColorConstants.ERROR_FONT_COLOR);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleValueError, DisplayMode.NORMAL, ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleValueError, DisplayMode.SELECT, ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
Style cellStyleChangedForceGround = new Style();
cellStyleChangedForceGround.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WIDGET_DARK_SHADOW);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleChangedForceGround, DisplayMode.NORMAL, ContextTableConstants.LABEL_CHANGED_FORCEGROUND);
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDisplayConverter());
}
}

View File

@@ -1,81 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.ui.context.nattableTree;
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
import org.eclipse.nebula.widgets.nattable.layer.ILayer;
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
import org.talend.core.ui.context.model.ContextTabChildModel;
import org.talend.core.ui.context.model.table.ContextTableConstants;
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
import org.talend.core.ui.utils.ContextTypeValidator;
public class ContextValueLabelAccumulator extends ColumnOverrideLabelAccumulator {
private IDataProvider dataProvider;
private ColumnGroupModel columnGroupModel;
private IContextManager manager;
public ContextValueLabelAccumulator(ILayer layer, IDataProvider dataProvider, IContextManager manager, ColumnGroupModel columnGroupModel) {
super(layer);
this.dataProvider = dataProvider;
this.manager = manager;
this.columnGroupModel = columnGroupModel;
}
@Override
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
super.accumulateConfigLabels(configLabels, columnPosition, rowPosition);
boolean isAddedValueNotMatchStyle = false;
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getList().get(rowPosition);
if (configLabels.contains(ContextTableConstants.COLUMN_CONTEXT_VALUE)) {
if (columnGroupModel != null && columnGroupModel.isPartOfAGroup(columnPosition)) {
String columnGroupName = columnGroupModel.getColumnGroupByIndex(columnPosition).getName();
IContextParameter realPara = ContextNatTableUtils.getRealParameter(manager, columnGroupName, rowNode.getTreeData());
if (realPara != null) {
boolean isValid = ContextTypeValidator.isMatchType(realPara.getType(), realPara.getValue());
if (isValid) {
configLabels.remove(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
} else {
configLabels.addLabel(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
isAddedValueNotMatchStyle = true;
}
}
}
}
if (!isAddedValueNotMatchStyle) {
if (rowNode.getTreeData() instanceof ContextTableTabParentModel) {
ContextTableTabParentModel rowModel = (ContextTableTabParentModel) rowNode.getTreeData();
Boolean isRepositoryContext = rowModel.hasChildren();
if (isRepositoryContext) {
configLabels.addLabel(ContextTableConstants.LABEL_CHANGED_FORCEGROUND);
} else {
}
} else {
ContextTabChildModel rowChildModel = (ContextTabChildModel) rowNode.getTreeData();
if (rowChildModel != null) {
configLabels.addLabel(ContextTableConstants.LABEL_CHANGED_FORCEGROUND);
}
}
}
}
}

View File

@@ -26,8 +26,6 @@ import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -274,28 +272,4 @@ public class ContextValuesNatText extends Composite {
public Button getButton() {
return this.button;
}
@Override
public void setBackground(Color color) {
super.setBackground(color);
if (text != null && !text.isDisposed()) {
text.setBackground(color);
}
}
@Override
public void setFont(Font font) {
super.setFont(font);
if (text != null && !text.isDisposed()) {
text.setFont(font);
}
}
@Override
public void setForeground(Color color) {
super.setForeground(color);
if (text != null && !text.isDisposed()) {
text.setForeground(color);
}
}
}

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