Compare commits

...

41 Commits

Author SHA1 Message Date
Zhiwei Xue
aeb31c0e57 feat(TUP-41073):Block the update if studio is not compatible (#6710) (#6728)
* feat(TUP-41073):Block the update if studio is not compatible

* feat(TUP-41073):fix feature adapt and block commandline
2024-01-15 16:28:53 +08:00
bhe-talendbj
9c5e56f757 fix(TUP-41511): throw exception (#6722) 2024-01-12 14:35:29 +08:00
msjian
77ee619152 chore(TDQ-21713): improve code to fix NPE (#6717) 2024-01-10 18:29:04 +08:00
Jane Ding
feb8e81628 feat(TUP-36992):Set max-width for Context column in Studio (#6601)
* feat(TUP-40408):Context view improvement research
https://jira.talendforge.org/browse/TUP-40408

* feat(TUP-40408):Context view improvement research
https://jira.talendforge.org/browse/TUP-40408

* feat(TUP-40408):Context view improvement research
https://jira.talendforge.org/browse/TUP-40408

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992

* feat(TUP-36992):Set max-width for Context column in Studio
https://jira.talendforge.org/browse/TUP-36992
2024-01-10 17:20:31 +08:00
bhe-talendbj
472b999612 fix(TUP-40092): Uncommitted changes available on all branches (#6594)
* fix(TUP-40092): add new field to ExceptionMessageDialog

* fix(TUP-40092): add new method
2024-01-10 16:31:35 +08:00
Emmanuel GALLOIS
f924a19f7d feat(TDI-50675): bump component-runtime to 1.63.0 (#6660) 2024-01-09 11:22:25 +01:00
wang wei
8ca4df75ea fix(TDI-50707): Still missing java options with JDK 17 for tRESTClient (#6699) 2024-01-08 18:14:05 +08:00
sbliu
9e04aa1fd4 chore(TUP-40453) upgrade avro in tck (#6708) 2024-01-08 15:25:52 +08:00
kjwang
ed7375ea82 Fix TUP-41299 Cannot connect to Oracle with patch R2023-11 (#6648)
* Fix TUP-41299 Cannot connect to Oracle with patch R2023-11
https://jira.talendforge.org/browse/TUP-41299
2024-01-08 11:50:00 +08:00
msjian
5ce7b0d702 fix(TDQ-21713): fix failed junit (#6705) 2024-01-07 14:19:57 +08:00
msjian
127573adc5 fix fail junit (#6703) 2024-01-06 11:11:52 +08:00
msjian
96abfedf4c fix(TDQ-21713): fix one failed junit (#6701) 2024-01-05 14:58:51 +08:00
hzhao
b19d7c550d fix(TUP-41404): dummy change to update the plugin timestamp # (#6698) 2024-01-04 16:15:03 +08:00
bhe-talendbj
6eec1e24d1 fix(TUP-41391): Always pop up workspace has been changed when start studio (#6689)
* fix(TUP-41391): initialized workspace too early

* fix(TUP-41391): initialized workspace too early
2024-01-03 16:46:07 +08:00
zyuan-talend
7a5fb399ec fix(TUP-41242):Clean up the call of studio registration service. (#6638) 2024-01-03 10:07:20 +08:00
msjian
f7bebc1efe fix(TDQ-21668): fix generate ThresholdViolationAlert job failed when jdk17 (#6676) 2023-12-29 18:10:00 +08:00
msjian
4e50edcff1 fix(TDQ-21713): ignore ".gitkeep" file under the git remote project's folders(#6687) 2023-12-29 15:29:38 +08:00
hcyi
4cf6b6277f fix(TUP-41106):Track shared mode with data collector. (#6672)
* fix(TUP-41106):Track shared mode with data collector.

* fix(TUP-41106):Track Enable Java 17 compatibility with data collector.
2023-12-29 15:09:22 +08:00
hcyi
f964d20a63 fix(TUP-41082):Track projects with Java 17 enabled. (#6651) 2023-12-28 18:06:18 +08:00
jiezhang-tlnd
8225e6fa05 chore(TUP-39612)bcprov-jdk15on:1.70 | CVE-2023-33201 (#6559) 2023-12-28 11:16:12 +08:00
Dmytro Sylaiev
9e918597a3 fix(TDI-50700): Fix httpclient for java 17 (#6662) 2023-12-26 13:07:08 +02:00
zyuan-talend
825a4634d5 fix(TUP-41256):Update jars linked to EDI component. (#6670) 2023-12-26 18:45:48 +08:00
msjian
e0b36d539d Revert "fix(TDQ-21668): fix generate job ThresholdViolationAlert fail when jdk17 (#6622)" (#6678)
This reverts commit afc3c0c57e.
2023-12-26 18:44:16 +08:00
sbliu
2f7fcb839c fix(TUP-41009) data view failed for tacokit data connection (#6654) 2023-12-26 14:19:11 +08:00
bhe-talendbj
4810bd8cda fix(TUP-41249): update manifest timestamp (#6665) (#6666)
* fix(TUP-41249): update manifest timestamp

* fix(TUP-41249): update type of time
2023-12-22 19:55:32 +08:00
Jane Ding
b2173b2707 Add localized files (#6656) (#6659)
Co-authored-by: Toshi Sasada <51699524+tsasada-talend@users.noreply.github.com>
Co-authored-by: build-talend-doc <build-talend-doc@talend.com>
2023-12-21 17:38:45 +08:00
hzhao
30643242a4 fix(TUP-40887): Mac Sonoma issue with image flipped (#6639)
* fix(TUP-40887): Mac Sonoma issue with image flipped

* fix(TUP-40887): Mac Sonoma issue with image flipped

* fix(TUP-40887): Mac Sonoma issue with image flipped

* fix(TUP-40887): Mac Sonoma issue with image flipped

* fix(TUP-40887):  try remove listener

* fix(TUP-40887): add back resourceDisposeListener

* fix(TUP-40887): Mac Sonoma issue with image flipped
2023-12-21 10:42:03 +08:00
sbliu
eea308c852 chore(TUP-40457) Errors in CommandLine log file (#6585) 2023-12-21 10:03:52 +08:00
hzhao
482dab62dc fix(TUP-41133): Display row number displayed as 0 after click some (#6637)
* fix(TUP-41133): Display row number displayed as 0 after click some
buttons in schema of tDBOutput

* fix(TUP-41133): refresh for paste action
2023-12-19 18:52:28 +08:00
bhe-talendbj
e9fb0a7d70 chore(TUP-40916): Studio issues if Java version is > Java 17 (#6572)
* chore(TUP-40916): update error message

* chore(TUP-40916): update error message

* chore(TUP-40916): exit studio if validate java version error

* chore(TUP-40916): exit studio if validate java version error

* chore(TUP-40916): update error messages

* chore(TUP-40916): update error messages

* chore(TUP-40916): validate java complier's compliance level

* chore(TUP-40916): update message

* chore(TUP-40916): update message
2023-12-18 14:55:27 +08:00
bhe-talendbj
962800e16b fix(TUP-41020): LDAP Metadata : Check Authentication fails when Encryption method = LDAPS(SSL) even with correct credentials. (#6590)
* fix(TUP-41020): init default trust manager if can not find cacert path

* fix(TUP-41020): add junit test
2023-12-18 10:09:48 +08:00
Jane Ding
c605b5cf6e fix(TUP-40871):Import dependencies will not calculate the context (#6587)
* fix(TUP-40871):Import dependencies will not calculate the context
dependent for db connection
https://jira.talendforge.org/browse/TUP-40871

* fix(TUP-40871):Import dependencies will not calculate the context
dependent for db connection
https://jira.talendforge.org/browse/TUP-40871
2023-12-18 09:59:47 +08:00
bhe-talendbj
50facdd03d fix(TUP-41249): correct allowed seconds for pat (#6631) 2023-12-13 17:41:12 +08:00
kjwang
0d3ad601ab TUP-41174 old version of Teradata related jars download fail (#6629)
* TUP-41174 old version of Teradata related jars download fail (Add junit)
https://jira.talendforge.org/browse/TUP-41174
2023-12-12 17:50:08 +08:00
apoltavtsev
4851f670d6 APPINT-36161: Correct build type for child Route job (#6619) 2023-12-11 09:23:59 +01:00
msjian
afc3c0c57e fix(TDQ-21668): fix generate job ThresholdViolationAlert fail when jdk17 (#6622) 2023-12-11 16:07:24 +08:00
kjwang
5cc4ddbcf2 Fix TUP-41174 old version of Teradata related jars download fail (#6620) (#6626)
* Fix TUP-41174 old version of Teradata related jars download fail
https://jira.talendforge.org/browse/TUP-41174
2023-12-11 15:54:37 +08:00
bhe-talendbj
646c80fec6 chore(TUP-41184): correct maven repository id (#6624) 2023-12-11 15:43:27 +08:00
Zhiwei Xue
7f5e7c70b3 fix(TUP-41154):TcompV0 metadata refresh issue when only parts feature (#6609)
installed
2023-12-08 18:21:04 +08:00
sbliu
3a196a0095 Revert "fix(TUP-41057) add dnd support for dynamic setting's tableviewer (#6592)" (#6614)
This reverts commit 2019954122.
2023-12-08 17:02:05 +08:00
Jane Ding
b571bef976 Add localized files (#6606) (#6616)
Co-authored-by: Toshi Sasada <51699524+tsasada-talend@users.noreply.github.com>
Co-authored-by: build-talend-doc <build-talend-doc@talend.com>
2023-12-08 16:03:18 +08:00
64 changed files with 1185 additions and 1874 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

View File

@@ -40,6 +40,8 @@ public class ExceptionMessageDialog extends MessageDialog {
private String exceptionString = null;
private int[] diabledButtonIndex = new int[] {};
private boolean expandedOnOpen = false;
public ExceptionMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
int dialogImageType, String[] dialogButtonLabels, int defaultIndex, Throwable ex) {
@@ -85,6 +87,8 @@ public class ExceptionMessageDialog extends MessageDialog {
text.setText(exceptionString);
text.setEditable(false);
errorComposite.setClient(text);
errorComposite.setExpanded(expandedOnOpen);
return errorComposite;
}
@@ -150,6 +154,22 @@ public class ExceptionMessageDialog extends MessageDialog {
this.exceptionString = exceptionString;
}
/**
* @return the expandedOnOpen
*/
public boolean isExpandedOnOpen() {
return expandedOnOpen;
}
/**
* @param expandedOnOpen the expandedOnOpen to set
*/
public void setExpandedOnOpen(boolean expandedOnOpen) {
this.expandedOnOpen = expandedOnOpen;
}
public void setDisabledButtons(int[] index) {
this.diabledButtonIndex = index;
}

View File

@@ -39,6 +39,7 @@ public enum EImage implements IImage {
EDIT_ICON("/icons/write_obj.gif"), //$NON-NLS-1$
READ_ICON("/icons/read_obj.gif"), //$NON-NLS-1$
WRAP_ICON("/icons/wrap.png"), //$NON-NLS-1$
QUESTION_ICON("/icons/question.gif"), //$NON-NLS-1$
HELP_ICON("/icons/help.png"), //$NON-NLS-1$
MOREINFO_ICON("/icons/moreInfo.png"), //$NON-NLS-1$

View File

@@ -23,10 +23,19 @@ public class FatalException extends RuntimeException {
@SuppressWarnings("unused")//$NON-NLS-1$
private static final long serialVersionUID = 1L;
public static final int CODE_INCOMPATIBLE_UPDATE = 10;
private int code;
public FatalException(String message, Throwable cause) {
super(message, cause);
}
public FatalException(int code, String message) {
super(message);
this.code = code;
}
public FatalException(String message) {
super(message);
}
@@ -34,4 +43,9 @@ public class FatalException extends RuntimeException {
public FatalException(Throwable cause) {
super(cause);
}
public int getCode() {
return code;
}
}

View File

@@ -31,7 +31,9 @@ import javax.xml.transform.stream.StreamResult;
import org.talend.utils.xml.XmlUtils;
import org.w3c.dom.Document;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
/**
*
@@ -50,6 +52,23 @@ public final class XMLFileUtil {
public static Document loadDoc(InputStream stream) throws ParserConfigurationException, SAXException, IOException {
try {
DocumentBuilder db = DOCBUILDER_FACTORY.newDocumentBuilder();
db.setErrorHandler(new ErrorHandler() {
@Override
public void warning(SAXParseException exception) throws SAXException {
throw exception;
}
@Override
public void fatalError(SAXParseException exception) throws SAXException {
throw exception;
}
@Override
public void error(SAXParseException exception) throws SAXException {
throw exception;
}
});
return db.parse(stream);
} finally {
try {

View File

@@ -52,7 +52,7 @@ public abstract class ExtendedTableCaseCommand extends Command implements IExten
@Override
public void execute() {
convertCase(extendedTable, beansToCovertCase, selectionIndices, isUpperCase);
extendedTable.getTableViewer().refresh();
}
public abstract void convertCase(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, boolean isUpperCase);

View File

@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.gef.commands.Command;
import org.talend.commons.ui.runtime.i18n.Messages;
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorNotModifiable;
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
import org.talend.commons.ui.utils.SimpleClipboard;
import org.talend.commons.utils.data.list.UniqueStringGenerator;
@@ -65,6 +66,11 @@ public abstract class ExtendedTablePasteCommand extends Command implements IExte
List list = new ArrayList((List) data);
list = createPastableBeansList(extendedTable, list);
extendedTable.addAll(indexStart, list);
// when not lazy load need to do refresh to refresh the row number
if (!TableViewerCreatorNotModifiable.getRecommandLazyLoad()
&& !TableViewerCreatorNotModifiable.isLazyLoadingEnabled()) {
extendedTable.getTableViewer().refresh();
}
}
}

View File

@@ -14,6 +14,7 @@ package org.talend.commons.ui.swt.advanced.dataeditor.commands;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.gef.commands.Command;
import org.talend.commons.ui.runtime.i18n.Messages;
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
@@ -54,7 +55,7 @@ public abstract class ExtendedTableQuoteCommand extends Command implements IExte
@Override
public void execute() {
toQuote(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
extendedTable.getTableViewer().refresh();
}
public abstract void toQuote(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, String quote, boolean isAddingQuote);

View File

@@ -1,101 +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.ui.swt.dnd;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetAdapter;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
public class DNDTableViewerHelper {
public static void addDndSupport(final TableViewer tableViewer) {
if(tableViewer == null) {
return;
}
DropTarget dropTarget = new DropTarget(tableViewer.getTable(), DND.DROP_DEFAULT | DND.DROP_COPY);
dropTarget.setTransfer(new Transfer[] { TextTransfer.getInstance()});
dropTarget.addDropListener(new DropTargetAdapter() {
@Override
public void dragOver(DropTargetEvent event) {
if(!isColumnDroptable(tableViewer, getTargetColumn(event))) {
event.detail = DND.DROP_NONE;
} else {
event.detail = DND.DROP_COPY;
}
}
@Override
public void dragEnter(DropTargetEvent event) {
// Allow dropping text only
for (int i = 0, n = event.dataTypes.length; i < n; i++) {
if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
event.currentDataType = event.dataTypes[i];
}
}
}
@Override
public void drop(DropTargetEvent event) {
if (ifAnyTextDropped(event)) {
pasteToTable(event);
}
}
private boolean ifAnyTextDropped(DropTargetEvent event) {
return TextTransfer.getInstance().isSupportedType(event.currentDataType);
}
private void pasteToTable(DropTargetEvent event) {
int columnIndex = getTargetColumn(event);
if(isColumnDroptable(tableViewer, columnIndex)) {
TableItem item = (TableItem) event.item;
String originContext = item.getText(columnIndex);
String idColmn = (String) tableViewer.getColumnProperties()[columnIndex];
ICellModifier cellModifier = tableViewer.getCellModifier();
cellModifier.modify(event.item, idColmn, originContext + (String)event.data);
}
}
private boolean isColumnDroptable(final TableViewer tableViewer, int columnIndex) {
CellEditor[] cellEditors = tableViewer.getCellEditors();
boolean isTextCellEditor = cellEditors[columnIndex] != null
&& cellEditors[columnIndex].getControl() instanceof Text;
return isTextCellEditor;
}
private int getTargetColumn(DropTargetEvent event) {
Point posInTable = tableViewer.getTable().toControl(event.x, event.y);
ViewerCell cell = tableViewer.getCell(posInTable);
int columnIndex = 0;
if(cell != null) {
columnIndex = cell.getColumnIndex();
}
return columnIndex;
}
});
}
}

View File

@@ -24,7 +24,6 @@ import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNot
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorNotModifiable;
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.ITableCellValueModifiedListener;
import org.talend.commons.ui.runtime.swt.tableviewer.data.AccessorUtils;
import org.talend.commons.ui.swt.dnd.DNDTableViewerHelper;
import org.talend.commons.ui.swt.extended.table.ModifyBeanValueCommand;
import org.talend.commons.ui.swt.proposal.ExtendedTextCellEditorWithProposal;
import org.talend.commons.ui.swt.tableviewer.behavior.DefaultCellModifier;
@@ -149,9 +148,6 @@ public class TableViewerCreator<B> extends TableViewerCreatorNotModifiable<B> im
@Override
public Table createTable() {
Table table = super.createTable();
DNDTableViewerHelper.addDndSupport(getTableViewer());
initCellModifier();
return table;

View File

@@ -1,178 +1,178 @@
// ============================================================================
//
// 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.commons.ui.utils.loader;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.log4j.Logger;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
/**
* ggu class global comment. Detailled comment
*/
public class MyURLClassLoader extends URLClassLoader {
public static interface IAssignableClassFilter {
public boolean filter(URL[] urls);
public boolean filter(Class clazz);
public boolean filter(String clazzName);
}
private static Logger log = Logger.getLogger(MyURLClassLoader.class);
private Map pclasses = new HashMap();
public MyURLClassLoader(String fileName) throws IOException {
this(new File(fileName).toURL());
}
public MyURLClassLoader(URL url) {
this(new URL[] { url });
}
public MyURLClassLoader(URL[] urls) {
super(urls, Class.class.getClassLoader());
}
public MyURLClassLoader(URL[] urls, ClassLoader parentLoader) {
super(urls, parentLoader);
}
public Class[] getAssignableClasses(Class type) throws IOException {
return getAssignableClasses(type, null);
}
@SuppressWarnings("unchecked")
public Class[] getAssignableClasses(Class type, IAssignableClassFilter filter) throws IOException {
List classes = new ArrayList();
URL[] urls = getURLs();
for (URL url : urls) {
if (filter != null && filter.filter(new URL[] { url })) {
continue;
}
File file = new File(url.getFile());
if (!file.isDirectory() && file.exists() && file.canRead()) {
ZipFile zipFile = null;
try {
zipFile = new ZipFile(file);
} catch (IOException ex) {
ExceptionHandler.process(ex);
}
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
Class cls = null;
String entryName = entries.nextElement().getName();
String className = changeFileNameToClassName(entryName);
if (className != null) {
if (filter != null && filter.filter(className)) {
continue;
}
try {
cls = loadClass(className);
} catch (Throwable th) {
log.warn(th);
}
if (cls != null) {
if (filter != null && filter.filter(cls)) {
continue;
}
if (isAssignableType(type, cls)) {
classes.add(cls);
}
}
}
}
}
}
return (Class[]) classes.toArray(new Class[classes.size()]);
}
@SuppressWarnings("unchecked")
private boolean isAssignableType(Class type, Class current) {
if (type == null || current == null || current.equals(Object.class)) {
return false;
}
if (type.isAssignableFrom(current)) {
return true;
} else
// sometimes can not assign the java generic, use the class url
if (type.getName() != null && type.getName().equals(current.getName())) {
return true;
} else {
//
if (type.isInterface()) {//
for (Class interfaceClazz : current.getInterfaces()) {
if (interfaceClazz.equals(type)) {
return true;
} else {
if (isAssignableType(type, interfaceClazz)) {
return true;
}
}
}
if (isAssignableType(type, current.getSuperclass())) {
return true;
}
} else {
return isAssignableType(type, current.getSuperclass());
}
}
return false;
}
/*
* (non-Javadoc)
*
* @see java.net.URLClassLoader#findClass(java.lang.String)
*/
@SuppressWarnings("unchecked")
protected synchronized Class findCslass(String className) throws ClassNotFoundException {
Class cls = (Class) pclasses.get(className);
if (cls == null) {
cls = super.findClass(className);
pclasses.put(className, cls);
}
return cls;
}
public static String changeFileNameToClassName(String name) {
if (name == null) {
throw new IllegalArgumentException("File Name == null");
}
String className = null;
if (name.toLowerCase().endsWith(".class")) {
className = name.replace('/', '.');
className = className.replace('\\', '.');
className = className.substring(0, className.length() - 6);
}
return className;
}
protected void classHasBeenLoaded(Class cls) {
}
}
// ============================================================================
//
// 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.commons.ui.utils.loader;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.log4j.Logger;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
/**
* ggu class global comment. Detailled comment
*/
public class MyURLClassLoader extends URLClassLoader {
public static interface IAssignableClassFilter {
public boolean filter(URL[] urls);
public boolean filter(Class clazz);
public boolean filter(String clazzName);
}
private static Logger log = Logger.getLogger(MyURLClassLoader.class);
private Map pclasses = new HashMap();
public MyURLClassLoader(String fileName) throws IOException {
this(new File(fileName).toURI().toURL());
}
public MyURLClassLoader(URL url) {
this(new URL[] { url });
}
public MyURLClassLoader(URL[] urls) {
super(urls, Class.class.getClassLoader());
}
public MyURLClassLoader(URL[] urls, ClassLoader parentLoader) {
super(urls, parentLoader);
}
public Class[] getAssignableClasses(Class type) throws IOException {
return getAssignableClasses(type, null);
}
@SuppressWarnings("unchecked")
public Class[] getAssignableClasses(Class type, IAssignableClassFilter filter) throws IOException {
List classes = new ArrayList();
URL[] urls = getURLs();
for (URL url : urls) {
if (filter != null && filter.filter(new URL[] { url })) {
continue;
}
File file = new File(url.getFile());
if (!file.isDirectory() && file.exists() && file.canRead()) {
ZipFile zipFile = null;
try {
zipFile = new ZipFile(file);
} catch (IOException ex) {
ExceptionHandler.process(ex);
}
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
Class cls = null;
String entryName = entries.nextElement().getName();
String className = changeFileNameToClassName(entryName);
if (className != null) {
if (filter != null && filter.filter(className)) {
continue;
}
try {
cls = loadClass(className);
} catch (Throwable th) {
log.warn(th);
}
if (cls != null) {
if (filter != null && filter.filter(cls)) {
continue;
}
if (isAssignableType(type, cls)) {
classes.add(cls);
}
}
}
}
}
}
return (Class[]) classes.toArray(new Class[classes.size()]);
}
@SuppressWarnings("unchecked")
private boolean isAssignableType(Class type, Class current) {
if (type == null || current == null || current.equals(Object.class)) {
return false;
}
if (type.isAssignableFrom(current)) {
return true;
} else
// sometimes can not assign the java generic, use the class url
if (type.getName() != null && type.getName().equals(current.getName())) {
return true;
} else {
//
if (type.isInterface()) {//
for (Class interfaceClazz : current.getInterfaces()) {
if (interfaceClazz.equals(type)) {
return true;
} else {
if (isAssignableType(type, interfaceClazz)) {
return true;
}
}
}
if (isAssignableType(type, current.getSuperclass())) {
return true;
}
} else {
return isAssignableType(type, current.getSuperclass());
}
}
return false;
}
/*
* (non-Javadoc)
*
* @see java.net.URLClassLoader#findClass(java.lang.String)
*/
@SuppressWarnings("unchecked")
protected synchronized Class findCslass(String className) throws ClassNotFoundException {
Class cls = (Class) pclasses.get(className);
if (cls == null) {
cls = super.findClass(className);
pclasses.put(className, cls);
}
return cls;
}
public static String changeFileNameToClassName(String name) {
if (name == null) {
throw new IllegalArgumentException("File Name == null");
}
String className = null;
if (name.toLowerCase().endsWith(".class")) {
className = name.replace('/', '.');
className = className.replace('\\', '.');
className = className.substring(0, className.length() - 6);
}
return className;
}
protected void classHasBeenLoaded(Class cls) {
}
}

View File

@@ -155,7 +155,6 @@ 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.cdcFoundation.deprecated=CDC Foundation (\u975E\u63A8\u5968)
ProjectRepositoryNode.genericSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE
ProjectRepositoryNode.queries=\u30AF\u30A8\u30EA\u30FC
ProjectRepositoryNode.synonymSchemas=\u30B7\u30CE\u30CB\u30E0\u30B9\u30AD\u30FC\u30DE

View File

@@ -147,7 +147,11 @@ public class LDAPCATruster implements X509TrustManager {
} catch (IOException ex) {
}
try {
ks.load(in, certStorePwd);
if (in != null) {
ks.load(in, certStorePwd);
} else {
ks = null;
}
} catch (Exception e) {
log.error(Messages.getString("LDAPCATruster.failedLoadCert") + e.getMessage()); //$NON-NLS-1$
return;

View File

@@ -49,8 +49,10 @@ tDqReportRun=java.base/java.lang,java.base/java.nio
tWebService=java.base/java.lang
tWebServiceInput=java.base/java.lang
tRESTClient=java.base/sun.net.www.protocol.https,java.base/java.net
# 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
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,java.base/sun.net.www.protocol.https
# BigData distribution
SPARK_3_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

@@ -39,6 +39,9 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.utils.JavaVersion;
import org.talend.utils.StudioKeysFileCheck;
import org.talend.utils.VersionException;
/**
* Utilities around perl stuff. <br/>
@@ -248,7 +251,7 @@ public final class JavaUtils {
setProjectJavaVserion(javaVersion);
applyCompilerCompliance(javaVersion);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
IRunProcessService service = GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
service.updateProjectPomWithTemplate();
}
}
@@ -284,6 +287,10 @@ public final class JavaUtils {
if (version == null) {
return defaultCompliance;
}
JavaVersion ver = new JavaVersion(version);
if (ver.getMajor() > 8) {
return String.valueOf(ver.getMajor());
}
if (version.startsWith(JavaCore.VERSION_1_8)) {
return JavaCore.VERSION_1_8;
}
@@ -364,5 +371,39 @@ public final class JavaUtils {
monitor.worked(1);
}
}
public static void validateJavaVersion() {
try {
// validate jvm which is used to start studio
StudioKeysFileCheck.validateJavaVersion();
// validate default complier's compliance level
IVMInstall install = JavaRuntime.getDefaultVMInstall();
String ver = getCompilerCompliance((IVMInstall2) install, JavaCore.VERSION_1_8);
if (new JavaVersion(ver).compareTo(new JavaVersion(StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING)) > 0) {
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_NOT_SUPPORTED,
"The maximum Java version supported by Studio is " + StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING + ". Your compiler's compliance level is " + ver);
throw e;
}
} catch (Exception e1) {
if (e1 instanceof VersionException) {
throw e1;
}
ExceptionHandler.process(e1);
}
}
public static boolean isJava17() {
boolean isJava17 = false;
String javaVersion = System.getProperty("java.version");
String[] arr = javaVersion.split("[^\\d]+");
try {
isJava17 = Integer.parseInt(arr[0]) >= 17;
} catch (NumberFormatException e) {
ExceptionHandler.process(e);
isJava17 = false;
}
return isJava17;
}
}

View File

@@ -45,6 +45,8 @@ import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
*/
public class JobContextManager implements IContextManager {
private boolean isWrapContextText;
private IContext defaultContext = new JobContext(IContext.DEFAULT);
private List<IContext> listContext = new ArrayList<IContext>();
@@ -102,6 +104,14 @@ public class JobContextManager implements IContextManager {
private Map<ContextItem, List<IContext>> renameContextGroupMap = new HashMap<ContextItem, List<IContext>>();
public boolean isWrapContextText() {
return isWrapContextText;
}
public void setWrapContextText(boolean isWrapContextText) {
this.isWrapContextText = isWrapContextText;
}
public Map<ContextItem, List<IContext>> getAddContextGroupMap() {
return this.addContextGroupMap;
}

View File

@@ -246,6 +246,11 @@ public class ModuleAccessHelper {
if ("ID".equals(property.getId()) && "Mock_job_for_Guess_schema".equals(property.getLabel())) {
return true;
}
// TDQ-21668: only for fix generate ThresholdViolationAlert job failed
if (property.getLabel().startsWith("ThresholdViolationAlert")) { //$NON-NLS-1$
return true;
}
// TDQ-21668~
Class<?> clazz = process.getClass();
// preview process
if (CLASS_PREVIEW_PROCESS.equals(clazz.getName()) || CLASS_PREVIEW_PROCESS.equals(clazz.getSuperclass().getName())) {

View File

@@ -61,7 +61,7 @@ public interface ICloudSignOnService extends IService {
* @param dataCenter data center of TMC
* @return Introspected PAT
*/
PAT introspectPAT(String pat, String dataCenter);
PAT introspectPAT(String pat, String dataCenter) throws Exception;
/**
* Introspect pat and check whether pat is allowed
@@ -70,5 +70,5 @@ public interface ICloudSignOnService extends IService {
* @param tmcUrl tmc url
* @return valid or not
*/
boolean validatePAT(String pat, String tmcUrl);
boolean validatePAT(String pat, String tmcUrl) throws Exception;
}

View File

@@ -149,6 +149,10 @@ public interface IStudioLiteP2Service extends IService {
void cleanM2(IProgressMonitor monitor);
boolean isCompatibleUpdate() throws Exception;
String getCompatibleMessage() throws Exception;
public static IStudioLiteP2Service get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IStudioLiteP2Service.class)) {
return GlobalServiceRegister.getDefault().getService(IStudioLiteP2Service.class);

View File

@@ -499,6 +499,7 @@ public class RepositoryNodeUtilities {
|| curType == ERepositoryObjectType.METADATA_CON_SYNONYM
|| curType == ERepositoryObjectType.METADATA_CON_QUERY
|| curType == ERepositoryObjectType.METADATA_CONNECTIONS
|| curType == ERepositoryObjectType.METADATA_TACOKIT_JDBC
|| curType == ERepositoryObjectType.METADATA_FILE_DELIMITED
|| curType == ERepositoryObjectType.METADATA_FILE_POSITIONAL
|| curType == ERepositoryObjectType.METADATA_FILE_REGEXP
@@ -525,12 +526,13 @@ public class RepositoryNodeUtilities {
tmpType = ERepositoryObjectType.DOCUMENTATION;
}
if (tmpType != null && tmpType == rootContextType) {
if (tmpType != null && (tmpType == rootContextType || rootContextType.isChildTypeOf(tmpType))) {
expandParentNode(view, rootNode);
}
// expand the parent node
if (curType == rootContextType && isRepositoryFolder(rootNode)) {
if ((curType == rootContextType || curType.isChildTypeOf(rootContextType))
&& isRepositoryFolder(rootNode)) {
if (rootContextType == ERepositoryObjectType.SQLPATTERNS
&& !(rootNode.getParent() instanceof IProjectRepositoryNode)) {
// sql pattern

View File

@@ -108,6 +108,8 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
private Button manageEnvironmentsButton;
private Button wrapButton;
private ContextManagerHelper helper;
private List<Button> buttonList;
@@ -229,8 +231,11 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
}
private void createButtonsGroup(Composite parentComposite) {
boolean isRepositoryContext = (modelManager instanceof ContextComposite)
&& ((ContextComposite) modelManager).isRepositoryContext();
int columnNum = isRepositoryContext ? 5 : 7;
buttonsComp = new Composite(parentComposite, SWT.NULL);
buttonsComp.setLayout(GridLayoutFactory.swtDefaults().spacing(5, 0).margins(5, 0).numColumns(7).create());
buttonsComp.setLayout(GridLayoutFactory.swtDefaults().spacing(10, 0).margins(5, 0).numColumns(columnNum).create());
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.DOWN).grab(true, false).applyTo(buttonsComp);
buttonList.clear();
addButton = createAddPushButton(buttonsComp);
@@ -238,8 +243,6 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
removeButton = createRemovePushButton(buttonsComp);
buttonList.add(removeButton);
boolean isRepositoryContext = (modelManager instanceof ContextComposite)
&& ((ContextComposite) modelManager).isRepositoryContext();
if (!isRepositoryContext) {// for bug 7393
moveUpButton = createMoveUpPushButton(buttonsComp);
buttonList.add(moveUpButton);
@@ -253,14 +256,16 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
}
createEnvironmentsGroup(buttonsComp);
wrapButton = createWrapButton(buttonsComp);
}
private void createEnvironmentsGroup(Composite parentComposite) {
Composite environmentsComp = new Composite(parentComposite, SWT.NULL);
environmentsComp.setLayout(new GridLayout(2, false));
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.horizontalSpacing = 10;
environmentsComp.setLayout(gridLayout);
GridData contextComboData = new GridData();
contextComboData.grabExcessHorizontalSpace = true;
contextComboData.horizontalAlignment = GridData.END;
environmentsComp.setLayoutData(contextComboData);
viewEnvironmentsCombo = new CCombo(environmentsComp, SWT.BORDER);
@@ -547,6 +552,35 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
return selectContextVariablesPushButton;
}
private Button createWrapButton(final Composite parent) {
Button wrapToggleButton = new Button(parent, SWT.TOGGLE);
wrapToggleButton.setBackground(parent.getBackground());
GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.END;
Image image = ImageProvider.getImage(EImage.WRAP_ICON);
IContextManager contextManager = getContextManager();
if (contextManager instanceof JobContextManager) {
JobContextManager jobContextManager = (JobContextManager) contextManager;
wrapToggleButton.setSelection(jobContextManager.isWrapContextText());
}
wrapToggleButton.setImage(image);
wrapToggleButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IContextManager contextManager = getContextManager();
if (contextManager instanceof JobContextManager) {
JobContextManager jobContextManager = (JobContextManager) contextManager;
jobContextManager.setWrapContextText(wrapToggleButton.getSelection());
}
refresh();
}
});
return wrapToggleButton;
}
private void setButtonEnableState() {
boolean enableState = !modelManager.isReadOnly();
if (this.addButton != null) {
@@ -570,6 +604,13 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
if (contextsCombo != null) {
this.contextsCombo.setEnabled(enableState);
}
if (wrapButton != null) {
IContextManager contextManager = getContextManager();
if (contextManager instanceof JobContextManager) {
JobContextManager jobContextManager = (JobContextManager) contextManager;
wrapButton.setSelection(jobContextManager.isWrapContextText());
}
}
}
public Object createNewEntry() {

View File

@@ -20,6 +20,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
@@ -34,6 +35,7 @@ import org.eclipse.nebula.widgets.nattable.config.DefaultComparator;
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor;
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
import org.eclipse.nebula.widgets.nattable.edit.event.DataUpdateEvent;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.DetailGlazedListsEventLayer;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsSortModel;
@@ -56,10 +58,18 @@ import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup;
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupReorderLayer;
import org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer;
import org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer;
import org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform;
import org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform;
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
import org.eclipse.nebula.widgets.nattable.layer.ILayer;
import org.eclipse.nebula.widgets.nattable.layer.ILayerListener;
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.layer.event.ILayerEvent;
import org.eclipse.nebula.widgets.nattable.layer.event.RowDeleteEvent;
import org.eclipse.nebula.widgets.nattable.layer.event.RowInsertEvent;
import org.eclipse.nebula.widgets.nattable.layer.event.RowStructuralChangeEvent;
import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
import org.eclipse.nebula.widgets.nattable.painter.layer.NatGridLayerPainter;
import org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer;
@@ -92,7 +102,9 @@ 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.context.JobContextManager;
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
@@ -149,6 +161,10 @@ public class ContextTreeTable {
private final static int fixedTypeWidth = 100;
private final static int minDefultHeight = 20;
private final static int maxDefaultWidth = 400;
public ContextTreeTable(IContextModelManager manager) {
this.manager = manager;
}
@@ -421,6 +437,101 @@ public class ContextTreeTable {
currentNatTabSel = (IStructuredSelection) event.getSelection();
}
});
this.natTable.addLayerListener(new ILayerListener() {
@Override
public void handleLayerEvent(ILayerEvent event) {
// DataUpdateEvent->Data change, RowInsertEvent->node expand, RowDeleteEvent->node collapse
if (event instanceof DataUpdateEvent) {
// data changed then execute here no need compare value
DataUpdateEvent dataEvent = (DataUpdateEvent) event;
ILayer layer = dataEvent.getLayer();
DataLayer dataLayer = getDataLayer(layer);
if (dataLayer == null) {
return;
}
int rowPosition = dataEvent.getRowPosition();
int columnPosition = dataEvent.getColumnPosition();
if (layer instanceof GridLayer) {
GridLayer gridLayer = (GridLayer) layer;
rowPosition = rowPosition - gridLayer.getColumnHeaderLayer().getRowCount();
columnPosition = columnPosition - gridLayer.getRowHeaderLayer().getColumnCount();
}
String text = dataEvent.getNewValue() == null ? "" : dataEvent.getNewValue().toString();
GC gc = new GCFactory(natTable).createGC();
Point point = gc.textExtent(text, SWT.DRAW_MNEMONIC);
int textLength = point.x;
int currentColumnWidth = layer.getColumnWidthByPosition(columnPosition);
if (textLength > layer.getColumnWidthByPosition(columnPosition)) {
if (textLength > maxDefaultWidth) {
int columnWidth = Math.max(currentColumnWidth, maxDefaultWidth);
dataLayer.setColumnWidthByPosition(columnPosition, columnWidth);
} else {
int columnWidth = getColumWidth(gc, dataLayer, columnPosition);
dataLayer.setColumnWidthByPosition(columnPosition, columnWidth);
}
}
int promptColPos = dataLayer.getColumnPositionByIndex(3);
IContextManager contextManager = manager.getContextManager();
if (contextManager instanceof JobContextManager) {
JobContextManager jobContextManager = (JobContextManager) contextManager;
if (jobContextManager.isWrapContextText()) {
int rowHeight = getRowHeight(gc, dataLayer, rowPosition, promptColPos);
dataLayer.setRowHeightByPosition(rowPosition, rowHeight);
}
}
gc.dispose();
} else if (event instanceof RowInsertEvent || event instanceof RowDeleteEvent) {
RowStructuralChangeEvent changeEvent = (RowStructuralChangeEvent) event;
ILayer layer = changeEvent.getLayer();
DataLayer dataLayer = getDataLayer(layer);
List<Integer> checkPos = new ArrayList<Integer>();
checkPos.add(3);
adjustCellWidthHeight(dataLayer, checkPos);
}
}
});
}
private DataLayer getDataLayer(ILayer layer) {
DataLayer dataLayer = null;
if (layer instanceof GridLayer) {
GridLayer gridLayer = (GridLayer) layer;
ILayer bodyLayer = gridLayer.getBodyLayer();
if (bodyLayer instanceof AbstractLayerTransform) {
AbstractLayerTransform childLayer = (AbstractLayerTransform) bodyLayer;
dataLayer = findDataLayerByUnderlyingLayer(childLayer);
}
} else if (layer instanceof DataLayer) {
dataLayer = (DataLayer) layer;
} else if (layer instanceof AbstractLayerTransform || layer instanceof AbstractIndexLayerTransform) {
dataLayer = findDataLayerByUnderlyingLayer(layer);
}
return dataLayer;
}
private DataLayer findDataLayerByUnderlyingLayer(ILayer layer) {
// only 1 underlyingLayer set on AbstractLayerTransform / AbstractIndexLayerTransform
ILayer underlyingLayer = null;
if (layer instanceof AbstractLayerTransform) {
AbstractLayerTransform layerTransform = (AbstractLayerTransform) layer;
underlyingLayer = layerTransform.getUnderlyingLayerByPosition(0, 0);
} else if (layer instanceof AbstractIndexLayerTransform) {
AbstractIndexLayerTransform layerTransform = (AbstractIndexLayerTransform) layer;
underlyingLayer = layerTransform.getUnderlyingLayerByPosition(0, 0);
}
if (underlyingLayer instanceof DataLayer) {
return (DataLayer) underlyingLayer;
} else if (underlyingLayer instanceof AbstractLayerTransform) {
AbstractLayerTransform childLayer = (AbstractLayerTransform) underlyingLayer;
return findDataLayerByUnderlyingLayer(childLayer);
} else if (underlyingLayer instanceof AbstractIndexLayerTransform) {
AbstractIndexLayerTransform childLayer = (AbstractIndexLayerTransform) underlyingLayer;
return findDataLayerByUnderlyingLayer(childLayer);
}
return null;
}
private List<Integer> getAllCheckPosBehaviour(IContextModelManager manager, ColumnGroupModel contextGroupModel) {
@@ -448,58 +559,108 @@ public class ContextTreeTable {
dataLayer.setColumnWidthByPosition(i, averageWidth);
}
} else {
int typeColumnPos = dataLayer.getColumnPositionByIndex(1);
int leftWidth = maxWidth - fixedTypeWidth - fixedCheckBoxWidth * checkColumnsPos.size() - cornerWidth * 2;
int currentColumnsCount = dataColumnsCount - checkColumnsPos.size() - 1;
int averageWidth = leftWidth / currentColumnsCount;
for (int i = 0; i < dataLayer.getColumnCount(); i++) {
boolean findHide = false;
boolean findCheck = false;
boolean findType = false;
if (typeColumnPos == i) {
findType = true;
dataLayer.setColumnWidthByPosition(i, fixedTypeWidth);
}
for (int checkPos : checkColumnsPos) {
if (checkPos == i) {
findCheck = true;
dataLayer.setColumnWidthByPosition(i, fixedCheckBoxWidth);
}
}
if (!findHide && !findCheck && !findType) {
int colW = getColumWidth(dataLayer, i, averageWidth);
dataLayer.setColumnWidthByPosition(i, colW);
}
}
adjustCellWidthHeight(dataLayer, checkColumnsPos);
}
}
private int getColumWidth(DataLayer dataLayer, int colPos, int avgWidth) {
int colWidth = fixedTypeWidth;
private void adjustCellWidthHeight(DataLayer dataLayer, List<Integer> checkColumnsPos) {
int typeColumnPos = dataLayer.getColumnPositionByIndex(1);
GC gc = new GCFactory(natTable).createGC();
for (int i = 0; i < dataLayer.getColumnCount(); i++) {
boolean findCheck = false;
boolean findType = false;
if (typeColumnPos == i) {
findType = true;
dataLayer.setColumnWidthByPosition(i, fixedTypeWidth);
}
for (int checkPos : checkColumnsPos) {
if (checkPos == i) {
findCheck = true;
dataLayer.setColumnWidthByPosition(i, fixedCheckBoxWidth);
}
}
if (!findCheck && !findType) {
int colW = getColumWidth(gc, dataLayer, i);
dataLayer.setColumnWidthByPosition(i, colW);
}
}
// setColumnWidthByPosition final scaled by DPI, set height according final width
int promptColPos = dataLayer.getColumnPositionByIndex(3);
IContextManager contextManager = manager.getContextManager();
if (contextManager instanceof JobContextManager) {
JobContextManager jobContextManager = (JobContextManager) contextManager;
if (jobContextManager.isWrapContextText()) {
for (int i = 0; i < dataLayer.getPreferredRowCount(); i++) {
int rowHeight = getRowHeight(gc, dataLayer, i, promptColPos);
dataLayer.setRowHeightByPosition(i, rowHeight);
}
}
}
gc.dispose();
}
private int getColumWidth(GC gc, DataLayer dataLayer, int colPos) {
int colWidth = fixedTypeWidth;
int max = 0;
String text = "";
for (int i = 0; i < dataLayer.getPreferredRowCount(); i++) {
Object dataValueByPosition = dataLayer.getDataValueByPosition(colPos, i);
if (dataValueByPosition == null) {
if (dataValueByPosition == null || StringUtils.isBlank(dataValueByPosition.toString())) {
continue;
}
text = dataValueByPosition.toString();
Point size = gc.textExtent(text, SWT.DRAW_MNEMONIC);
int temp = size.x;
if (temp > max) {
max = temp;
int textWidth = size.x;
if (textWidth > max) {
max = textWidth;
}
}
gc.dispose();
if (max > colWidth) {
max = (int) (max - text.getBytes().length * 1.5);
if (max > maxDefaultWidth) {
max = maxDefaultWidth;
}
}
return colWidth > max ? colWidth : max;
}
private int getRowHeight(GC gc, DataLayer dataLayer, int rowPos, int promptColPos) {
int maxHeight = minDefultHeight;
for (int j = 0; j < dataLayer.getColumnCount(); j++) {
// only check value column height
if (j <= promptColPos) {
continue;
}
Object dataValueByPosition = dataLayer.getDataValueByPosition(j, rowPos);
if (dataValueByPosition == null || StringUtils.isBlank(dataValueByPosition.toString())) {
continue;
}
String text = dataValueByPosition.toString();
Point size = gc.textExtent(text, SWT.DRAW_MNEMONIC);
int textWidth = size.x;
int textHeight = size.y;
String[] lines = text.split(TextPainter.NEW_LINE_REGEX);
int columnWidth = dataLayer.getColumnWidthByPosition(j);
if (textWidth >= columnWidth || lines.length > 1) {
int heightCount = 0;
for (String line : lines) {
int lineWidth = gc.textExtent(line).x;
if (lineWidth < columnWidth) {
heightCount++;
} else {
heightCount += lineWidth / columnWidth;
heightCount += lineWidth % columnWidth == 0 ? 0 : 1;
}
}
int cellheight = textHeight * heightCount;
maxHeight = Math.max(maxHeight, dataLayer.downScaleRowHeight(cellheight));
} else {
maxHeight = Math.max(maxHeight, textHeight);
}
}
return maxHeight;
}
private void addCustomSelectionBehaviour(SelectionLayer layer) {
// need control the selection style when select the rows.
DefaultSelectionStyleConfiguration selectStyleConfig = new DefaultSelectionStyleConfiguration();

View File

@@ -0,0 +1,84 @@
// ============================================================================
//
// 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.ui.context;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.talend.commons.ui.runtime.ITalendThemeService;
import org.talend.commons.ui.swt.colorstyledtext.ColorStyledText;
/**
* DOC jding class global comment. Detailled comment
*/
public class StringTextDialog extends Dialog {
private String content;
private Text text;
public StringTextDialog(Shell parentShell) {
super(parentShell);
}
public StringTextDialog(Shell parentShell, String content) {
super(parentShell);
this.content = content;
}
@Override
protected boolean isResizable() {
return true;
}
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Enter the value");
}
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 640;
gd.heightHint = 260;
composite.setLayoutData(gd);
composite.setLayout(new GridLayout());
text = new Text(composite, SWT.WRAP | SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.LEFT);
text.setForeground(ITalendThemeService.getColor(ColorStyledText.PREFERENCE_COLOR_FOREGROUND).orElse(null));
text.setBackground(ITalendThemeService.getColor(ColorStyledText.PREFERENCE_COLOR_BACKGROUND).orElse(null));
text.setLayoutData(new GridData(GridData.FILL_BOTH));
text.setText(content);
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
content = text.getText();
}
});
return composite;
}
public String getTextContent() {
return content;
}
}

View File

@@ -37,7 +37,9 @@ import org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter;
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
import org.eclipse.nebula.widgets.nattable.style.CellStyleUtil;
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.ui.util.CellEdgeEnum;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.swt.graphics.Color;
@@ -128,7 +130,11 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
ContextTableConstants.COLUMN_CHECK_PROPERTY);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
Style valueCellStyleDefault = new Style();
valueCellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
valueCellStyleDefault.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, HorizontalAlignmentEnum.LEFT);
valueCellStyleDefault.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, VerticalAlignmentEnum.TOP);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, valueCellStyleDefault, DisplayMode.NORMAL,
ContextTableConstants.COLUMN_CONTEXT_VALUE);
Style cellStyleSelect = new Style();
@@ -146,6 +152,10 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
ContextTableConstants.COLUMN_CHECK_PROPERTY);
Style valueCellStyleSelect = new Style();
valueCellStyleSelect.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_TITLE_INACTIVE_BACKGROUND);
valueCellStyleSelect.setAttributeValue(CellStyleAttributes.FONT, GUIHelper.DEFAULT_FONT);
valueCellStyleSelect.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, HorizontalAlignmentEnum.LEFT);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
ContextTableConstants.COLUMN_CONTEXT_VALUE);
}
@@ -317,6 +327,13 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
ProxyDynamicCellEditor cutomCellEditor = new ProxyDynamicCellEditor(dataProvider, manager, modelManager);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, cutomCellEditor, DisplayMode.EDIT,
ContextTableConstants.COLUMN_CONTEXT_VALUE);
ContextAutoResizeTextPainter customPainter = new ContextAutoResizeTextPainter(true, false, false);
customPainter.setWordWrapping(true);
ContextNatTableBackGroudPainter backGroudPainter = new ContextNatTableBackGroudPainter(customPainter, dataProvider);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, backGroudPainter, DisplayMode.NORMAL,
ContextTableConstants.COLUMN_CONTEXT_VALUE);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, backGroudPainter, DisplayMode.SELECT,
ContextTableConstants.COLUMN_CONTEXT_VALUE);
}
private void registerColumnFiveTextEditor(IConfigRegistry configRegistry) {

View File

@@ -15,6 +15,7 @@ package org.talend.core.ui.context.nattableTree;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
import org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum;
import org.eclipse.nebula.widgets.nattable.style.IStyle;
@@ -109,9 +110,12 @@ public class ContextValuesNatText extends Composite {
if (NatTableCellEditorFactory.isPassword(realPara.getType())) {
widgetStyle = SWT.PASSWORD | HorizontalAlignmentEnum.getSWTStyle(cellStyle);
}
if (NatTableCellEditorFactory.isResource(realPara.getType())) {
if (NatTableCellEditorFactory.isResource(realPara.getType()) || NatTableCellEditorFactory.isList(realPara.getType())) {
widgetStyle = SWT.READ_ONLY | HorizontalAlignmentEnum.getSWTStyle(cellStyle);
}
if (NatTableCellEditorFactory.isString(realPara.getType())) {
widgetStyle = widgetStyle | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL;
}
text = new Text(this, widgetStyle);
text.setBackground(cellStyle.getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR));
text.setForeground(cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR));
@@ -235,6 +239,7 @@ public class ContextValuesNatText extends Composite {
*/
protected String getTransformedSelection(boolean focusOnText) {
Object result = null;
validateValue();
result = cellFactory.openCustomCellEditor(realPara, getShell());
String finalResult = "";
if (result == null || result.equals("")) {
@@ -251,6 +256,14 @@ public class ContextValuesNatText extends Composite {
return finalResult;
}
private void validateValue() {
// possible value modified manually
// notify focuslost to commit value might execute after dialog open in some os
if (NatTableCellEditorFactory.isString(realPara.getType()) && !StringUtils.equals(realPara.getValue(), text.getText())) {
realPara.setValue(text.getText());
}
}
protected String getTransformedTextForDialog(boolean focusOnText) {
String result = "";
result = getTransformedSelection(focusOnText);

View File

@@ -25,6 +25,8 @@ import org.eclipse.nebula.widgets.nattable.style.Style;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
import org.eclipse.nebula.widgets.nattable.widget.EditModeEnum;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
@@ -78,6 +80,33 @@ public class CustomTextCellEditor extends AbstractCellEditor {
this.cellStyle = cellStyle;
this.commitOnUpDown = commitOnUpDown;
this.moveSelectionOnEnter = moveSelectionOnEnter;
this.focusListener = new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
// overwrite org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor.InlineFocusListener
// set closeAfterCommit to false
if (!commit(MoveDirectionEnum.NONE, false)) {
if (!e.widget.isDisposed() && e.widget instanceof Control) {
((Control) e.widget).forceFocus();
}
} else {
if (!CustomTextCellEditor.this.parent.isDisposed()) {
CustomTextCellEditor.this.parent.forceFocus();
}
}
}
};
}
@Override
public void addEditorControlListeners() {
Control editorControl = getEditorControl();
if (editorControl != null && !editorControl.isDisposed() && this.editMode == EditModeEnum.INLINE) {
editorControl.addFocusListener(this.focusListener);
editorControl.addTraverseListener(this.traverseListener);
}
}
/*

View File

@@ -27,6 +27,7 @@ import org.talend.core.model.metadata.types.JavaTypesManager;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.service.IResourcesDependenciesService;
import org.talend.core.ui.context.MultiStringSelectionDialog;
import org.talend.core.ui.context.StringTextDialog;
import org.talend.core.utils.TalendQuoteUtils;
/**
@@ -44,7 +45,7 @@ public class NatTableCellEditorFactory {
String currentType = para.getType();
if (currentType != null) {
if (isFile(currentType) || isDate(currentType) || isDirectory(currentType) || isList(currentType)
|| isResource(currentType)) {
|| isResource(currentType) || isString(currentType)) {
return true;
}
}
@@ -67,6 +68,8 @@ public class NatTableCellEditorFactory {
defalutDataValue = para.getDisplayValue();
} else if (isResource(currentType)) {
transformResult = openResourcesDialogForCellEditor(parentShell, para);
} else if (isString(currentType)) {
transformResult = openStringDialogFoeCellEditor(parentShell, para);
}
}
return transformResult;
@@ -140,6 +143,15 @@ public class NatTableCellEditorFactory {
return ContextNatTableUtils.getSpecialTypeDisplayValue(JavaTypesManager.RESOURCE.getId(), value);
}
private String openStringDialogFoeCellEditor(Shell parentShell, IContextParameter para) {
StringTextDialog stringTextDialog = new StringTextDialog(parentShell, para.getValue());
int open = stringTextDialog.open();
if (open == Dialog.OK) {
return stringTextDialog.getTextContent();
}
return "";
}
public static String getAddQuoteString(String path) {
ECodeLanguage codeLanguage = LanguageManager.getCurrentLanguage();
if (codeLanguage == ECodeLanguage.PERL) {
@@ -184,6 +196,10 @@ public class NatTableCellEditorFactory {
return MetadataToolHelper.isResource(value);
}
public static boolean isString(final String value) {
return JavaTypesManager.STRING.getId().equals(value);
}
/**
* For the different value between display value and real value, due to nattable model comes from context, if set
* new context parameter value in this factory, then the UpdateDataCommandHandler of nattable will treat this as no

View File

@@ -146,4 +146,13 @@ public class ProxyDynamicCellEditor extends AbstractCellEditor {
return super.commit(direction, closeAfterCommit, skipValidation);
}
@Override
public void addEditorControlListeners() {
if (dynamicEditor != null) {
dynamicEditor.addEditorControlListeners();
} else {
super.addEditorControlListeners();
}
}
}

View File

@@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
@@ -341,7 +342,11 @@ public abstract class AbstractMetadataTableEditorView<B> extends AbstractDataTab
column.setBeanPropertyAccessors(getRowNumAccessor());
column.setWeight(5);
column.setModifiable(false);
column.setMinimumWidth(10);
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
column.setMinimumWidth(10);
} else {
column.setMinimumWidth(30);
}
column.setSortable(true);
}

View File

@@ -30,6 +30,7 @@ import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.LoginException;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.nofitication.ArrangedNotificationPopup;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.core.CorePlugin;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.repository.model.ProxyRepositoryFactory;
@@ -79,7 +80,7 @@ public class Java17NotificationPopup extends ArrangedNotificationPopup {
}
public static boolean show() {
return !showOnce() && isJava17() && (!ModuleAccessHelper.allowJavaInternalAcess(null) || !checkInterpreter());
return !showOnce() && JavaUtils.isJava17() && (!ModuleAccessHelper.allowJavaInternalAcess(null) || !checkInterpreter());
}
private static boolean showOnce() {
@@ -132,17 +133,4 @@ public class Java17NotificationPopup extends ArrangedNotificationPopup {
return false;
}
private static boolean isJava17() {
boolean isJava17 = false;
String javaVersion = System.getProperty("java.version");
String[] arr = javaVersion.split("[^\\d]+");
try {
isJava17 = Integer.parseInt(arr[0]) >= 17;
} catch (NumberFormatException e) {
ExceptionHandler.process(e);
isJava17 = false;
}
return isJava17;
}
}

View File

@@ -30,6 +30,8 @@ public interface IGitUIProviderService extends IService {
public String[] changeCredentials(Shell parent, Serializable uriIsh, String initUser, boolean canStoreCredentials);
boolean checkPendingChanges();
boolean checkUncommittedFiles();
public void openPushFailedDialog(Object pushResult);

View File

@@ -15,8 +15,11 @@ package org.talend.core.ui.token;
import org.apache.commons.codec.digest.DigestUtils;
import org.eclipse.jface.preference.IPreferenceStore;
import org.talend.commons.utils.VersionUtils;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.daikon.token.TokenGenerator;
@@ -41,6 +44,10 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
private static final TokenKey OS = new TokenKey("os"); //$NON-NLS-1$
private static final TokenKey SHARE_MODE = new TokenKey("share.mode"); //$NON-NLS-1$
private static final TokenKey ENABLED_JAVA17_COMPATIBILITY = new TokenKey("enabled.java17.compatibility"); //$NON-NLS-1$
public static final String COLLECTOR_SYNC_NB = "COLLECTOR_SYNC_NB"; //$NON-NLS-1$
public DefaultTokenCollector() {
@@ -70,7 +77,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
// typeStudio
if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService brandingService = GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getAcronym());
// tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getShortProductName());
@@ -92,6 +99,11 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
tokenStudioObject.put(STOP_COLLECTOR.getKey(), "0"); //$NON-NLS-1$
}
// Share mode
tokenStudioObject.put(SHARE_MODE.getKey(), SharedStudioUtils.isSharedStudioMode());
// Enable Java 17 compatibility
tokenStudioObject.put(ENABLED_JAVA17_COMPATIBILITY.getKey(), CoreRuntimePlugin.getInstance().getProjectPreferenceManager()
.getPreferenceStore().getBoolean(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS));
return tokenStudioObject;
}
}

View File

@@ -50,7 +50,6 @@ public class DisableLanguageActions implements IStartup {
}
ECodeLanguage lan = LanguageManager.getCurrentLanguage();
switch (lan) {
case JAVA:
ids = Arrays.asList(new String[] { "org.talend.help.perl.OpenPerlHelpAction" }); //$NON-NLS-1$

View File

@@ -1085,7 +1085,7 @@ public class ProcessorUtilities {
if (childBuildType == null) {
Property parentProperty = parentJobInfo.getProcessor().getProperty();
String parentBuildType = (String)parentProperty.getAdditionalProperties().get(TalendProcessArgumentConstant.ARG_BUILD_TYPE);
if ("ROUTE".equalsIgnoreCase(parentBuildType)) {
if (parentBuildType!= null && parentBuildType.contains("ROUTE")) {
childProperty.getAdditionalProperties().put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, "OSGI");
}
}

View File

@@ -93,7 +93,7 @@
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.11.2</version>
<version>1.11.3</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@@ -146,8 +146,8 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.74</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>

View File

@@ -97,8 +97,8 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.74</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>

View File

@@ -37,8 +37,8 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.74</version>
</dependency>
</dependencies>
<build>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.62.1</tcomp.version>
<tcomp.version>1.63.0</tcomp.version>
<slf4j.version>1.7.34</slf4j.version>
<reload4j.version>1.2.22</reload4j.version>
</properties>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<repositories>
<repository>
<id>Talend OpenSource Release</id>
<id>talend_open</id>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
</repositories>

View File

@@ -243,12 +243,7 @@ public class LibraryDataService {
}
Map<String, Object> properties = resolveDescProperties(artifact, false);
if (properties != null && properties.size() > 0) {
//if the type is provided in mvnUrl, will not be replaced with the descriptor one.
boolean usePomPackingType = true;
if (!StringUtils.isBlank(MavenUrlHelper.parseMvnUrl(mvnUrl, false).getType())) {
usePomPackingType = false;
}
parseDescriptorResult(libraryObj, properties, false, usePomPackingType);
parseDescriptorResult(libraryObj, properties, false);
if (libraryObj.getLicenses().size() == 0) {
libraryObj.setLicenseMissing(true);
libraryObj.getLicenses().add(unknownLicense);
@@ -358,15 +353,10 @@ public class LibraryDataService {
}
private void parseDescriptorResult(Library libraryObj, Map<String, Object> properties, boolean is4Parent) throws Exception {
parseDescriptorResult(libraryObj, properties, is4Parent, true);
}
private void parseDescriptorResult(Library libraryObj, Map<String, Object> properties, boolean is4Parent, boolean usePomPackagingType) throws Exception {
if (properties.size() == 0) {
libraryObj.setPomMissing(true);
}
//If packaging type is provided in mvnUrl, not use the <packaging> setting in pom.xml.
if (!is4Parent && usePomPackagingType) {
if (!is4Parent) {
String type = String.valueOf(properties.get("type"));
libraryObj.setType(MavenConstants.PACKAGING_BUNDLE.equalsIgnoreCase(type) ? MavenConstants.PACKAGING_JAR : type); //$NON-NLS-1$
}

View File

@@ -1085,8 +1085,8 @@ public class ExtractMetaDataUtils {
} else if (driverJarPathArg.contains("/")) {
if (driverJarPathArg.contains(";")) {
String jars[] = driverJarPathArg.split(";");
List<String> jarNames = new ArrayList<>();
for (String jar : jars) {
jar = TalendQuoteUtils.removeQuotesIfExist(jar);
if (jar.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
setDriverPath(librairesManagerService, jarPathList, jar);
} else {

View File

@@ -1,111 +1,111 @@
// ============================================================================
//
// 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.model.metadata.builder.database;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import org.talend.commons.exception.ExceptionHandler;
/**
*
* DOC YeXiaowei class global comment. Detailled comment <br/>
*
*/
public class HotClassLoader extends URLClassLoader {
// Commentted by Marvin Wang on Feb. 4, 2012 for TDI-23833.
// // qli modified to fix the bug 6281.
// private static HotClassLoader instance;
//
// public static HotClassLoader getInstance() {
// // bug 17800 fixed
// // if (instance == null) {
// instance = new HotClassLoader();
// // }
// return instance;
// }
public HotClassLoader() {
super(new URL[0], ClassLoader.getSystemClassLoader());
}
public void addPath(String paths) {
if (paths == null || paths.length() <= 0) {
return;
}
String separator = System.getProperty("path.separator"); //$NON-NLS-1$
String[] pathToAdds = paths.split(separator);
for (String pathToAdd2 : pathToAdds) {
if (pathToAdd2 != null && pathToAdd2.length() > 0) {
try {
File pathToAdd = new File(pathToAdd2).getCanonicalFile();
addURL(pathToAdd.toURL());
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
}
}
// public static String getClassFile(String name){
// if(name != null && !"".equals(name))
// return name.replace(".", "/").concat(".class");
// return null;
// }
//
// /**
// * "hive driver"
// */
// public Class findClass(String name) throws ClassNotFoundException{
// Class clazz = null;
// byte[] data = loadClassData(name);
//
// clazz = defineClass(name, data, 0, data.length);
// URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
// return clazz;
// }
//
//
// public byte[] loadClassData(String name) throws ClassNotFoundException{
// InputStream input = null;
// ByteArrayOutputStream output = null;
// byte[] data = null;
// URL[] urls = this.getURLs();
// if(urls != null){
// boolean isFind = false;
// for(URL url : urls){
// try {
// String newDriverName = HotClassLoader.getClassFile(name);
// URL newURL = new URL("jar:" + url.toString() + "!/"+ newDriverName);
// input = newURL.openStream();
// output = new ByteArrayOutputStream();
// int ch = 0;
// while((ch = input.read()) != -1){
// output.write(ch);
// }
// data = output.toByteArray();
// isFind = true;
// break;
// } catch (IOException e) {
// }
// }
// if(!isFind)
// throw new ClassNotFoundException("Can not find " + name + "!");
// }
// return data;
// }
}
// ============================================================================
//
// 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.model.metadata.builder.database;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import org.talend.commons.exception.ExceptionHandler;
/**
*
* DOC YeXiaowei class global comment. Detailled comment <br/>
*
*/
public class HotClassLoader extends URLClassLoader {
// Commentted by Marvin Wang on Feb. 4, 2012 for TDI-23833.
// // qli modified to fix the bug 6281.
// private static HotClassLoader instance;
//
// public static HotClassLoader getInstance() {
// // bug 17800 fixed
// // if (instance == null) {
// instance = new HotClassLoader();
// // }
// return instance;
// }
public HotClassLoader() {
super(new URL[0], ClassLoader.getSystemClassLoader());
}
public void addPath(String paths) {
if (paths == null || paths.length() <= 0) {
return;
}
String separator = System.getProperty("path.separator"); //$NON-NLS-1$
String[] pathToAdds = paths.split(separator);
for (String pathToAdd2 : pathToAdds) {
if (pathToAdd2 != null && pathToAdd2.length() > 0) {
try {
File pathToAdd = new File(pathToAdd2).getCanonicalFile();
addURL(pathToAdd.toURI().toURL());
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
}
}
// public static String getClassFile(String name){
// if(name != null && !"".equals(name))
// return name.replace(".", "/").concat(".class");
// return null;
// }
//
// /**
// * "hive driver"
// */
// public Class findClass(String name) throws ClassNotFoundException{
// Class clazz = null;
// byte[] data = loadClassData(name);
//
// clazz = defineClass(name, data, 0, data.length);
// URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
// return clazz;
// }
//
//
// public byte[] loadClassData(String name) throws ClassNotFoundException{
// InputStream input = null;
// ByteArrayOutputStream output = null;
// byte[] data = null;
// URL[] urls = this.getURLs();
// if(urls != null){
// boolean isFind = false;
// for(URL url : urls){
// try {
// String newDriverName = HotClassLoader.getClassFile(name);
// URL newURL = new URL("jar:" + url.toString() + "!/"+ newDriverName);
// input = newURL.openStream();
// output = new ByteArrayOutputStream();
// int ch = 0;
// while((ch = input.read()) != -1){
// output.write(ch);
// }
// data = output.toByteArray();
// isFind = true;
// break;
// } catch (IOException e) {
// }
// }
// if(!isFind)
// throw new ClassNotFoundException("Can not find " + name + "!");
// }
// return data;
// }
}

View File

@@ -114,4 +114,5 @@ DataTransferMessages.ArchiveExport_selectDestinationTitle=Export to Archive File
WorkbenchMessages.ShowView_errorTitle=Problems Showing View
ComponentsManager.form.install.dialog.restart.title=Restarting Studio
ComponentsManager.form.install.dialog.restart.message=We need to restart studio to finish the installation.\n\nDo you want to restart studio right now?
JavaVersion.CheckError=Java upgrade required, minimal required java version is {0}, current version is {1}.
JavaVersion.CheckError=Java upgrade required, minimal required java version is {0}, current version is {1}.
JavaVersion.CheckError.notSupported=The maximum Java version supported by Studio is {0}. Your current version is {1}.

View File

@@ -115,3 +115,4 @@ WorkbenchMessages.ShowView_errorTitle=\u30D3\u30E5\u30FC\u8868\u793A\u306E\u554F
ComponentsManager.form.install.dialog.restart.title=Studio\u3092\u518D\u8D77\u52D5\u4E2D
ComponentsManager.form.install.dialog.restart.message=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3092\u5B8C\u4E86\u3059\u308B\u306B\u306FStudio\u306E\u518D\u8D77\u52D5\u304C\u5FC5\u8981\u3067\u3059\u3002\n\n\u4ECA\u3059\u3050Studio\u3092\u518D\u8D77\u52D5\u3057\u307E\u3059\u304B?
JavaVersion.CheckError=Java\u306E\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u304C\u5FC5\u8981\u3067\u3059\u3002\u5FC5\u8981\u6700\u5C0F\u9650\u306Ejava\u30D0\u30FC\u30B8\u30E7\u30F3\u306F{0}\u3067\u3001\u73FE\u5728\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F{1}\u3067\u3059\u3002
JavaVersion.CheckError.notSupported=Studio\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308BJava\u306E\u6700\u5927\u30D0\u30FC\u30B8\u30E7\u30F3\u306F{0}\u3067\u3059\u3002\u73FE\u5728\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F{1}\u3067\u3059\u3002

View File

@@ -12,7 +12,12 @@
// ============================================================================
package org.talend.rcp;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.internal.splash.EclipseSplashHandler;
import org.talend.repository.ui.image.ImageUtils;
/**
* this class is justmade so that we can get the handler instance (no other way to get the instance). this instance is
@@ -30,4 +35,30 @@ public class TalendSplashHandler extends EclipseSplashHandler {
instance = this;
}
}
@Override
public IProgressMonitor getBundleProgressMonitor() {
IProgressMonitor bundleProgressMonitor = super.getBundleProgressMonitor();
if (!ImageUtils.isSonoma()) {
return bundleProgressMonitor;
}
if (bundleProgressMonitor != null && bundleProgressMonitor instanceof ProgressMonitorPart) {
ProgressMonitorPart pmp = (ProgressMonitorPart) bundleProgressMonitor;
Shell splash = getSplash();
if (splash != null) {
Shell shell = splash.getShell();
if (shell != null) {
Image backgroundImage = shell.getBackgroundImage();
if (backgroundImage != null) {
backgroundImage = ImageUtils.flipImage(shell.getDisplay(), backgroundImage);
pmp.setBackgroundImage(backgroundImage);
ImageUtils.addResourceDisposeListener(pmp, backgroundImage);
return pmp;
}
}
}
}
return bundleProgressMonitor;
}
}

View File

@@ -83,6 +83,7 @@ import org.talend.repository.ProjectManager;
import org.talend.repository.model.IRepositoryService;
import org.talend.repository.ui.login.LoginHelper;
import org.talend.utils.StudioKeysFileCheck;
import org.talend.utils.VersionException;
/**
* This class controls all aspects of the application's execution.
@@ -146,10 +147,14 @@ public class Application implements IApplication {
StudioKeysFileCheck.validateJavaVersion();
} catch (Exception e) {
Shell shell = new Shell(display, SWT.NONE);
MessageDialog.openError(shell, null, // $NON-NLS-1$
Messages.getString("JavaVersion.CheckError", StudioKeysFileCheck.JAVA_VERSION_MINIMAL_STRING,
StudioKeysFileCheck.getJavaVersion()));
return IApplication.EXIT_RELAUNCH;
if (e instanceof VersionException) {
String msg = Messages.getString("JavaVersion.CheckError", StudioKeysFileCheck.JAVA_VERSION_MINIMAL_STRING, StudioKeysFileCheck.getJavaVersion());
if (!((VersionException) e).requireUpgrade()) {
msg = Messages.getString("JavaVersion.CheckError.notSupported", StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING, StudioKeysFileCheck.getJavaVersion());
}
MessageDialog.openError(shell, null, msg);
}
return IApplication.EXIT_OK;
}
try {

View File

@@ -14,13 +14,9 @@ package org.talend.registration.register;
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
@@ -31,20 +27,14 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
import org.talend.commons.utils.network.NetworkUtil;
import org.talend.commons.utils.platform.PluginChecker;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.general.ConnectionBean;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.prefs.PreferenceManipulator;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.core.ui.token.DefaultTokenCollector;
import org.talend.registration.i18n.Messages;
import org.talend.registration.register.proxy.HttpProxyUtil;
import org.talend.registration.register.proxy.RegisterUserPortTypeProxy;
import org.talend.repository.ui.login.connections.ConnectionUserPerReader;
/**
@@ -83,284 +73,6 @@ public class RegisterManagement {
return instance;
}
@Deprecated
public boolean register(String email, String country, boolean isProxyEnabled, String proxyHost, String proxyPort,
String designerVersion, String projectLanguage, String osName, String osVersion, String javaVersion,
long totalMemory, Long memRAM, int nbProc) throws BusinessException {
registNumber = null;
BigInteger result = BigInteger.valueOf(-1);
// if proxy is enabled
if (isProxyEnabled) {
// get parameter and put them in System.properties.
System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$
System.setProperty("http.proxyPort", proxyPort); //$NON-NLS-1$
// override automatic update parameters
if (proxyPort != null && proxyPort.trim().equals("")) { //$NON-NLS-1$
proxyPort = null;
}
HttpProxyUtil.setHttpProxyInfo(true, proxyHost, proxyPort);
}
RegisterUserPortTypeProxy proxy = new RegisterUserPortTypeProxy();
proxy.setEndpoint("https://www.talend.com/TalendRegisterWS/registerws.php"); //$NON-NLS-1$
try {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
result = proxy.registerUserWithAllUserInformationsAndReturnId(email, country, designerVersion,
brandingService.getShortProductName(), projectLanguage, osName, osVersion, javaVersion,
totalMemory + "", memRAM //$NON-NLS-1$
+ "", nbProc + ""); //$NON-NLS-1$ //$NON-NLS-2$
if (result.signum() > 0) {
PlatformUI.getPreferenceStore().setValue("REGISTRATION_DONE", 1); //$NON-NLS-1$
registNumber = result.longValue();
// validateRegistration(brandingService.getAcronym(), result.longValue());
PreferenceManipulator prefManipulator = new PreferenceManipulator();
// prefManipulator.addUser(email);
// prefManipulator.setLastUser(email);
// Create a default connection:
if (prefManipulator.readConnections().isEmpty()) {
ConnectionBean recup = ConnectionBean.getDefaultConnectionBean();
recup.setUser(email);
recup.setComplete(true);
prefManipulator.addConnection(recup);
}
}
} catch (RemoteException e) {
decrementTry();
throw new BusinessException(e);
}
return result.signum() > 0;
}
public boolean updateUser(String email, String pseudo, String oldPassword, String password, String firstname,
String lastname, String country, boolean isProxyEnabled, String proxyHost, String proxyPort) throws BusinessException {
BigInteger result = BigInteger.valueOf(-1);
registNumber = null;
// if proxy is enabled
if (isProxyEnabled) {
// get parameter and put them in System.properties.
System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$
System.setProperty("http.proxyPort", proxyPort); //$NON-NLS-1$
// override automatic update parameters
if (proxyPort != null && proxyPort.trim().equals("")) { //$NON-NLS-1$
proxyPort = null;
}
HttpProxyUtil.setHttpProxyInfo(true, proxyHost, proxyPort);
}
// OS
String osName = System.getProperty("os.name"); //$NON-NLS-1$
String osVersion = System.getProperty("os.version"); //$NON-NLS-1$
// Java version
String javaVersion = System.getProperty("java.version"); //$NON-NLS-1$
// Java Memory
long totalMemory = Runtime.getRuntime().totalMemory();
// RAM
com.sun.management.OperatingSystemMXBean composantSystem = (com.sun.management.OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean();
Long memRAM = new Long(composantSystem.getTotalPhysicalMemorySize() / 1024);
// CPU
int nbProc = Runtime.getRuntime().availableProcessors();
// VERSION
String version = VersionUtils.getVersion();
RegisterUserPortTypeProxy proxy = new RegisterUserPortTypeProxy();
proxy.setEndpoint("https://www.talend.com/TalendRegisterWS/registerws.php"); //$NON-NLS-1$
try {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
result = proxy.updateUser(email, pseudo, oldPassword, password, firstname, lastname, country, version,
brandingService.getAcronym(), osName, osVersion, javaVersion, totalMemory + "", memRAM //$NON-NLS-1$
+ "", nbProc + ""); //$NON-NLS-1$ //$NON-NLS-2$
if (result != null && result.signum() > 0) {
PlatformUI.getPreferenceStore().setValue("REGISTRATION_DONE", 1); //$NON-NLS-1$
saveRegistoryBean();
registNumber = result.longValue();
// validateRegistration(brandingService.getAcronym(), result.longValue());
PreferenceManipulator prefManipulator = new PreferenceManipulator();
// prefManipulator.addUser(email);
// prefManipulator.setLastUser(email);
// Create a default connection:
if (prefManipulator.readConnections().isEmpty()) {
ConnectionBean recup = ConnectionBean.getDefaultConnectionBean();
recup.setUser(email);
recup.setComplete(true);
prefManipulator.addConnection(recup);
}
} else {
checkErrors(result.intValue());
}
} catch (RemoteException e) {
decrementTry();
increaseFailRegisterTimes();
MessageDialog.openError(null, Messages.getString("RegisterManagement.errors"), e.getMessage()); //$NON-NLS-1$
throw new BusinessException(e);
}
if (result != null) {
return result.signum() > 0;
} else {
return false;
}
}
public boolean createUser(String email, String pseudo, String password, String firstname, String lastname, String country,
boolean isProxyEnabled, String proxyHost, String proxyPort, String proxyUser, String proxyPassword)
throws BusinessException {
BigInteger result = BigInteger.valueOf(-1);
registNumber = null;
// if proxy is enabled
if (isProxyEnabled) {
Properties properties = System.getProperties();
properties.put("http.proxySet", "true"); //$NON-NLS-1$
properties.put("http.proxyHost", proxyHost);
properties.put("http.proxyPort", proxyPort);
properties.put("http.proxyUser", proxyUser); //$NON-NLS-1$
properties.put("http.proxyPassword", proxyPassword); //$NON-NLS-1$
}
// OS
String osName = System.getProperty("os.name"); //$NON-NLS-1$
String osVersion = System.getProperty("os.version"); //$NON-NLS-1$
// Java version
String javaVersion = System.getProperty("java.version"); //$NON-NLS-1$
// Java Memory
long totalMemory = Runtime.getRuntime().totalMemory();
// RAM
com.sun.management.OperatingSystemMXBean composantSystem = (com.sun.management.OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean();
Long memRAM = new Long(composantSystem.getTotalPhysicalMemorySize() / 1024);
// CPU
int nbProc = Runtime.getRuntime().availableProcessors();
// VERSION
String version = VersionUtils.getVersion();
// UNIQUE_ID
String uniqueId = DefaultTokenCollector.hashUniqueId();
RegisterUserPortTypeProxy proxy = new RegisterUserPortTypeProxy();
proxy.setEndpoint("https://www.talend.com/TalendRegisterWS/registerws.php"); //$NON-NLS-1$
try {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
if (country == null) {
country = Locale.getDefault().getCountry();
if (country == null) {
country = "unknown";
}
}
result = proxy.createUser53(email, pseudo, password, firstname, lastname, country, version,
brandingService.getAcronym(), osName, osVersion, javaVersion, totalMemory + "", memRAM //$NON-NLS-1$
+ "", nbProc + "", uniqueId); //$NON-NLS-1$ //$NON-NLS-2$
if (result.signum() > 0) {
PlatformUI.getPreferenceStore().setValue("REGISTRATION_DONE", 1); //$NON-NLS-1$
saveRegistoryBean();
registNumber = result.longValue();
// validateRegistration(brandingService.getAcronym(), result.longValue());
PreferenceManipulator prefManipulator = new PreferenceManipulator();
// prefManipulator.addUser(email);
// prefManipulator.setLastUser(email);
// Create a default connection:
if (prefManipulator.readConnections().isEmpty()) {
ConnectionBean recup = ConnectionBean.getDefaultConnectionBean();
recup.setUser(email);
recup.setComplete(true);
prefManipulator.addConnection(recup);
}
} else {
checkErrors(result.intValue());
}
} catch (RemoteException e) {
decrementTry();
increaseFailRegisterTimes();
MessageDialog.openError(null, Messages.getString("RegisterManagement.errors"), e.getMessage()); //$NON-NLS-1$
throw new BusinessException(e);
}
return result.signum() > 0;
}
public boolean createUser(String pseudo, String password, String firstname, String lastname, String country,
boolean isProxyEnabled, String proxyHost, String proxyPort, String proxyUser, String proxyPassword)
throws BusinessException {
BigInteger result = BigInteger.valueOf(-1);
registNumber = null;
// if proxy is enabled
if (isProxyEnabled) {
Properties properties = System.getProperties();
properties.put("http.proxySet", "true"); //$NON-NLS-1$
properties.put("http.proxyHost", proxyHost);
properties.put("http.proxyPort", proxyPort);
properties.put("http.proxyUser", proxyUser); //$NON-NLS-1$
properties.put("http.proxyPassword", proxyPassword); //$NON-NLS-1$
}
// OS
String osName = System.getProperty("os.name"); //$NON-NLS-1$
String osVersion = System.getProperty("os.version"); //$NON-NLS-1$
// Java version
String javaVersion = System.getProperty("java.version"); //$NON-NLS-1$
// Java Memory
long totalMemory = Runtime.getRuntime().totalMemory();
// RAM
com.sun.management.OperatingSystemMXBean composantSystem = (com.sun.management.OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean();
Long memRAM = new Long(composantSystem.getTotalPhysicalMemorySize() / 1024);
// CPU
int nbProc = Runtime.getRuntime().availableProcessors();
// VERSION
String version = VersionUtils.getVersion();
// UNIQUE_ID
String uniqueId = DefaultTokenCollector.calcUniqueId();
RegisterUserPortTypeProxy proxy = new RegisterUserPortTypeProxy();
proxy.setEndpoint("https://www.talend.com/TalendRegisterWS/registerws.php"); //$NON-NLS-1$
try {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
if (country == null) {
country = Locale.getDefault().getCountry();
if (country == null) {
country = "unknown";
}
}
result = proxy.updateUser53(pseudo, password, firstname, lastname, country, version, brandingService.getAcronym(),
osName, osVersion, javaVersion, totalMemory + "", memRAM //$NON-NLS-1$
+ "", nbProc + "", uniqueId); //$NON-NLS-1$ //$NON-NLS-2$
if (result.intValue() != -110 && result.signum() < 0) {
checkErrors(result.intValue());
}
} catch (RemoteException e) {
MessageDialog.openError(null, Messages.getString("RegisterManagement.errors"), e.getMessage()); //$NON-NLS-1$
throw new BusinessException(e);
}
return result.intValue() == -110;
}
private void checkErrors(int signum) {
String message = ""; //$NON-NLS-1$
switch (signum) {
@@ -421,33 +133,6 @@ public class RegisterManagement {
MessageDialog.openError(null, Messages.getString("RegisterManagement.errors"), message); //$NON-NLS-1$
}
public String checkUser(String email, boolean isProxyEnabled, String proxyHost, String proxyPort, String proxyUser,
String proxyPassword) throws BusinessException {
// if proxy is enabled
if (isProxyEnabled) {
// get parameter and put them in System.properties.
System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$
System.setProperty("http.proxyPort", proxyPort); //$NON-NLS-1$
System.setProperty("http.proxyUser", proxyUser); //$NON-NLS-1$
System.setProperty("http.proxyPassword", proxyPassword); //$NON-NLS-1$
// override automatic update parameters
if (proxyPort != null && proxyPort.trim().equals("")) { //$NON-NLS-1$
proxyPort = null;
}
HttpProxyUtil.setHttpProxyInfo(true, proxyHost, proxyPort);
}
RegisterUserPortTypeProxy proxy = new RegisterUserPortTypeProxy();
proxy.setEndpoint("https://www.talend.com/TalendRegisterWS/registerws.php"); //$NON-NLS-1$
try {
return proxy.checkUser(email);
} catch (RemoteException e) {
throw new BusinessException(e);
}
}
public void validateRegistration() {
if (!NetworkUtil.isNetworkValidByStatus()) {
return;

View File

@@ -1,16 +0,0 @@
/**
* RegisterUser.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package org.talend.registration.register.proxy;
public interface RegisterUser {
public java.lang.String getRegisterUserPortAddress();
public org.talend.registration.register.proxy.RegisterUserPortType getRegisterUserPort() throws javax.xml.rpc.ServiceException;
public org.talend.registration.register.proxy.RegisterUserPortType getRegisterUserPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}

View File

@@ -1,386 +0,0 @@
/**
* RegisterUserBindingStub.java
*
* This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package org.talend.registration.register.proxy;
import java.math.BigInteger;
import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
public class RegisterUserBindingStub extends org.apache.axis2.client.Stub implements
org.talend.registration.register.proxy.RegisterUserPortType {
private String cachedEndpoint;
private String cachedUsername;
private String cachedPassword;
private boolean manageSession;
public RegisterUserBindingStub(String endpointURL) throws org.apache.axis2.AxisFault {
cachedEndpoint = endpointURL;
}
protected org.apache.axis2.rpc.client.RPCServiceClient createCall() throws java.rmi.RemoteException {
try {
Options options = new Options();
RPCServiceClient client = new RPCServiceClient();
client.setOptions(options);
if (manageSession) {
options.setManageSession(manageSession);
}
if (cachedUsername != null) {
options.setUserName(cachedUsername);
}
if (cachedPassword != null) {
options.setPassword(cachedPassword);
}
if (cachedEndpoint != null) {
options.setTo(new EndpointReference(cachedEndpoint));
}
return client;
} catch (java.lang.Throwable _t) {
throw new org.apache.axis2.AxisFault("Failure trying to get the client object", _t);
}
}
public boolean registerUser(java.lang.String email, java.lang.String country, java.lang.String designerversion)
throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/RegisterUser");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "RegisterUser");
Object[] parameters = { email, country, designerversion };
Class[] returnTypes = new Class[] { boolean.class };
// Invoking the method
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return ((Boolean) response[0]).booleanValue();
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return false;
}
public boolean registerUserWithProductName(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/RegisterUserWithProductName");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "RegisterUserWithProductName");
Object[] parameters = { email, country, designerversion, productname };
Class[] returnTypes = new Class[] { boolean.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return ((Boolean) response[0]).booleanValue();
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return false;
}
public boolean registerUserWithAllUserInformations(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String projectLanguage,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/RegisterUserWithAllUserInformations");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "RegisterUserWithAllUserInformations");
Object[] parameters = { email, country, designerversion, productname, projectLanguage, osName, osVersion, javaVersion,
totalMemory, memRAM, nbProc };
Class[] returnTypes = new Class[] { boolean.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return ((Boolean) response[0]).booleanValue();
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return false;
}
public java.math.BigInteger registerUserWithAllUserInformationsAndReturnId(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String projectLanguage,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction(
"https://www.talend.com/TalendRegisterWS/registerws.php/RegisterUserWithAllUserInformationsAndReturnId");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "RegisterUserWithAllUserInformationsAndReturnId");
Object[] parameters = { email, country, designerversion, productname, projectLanguage, osName, osVersion, javaVersion,
totalMemory, memRAM, nbProc };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
/*
* (non-Javadoc)
*
* @see org.talend.repository.registeruser.proxy.RegisterUserPortType#
* registerUserWithAllUserInformationsUniqueIdAndReturnId(java.lang.String, java.lang.String, java.lang.String,
* java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String,
* java.lang.String, java.lang.String, java.lang.String)
*/
@Override
public BigInteger registerUserWithAllUserInformationsUniqueIdAndReturnId(String email, String country,
String designerversion, String productname, String projectLanguage, String osName, String osVersion,
String javaVersion, String totalMemory, String memRAM, String nbProc, String uniqueId)
throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction(
"https://www.talend.com/TalendRegisterWS/registerws.php/RegisterUserWithAllUserInformationsUniqueIdAndReturnId");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl",
"RegisterUserWithAllUserInformationsUniqueIdAndReturnId");
Object[] parameters = { email, country, designerversion, productname, projectLanguage, osName, osVersion, javaVersion,
totalMemory, memRAM, nbProc, uniqueId };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
public org.talend.registration.register.proxy.UserRegistration[] listUsers() throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/ListUsers");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "ListUsers");
Object[] parameters = {};
Class[] returnTypes = new Class[] { UserRegistration.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (UserRegistration[]) response;
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new UserRegistration[0];
}
public java.lang.String checkUser(java.lang.String email) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction(
"https://www.talend.com/TalendRegisterWS/registerws.php/CheckUser");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "CheckUser");
Object[] parameters = { email };
Class[] returnTypes = new Class[] { String.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (String) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return "";
}
public java.math.BigInteger createUser(java.lang.String email, java.lang.String pseudo, java.lang.String password,
java.lang.String firstname, java.lang.String lastname, java.lang.String country, java.lang.String designerversion,
java.lang.String productname, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/CreateUser");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "CreateUser");
Object[] parameters = { email, pseudo, password, firstname, lastname, country, designerversion, productname, osName,
osVersion, javaVersion, totalMemory, memRAM, nbProc };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
public java.math.BigInteger updateUser(java.lang.String email, java.lang.String pseudo, java.lang.String passwordOld,
java.lang.String passwordNew, java.lang.String firstname, java.lang.String lastname, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String osName, java.lang.String osVersion,
java.lang.String javaVersion, java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc)
throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/UpdateUser");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "UpdateUser");
Object[] parameters = { email, pseudo, passwordOld, passwordNew, firstname, lastname, country, designerversion,
productname, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
public java.math.BigInteger createUser50(java.lang.String pseudo, java.lang.String password, java.lang.String firstname,
java.lang.String lastname, java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/CreateUser50");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "CreateUser50");
Object[] parameters = { pseudo, password, firstname, lastname, country, designerversion, productname, osName, osVersion,
javaVersion, totalMemory, memRAM, nbProc };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
public java.math.BigInteger createUser53(java.lang.String email, java.lang.String pseudo, java.lang.String password,
java.lang.String firstname, java.lang.String lastname, java.lang.String country, java.lang.String designerversion,
java.lang.String productname, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId)
throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/CreateUser53");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "CreateUser53");
Object[] parameters = { email, pseudo, password, firstname, lastname, country, designerversion, productname, osName,
osVersion, javaVersion, totalMemory, memRAM, nbProc, uniqueId };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
public java.math.BigInteger updateUser53(java.lang.String pseudo, java.lang.String password, java.lang.String firstname,
java.lang.String lastname, java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId) throws java.rmi.RemoteException {
if (cachedEndpoint == null) {
throw new AxisFault("No endpoints found in the WSDL");
}
RPCServiceClient client = createCall();
Options options = client.getOptions();
options.setAction("https://www.talend.com/TalendRegisterWS/registerws.php/UpdateUser53");
QName method = new QName("http://www.talend.com/TalendRegisterWS/wsdl", "UpdateUser53");
Object[] parameters = { pseudo, password, firstname, lastname, country, designerversion, productname, osName, osVersion,
javaVersion, totalMemory, memRAM, nbProc, uniqueId };
Class[] returnTypes = new Class[] { BigInteger.class };
try {
Object[] response = client.invokeBlocking(method, parameters, returnTypes);
if (response.length > 0) {
return (BigInteger) response[0];
}
} catch (org.apache.axis2.AxisFault axisFaultException) {
throw axisFaultException;
}
return new BigInteger("-1");
}
}

View File

@@ -1,129 +0,0 @@
/**
* RegisterUserLocator.java
*
* This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package org.talend.registration.register.proxy;
public class RegisterUserLocator implements
org.talend.registration.register.proxy.RegisterUser {
public RegisterUserLocator() {
}
// Use to get a proxy class for RegisterUserPort
private java.lang.String RegisterUserPort_address = "https://www.talend.com/TalendRegisterWS/registerws.php";
public java.lang.String getRegisterUserPortAddress() {
return RegisterUserPort_address;
}
// The WSDD service name defaults to the port name.
private java.lang.String RegisterUserPortWSDDServiceName = "RegisterUserPort";
public java.lang.String getRegisterUserPortWSDDServiceName() {
return RegisterUserPortWSDDServiceName;
}
public void setRegisterUserPortWSDDServiceName(java.lang.String name) {
RegisterUserPortWSDDServiceName = name;
}
public org.talend.registration.register.proxy.RegisterUserPortType getRegisterUserPort()
throws javax.xml.rpc.ServiceException {
java.net.URL endpoint;
try {
endpoint = new java.net.URL(RegisterUserPort_address);
} catch (java.net.MalformedURLException e) {
throw new javax.xml.rpc.ServiceException(e);
}
return getRegisterUserPort(endpoint);
}
public org.talend.registration.register.proxy.RegisterUserPortType getRegisterUserPort(java.net.URL portAddress)
throws javax.xml.rpc.ServiceException {
try {
org.talend.registration.register.proxy.RegisterUserBindingStub _stub = new org.talend.registration.register.proxy.RegisterUserBindingStub(
portAddress.toString());
return _stub;
} catch (org.apache.axis2.AxisFault e) {
return null;
}
}
public void setRegisterUserPortEndpointAddress(java.lang.String address) {
RegisterUserPort_address = address;
}
/**
* For the given interface, get the stub implementation. If this service has no port for the given interface, then
* ServiceException is thrown.
*/
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (org.talend.registration.register.proxy.RegisterUserPortType.class.isAssignableFrom(serviceEndpointInterface)) {
org.talend.registration.register.proxy.RegisterUserBindingStub _stub = new org.talend.registration.register.proxy.RegisterUserBindingStub(
RegisterUserPort_address);
return _stub;
}
} catch (java.lang.Throwable t) {
throw new javax.xml.rpc.ServiceException(t);
}
throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: "
+ (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
}
/**
* For the given interface, get the stub implementation. If this service has no port for the given interface, then
* ServiceException is thrown.
*/
public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface)
throws javax.xml.rpc.ServiceException {
if (portName == null) {
return getPort(serviceEndpointInterface);
}
java.lang.String inputPortName = portName.getLocalPart();
if ("RegisterUserPort".equals(inputPortName)) {
return getRegisterUserPort();
} else {
java.rmi.Remote _stub = getPort(serviceEndpointInterface);
return _stub;
}
}
public javax.xml.namespace.QName getServiceName() {
return new javax.xml.namespace.QName("http://www.talend.com/TalendRegisterWS/wsdl", "RegisterUser");
}
private java.util.HashSet ports = null;
public java.util.Iterator getPorts() {
if (ports == null) {
ports = new java.util.HashSet();
ports.add(new javax.xml.namespace.QName("http://www.talend.com/TalendRegisterWS/wsdl", "RegisterUserPort"));
}
return ports.iterator();
}
/**
* Set the endpoint address for the specified port name.
*/
public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("RegisterUserPort".equals(portName)) {
setRegisterUserPortEndpointAddress(address);
} else { // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
/**
* Set the endpoint address for the specified port name.
*/
public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address)
throws javax.xml.rpc.ServiceException {
setEndpointAddress(portName.getLocalPart(), address);
}
}

View File

@@ -1,63 +0,0 @@
/**
* RegisterUserPortType.java
*
* This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package org.talend.registration.register.proxy;
public interface RegisterUserPortType extends java.rmi.Remote {
public boolean registerUser(java.lang.String email, java.lang.String country, java.lang.String designerversion)
throws java.rmi.RemoteException;
public boolean registerUserWithProductName(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname) throws java.rmi.RemoteException;
public boolean registerUserWithAllUserInformations(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String projectLanguage,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException;
public java.math.BigInteger registerUserWithAllUserInformationsAndReturnId(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String projectLanguage,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException;
public java.math.BigInteger registerUserWithAllUserInformationsUniqueIdAndReturnId(java.lang.String email,
java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String projectLanguage, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId)
throws java.rmi.RemoteException;
public org.talend.registration.register.proxy.UserRegistration[] listUsers() throws java.rmi.RemoteException;
public java.lang.String checkUser(java.lang.String email) throws java.rmi.RemoteException;
public java.math.BigInteger createUser(java.lang.String email, java.lang.String pseudo, java.lang.String password,
java.lang.String firstname, java.lang.String lastname, java.lang.String country, java.lang.String designerversion,
java.lang.String productname, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException;
public java.math.BigInteger updateUser(java.lang.String email, java.lang.String pseudo, java.lang.String passwordOld,
java.lang.String passwordNew, java.lang.String firstname, java.lang.String lastname, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String osName, java.lang.String osVersion,
java.lang.String javaVersion, java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc)
throws java.rmi.RemoteException;
public java.math.BigInteger createUser50(java.lang.String pseudo, java.lang.String password, java.lang.String firstname,
java.lang.String lastname, java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException;
public java.math.BigInteger createUser53(java.lang.String email, java.lang.String pseudo, java.lang.String password,
java.lang.String firstname, java.lang.String lastname, java.lang.String country, java.lang.String designerversion,
java.lang.String productname, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId)
throws java.rmi.RemoteException;
public java.math.BigInteger updateUser53(java.lang.String pseudo, java.lang.String password, java.lang.String firstname,
java.lang.String lastname, java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId) throws java.rmi.RemoteException;
}

View File

@@ -1,147 +0,0 @@
package org.talend.registration.register.proxy;
public class RegisterUserPortTypeProxy implements org.talend.registration.register.proxy.RegisterUserPortType {
private String _endpoint = null;
private org.talend.registration.register.proxy.RegisterUserPortType registerUserPortType = null;
public RegisterUserPortTypeProxy() {
_initRegisterUserPortTypeProxy();
}
public RegisterUserPortTypeProxy(String endpoint) {
_endpoint = endpoint;
_initRegisterUserPortTypeProxy();
}
private void _initRegisterUserPortTypeProxy() {
try {
registerUserPortType = (new org.talend.registration.register.proxy.RegisterUserLocator()).getRegisterUserPort();
} catch (javax.xml.rpc.ServiceException serviceException) {
}
}
public String getEndpoint() {
return _endpoint;
}
public void setEndpoint(String endpoint) {
_endpoint = endpoint;
}
public org.talend.registration.register.proxy.RegisterUserPortType getRegisterUserPortType() {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType;
}
public boolean registerUser(java.lang.String email, java.lang.String country, java.lang.String designerversion)
throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.registerUser(email, country, designerversion);
}
public boolean registerUserWithProductName(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.registerUserWithProductName(email, country, designerversion, productname);
}
public boolean registerUserWithAllUserInformations(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String projectLanguage,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.registerUserWithAllUserInformations(email, country, designerversion, productname,
projectLanguage, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc);
}
public java.math.BigInteger registerUserWithAllUserInformationsAndReturnId(java.lang.String email, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String projectLanguage,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.registerUserWithAllUserInformationsAndReturnId(email, country, designerversion, productname,
projectLanguage, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc);
}
public java.math.BigInteger registerUserWithAllUserInformationsUniqueIdAndReturnId(java.lang.String email,
java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String projectLanguage, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId)
throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.registerUserWithAllUserInformationsUniqueIdAndReturnId(email, country, designerversion,
productname, projectLanguage, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc, uniqueId);
}
public org.talend.registration.register.proxy.UserRegistration[] listUsers() throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.listUsers();
}
public java.lang.String checkUser(java.lang.String email) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.checkUser(email);
}
public java.math.BigInteger createUser(java.lang.String email, java.lang.String pseudo, java.lang.String password,
java.lang.String firstname, java.lang.String lastname, java.lang.String country, java.lang.String designerversion,
java.lang.String productname, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.createUser(email, pseudo, password, firstname, lastname, country, designerversion,
productname, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc);
}
public java.math.BigInteger updateUser(java.lang.String email, java.lang.String pseudo, java.lang.String passwordOld,
java.lang.String passwordNew, java.lang.String firstname, java.lang.String lastname, java.lang.String country,
java.lang.String designerversion, java.lang.String productname, java.lang.String osName, java.lang.String osVersion,
java.lang.String javaVersion, java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc)
throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.updateUser(email, pseudo, passwordOld, passwordNew, firstname, lastname, country,
designerversion, productname, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc);
}
public java.math.BigInteger createUser50(java.lang.String pseudo, java.lang.String password, java.lang.String firstname,
java.lang.String lastname, java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.createUser50(pseudo, password, firstname, lastname, country, designerversion, productname,
osName, osVersion, javaVersion, totalMemory, memRAM, nbProc);
}
public java.math.BigInteger createUser53(java.lang.String email, java.lang.String pseudo, java.lang.String password,
java.lang.String firstname, java.lang.String lastname, java.lang.String country, java.lang.String designerversion,
java.lang.String productname, java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion,
java.lang.String totalMemory, java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId)
throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.createUser53(email, pseudo, password, firstname, lastname, country, designerversion,
productname, osName, osVersion, javaVersion, totalMemory, memRAM, nbProc, uniqueId);
}
public java.math.BigInteger updateUser53(java.lang.String pseudo, java.lang.String password, java.lang.String firstname,
java.lang.String lastname, java.lang.String country, java.lang.String designerversion, java.lang.String productname,
java.lang.String osName, java.lang.String osVersion, java.lang.String javaVersion, java.lang.String totalMemory,
java.lang.String memRAM, java.lang.String nbProc, java.lang.String uniqueId) throws java.rmi.RemoteException {
if (registerUserPortType == null)
_initRegisterUserPortTypeProxy();
return registerUserPortType.updateUser53(pseudo, password, firstname, lastname, country, designerversion, productname,
osName, osVersion, javaVersion, totalMemory, memRAM, nbProc, uniqueId);
}
}

View File

@@ -1,220 +0,0 @@
/**
* UserRegistration.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package org.talend.registration.register.proxy;
public class UserRegistration implements java.io.Serializable {
private int id;
private java.lang.String email;
private java.lang.String country;
private java.lang.String designer_version;
private java.lang.String productname;
private java.lang.String registration_date;
public UserRegistration() {
}
public UserRegistration(
int id,
java.lang.String email,
java.lang.String country,
java.lang.String designer_version,
java.lang.String productname,
java.lang.String registration_date) {
this.id = id;
this.email = email;
this.country = country;
this.designer_version = designer_version;
this.productname = productname;
this.registration_date = registration_date;
}
/**
* Gets the id value for this UserRegistration.
*
* @return id
*/
public int getId() {
return id;
}
/**
* Sets the id value for this UserRegistration.
*
* @param id
*/
public void setId(int id) {
this.id = id;
}
/**
* Gets the email value for this UserRegistration.
*
* @return email
*/
public java.lang.String getEmail() {
return email;
}
/**
* Sets the email value for this UserRegistration.
*
* @param email
*/
public void setEmail(java.lang.String email) {
this.email = email;
}
/**
* Gets the country value for this UserRegistration.
*
* @return country
*/
public java.lang.String getCountry() {
return country;
}
/**
* Sets the country value for this UserRegistration.
*
* @param country
*/
public void setCountry(java.lang.String country) {
this.country = country;
}
/**
* Gets the designer_version value for this UserRegistration.
*
* @return designer_version
*/
public java.lang.String getDesigner_version() {
return designer_version;
}
/**
* Sets the designer_version value for this UserRegistration.
*
* @param designer_version
*/
public void setDesigner_version(java.lang.String designer_version) {
this.designer_version = designer_version;
}
/**
* Gets the productname value for this UserRegistration.
*
* @return productname
*/
public java.lang.String getProductname() {
return productname;
}
/**
* Sets the productname value for this UserRegistration.
*
* @param productname
*/
public void setProductname(java.lang.String productname) {
this.productname = productname;
}
/**
* Gets the registration_date value for this UserRegistration.
*
* @return registration_date
*/
public java.lang.String getRegistration_date() {
return registration_date;
}
/**
* Sets the registration_date value for this UserRegistration.
*
* @param registration_date
*/
public void setRegistration_date(java.lang.String registration_date) {
this.registration_date = registration_date;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof UserRegistration)) return false;
UserRegistration other = (UserRegistration) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
this.id == other.getId() &&
((this.email==null && other.getEmail()==null) ||
(this.email!=null &&
this.email.equals(other.getEmail()))) &&
((this.country==null && other.getCountry()==null) ||
(this.country!=null &&
this.country.equals(other.getCountry()))) &&
((this.designer_version==null && other.getDesigner_version()==null) ||
(this.designer_version!=null &&
this.designer_version.equals(other.getDesigner_version()))) &&
((this.productname==null && other.getProductname()==null) ||
(this.productname!=null &&
this.productname.equals(other.getProductname()))) &&
((this.registration_date==null && other.getRegistration_date()==null) ||
(this.registration_date!=null &&
this.registration_date.equals(other.getRegistration_date())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += getId();
if (getEmail() != null) {
_hashCode += getEmail().hashCode();
}
if (getCountry() != null) {
_hashCode += getCountry().hashCode();
}
if (getDesigner_version() != null) {
_hashCode += getDesigner_version().hashCode();
}
if (getProductname() != null) {
_hashCode += getProductname().hashCode();
}
if (getRegistration_date() != null) {
_hashCode += getRegistration_date().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
}

View File

@@ -112,6 +112,10 @@ public class ProviderManager extends AbstractImportResourcesManager {
if (provider instanceof TarLeveledStructureProvider) {
return ((TarLeveledStructureProvider) provider).getRoot();
}
if (provider instanceof TalendZipLeveledStructureProvider) {
return ((TalendZipLeveledStructureProvider) provider).getRoot();
}
return null;
}
}

View File

@@ -283,7 +283,13 @@ public class ImportBasicHandler extends AbstractImportExecutableHandler {
.getImportErrors()
.add(Messages.getString("ImportBasicHandler_LoadEMFResourceError", importItem.getPath().lastSegment(),
HandlerUtil.getValidItemRelativePath(manager, importItem.getPath())));
log.error(Messages.getString("ImportBasicHandler_ErrorCreateEmfResource") + " - " + HandlerUtil.getValidItemRelativePath(manager, importItem.getPath())); //$NON-NLS-1$
// TDQ-21713: ignore ".gitkeep" file under the git remote project's folders
if (importItem.getPath() != null
&& (!".gitkeep.properties".equalsIgnoreCase(importItem.getPath().lastSegment()))) { //$NON-NLS-1$
log.error(Messages.getString("ImportBasicHandler_ErrorCreateEmfResource") + " - " //$NON-NLS-1$ //$NON-NLS-2$
+ HandlerUtil.getValidItemRelativePath(manager, importItem.getPath()));
}
}
}

View File

@@ -12,6 +12,10 @@
// ============================================================================
package org.talend.repository.items.importexport.handlers.imports;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -24,13 +28,24 @@ import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ItemRelation;
import org.talend.core.model.properties.ItemRelations;
import org.talend.core.model.properties.Project;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.Relation;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.repository.items.importexport.handlers.HandlerUtil;
import org.talend.repository.items.importexport.handlers.ImportHandlerHelper;
import org.talend.repository.items.importexport.handlers.model.ImportItem;
import org.talend.repository.items.importexport.wizard.models.ItemImportNode;
/**
@@ -91,6 +106,7 @@ public class ImportDependencyRelationsHelper {
checkedNodeList.forEach(checkedNode -> {
List<ItemImportNode> relatedImportNodes = findOutRelationsItemImportNodes(checkedNode, toSelectSet,
allImportItemNodesList);
findOutConnectionContextRelationItemImportNodes(checkedNode, toSelectSet, relatedImportNodes, allImportItemNodesList);
checkImportRelationDependency(relatedImportNodes, toSelectSet, allImportItemNodesList);
});
}
@@ -148,6 +164,61 @@ public class ImportDependencyRelationsHelper {
return relatedImportNodesList;
}
private void findOutConnectionContextRelationItemImportNodes(ItemImportNode checkedNode, Set<ItemImportNode> toSelectSet,
List<ItemImportNode> relatedImportNodes, List<ItemImportNode> allImportItemNodesList) {
ImportItem importItem = checkedNode.getItemRecord();
if (!(importItem.getProperty().getItem() instanceof ConnectionItem)) {
return;
}
BufferedInputStream stream = null;
try {
ResourceSet resourceSet = importItem.getResourceSet();
IPath itemPath = HandlerUtil.getItemPath(importItem.getPath(), importItem.getItem());
URI itemUri = HandlerUtil.getURI(itemPath);
Resource itemResource = resourceSet.getResource(itemUri, false);
if (itemResource == null) {
itemResource = resourceSet.createResource(itemUri);
}
File itemFile = new File(itemPath.toPortableString());
stream = new BufferedInputStream(new FileInputStream(itemFile));
itemResource.load(stream, null);
URI propertyUri = HandlerUtil.getURI(importItem.getPath());
Resource resource = resourceSet.getResource(propertyUri, false);
File propertyFile = new File(importItem.getPath().toPortableString());
stream = new BufferedInputStream(new FileInputStream(propertyFile));
resource.load(stream, null);
Property property = new ImportHandlerHelper().generateProperty(resource);
Item item = property.getItem();
if (item instanceof ConnectionItem) {
ConnectionItem connItem = (ConnectionItem) item;
Connection connection = connItem.getConnection();
if (connection.isContextMode() && StringUtils.isNotBlank(connection.getContextId())) {
String technicalLabel = checkedNode.getProjectNode().getProject().getTechnicalLabel();
ItemImportNode contextImportNode = getLatestVersionItemImportNode(connection.getContextId(), technicalLabel,
allImportItemNodesList, false);
if (contextImportNode != null && !toSelectSet.contains(contextImportNode)) {
toSelectSet.add(contextImportNode);
relatedImportNodes.add(contextImportNode);
}
}
}
} catch (Exception e) {
if (Platform.inDebugMode()) {
ExceptionHandler.process(e);
}
} finally {
if (stream != null) {
try {
stream.close();
} catch (IOException e) {
if (Platform.inDebugMode()) {
ExceptionHandler.process(e);
}
}
}
}
}
public ItemImportNode getLatestVersionItemImportNode(String id, String projectTecLabel,
List<ItemImportNode> allImportItemNodesList, boolean isGlobalRoutine) {
List<ItemImportNode> allItemImportNodesById = getItemImportNode(allImportItemNodesList, node -> {

View File

@@ -34,6 +34,7 @@ import org.talend.core.model.properties.Project;
import org.talend.core.model.properties.RoutinesJarItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.routines.RoutinesUtil;
import org.talend.core.repository.utils.RepositoryNodeManager;
import org.talend.core.ui.ITestContainerProviderService;
import org.talend.repository.items.importexport.handlers.model.EmptyFolderImportItem;
import org.talend.repository.items.importexport.handlers.model.ImportItem;
@@ -282,7 +283,7 @@ public class ImportNodesBuilder {
}
private TypeImportNode findAndCreateParentTypeNode(ProjectImportNode projectNode, ERepositoryObjectType curType) {
if (curType == ERepositoryObjectType.METADATA_TACOKIT_JDBC || curType == ERepositoryObjectType.SNOWFLAKE) {
if (curType == ERepositoryObjectType.METADATA_TACOKIT_JDBC || RepositoryNodeManager.isSnowflake(curType)) {
curType = ERepositoryObjectType.METADATA_CONNECTIONS;
}
ERepositoryObjectType parentParentType = ERepositoryObjectType.findParentType(curType);

View File

@@ -2862,7 +2862,7 @@ public class DatabaseForm extends AbstractForm {
File file = new File(stringToFile);
if (file != null) {
try {
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURL()},this.getClass().getClassLoader());
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURI().toURL()},this.getClass().getClassLoader());
Class[] classes = cl.getAssignableClasses(Driver.class);
for (Class classe : classes) {
driverClassTxt.add(classe.getName());
@@ -6371,7 +6371,7 @@ public class DatabaseForm extends AbstractForm {
File file = new File(stringToFile);
if (file != null) {
try {
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURL()},this.getClass().getClassLoader());
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURI().toURL()},this.getClass().getClassLoader());
Class[] classes = cl.getAssignableClasses(Driver.class);
for (Class classe : classes) {
generalJdbcClassNameText.add(classe.getName());

View File

@@ -52,4 +52,5 @@ public class EnvironmentUtils {
public static boolean isAarch64() {
return StringUtils.equals(Platform.ARCH_AARCH64, Platform.getOSArch());
}
}

View File

@@ -64,7 +64,7 @@ public class TMCRepositoryUtil {
public static final int ALLOWED_PAT_MAX_DAYS = 60;
public static final long ALLOWED_PAT_MAX_MILLI_SECONDS = ALLOWED_PAT_MAX_DAYS * 24 * 60 * 1000;
public static final long ALLOWED_PAT_MAX_MILLI_SECONDS = 1000L * ALLOWED_PAT_MAX_DAYS * 24 * 60 * 60;
public static final Pattern DATA_CENTER_PATTERN = Pattern.compile("^http[s?]://tmc\\.(.*)(\\.cloud\\.talend\\.com.*)", Pattern.CASE_INSENSITIVE);

View File

@@ -0,0 +1,34 @@
// ============================================================================
//
// 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.repository.model.ldap;
import java.security.cert.X509Certificate;
import org.junit.Assert;
import org.junit.Test;
/**
* @author PCW created on Nov 28, 2023
*
*/
public class LDAPCATrusterTest {
@Test
public void testGetAcceptedIssuers() {
LDAPCATruster truster = new LDAPCATruster(null);
X509Certificate[] certs = truster.getAcceptedIssuers();
Assert.assertTrue(certs.length > 1);
}
}

View File

@@ -1,96 +1,128 @@
// ============================================================================
//
// 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.librariesmanager.utils;
import static org.junit.Assert.*;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.junit.Assert;
import org.junit.Test;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleToInstall;
/**
* created by wchen on 2016年2月18日 Detailled comment
*
*/
public class RemoteModulesHelperTest {
/**
* Test method for
* {@link org.talend.librariesmanager.utils.RemoteModulesHelper#getNotInstalledModulesRunnable(java.util.List, java.util.List, boolean)}
* .
*
* @throws InterruptedException
* @throws InvocationTargetException
*/
@Test
public void testGetNotInstalledModulesRunnableListOfModuleNeededListOfModuleToInstallBoolean()
throws InvocationTargetException, InterruptedException {
List<ModuleNeeded> neededModules = new ArrayList<ModuleNeeded>();
ModuleNeeded m1 = new ModuleNeeded("tMysqlInput", "mysql.jar", "", true, null, null,
"mvn:org.talend.libraries/mysql/6.0.0");
ModuleNeeded m2 = new ModuleNeeded("tMysqlInput", "mysql.jar", "", true, null, null,
"mvn:org.talend.libraries/mysql/6.1.0");
ModuleNeeded m3 = new ModuleNeeded("tMyComponent1", "test.jar", "", true, null, null,
"mvn:org.talend.libraries/test/6.0.0");
ModuleNeeded m4 = new ModuleNeeded("tMyComponent2", "test.jar", "", true, null, null,
"mvn:org.talend.libraries/test/6.0.0");
ModuleNeeded m5 = new ModuleNeeded("tMyComponent3", "test.exe", "", true, null, null,
"mvn:org.talend.libraries/test/6.0.0");
neededModules.add(m1);
neededModules.add(m2);
neededModules.add(m3);
neededModules.add(m4);
neededModules.add(m5);
List<ModuleToInstall> toInstall1 = new ArrayList<ModuleToInstall>();
IRunnableWithProgress notInstalledModulesRunnable = RemoteModulesHelper.getInstance()
.getNotInstalledModulesRunnable(neededModules, toInstall1, false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(4, toInstall1.size());
}
@Test
public void testGetNotInstalledModulesRunnableListForModuleNameURL() throws InvocationTargetException, InterruptedException {
List<ModuleNeeded> neededModules = new ArrayList<ModuleNeeded>();
ModuleNeeded m1 = new ModuleNeeded("test", "protobuf-java-2.6.1.jar", "", true, null, null,
"mvn:com.google.protobuf/protobuf-java/2.6.1");
neededModules.add(m1);
List<ModuleToInstall> toInstall1 = new ArrayList<ModuleToInstall>();
IRunnableWithProgress notInstalledModulesRunnable = RemoteModulesHelper.getInstance()
.getNotInstalledModulesRunnable(neededModules, toInstall1, false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(1, toInstall1.size());
Assert.assertEquals("protobuf-java-2.6.1.jar", toInstall1.get(0).getName());
Assert.assertEquals("mvn:com.google.protobuf/protobuf-java/2.6.1/jar", toInstall1.get(0).getMavenUri());
neededModules.clear();
ModuleNeeded m2 = new ModuleNeeded("test", "protobuf-java.jar", "", true, null, null,
"mvn:org.talend.libraries/protobuf-java/6.0.0");
neededModules.add(m2);
toInstall1 = new ArrayList<ModuleToInstall>();
notInstalledModulesRunnable = RemoteModulesHelper.getInstance().getNotInstalledModulesRunnable(neededModules, toInstall1,
false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(1, toInstall1.size());
Assert.assertEquals("protobuf-java.jar", toInstall1.get(0).getName());
Assert.assertEquals("mvn:org.talend.libraries/protobuf-java/6.0.0/jar", toInstall1.get(0).getMavenUri());
}
}
// ============================================================================
//
// 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.librariesmanager.utils;
import static org.junit.Assert.*;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.junit.Assert;
import org.junit.Test;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleToInstall;
import org.talend.core.runtime.maven.MavenConstants;
/**
* created by wchen on 2016骞<36>2鏈<32>18鏃<38> Detailled comment
*
*/
public class RemoteModulesHelperTest {
/**
* Test method for
* {@link org.talend.librariesmanager.utils.RemoteModulesHelper#getNotInstalledModulesRunnable(java.util.List, java.util.List, boolean)}
* .
*
* @throws InterruptedException
* @throws InvocationTargetException
*/
@Test
public void testGetNotInstalledModulesRunnableListOfModuleNeededListOfModuleToInstallBoolean()
throws InvocationTargetException, InterruptedException {
List<ModuleNeeded> neededModules = new ArrayList<ModuleNeeded>();
ModuleNeeded m1 = new ModuleNeeded("tMysqlInput", "mysql.jar", "", true, null, null,
"mvn:org.talend.libraries/mysql/6.0.0");
ModuleNeeded m2 = new ModuleNeeded("tMysqlInput", "mysql.jar", "", true, null, null,
"mvn:org.talend.libraries/mysql/6.1.0");
ModuleNeeded m3 = new ModuleNeeded("tMyComponent1", "test.jar", "", true, null, null,
"mvn:org.talend.libraries/test/6.0.0");
ModuleNeeded m4 = new ModuleNeeded("tMyComponent2", "test.jar", "", true, null, null,
"mvn:org.talend.libraries/test/6.0.0");
ModuleNeeded m5 = new ModuleNeeded("tMyComponent3", "test.exe", "", true, null, null,
"mvn:org.talend.libraries/test/6.0.0");
neededModules.add(m1);
neededModules.add(m2);
neededModules.add(m3);
neededModules.add(m4);
neededModules.add(m5);
List<ModuleToInstall> toInstall1 = new ArrayList<ModuleToInstall>();
IRunnableWithProgress notInstalledModulesRunnable = RemoteModulesHelper.getInstance()
.getNotInstalledModulesRunnable(neededModules, toInstall1, false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(4, toInstall1.size());
}
@Test
public void testGetNotInstalledModulesRunnableListForModuleNameURL() throws InvocationTargetException, InterruptedException {
List<ModuleNeeded> neededModules = new ArrayList<ModuleNeeded>();
ModuleNeeded m1 = new ModuleNeeded("test", "protobuf-java-2.6.1.jar", "", true, null, null,
"mvn:com.google.protobuf/protobuf-java/2.6.1");
neededModules.add(m1);
List<ModuleToInstall> toInstall1 = new ArrayList<ModuleToInstall>();
IRunnableWithProgress notInstalledModulesRunnable = RemoteModulesHelper.getInstance()
.getNotInstalledModulesRunnable(neededModules, toInstall1, false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(1, toInstall1.size());
Assert.assertEquals("protobuf-java-2.6.1.jar", toInstall1.get(0).getName());
Assert.assertEquals("mvn:com.google.protobuf/protobuf-java/2.6.1/jar", toInstall1.get(0).getMavenUri());
neededModules.clear();
ModuleNeeded m2 = new ModuleNeeded("test", "protobuf-java.jar", "", true, null, null,
"mvn:org.talend.libraries/protobuf-java/6.0.0");
neededModules.add(m2);
toInstall1 = new ArrayList<ModuleToInstall>();
notInstalledModulesRunnable = RemoteModulesHelper.getInstance().getNotInstalledModulesRunnable(neededModules, toInstall1,
false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(1, toInstall1.size());
Assert.assertEquals("protobuf-java.jar", toInstall1.get(0).getName());
Assert.assertEquals("mvn:org.talend.libraries/protobuf-java/6.0.0/jar", toInstall1.get(0).getMavenUri());
}
@Test
public void testGetManualInstallModulesRunnableListForModuleNameURL() throws InvocationTargetException, InterruptedException {
List<ModuleNeeded> neededModules = new ArrayList<ModuleNeeded>();
ModuleNeeded m1 = new ModuleNeeded("test", "tdgssconfig-16.20.00.02.jar", "", true, null, null,
"mvn:com.teradata/tdgssconfig/16.20.00.02/jar");
neededModules.add(m1);
List<ModuleToInstall> toInstall1 = new ArrayList<ModuleToInstall>();
IRunnableWithProgress notInstalledModulesRunnable = RemoteModulesHelper.getInstance()
.getNotInstalledModulesRunnable(neededModules, toInstall1, false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(1, toInstall1.size());
Assert.assertEquals(MavenConstants.DOWNLOAD_MANUAL, toInstall1.get(0).getDistribution());
neededModules = new ArrayList<ModuleNeeded>();
m1 = new ModuleNeeded("test", "tdgssconfig-16.20.00.02.jar", "", true, null, null,
"mvn:com.teradata/tdgssconfig/16.20.00.02/jar");
neededModules.add(m1);
m1 = new ModuleNeeded("test", "terajdbc4-16.20.00.02.jar", "", true, null, null,
"mvn:com.teradata/terajdbc4/16.20.00.02/jar");
neededModules.add(m1);
List<ModuleToInstall> toInstall2 = new ArrayList<ModuleToInstall>();
notInstalledModulesRunnable = RemoteModulesHelper.getInstance()
.getNotInstalledModulesRunnable(neededModules, toInstall2, false, false, false);
notInstalledModulesRunnable.run(new NullProgressMonitor());
assertEquals(2, toInstall2.size());
Assert.assertEquals(MavenConstants.DOWNLOAD_MANUAL, toInstall2.get(0).getDistribution());
Assert.assertEquals(MavenConstants.DOWNLOAD_MANUAL, toInstall2.get(1).getDistribution());
}
}

View File

@@ -506,14 +506,25 @@ public class ImportBasicHandlerTest {
}
@Test
public void testComputeImportItem() throws Exception {
public void testComputeProperty() throws Exception {
ImportBasicHandler basicHandler = new ImportBasicHandler();
ImportItem ImportItem = new ImportItem(processPropPath1);
ImportItem.setItemName(processPropPath1.lastSegment());
// Property
Property property = mock(Property.class);
ImportItem.setProperty(property);
ImportItem importItem = new ImportItem(processPropPath1);
importItem.setItemName(processPropPath1.lastSegment());
ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
Property myProperty = PropertiesFactory.eINSTANCE.createProperty();
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
itemState.setDeleted(false);
itemState.setPath("TEST/process/test1_0.1.item");
processItem.setState(itemState);
processItem.setProperty(myProperty);
myProperty.setLabel("test1");
myProperty.setVersion("0.1");
myProperty.setItem(processItem);
importItem.setProperty(myProperty);
// Resources
ResourcesManager resManager = mock(ResourcesManager.class);
Set<IPath> pathes = new HashSet<IPath>();
@@ -523,9 +534,9 @@ public class ImportBasicHandlerTest {
pathes.add(processItemPath1);
when(resManager.getPaths()).thenReturn(pathes);
// call
basicHandler.computeImportItem(resManager, processPropPath1);
basicHandler.computeProperty(resManager, importItem);
// Load Resource failed
Assert.assertNull(basicHandler.loadResource(resManager, ImportItem));
Assert.assertNull(basicHandler.loadResource(resManager, importItem));
Assert.assertTrue(ImportCacheHelper.getInstance().getImportErrors().size() == 1);
// ...
}