Compare commits
127 Commits
patch/7.3.
...
patch/7.3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86171f4473 | ||
|
|
ebe668a985 | ||
|
|
cff7a54f6f | ||
|
|
13309d3297 | ||
|
|
311c5680d3 | ||
|
|
743d863776 | ||
|
|
9a87e0c49e | ||
|
|
78522294dc | ||
|
|
2854fa80b5 | ||
|
|
7389610259 | ||
|
|
ae319f0d85 | ||
|
|
98a80d18b6 | ||
|
|
f878723f81 | ||
|
|
1ac0beea10 | ||
|
|
cc0cab9532 | ||
|
|
0d7971730f | ||
|
|
75cc28c0be | ||
|
|
f8e3b6d5cb | ||
|
|
8a82cff8f3 | ||
|
|
ab9d3d1db2 | ||
|
|
05779d09a3 | ||
|
|
d40317d16a | ||
|
|
0c3625940c | ||
|
|
00c0652cbb | ||
|
|
823b72bcd9 | ||
|
|
f760212388 | ||
|
|
9da9e8199a | ||
|
|
baf574ea55 | ||
|
|
892065d2c4 | ||
|
|
724dc1b72d | ||
|
|
132d794131 | ||
|
|
2298c44339 | ||
|
|
03e462f8ff | ||
|
|
f7fb174301 | ||
|
|
54fc6ecd51 | ||
|
|
779e9a8086 | ||
|
|
f2d189c792 | ||
|
|
84edc461db | ||
|
|
b06ee57323 | ||
|
|
4590b8456d | ||
|
|
b2c74643a7 | ||
|
|
b35fb11251 | ||
|
|
576d3abf29 | ||
|
|
14ca2dfaa7 | ||
|
|
b607ed6fb3 | ||
|
|
acd02c4c18 | ||
|
|
615a4f209e | ||
|
|
172f3c3483 | ||
|
|
a4ce2f457e | ||
|
|
f2af89413f | ||
|
|
0c8c872bd6 | ||
|
|
38ed0b9f1f | ||
|
|
4df14e99d0 | ||
|
|
0c3e5175dd | ||
|
|
4ed8a4a803 | ||
|
|
365700699e | ||
|
|
dab6da165f | ||
|
|
b33018d422 | ||
|
|
81ec1966bd | ||
|
|
d3246a9713 | ||
|
|
b098e18278 | ||
|
|
f635d5a9f6 | ||
|
|
49b4be0929 | ||
|
|
39afb9e94a | ||
|
|
d119efe8d6 | ||
|
|
66cdd796fd | ||
|
|
af3def7767 | ||
|
|
e7db5386c9 | ||
|
|
0b8f214c38 | ||
|
|
3c9684f993 | ||
|
|
de29a9fee4 | ||
|
|
e346460a75 | ||
|
|
294bb6a9c9 | ||
|
|
cb76ce50a7 | ||
|
|
e8e197e81c | ||
|
|
a5d5c0ef55 | ||
|
|
82b425506a | ||
|
|
932e8d61e3 | ||
|
|
6baf2b82be | ||
|
|
1331c1d70b | ||
|
|
e719944af0 | ||
|
|
333f9ad538 | ||
|
|
eede5c3bc2 | ||
|
|
cafb7db6b8 | ||
|
|
b042f20e49 | ||
|
|
c0fde38133 | ||
|
|
5efc4dd8c4 | ||
|
|
f5833bb365 | ||
|
|
548f6a97fd | ||
|
|
864ba43149 | ||
|
|
d0d955546b | ||
|
|
51cb13c619 | ||
|
|
e9d7c4a43c | ||
|
|
67d44985fa | ||
|
|
41f5d459f6 | ||
|
|
b38b96fedc | ||
|
|
df53ee1a1f | ||
|
|
035bc4a39c | ||
|
|
1105d9c65c | ||
|
|
488e7aaedb | ||
|
|
681dd59eb2 | ||
|
|
7a3c23cdb5 | ||
|
|
a6f4581b0a | ||
|
|
40e63f3c01 | ||
|
|
d54cddaedf | ||
|
|
41e2ef2d2d | ||
|
|
bccc406937 | ||
|
|
a9b3d20e06 | ||
|
|
47b5a7e251 | ||
|
|
e9b5fa3ba7 | ||
|
|
39a730cae4 | ||
|
|
d88d513e4e | ||
|
|
75176b6f45 | ||
|
|
11ecc1cbfd | ||
|
|
53efef8de0 | ||
|
|
db2eb01c38 | ||
|
|
f9af16ba90 | ||
|
|
23f2926741 | ||
|
|
48653aa380 | ||
|
|
d80fefc234 | ||
|
|
a0b395cd3a | ||
|
|
98bcc66479 | ||
|
|
a716257dd0 | ||
|
|
b164f8c447 | ||
|
|
dd352b4a8f | ||
|
|
08ac05c23e | ||
|
|
90a37f8418 |
BIN
main/plugins/org.talend.common.ui.runtime/icons/lowercase.jpg
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/lowercase.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
main/plugins/org.talend.common.ui.runtime/icons/uppercase.jpg
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/uppercase.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -132,3 +132,8 @@ GlobalServiceRegister.ServiceNotRegistered=The service {0} has not been register
|
||||
MessageBoxExceptionHandler.showMessageForSchemaImportXml.unParseXML.title=The xml can't parse.
|
||||
MessageBoxExceptionHandler.showMessageForSchemaImportXml.unParseXML.msg=The xml can't parse in this format.
|
||||
HibernateUtils.auditDBIsNotUsable=The audit database must be empty or only contains tables related to audit.
|
||||
CasePushButton.CaseButton.Tip=Uppercase/Lowercase Db column
|
||||
QuotePushButton.QuoteButton.Tip=Add/Remove Quote on Db column
|
||||
QuoteManipulateDialog.title=Add/Remove quote on Db column
|
||||
QuoteManipulateDialog.addQuote=Add quote
|
||||
QuoteManipulateDialog.removeQuote=Remove quote
|
||||
|
||||
@@ -88,6 +88,8 @@ public enum EImage implements IImage {
|
||||
LEFTX_ICON("/icons/leftx.png"), //$NON-NLS-1$
|
||||
RIGHT_ICON("/icons/right.gif"), //$NON-NLS-1$
|
||||
RIGHTX_ICON("/icons/rightx.png"), //$NON-NLS-1$
|
||||
LOWERCASE_ICON("/icons/lowercase.jpg"), //$NON-NLS-1$
|
||||
UPPERCASE_ICON("/icons/uppercase.jpg"), //$NON-NLS-1$
|
||||
|
||||
KEY_ICON("/icons/key.gif"), //$NON-NLS-1$
|
||||
HIERARCHY_ICON("/icons/hierarchicalLayout.gif"), //$NON-NLS-1$
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.talend.commons.runtime.service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.osgi.framework.InvalidSyntaxException;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
|
||||
public interface ICollectDataService {
|
||||
|
||||
final String KEY_SOURCE = "source";
|
||||
|
||||
//
|
||||
final String AMC_FILE_TYPE_USED = "FILE_TYPE_USED";
|
||||
|
||||
final String AMC_DATABASE_TYPE_USED = "DATABASE_TYPE_USED";
|
||||
|
||||
final String AMC_PREVIEW_KEY = "amc.datasource";
|
||||
|
||||
final String AMC_PREVIEW_FILEVALUE = "File";
|
||||
|
||||
final String AMC_PREVIEW_DATABASEVALUE = "Database";
|
||||
|
||||
/**
|
||||
* @return json string
|
||||
*/
|
||||
String getCollectedDataJSON();
|
||||
|
||||
Properties getCollectedData();
|
||||
|
||||
public static ICollectDataService getInstance(String from) throws Exception {
|
||||
BundleContext bc = FrameworkUtil.getBundle(ICollectDataService.class).getBundleContext();
|
||||
Collection<ServiceReference<ICollectDataService>> tacokitServices = Collections.emptyList();
|
||||
try {
|
||||
tacokitServices = bc.getServiceReferences(ICollectDataService.class, null);
|
||||
} catch (InvalidSyntaxException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
if (tacokitServices != null) {
|
||||
for (ServiceReference<ICollectDataService> sr : tacokitServices) {
|
||||
if (from == null || from.equals(sr.getProperty(KEY_SOURCE))) {
|
||||
ICollectDataService tacokitService = bc.getService(sr);
|
||||
if (tacokitService != null) {
|
||||
return tacokitService;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.runtime.service;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
*/
|
||||
@@ -19,6 +21,10 @@ public interface P2InstallComponent {
|
||||
|
||||
boolean install();
|
||||
|
||||
default boolean install(IProgressMonitor monitor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean needRelaunch();
|
||||
|
||||
String getInstalledMessages();
|
||||
|
||||
@@ -56,6 +56,19 @@ public class Hex {
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
public static boolean isNeedConvertToHex(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
int ch = value.charAt(i);
|
||||
if (ch < 32) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int toDigit(char ch, int index) {
|
||||
int digit = Character.digit(ch, 16);
|
||||
|
||||
@@ -29,6 +29,8 @@ public interface IExtendedList<T> extends List<T> {
|
||||
public void swapElements(List<Integer> indicesOrigin, List<Integer> indicesTarget);
|
||||
|
||||
public void swapElement(T object1, T object2);
|
||||
|
||||
public void replaceElement(int index, T object2);
|
||||
|
||||
/**
|
||||
* Getter for useEquals.
|
||||
|
||||
@@ -537,6 +537,11 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
fireReplacedEvent(index, replacedObject, element, false);
|
||||
return replacedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceElement(int index, T element) {
|
||||
this.list.set(index, element);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -109,11 +108,11 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
// MOD yyin 2012-05-15 TDQ-5190
|
||||
String sql = "SELECT DISTINCT CREATOR FROM SYSIBM.SYSTABLES"; //$NON-NLS-1$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String creator = rs.getString("CREATOR"); //$NON-NLS-1$
|
||||
@@ -331,18 +330,20 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
|
||||
throws SQLException {
|
||||
// for real
|
||||
String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where TBNAME='" + tableNamePattern + "' AND TBCREATOR = '" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ schemaPattern + "' ORDER BY TBCREATOR, TBNAME, COLNO"; //$NON-NLS-1$
|
||||
String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where TBNAME=? AND TBCREATOR = ? ORDER BY TBCREATOR, TBNAME, COLNO"; //$NON-NLS-1$
|
||||
|
||||
// for test
|
||||
// String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where NAME='NAME'";
|
||||
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, tableNamePattern);
|
||||
stmt.setString(2, schemaPattern);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
|
||||
// For real db2 for zos, should use these code.
|
||||
|
||||
@@ -25,7 +25,6 @@ public class JtdsDatabaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
|
||||
@Override
|
||||
public ResultSet getSchemas() throws SQLException {
|
||||
java.sql.Statement statement = connection.createStatement();
|
||||
String sql;
|
||||
if (((PackageFakeDatabaseMetadata) connection).getDatabaseMajorVersion() >= 9) {
|
||||
sql = JDBC3 ? "SELECT name AS TABLE_SCHEM, NULL as TABLE_CATALOG FROM " + connection.getCatalog() + ".sys.schemas"
|
||||
@@ -36,6 +35,7 @@ public class JtdsDatabaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
}
|
||||
|
||||
sql += " ORDER BY TABLE_SCHEM";
|
||||
return statement.executeQuery(sql);
|
||||
java.sql.PreparedStatement statement = connection.prepareStatement(sql);
|
||||
return statement.executeQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -152,15 +152,19 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
// check if the type is contained is in the types needed.
|
||||
String sqlcv = "SELECT OBJECT_NAME,PACKAGE_ID FROM _SYS_REPO.ACTIVE_OBJECT WHERE OBJECT_SUFFIX = 'calculationview'"; //$NON-NLS-1$
|
||||
if (tableNamePattern != null && !tableNamePattern.equals("%")) { //$NON-NLS-1$
|
||||
sqlcv += " AND (OBJECT_NAME LIKE '" + tableNamePattern + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE '" + tableNamePattern + "')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " AND (OBJECT_NAME LIKE ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE ? )"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
ResultSet rscv = null;
|
||||
Statement stmtcv = null;
|
||||
PreparedStatement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
try {
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
stmtcv = connection.prepareStatement(sqlcv);
|
||||
if (tableNamePattern != null && !tableNamePattern.equals("%")) {
|
||||
stmtcv.setString(1, tableNamePattern);
|
||||
stmtcv.setString(2, tableNamePattern);
|
||||
}
|
||||
rscv = stmtcv.executeQuery();
|
||||
while (rscv.next()) {
|
||||
String objectName = rscv.getString("OBJECT_NAME"); //$NON-NLS-1$
|
||||
if (objectName != null) {
|
||||
@@ -303,11 +307,11 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
if (!load) {
|
||||
String sqlcv = "SELECT * from \"" + schemaPattern + "\".\"" + tableNamePattern + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
ResultSet rscv = null;
|
||||
Statement stmtcv = null;
|
||||
PreparedStatement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
try {
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
stmtcv = connection.prepareStatement(sqlcv);
|
||||
rscv = stmtcv.executeQuery();
|
||||
int i = 1;
|
||||
while (rscv.next()) {
|
||||
String tableName = tableNamePattern;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -62,11 +62,11 @@ public class SASDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
// see the feature 5827
|
||||
String sql = "SELECT DISTINCT LIBNAME FROM SASHELP.VTABLE"; //$NON-NLS-1$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String creator = rs.getString("LIBNAME"); //$NON-NLS-1$
|
||||
@@ -147,17 +147,21 @@ public class SASDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
public ResultSet getTables(String catalog, String schema, String tableNamePattern, String[] types) throws SQLException {
|
||||
String sql;
|
||||
if (schema != null) {
|
||||
sql = "SELECT * FROM SASHELP.VTABLE where LIBNAME = '" + schema + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sql = "SELECT * FROM SASHELP.VTABLE where LIBNAME = ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
} else {
|
||||
sql = "SELECT * FROM SASHELP.VTABLE"; //$NON-NLS-1$
|
||||
}
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
if (schema != null) {
|
||||
stmt.setString(1, schema);
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("MEMNAME"); //$NON-NLS-1$
|
||||
@@ -229,18 +233,20 @@ public class SASDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
|
||||
throws SQLException {
|
||||
// for real
|
||||
String sql = "SELECT * FROM SASHELP.VCOLUMN where MEMNAME='" + tableNamePattern + "' AND LIBNAME = '" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ schemaPattern + "' ORDER BY LIBNAME, MEMNAME, VARNUM"; //$NON-NLS-1$
|
||||
String sql = "SELECT * FROM SASHELP.VCOLUMN where MEMNAME=? AND LIBNAME = ? ORDER BY LIBNAME, MEMNAME, VARNUM"; //$NON-NLS-1$
|
||||
|
||||
// for test
|
||||
// String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where NAME='NAME'";
|
||||
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, tableNamePattern);
|
||||
stmt.setString(2, schemaPattern);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
String tableName = rs.getString("MEMNAME"); //$NON-NLS-1$
|
||||
if (tableName != null) {
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -52,10 +52,12 @@ public class Sybase16SADatabaseMetaData extends SybaseDatabaseMetaData {
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, login);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
@@ -113,8 +115,7 @@ public class Sybase16SADatabaseMetaData extends SybaseDatabaseMetaData {
|
||||
*/
|
||||
protected String createSqlByLoginAndCatalog(String loginName, String catalogName) {
|
||||
String sql = "select count(*) from " + catalogName
|
||||
+ ".dbo.sysusers where suid in (select suid from "+catalogName+".dbo.syslogins where name = '" + loginName
|
||||
+ "')";
|
||||
+ ".dbo.sysusers where suid in (select suid from " + catalogName + ".dbo.syslogins where name = ? )";
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -54,10 +54,13 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, login);
|
||||
stmt.setString(2, login);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
@@ -92,11 +95,11 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
|
||||
String sql = "SELECT DISTINCT name FROM " + catalog + ".dbo.sysusers where suid > 0"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("name"); //$NON-NLS-1$
|
||||
@@ -136,9 +139,9 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
*/
|
||||
protected String createSqlByLoginAndCatalog(String loginName, String catalogName) {
|
||||
return "select count(*) from " + catalogName //$NON-NLS-1$
|
||||
+ ".dbo.sysusers where suid in (select suid from master.dbo.syslogins where name = '" + loginName //$NON-NLS-1$
|
||||
+ "') or suid in (select altsuid from " + catalogName //$NON-NLS-1$
|
||||
+ ".dbo.sysalternates a, master.dbo.syslogins b where b.name = '" + loginName + "' and a.suid = b.suid)"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ ".dbo.sysusers where suid in (select suid from master.dbo.syslogins where name = ?"
|
||||
+ ") or suid in (select altsuid from " + catalogName //$NON-NLS-1$
|
||||
+ ".dbo.sysalternates a, master.dbo.syslogins b where b.name = ? and a.suid = b.suid)"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -97,13 +97,12 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
int dbMajorVersion = connection.getMetaData().getDatabaseMajorVersion();
|
||||
String sql = "HELP COLUMN \"" + schema + "\".\"" + table + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
String columnName = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.INDICESV WHERE UPPER(databasename) = UPPER('" + schema //$NON-NLS-1$
|
||||
+ "') AND UPPER(tablename) = UPPER('" + table + "') AND UPPER(UniqueFlag) = UPPER('Y')"; //$NON-NLS-1$//$NON-NLS-2$
|
||||
sql = "SELECT * from DBC.INDICESV WHERE UPPER(databasename) = UPPER(?) AND UPPER(tablename) = UPPER(?) AND UPPER(UniqueFlag) = UPPER('Y')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
rs = getResultSet(catalog, schema, table, sql);
|
||||
while (rs.next()) {
|
||||
columnName = rs.getString("ColumnName").trim(); //$NON-NLS-1$
|
||||
@@ -112,8 +111,11 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
list.add(r);
|
||||
}
|
||||
} else {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, schema);
|
||||
stmt.setString(2, table);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
|
||||
String pk = rs.getString("Primary?");//$NON-NLS-1$
|
||||
@@ -138,10 +140,10 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
|
||||
public ResultSet getResultSet(String catalog, String schema, String table, String sql) throws SQLException {
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -203,17 +205,15 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
sysTable = "DBC.TABLESV";//$NON-NLS-1$
|
||||
}
|
||||
if (types != null && types.length > 0) {
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
|
||||
+ "') AND tablekind " + addTypesToSql(types); //$NON-NLS-1$
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER(?) AND tablekind " + addTypesToSql(types); //$NON-NLS-1$
|
||||
} else {
|
||||
// When the types is empty, all the tables and views will be retrieved.
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
|
||||
+ "') AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER(?) AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// add the filter for table/views
|
||||
if (!StringUtils.isEmpty(tableNamePattern)) {
|
||||
sql = sql + " AND tablename LIKE '" + tableNamePattern + "'";//$NON-NLS-1$//$NON-NLS-2$
|
||||
sql = sql + " AND tablename LIKE ?";//$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
if (types != null && types.length > 0) {
|
||||
@@ -223,11 +223,18 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
}
|
||||
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, database);
|
||||
|
||||
// add the filter for table/views
|
||||
if (!StringUtils.isEmpty(tableNamePattern)) {
|
||||
stmt.setString(2, tableNamePattern);
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("TableName").trim(); //$NON-NLS-1$
|
||||
@@ -326,21 +333,33 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
if (!StringUtils.isEmpty(database)) {
|
||||
sql = "HELP COLUMN \"" + database + "\".\"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$
|
||||
+ "') AND UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(databasename) = UPPER(?) AND UPPER(tablename) = UPPER(?)" //$NON-NLS-1$
|
||||
+ " Order by tablename "; //$NON-NLS-1$ //$NON-NLS-3$
|
||||
}
|
||||
} else {
|
||||
sql = "HELP COLUMN \"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER(?)" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$
|
||||
// //$NON-NLS-3$
|
||||
}
|
||||
}
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
if (!StringUtils.isEmpty(database)) {
|
||||
if (dbMajorVersion > 12) {
|
||||
stmt.setString(1, database);
|
||||
stmt.setString(2, tableNamePattern);
|
||||
}
|
||||
} else {
|
||||
if (dbMajorVersion > 12) {
|
||||
stmt.setString(1, tableNamePattern);
|
||||
}
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
String tableName = tableNamePattern;
|
||||
String columnName = null;
|
||||
|
||||
@@ -277,6 +277,10 @@ public class NetworkUtil {
|
||||
if (wrapIpV6 && Inet6Address.class.isInstance(inetAddress)) {
|
||||
String addr = inetAddress.getHostAddress();
|
||||
if (!addr.startsWith("[") || !addr.endsWith("]")) {
|
||||
int idx = addr.indexOf("%");
|
||||
if (idx > 0) {
|
||||
addr = addr.substring(0, idx);
|
||||
}
|
||||
addr = "[" + addr + "]";
|
||||
}
|
||||
return addr;
|
||||
|
||||
@@ -76,6 +76,8 @@ ExtendedTableMoveCommand.MoveLabel=Move up or down, one or more table entries
|
||||
ExtendedTablePasteCommand.Paste.Label=Paste data from the internal clipoard
|
||||
ExtendedTableRemoveCommand.Romve.Label=Remove table entries
|
||||
ExtendedTableResetDBTypesCommand.ResetDBTypes.Label=Reset all DB Types to get the defaults
|
||||
ExtendedTableCaseCommand.case.Label=Change selected DB columns to uppercase/lowercase
|
||||
ExtendedTableQuoteCommand.Quote.Label=Quote selected DB columns
|
||||
ImportPushButton.ImportButton.Tip=Replace all rows by import from xml file
|
||||
ImportPushButtonForExtendedTable.ErrorMsg.Text=Error occurred
|
||||
LabelledFileField.BrowseButton.Text=Browse...
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.swt.advanced.composite;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Sash;
|
||||
|
||||
/**
|
||||
* This class is used for constructing 2 composites, putting 1 sashes in the middle composite, which is used for
|
||||
* changing other 2 composites.
|
||||
*
|
||||
*/
|
||||
public class TwoCompositesSashForm extends Composite {
|
||||
|
||||
public static final int SASH_WIDTH = 3;
|
||||
|
||||
private Composite leftComposite;
|
||||
|
||||
private Composite rightComposite;
|
||||
|
||||
private Sash midSash;
|
||||
|
||||
/**
|
||||
* Initialize.
|
||||
*
|
||||
* @param parent
|
||||
* @param style
|
||||
*/
|
||||
public TwoCompositesSashForm(Composite parent, int style) {
|
||||
super(parent, style);
|
||||
final GridLayout gridLayout = new GridLayout();
|
||||
gridLayout.numColumns = 3;
|
||||
gridLayout.marginBottom = 0;
|
||||
gridLayout.marginHeight = 0;
|
||||
gridLayout.marginLeft = 0;
|
||||
gridLayout.marginRight = 0;
|
||||
gridLayout.marginTop = 0;
|
||||
gridLayout.marginWidth = 0;
|
||||
gridLayout.horizontalSpacing = 0;
|
||||
|
||||
setLayout(gridLayout);
|
||||
final GridData gridData = new GridData(GridData.FILL_BOTH);
|
||||
setLayoutData(gridData);
|
||||
|
||||
addComponents();
|
||||
addSashListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes all widgets's position when sash was moved.
|
||||
*
|
||||
* @param shift
|
||||
*/
|
||||
private void setCompositesBounds(int shift) {
|
||||
// Set mid Composite Width.
|
||||
int midSashPreLocation = midSash.getBounds().x;
|
||||
midSash.setLocation(midSashPreLocation + shift, midSash.getBounds().y);
|
||||
if (midSash.getBounds().x > 0) {
|
||||
if (midSashPreLocation < 0) {
|
||||
leftComposite.setSize(leftComposite.getBounds().width + shift + midSashPreLocation, leftComposite
|
||||
.getBounds().height);
|
||||
} else {
|
||||
leftComposite.setSize(leftComposite.getBounds().width + shift, leftComposite.getBounds().height);
|
||||
}
|
||||
} else {
|
||||
leftComposite.setSize(0, leftComposite.getBounds().height);
|
||||
}
|
||||
// Set Right Composte Width.
|
||||
rightComposite.setLocation(rightComposite.getBounds().x + shift, rightComposite.getBounds().y);
|
||||
rightComposite.setSize(rightComposite.getBounds().width - shift, rightComposite.getBounds().height);
|
||||
}
|
||||
|
||||
public Composite getLeftComposite() {
|
||||
return this.leftComposite;
|
||||
}
|
||||
|
||||
public Composite getRightComposite() {
|
||||
return this.rightComposite;
|
||||
}
|
||||
|
||||
private void addSashListeners() {
|
||||
midSash.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
/*
|
||||
* (non-Java)
|
||||
*
|
||||
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
|
||||
*/
|
||||
public void handleEvent(Event event) {
|
||||
int shift = event.x - midSash.getBounds().x;
|
||||
setCompositesBounds(shift);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void addComponents() {
|
||||
leftComposite = new Composite(this, SWT.NONE);
|
||||
GridLayout gridLayout = new GridLayout();
|
||||
gridLayout.marginBottom = 0;
|
||||
gridLayout.marginHeight = 0;
|
||||
gridLayout.marginLeft = 0;
|
||||
gridLayout.marginRight = 0;
|
||||
gridLayout.marginTop = 0;
|
||||
gridLayout.marginWidth = 0;
|
||||
gridLayout.horizontalSpacing = 0;
|
||||
GridData gridData = new GridData(GridData.FILL_BOTH);
|
||||
|
||||
leftComposite.setLayout(gridLayout);
|
||||
leftComposite.setLayoutData(gridData);
|
||||
|
||||
midSash = new Sash(this, SWT.VERTICAL | SWT.SMOOTH);
|
||||
GridData gridData2 = new GridData(GridData.FILL_VERTICAL);
|
||||
midSash.setLayoutData(gridData2);
|
||||
midSash.setSize(SASH_WIDTH, midSash.getBounds().height);
|
||||
|
||||
rightComposite = new Composite(this, SWT.NONE);
|
||||
GridLayout gridLayout3 = new GridLayout();
|
||||
gridLayout3.marginBottom = 0;
|
||||
gridLayout3.marginHeight = 0;
|
||||
gridLayout3.marginLeft = 0;
|
||||
gridLayout3.marginRight = 0;
|
||||
gridLayout3.marginTop = 0;
|
||||
gridLayout3.marginWidth = 0;
|
||||
gridLayout3.horizontalSpacing = 0;
|
||||
rightComposite.setLayout(gridLayout3);
|
||||
GridData gridData4 = new GridData(GridData.FILL_BOTH);
|
||||
rightComposite.setLayoutData(gridData4);
|
||||
}
|
||||
|
||||
public void setGridDatas() {
|
||||
Composite composite = (Composite) leftComposite.getChildren()[0];
|
||||
GridLayout gridLayout2 = new GridLayout();
|
||||
gridLayout2.marginBottom = 0;
|
||||
gridLayout2.marginHeight = 0;
|
||||
gridLayout2.marginLeft = 0;
|
||||
gridLayout2.marginRight = 0;
|
||||
gridLayout2.marginTop = 0;
|
||||
gridLayout2.marginWidth = 0;
|
||||
gridLayout2.horizontalSpacing = 0;
|
||||
composite.setLayout(gridLayout2);
|
||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
Composite composite2 = (Composite) rightComposite.getChildren()[0];
|
||||
gridLayout2 = new GridLayout();
|
||||
gridLayout2.marginBottom = 0;
|
||||
gridLayout2.marginHeight = 0;
|
||||
gridLayout2.marginLeft = 0;
|
||||
gridLayout2.marginRight = 0;
|
||||
gridLayout2.marginTop = 0;
|
||||
gridLayout2.marginWidth = 0;
|
||||
gridLayout2.horizontalSpacing = 0;
|
||||
composite2.setLayout(gridLayout2);
|
||||
composite2.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,13 @@ import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveDownPushButtonFo
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.PastePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.RemovePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.RemovePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.ResetDBTypesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.SaveAsGenericSchemaPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.SelectContextVariablesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
|
||||
@@ -67,7 +69,11 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
protected ResetDBTypesPushButton resetDBTypesButton;
|
||||
|
||||
protected SelectContextVariablesPushButton selectContextVariablesButton;
|
||||
|
||||
protected CasePushButton caseButton;
|
||||
|
||||
protected QuotePushButton quoteButton;
|
||||
|
||||
/**
|
||||
* DOC amaumont MatadataToolbarEditor constructor comment.
|
||||
*
|
||||
@@ -103,7 +109,11 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
pasteButton = createPastePushButton();
|
||||
|
||||
addallButton = createAddAllPushButton();
|
||||
|
||||
|
||||
caseButton = createCasePushButton();
|
||||
|
||||
quoteButton = createQuotePushButton();
|
||||
|
||||
exportButton = createExportPushButton();
|
||||
|
||||
importButton = createImportPushButton();
|
||||
@@ -169,6 +179,14 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
protected SelectContextVariablesPushButton createSelectContextVariablesPushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected CasePushButton createCasePushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected QuotePushButton createQuotePushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for addButton.
|
||||
@@ -327,6 +345,14 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
if (getAddallButton() != null) {
|
||||
list.add(getAddallButton());
|
||||
}
|
||||
|
||||
if (getCaseButton() != null) {
|
||||
list.add(getCaseButton());
|
||||
}
|
||||
|
||||
if (getQuoteButton() != null) {
|
||||
list.add(getQuoteButton());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -348,6 +374,26 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
public AddAllPushButton getAddallButton() {
|
||||
return this.addallButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for caseButton.
|
||||
*
|
||||
* @return the caseButton
|
||||
*/
|
||||
public CasePushButton getCaseButton() {
|
||||
return this.caseButton;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for quoteButton.
|
||||
*
|
||||
* @return the quoteButton
|
||||
*/
|
||||
public QuotePushButton getQuoteButton() {
|
||||
return this.quoteButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.swt.advanced.dataeditor.button;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedControlViewer;
|
||||
|
||||
public abstract class CasePushButton extends ExtendedPushButton {
|
||||
|
||||
/**
|
||||
* DOC CasePushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public CasePushButton(Composite parent, AbstractExtendedControlViewer extendedControlViewer) {
|
||||
super(parent, extendedControlViewer,
|
||||
Messages.getString("CasePushButton.CaseButton.Tip"), ImageProvider.getImage(EImage.UPPERCASE_ICON)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#getEnabledState()
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && !getExtendedControlViewer().isReadOnly();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.swt.advanced.dataeditor.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class CasePushButtonForExtendedTable extends CasePushButton implements IExtendedTablePushButton {
|
||||
|
||||
private EnableStateListenerForTableButton enableStateHandler;
|
||||
private boolean isUpperCase = true;
|
||||
|
||||
/**
|
||||
* DOC CasePushButtonForExtendedTable constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public CasePushButtonForExtendedTable(Composite parent, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, extendedTableViewer);
|
||||
this.enableStateHandler = new EnableStateListenerForTableButton(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterCommandExecution(Command executedCommand) {
|
||||
super.afterCommandExecution(executedCommand);
|
||||
if (isUpperCase) {
|
||||
this.getButton().setToolTipText( Messages.getString("CasePushButton.CaseButton.Tip"));
|
||||
this.getButton().setImage(ImageProvider.getImage(EImage.LOWERCASE_ICON));
|
||||
this.isUpperCase = false;
|
||||
} else {
|
||||
this.getButton().setToolTipText( Messages.getString("CasePushButton.CaseButton.Tip"));
|
||||
this.getButton().setImage(ImageProvider.getImage(EImage.UPPERCASE_ICON));
|
||||
this.isUpperCase = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute() {
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
TableViewer tableViewer = extendedTableViewer.getTableViewerCreator().getTableViewer();
|
||||
ISelection selection = tableViewer.getSelection();
|
||||
StructuredSelection structuredSelection = (StructuredSelection) selection;
|
||||
Object[] objects = structuredSelection.toArray();
|
||||
int[] selectionIndices = extendedTableViewer.getTableViewerCreator().getTable().getSelectionIndices();
|
||||
return getCommandToExecute(extendedTableModel, Arrays.asList(objects), selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, boolean isUpperCase);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.ui.extended.button.IExtendedTablePushButton#getExtendedTableViewer()
|
||||
*/
|
||||
public AbstractExtendedTableViewer getExtendedTableViewer() {
|
||||
return (AbstractExtendedTableViewer) getExtendedControlViewer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && this.enableStateHandler.getEnabledState();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.swt.advanced.dataeditor.button;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedControlViewer;
|
||||
|
||||
public abstract class QuotePushButton extends ExtendedPushButton {
|
||||
|
||||
private String dbmsId = null;
|
||||
|
||||
/**
|
||||
* DOC QuotePushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public QuotePushButton(Composite parent, AbstractExtendedControlViewer extendedControlViewer) {
|
||||
super(parent, extendedControlViewer,
|
||||
Messages.getString("QuotePushButton.QuoteButton.Tip"), ImageProvider.getImage(EImage.EDIT_ICON)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#getEnabledState()
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && !getExtendedControlViewer().isReadOnly();
|
||||
}
|
||||
|
||||
|
||||
public String getDbmsId() {
|
||||
return dbmsId;
|
||||
}
|
||||
|
||||
|
||||
public void setDbmsId(String dbmsId) {
|
||||
this.dbmsId = dbmsId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.swt.advanced.dataeditor.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class QuotePushButtonForExtendedTable extends QuotePushButton implements IExtendedTablePushButton {
|
||||
|
||||
private String quote = null;
|
||||
private boolean isAddingQuote = true;
|
||||
private EnableStateListenerForTableButton enableStateHandler;
|
||||
|
||||
/**
|
||||
* DOC SchemaTargetAddPushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public QuotePushButtonForExtendedTable(Composite parent, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, extendedTableViewer);
|
||||
this.enableStateHandler = new EnableStateListenerForTableButton(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#beforeCommandExecution()
|
||||
*/
|
||||
@Override
|
||||
protected void beforeCommandExecution() {
|
||||
QuoteManipulateDialog dlg = new QuoteManipulateDialog(getButton().getShell());
|
||||
if (dlg.open() == Window.OK) {
|
||||
this.quote = dlg.getQuote();
|
||||
this.isAddingQuote = dlg.isAddingQuote();
|
||||
}
|
||||
}
|
||||
|
||||
protected Command getCommandToExecute() {
|
||||
if (quote == null) return null;
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
TableViewer tableViewer = extendedTableViewer.getTableViewerCreator().getTableViewer();
|
||||
ISelection selection = tableViewer.getSelection();
|
||||
StructuredSelection structuredSelection = (StructuredSelection) selection;
|
||||
Object[] objects = structuredSelection.toArray();
|
||||
int[] selectionIndices = extendedTableViewer.getTableViewerCreator().getTable().getSelectionIndices();
|
||||
return getCommandToExecute(extendedTableModel, Arrays.asList(objects), selectionIndices, quote, isAddingQuote );
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, String quote, boolean isAddingQuote);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.ui.extended.button.IExtendedTablePushButton#getExtendedTableViewer()
|
||||
*/
|
||||
public AbstractExtendedTableViewer getExtendedTableViewer() {
|
||||
return (AbstractExtendedTableViewer) getExtendedControlViewer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && this.enableStateHandler.getEnabledState();
|
||||
}
|
||||
|
||||
class QuoteManipulateDialog extends Dialog {
|
||||
|
||||
private Button addBtn;
|
||||
private Button removeBtn;
|
||||
private Text quoteTxt;
|
||||
private Button okBtn;
|
||||
boolean isAddingQuote = true;
|
||||
String quote = "";
|
||||
|
||||
public QuoteManipulateDialog(Shell parentShel) {
|
||||
super(parentShel);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
shell.setText(Messages.getString("QuoteManipulateDialog.title"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
// create OK and Cancel buttons by default
|
||||
okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
okBtn.setEnabled(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) Method declared on Dialog.
|
||||
*/
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 4;
|
||||
composite.setLayout(layout);
|
||||
GridData layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.widthHint = 400;
|
||||
composite.setLayoutData(layoutData);
|
||||
addBtn = new Button(composite, SWT.RADIO);
|
||||
addBtn.setSelection(true);
|
||||
Label label = new Label(composite, SWT.WRAP);
|
||||
label.setText(Messages.getString("QuoteManipulateDialog.addQuote")); //$NON-NLS-1$
|
||||
|
||||
removeBtn = new Button(composite, SWT.RADIO);
|
||||
Label label1 = new Label(composite, SWT.WRAP);
|
||||
label1.setText(Messages.getString("QuoteManipulateDialog.removeQuote")); //$NON-NLS-1$
|
||||
|
||||
quoteTxt = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
||||
layoutData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
layoutData.horizontalSpan = 4;
|
||||
quoteTxt.setLayoutData(layoutData);
|
||||
quoteTxt.setText("");
|
||||
quoteTxt.setFocus();
|
||||
|
||||
addBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
isAddingQuote = true;
|
||||
quoteTxt.setFocus();
|
||||
quote = quoteTxt.getText();
|
||||
}
|
||||
});
|
||||
|
||||
removeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
isAddingQuote = false;
|
||||
quoteTxt.setFocus();
|
||||
quote = quoteTxt.getText();
|
||||
}
|
||||
});
|
||||
|
||||
quoteTxt.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent e) {
|
||||
quote = quoteTxt.getText();
|
||||
if ( quote != null && quote.length() > 0) {
|
||||
okBtn.setEnabled(true);
|
||||
} else {
|
||||
okBtn.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return composite;
|
||||
}
|
||||
|
||||
public boolean isAddingQuote() {
|
||||
return this.isAddingQuote;
|
||||
}
|
||||
|
||||
public String getQuote() {
|
||||
return this.quote;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.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;
|
||||
|
||||
public abstract class ExtendedTableCaseCommand extends Command implements IExtendedTableCommand {
|
||||
|
||||
private ExtendedTableModel extendedTable;
|
||||
|
||||
private List beansToCovertCase;
|
||||
|
||||
private int[] selectionIndices;
|
||||
|
||||
private boolean isUpperCase;
|
||||
|
||||
|
||||
public static final String LABEL = Messages.getString("ExtendedTableCaseCommand.case.Label"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC ExtendedTableCaseCommand constructor comment.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
public ExtendedTableCaseCommand(ExtendedTableModel extendedTable, List beansToCovertCase, int[] selectionIndices, boolean isUpperCase) {
|
||||
super(LABEL);
|
||||
this.extendedTable = extendedTable;
|
||||
this.beansToCovertCase = new ArrayList(beansToCovertCase);
|
||||
this.selectionIndices = selectionIndices;
|
||||
this.isUpperCase = isUpperCase;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
convertCase(extendedTable, beansToCovertCase, selectionIndices, isUpperCase);
|
||||
|
||||
}
|
||||
|
||||
public abstract void convertCase(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, boolean isUpperCase);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#canUndo()
|
||||
*/
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#redo()
|
||||
*/
|
||||
@Override
|
||||
public void redo() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.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;
|
||||
|
||||
public abstract class ExtendedTableQuoteCommand extends Command implements IExtendedTableCommand {
|
||||
|
||||
private ExtendedTableModel extendedTable;
|
||||
|
||||
private List beansToQuote;
|
||||
|
||||
private int[] selectionIndices;
|
||||
|
||||
private String quote;
|
||||
|
||||
boolean isAddingQuote;
|
||||
|
||||
|
||||
public static final String LABEL = Messages.getString("ExtendedTableQuoteCommand.Quote.Label"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC ExtendedTableQuoteCommand constructor comment.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
public ExtendedTableQuoteCommand(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
super(LABEL);
|
||||
this.extendedTable = extendedTable;
|
||||
this.beansToQuote = new ArrayList(beansToQuote);
|
||||
this.selectionIndices = selectionIndices;
|
||||
this.quote = quote;
|
||||
this.isAddingQuote = isAddingQuote;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
toQuote(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
|
||||
}
|
||||
|
||||
public abstract void toQuote(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, String quote, boolean isAddingQuote);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#canUndo()
|
||||
*/
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#redo()
|
||||
*/
|
||||
@Override
|
||||
public void redo() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -178,6 +178,23 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
public void setUseEquals(boolean useEquals) {
|
||||
beansList.setUseEquals(useEquals);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Replace bean.
|
||||
*
|
||||
* @param bean
|
||||
* @param index can be null
|
||||
*/
|
||||
public void replace(B bean, Integer index) {
|
||||
|
||||
if (tableViewer != null && !tableViewer.getTable().isDisposed()) {
|
||||
tableViewer.replace(bean, index);
|
||||
tableViewer.refresh(bean, true, true);
|
||||
}
|
||||
this.beansList.replaceElement(index, bean);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DOC amaumont Comment method "remove".
|
||||
|
||||
@@ -12,11 +12,14 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.repository.model;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -623,8 +626,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
stream.close();
|
||||
|
||||
byte[] currentContent = item.getContent().getInnerContent();
|
||||
|
||||
if (!Arrays.equals(innerContent, currentContent)) {
|
||||
if (!isSameStringContent(innerContent, currentContent)) {
|
||||
item.getContent().setInnerContent(innerContent);
|
||||
Project project = getRepositoryContext().getProject();
|
||||
save(project, item);
|
||||
@@ -641,6 +643,44 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
throw new PersistenceException(ioe);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isSameStringContent(byte[] data1, byte[] data2) throws IOException {
|
||||
boolean isSame = true;
|
||||
BufferedReader br1 = null, br2 = null;
|
||||
try {
|
||||
br1 = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(data1), StandardCharsets.UTF_8.toString()));
|
||||
br2 = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(data2), StandardCharsets.UTF_8.toString()));
|
||||
String line1 = null, line2 = null;
|
||||
while (isSame) {
|
||||
line1 = br1.readLine();
|
||||
line2 = br2.readLine();
|
||||
if ((line1 == null && line2 == null)) {
|
||||
break;
|
||||
}
|
||||
if (!StringUtils.equals(line1, line2)) {
|
||||
isSame = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (br1 != null) {
|
||||
try {
|
||||
br1.close();
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
if (br2 != null) {
|
||||
try {
|
||||
br2.close();
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isSame;
|
||||
}
|
||||
|
||||
private void createSQLPattern(URL url, String sqlPatternLabel, String categoryName) throws PersistenceException {
|
||||
if (url == null) {
|
||||
@@ -693,8 +733,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
stream.close();
|
||||
|
||||
byte[] currentContent = item.getContent().getInnerContent();
|
||||
|
||||
if (!Arrays.equals(innerContent, currentContent)) {
|
||||
if (!isSameStringContent(innerContent, currentContent)) {
|
||||
item.getContent().setInnerContent(innerContent);
|
||||
Project project = getRepositoryContext().getProject();
|
||||
save(project, item);
|
||||
|
||||
@@ -463,4 +463,8 @@ public interface IRepositoryFactory {
|
||||
public boolean isRepositoryBusy();
|
||||
|
||||
public RepositoryWorkUnit getWorkUnitInProgress();
|
||||
|
||||
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version) throws PersistenceException;
|
||||
|
||||
public void batchDeleteOldVersionsPhysical(Project project, List<IRepositoryViewObject> objToDeleteList, boolean isDeleteOnRemote, IProgressMonitor monitor) throws PersistenceException;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.properties.SpagoBiServer;
|
||||
import org.talend.core.model.properties.Status;
|
||||
import org.talend.core.model.properties.TDQItem;
|
||||
import org.talend.core.model.properties.User;
|
||||
import org.talend.core.model.properties.impl.FolderItemImpl;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
@@ -411,7 +412,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
|
||||
boolean isThrow = true;
|
||||
if (tdqRepService != null && CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()) {
|
||||
if (tdqRepService != null && (CoreRuntimePlugin.getInstance().isDataProfilePerspectiveSelected()
|
||||
|| item instanceof TDQItem)) {
|
||||
// change MessageBox to DeleteModelElementConfirmDialog
|
||||
InputDialog inputDialog = tdqRepService.getInputDialog(item);
|
||||
if (MessageDialog.OK == inputDialog.open()) {
|
||||
@@ -2281,6 +2283,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
IRunProcessService runProcessService = getRunProcessService();
|
||||
if (runProcessService != null) {
|
||||
runProcessService.initMavenJavaProject(monitor, project);
|
||||
|
||||
// before afterLogon migration execute, check and update daikon dependency
|
||||
runProcessService.checkAndUpdateDaikonDependencies();
|
||||
}
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
@@ -2784,4 +2789,81 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version) throws PersistenceException {
|
||||
if (project == null || objToDelete == null || objToDelete.getProperty() == null) {
|
||||
return;
|
||||
}
|
||||
// RepositoryViewObject is dynamic, so force to use in all case the RepositoryObject with fixed object.
|
||||
IRepositoryViewObject object = new RepositoryObject(objToDelete.getProperty());
|
||||
|
||||
ERepositoryObjectType repositoryObjectType = object.getRepositoryObjectType();
|
||||
|
||||
ICoreService coreService = getCoreService();
|
||||
if (coreService != null) {
|
||||
if (repositoryObjectType == ERepositoryObjectType.PROCESS) {
|
||||
// delete the job launch, for bug 8878
|
||||
coreService.removeJobLaunch(object);
|
||||
}
|
||||
}
|
||||
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService service = GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
service.deleteOldVersionTalendJobProject(objToDelete);
|
||||
}
|
||||
|
||||
this.repositoryFactoryFromProvider.deleteOldVersionPhysical(project, object, version);
|
||||
|
||||
// i18n
|
||||
//log.info("Physical deletion [" + objToDelete + "] by " + getRepositoryContext().getUser() + ".");
|
||||
String str[] = new String[] { object.toString()+ "_" + version, getRepositoryContext().getUser().toString() };
|
||||
log.info(Messages.getString("ProxyRepositoryFactory.log.physicalDeletion", str)); //$NON-NLS-1$ }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchDeleteOldVersionPhysical4Remote(Project project, List<IRepositoryViewObject> objToDeleteList, IProgressMonitor monitor) throws PersistenceException {
|
||||
if (project == null || objToDeleteList == null || objToDeleteList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> idList = new ArrayList<>();
|
||||
List<IRepositoryViewObject> repositoryObjectList = new ArrayList<>();
|
||||
String label = "",lastLabel = "";
|
||||
for (IRepositoryViewObject objToDelete : objToDeleteList) {
|
||||
label = objToDelete.getProperty().getLabel();
|
||||
String versionedLabel = objToDelete.getProperty().getLabel() + "_" + objToDelete.getProperty().getVersion();
|
||||
monitor.setTaskName("Removing " + objToDelete.getRepositoryObjectType() + ":"+ versionedLabel);
|
||||
|
||||
IRepositoryViewObject object = new RepositoryObject(objToDelete.getProperty());
|
||||
boolean isExtendPoint = false;
|
||||
|
||||
idList.add(object.getProperty().getId());
|
||||
ERepositoryObjectType repositoryObjectType = object.getRepositoryObjectType();
|
||||
|
||||
ICoreService coreService = getCoreService();
|
||||
if (coreService != null) {
|
||||
if (repositoryObjectType == ERepositoryObjectType.PROCESS) {
|
||||
// delete the job launch, for bug 8878
|
||||
coreService.removeJobLaunch(object);
|
||||
}
|
||||
}
|
||||
|
||||
repositoryObjectList.add(object);
|
||||
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService service = GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
service.deleteOldVersionTalendJobProject(objToDelete);
|
||||
}
|
||||
this.repositoryFactoryFromProvider.deleteOldVersionPhysical(project, objToDelete,objToDelete.getProperty().getVersion());
|
||||
if (label != null && !label.equals(lastLabel)) monitor.worked(1); //for different versions in progress bar
|
||||
lastLabel = label;
|
||||
}
|
||||
|
||||
// save project will handle git/svn update
|
||||
this.repositoryFactoryFromProvider.saveProject(project);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/resty-0.3.2.jar" />
|
||||
<classpathentry exported="true" kind="lib" path="lib/delight-rhino-sandbox-0.0.15.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/rhino-1.7.13.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/resty-0.3.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/json_simple-1.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
|
||||
@@ -129,5 +129,7 @@ Bundle-Activator: org.talend.core.runtime.CoreRuntimePlugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .,
|
||||
lib/resty-0.3.2.jar,
|
||||
lib/json_simple-1.1.jar
|
||||
lib/json_simple-1.1.jar,
|
||||
lib/delight-rhino-sandbox-0.0.15.jar,
|
||||
lib/rhino-1.7.13.jar
|
||||
Eclipse-RegisterBuddy: org.talend.testutils
|
||||
|
||||
@@ -12,7 +12,9 @@ bin.includes = META-INF/,\
|
||||
lib/,\
|
||||
talend_metadata_columns_schema.xsd,\
|
||||
talend_targetschema_columns_schema.xsd,\
|
||||
dist/
|
||||
dist/,\
|
||||
lib/delight-rhino-sandbox-0.0.15.jar,\
|
||||
lib/rhino-1.7.13.jar
|
||||
src.includes = META-INF/,\
|
||||
mappingMetadataTypes.xml,\
|
||||
mappings/,\
|
||||
|
||||
@@ -9,19 +9,61 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.core.runtime</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/org.javadelight/delight-rhino-sandbox -->
|
||||
<dependency>
|
||||
<groupId>org.javadelight</groupId>
|
||||
<artifactId>delight-rhino-sandbox</artifactId>
|
||||
<version>0.0.15</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.mozilla/rhino -->
|
||||
<dependency>
|
||||
<groupId>org.mozilla</groupId>
|
||||
<artifactId>rhino</artifactId>
|
||||
<version>1.7.13</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-deploy</id>
|
||||
<phase>deploy</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.javadelight</groupId>
|
||||
<artifactId>delight-rhino-sandbox</artifactId>
|
||||
<version>0.0.15</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.mozilla</groupId>
|
||||
<artifactId>rhino</artifactId>
|
||||
<version>1.7.13</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-deploy</id>
|
||||
<phase>deploy</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -155,13 +155,6 @@ public interface ILibraryManagerService extends IService {
|
||||
|
||||
public boolean checkJarInstalledFromPlatform(String uriPath);
|
||||
|
||||
/**
|
||||
* deploy jars from lib/java to local maven if any jar already exist in maven and need update , for jars that not
|
||||
* exist in maven won't be deploy by this funciton , those jars should be deploy when it is needed Comment method
|
||||
* "synToLocalMaven".
|
||||
*/
|
||||
public void synToLocalMaven();
|
||||
|
||||
public String getMavenUriFromIndex(String jarName);
|
||||
|
||||
public void setCustomMavenURI(String orignalURI, String customURI);
|
||||
|
||||
@@ -114,7 +114,10 @@ public enum EDatabaseTypeName {
|
||||
"ParAccel", "ParAccel", Boolean.TRUE, "PARACCEL", "PARACCEL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
NETEZZA(
|
||||
"Netezza", "Netezza", Boolean.FALSE, "NETEZZA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SAS("SAS", "SAS", Boolean.TRUE, "SAS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
SAS("SAS", "SAS (Deprecated)", Boolean.TRUE, "SAS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// General JDBC not support schema defalut
|
||||
GENERAL_JDBC(
|
||||
"General JDBC", "General JDBC", Boolean.FALSE, "JDBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -146,7 +149,9 @@ public enum EDatabaseTypeName {
|
||||
"HBase", "HBase", Boolean.FALSE, "HBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
MAPRDB(
|
||||
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true),//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SNOWFLAKE(
|
||||
"SNOWFLAKE","SNOWFLAKE",Boolean.TRUE,"SNOWFLAKE",EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.None);
|
||||
|
||||
// displayName is used in Java code.
|
||||
private String displayName;
|
||||
|
||||
@@ -22,14 +22,14 @@ import org.talend.core.runtime.hd.hive.HiveMetadataHelper;
|
||||
*/
|
||||
public enum EImpalaDriver {
|
||||
|
||||
HIVE2("HIVE2", "HIVE2", "org.apache.hive.jdbc.HiveDriver"),
|
||||
IMPALA40("IMPALA40", "IMPALA40", "com.cloudera.impala.jdbc4.Driver"),
|
||||
IMPALA41("IMPALA41", "IMPALA41", "com.cloudera.impala.jdbc41.Driver");
|
||||
HIVE2("HIVE2", "HIVE2", "org.apache.hive.jdbc.HiveDriver", "doSupportHive2"),
|
||||
IMPALA("IMPALA", "IMPALA", "com.cloudera.impala.jdbc.Driver", "doSupportImpalaConnector");
|
||||
|
||||
EImpalaDriver(String displayName, String name, String driver) {
|
||||
EImpalaDriver(String displayName, String name, String driver, String supportDriverMethodName) {
|
||||
this.displayName = displayName;
|
||||
this.name = name;
|
||||
this.driver = driver;
|
||||
this.supportDriverMethodName = supportDriverMethodName;
|
||||
}
|
||||
|
||||
private String displayName;
|
||||
@@ -38,6 +38,8 @@ public enum EImpalaDriver {
|
||||
|
||||
private String driver;
|
||||
|
||||
private String supportDriverMethodName;
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
@@ -50,6 +52,10 @@ public enum EImpalaDriver {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public String getSupportDriverMethodName() {
|
||||
return supportDriverMethodName;
|
||||
}
|
||||
|
||||
public static boolean isSupport(String distribution, String version, boolean byDisplay, String supportMethodName) {
|
||||
return HiveMetadataHelper.doSupportMethod(distribution, version, byDisplay, supportMethodName);
|
||||
}
|
||||
@@ -57,7 +63,7 @@ public enum EImpalaDriver {
|
||||
public static String[] getImpalaDriverDisplay(String distribution, String version, boolean byDisplay) {
|
||||
List<String> list = new ArrayList<>(0);
|
||||
for (EImpalaDriver driver : EImpalaDriver.values()) {
|
||||
if (isSupport(distribution, version, byDisplay, "doSupportImpalaConnector")) {
|
||||
if (isSupport(distribution, version, byDisplay, driver.getSupportDriverMethodName())) {
|
||||
list.add(driver.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +214,36 @@ public class ConnParameterKeys {
|
||||
|
||||
/******************************************/
|
||||
|
||||
/*********** Azure Synapse keys ***************/
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_HOST = "CONN_PARA_KEY_SYNAPSE_HOST"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN = "CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_SPARK_POOLS = "CONN_PARA_KEY_SYNAPSE_SPARK_POOLS"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME = "CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_CONTAINER = "CONN_PARA_KEY_SYNAPSE_FS_CONTAINER"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_USERNAME = "CONN_PARA_KEY_SYNAPSE_FS_USERNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_PASSWORD = "CONN_PARA_KEY_SYNAPSE_FS_PASSWORD"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_STORAGE = "CONN_PARA_KEY_SYNAPSE_FS_STORAGE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB = "CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_DRIVER_MEMORY = "CONN_PARA_KEY_DRIVER_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_DRIVER_CORES = "CONN_PARA_KEY_DRIVER_CORES"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_MEMORY = "CONN_PARA_KEY_EXECUTOR_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_TUNING_PROPERTIES = "CONN_PARA_KEY_TUNING_PROPERTIES"; //$NON-NLS-1$
|
||||
|
||||
/******************************************/
|
||||
|
||||
/**
|
||||
* HBase keys.
|
||||
*/
|
||||
@@ -321,6 +351,8 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_ENDPOINT="CONN_PARA_KEY_DATABRICKS_ENDPOINT";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_RUN_MODE = "CONN_PARA_KEY_DATABRICKS_RUN_MODE";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";
|
||||
|
||||
@@ -334,5 +366,19 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_SET_HADOOP_CONF = "CONN_PARA_KEY_SET_HADOOP_CONF";
|
||||
|
||||
public static final String CONN_PARA_KEY_HADOOP_CONF_SPECIFIC_JAR = "CONN_PARA_KEY_HADOOP_CONF_SPECIFIC_JAR";
|
||||
|
||||
/**Knox*/
|
||||
public static final String CONN_PARA_KEY_SPARK_MODE="CONN_PARA_KEY_SPARK_MODE";
|
||||
|
||||
public static final String CONN_PARA_KEY_USE_KNOX="CONN_PARA_KEY_USE_KNOX";
|
||||
|
||||
public static final String CONN_PARA_KEY_KNOX_URL="CONN_PARA_KEY_KNOX_URL";
|
||||
|
||||
public static final String CONN_PARA_KEY_KNOX_USER = "CONN_PARA_KEY_KNOX_USER";
|
||||
|
||||
public static final String CONN_PARA_KEY_KNOX_PASSWORD="CONN_PARA_KEY_KNOX_PASSWORD";
|
||||
|
||||
public static final String CONN_PARA_KEY_KNOX_DIRECTORY="CONN_PARA_KEY_KNOX_DIRECTORY";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -228,8 +228,10 @@ public class DatabaseConnStrUtil {
|
||||
.get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA));
|
||||
}
|
||||
String url = null;
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal);
|
||||
String driver = dbConn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)
|
||||
|| template.startsWith(DbConnStrForHive.URL_IMPALA_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal, driver);
|
||||
}
|
||||
url = attachAdditionalHiveParameters(url, dbConn, false);
|
||||
return url;
|
||||
@@ -298,13 +300,20 @@ public class DatabaseConnStrUtil {
|
||||
if (!url.endsWith(";")) { //$NON-NLS-1$
|
||||
url = url + ";"; //$NON-NLS-1$
|
||||
}
|
||||
url = url + "ssl=true;"; //$NON-NLS-1$
|
||||
|
||||
boolean isHiveDriver = url.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE);
|
||||
|
||||
url = url + ( isHiveDriver ? "ssl=true;" : "SSL=1;" ); //$NON-NLS-1$
|
||||
|
||||
String trustStorePath = dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PATH);
|
||||
|
||||
if (trustStorePath != null) {
|
||||
url = url + "sslTrustStore=" + trustStorePath + ";"; //$NON-NLS-1$//$NON-NLS-2$
|
||||
url = url + ( isHiveDriver ? "sslTrustStore=" : "SSLTrustStore=" ) + trustStorePath + ";"; //$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
|
||||
String trustStorePassword = null;
|
||||
trustStorePassword = dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PASSWORD);
|
||||
|
||||
if (trustStorePassword != null) {
|
||||
if (encryptPassword) {
|
||||
trustStorePassword = "encrypted"; //$NON-NLS-1$
|
||||
@@ -316,7 +325,7 @@ public class DatabaseConnStrUtil {
|
||||
if (trustStorePassword == null) {
|
||||
trustStorePassword = ""; //$NON-NLS-1$
|
||||
}
|
||||
url = url + "trustStorePassword=" + trustStorePassword; //$NON-NLS-1$
|
||||
url = url + ( isHiveDriver ? "trustStorePassword=" : "SSLTrustStorePwd=" ) + trustStorePassword; //$NON-NLS-1$
|
||||
}
|
||||
if (url.endsWith(";")) { //$NON-NLS-1$
|
||||
url = url.substring(0, url.length() - 1);
|
||||
@@ -376,10 +385,15 @@ public class DatabaseConnStrUtil {
|
||||
return s;
|
||||
}
|
||||
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal) {
|
||||
String s = EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
|
||||
String standardURlString = getImpalaURlString(s, supportContext, server, port, sid);
|
||||
String principalSuffix = "principal="; //$NON-NLS-1$
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal,
|
||||
String driver) {
|
||||
String template = EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
|
||||
if (EDatabaseTypeName.IMPALA.getDbType().equals(driver)) {
|
||||
template = EDatabaseConnTemplate.IMPALA_IMPALA_DRIVER.getUrlTemplate(null);
|
||||
}
|
||||
String standardURlString = getImpalaURlString(template, supportContext, server, port, sid);
|
||||
|
||||
String principalSuffix = "IMPALA".equals(driver) ? "AuthMech=1" : "principal="; //$NON-NLS-1$
|
||||
boolean hasPrinc = false;
|
||||
String[] urlArray = standardURlString.split(SEMICOLON);
|
||||
if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
|
||||
@@ -391,7 +405,21 @@ public class DatabaseConnStrUtil {
|
||||
}
|
||||
} else {
|
||||
if (Principal != null) {
|
||||
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(Principal);
|
||||
|
||||
if("IMPALA".equals(driver)) {
|
||||
String krbServiceName = (Principal.split("/")[0]);
|
||||
String krbHostFQDN = (Principal.split("/")[1].split("@")[0]);
|
||||
String krbRealm = (Principal.split("/")[1].split("@")[1]);
|
||||
String urlKerberosParameter = ";KrbServiceName=" + krbServiceName
|
||||
+ ";KrbHostFQDN=" + krbHostFQDN
|
||||
+ ";KrbRealm=" + krbRealm;
|
||||
|
||||
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(urlKerberosParameter);
|
||||
|
||||
} else {
|
||||
|
||||
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(Principal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ public class DbConnStrForHive extends DbConnStr {
|
||||
|
||||
public static final String URL_HIVE_2_TEMPLATE = "jdbc:hive2://";//$NON-NLS-1$
|
||||
|
||||
public static final String URL_IMPALA_TEMPLATE = "jdbc:impala://";//$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC Marvin DbConnStrForHive constructor comment.
|
||||
*
|
||||
|
||||
@@ -33,7 +33,7 @@ public enum EDatabaseConnTemplate {
|
||||
MYSQL(new DbConnStr(EDatabaseTypeName.MYSQL, //
|
||||
"jdbc:mysql://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
|
||||
"3306", //$NON-NLS-1$
|
||||
"noDatetimeStringSync=true")), //$NON-NLS-1$
|
||||
"noDatetimeStringSync=true&enabledTLSProtocols=TLSv1.2,TLSv1.1,TLSv1")), //$NON-NLS-1$
|
||||
|
||||
AMAZON_AURORA(new DbConnStr(EDatabaseTypeName.AMAZON_AURORA, //
|
||||
"jdbc:mysql://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
|
||||
@@ -214,6 +214,9 @@ public enum EDatabaseConnTemplate {
|
||||
IMPALA(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:hive2://<host>:<port>/<sid>;auth=noSasl", //$NON-NLS-1$
|
||||
"21050", null, null, "localhost", "default")), //$NON-NLS-1$
|
||||
|
||||
IMPALA_IMPALA_DRIVER(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:impala://<host>:<port>/<sid>;auth=noSasl", //$NON-NLS-1$
|
||||
"21050", null, null, "localhost", "default")), //$NON-NLS-1$
|
||||
|
||||
HBASE(new DbConnStr(EDatabaseTypeName.HBASE, "127.0.0.1", //$NON-NLS-1$
|
||||
"2181")), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -77,14 +77,18 @@ public enum EDatabaseVersion4Drivers {
|
||||
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
|
||||
// MYSQL, add for 9594
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.30-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.49.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MARIADB(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MariaDB", "MARIADB", "mariadb-java-client-2.5.3.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// add for 9594
|
||||
MSSQL(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,"Open source JTDS", "JTDS", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MSSQL_2012(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
"Microsoft SQL Server 2012", "Microsoft SQL Server 2012", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
"Microsoft", "MSSQL_PROP", "mssql-jdbc.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.25.jar", "slf4j-log4j12-1.7.25.jar", "adal4j-1.6.5.jar", //$NON-NLS-1$
|
||||
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.6.jar", "oauth2-oidc-sdk-6.5.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "log4j-1.2.17.jar",
|
||||
"accessors-smart-2.4.7.jar", "asm-9.1.jar" })),
|
||||
|
||||
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
VERTICA_7_1_X(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 7.1.X (Deprecated)", "VERTICA_7_1_X", "vertica-jdbc-7.1.2-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -170,7 +174,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
"jackson-databind-2.10.1.jar", "jackson-annotations-2.10.1.jar", "httpcore-4.4.11.jar", "httpclient-4.5.9.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
|
||||
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.11.jar" })), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.30-bin.jar")); //$NON-NLS-1$
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.49.jar")); //$NON-NLS-1$
|
||||
|
||||
private DbVersion4Drivers dbVersionBean;
|
||||
|
||||
|
||||
@@ -101,22 +101,59 @@ public enum EHadoopProperties {
|
||||
HD_AZURE_DEPLOYBOLB,
|
||||
|
||||
HD_JOB_RESULT_FOLDER,
|
||||
|
||||
|
||||
SYNAPSE_ENDPOINT,
|
||||
|
||||
SYNAPSE_TOKEN,
|
||||
|
||||
SPARK_POOL_NAME,
|
||||
|
||||
SYNAPSE_STORAGE_HOST,
|
||||
|
||||
SYNAPSE_STORAGE_CONTAINER,
|
||||
|
||||
SYNAPSE_STORAGE_USERNAME,
|
||||
|
||||
SYNAPSE_STORAGE_PASSWORD,
|
||||
|
||||
DEPLOY_FOLDER,
|
||||
|
||||
SPARK_DRIVER_MEM,
|
||||
|
||||
SPARK_DRIVER_CORES,
|
||||
|
||||
SPARK_EXECUTOR_MEMORY,
|
||||
|
||||
QUBOLE_API_TOKEN,
|
||||
|
||||
QUBOLE_CLUSTER,
|
||||
|
||||
QUBOLE_CLUSTER_LABEL,
|
||||
|
||||
QUBOLE_ENDPOINT,
|
||||
|
||||
QUBOLE_ENDPOINT_URL,
|
||||
|
||||
QUBOLE_S3_ACCESS_KEY,
|
||||
|
||||
QUBOLE_S3_SECRET_KEY,
|
||||
|
||||
QUBOLE_S3_BUCKET_NAME,
|
||||
|
||||
QUBOLE_S3_BUCKET_KEY,
|
||||
|
||||
QUBOLE_S3_REGION,
|
||||
|
||||
DATABRICKS_ENDPOINT,
|
||||
|
||||
DATABRICKS_CLOUD_PROVIDER,
|
||||
|
||||
DATABRICKS_RUN_MODE,
|
||||
|
||||
DATABRICKS_CLUSTER_ID,
|
||||
|
||||
DATABRICKS_TOKEN,
|
||||
|
||||
DATABRICKS_DBFS_DEP_FOLDER;
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -34,6 +34,8 @@ public enum EHadoopDistributions {
|
||||
PIVOTAL_HD("Pivotal HD"), //$NON-NLS-1$
|
||||
|
||||
MICROSOFT_HD_INSIGHT("Microsoft HD Insight"), //$NON-NLS-1$
|
||||
|
||||
AZURE_SYNAPSE("Azure Synapse Runtime for Apache Spark 3.0"), //$NON-NLS-1$
|
||||
|
||||
GOOGLE_CLOUD_DATAPROC("Google Cloud Dataproc"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.hadoop.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum ESynapseStorage {
|
||||
|
||||
ADLS_GEN2("ADLS Gen2"); //$NON-NLS-1$
|
||||
|
||||
private String displayName;
|
||||
|
||||
ESynapseStorage(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static List<String> getAllSynapseStorageDisplayNames() {
|
||||
return getAllSynapseStorageNames(true);
|
||||
}
|
||||
|
||||
public static List<String> getAllSynapseStorageNames(boolean display) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
ESynapseStorage[] values = values();
|
||||
for (ESynapseStorage storage : values) {
|
||||
if (display) {
|
||||
names.add(storage.getDisplayName());
|
||||
} else {
|
||||
names.add(storage.getName());
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static ESynapseStorage getSynapseStoragenByDisplayName(String name) {
|
||||
return getSynapseStorageByName(name, true);
|
||||
}
|
||||
|
||||
public static ESynapseStorage getSynapseStorageByName(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (ESynapseStorage storage : values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(storage.getDisplayName())) {
|
||||
return storage;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(storage.getName())) {
|
||||
return storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -26,11 +26,6 @@ public enum ECustomVersionGroup {
|
||||
|
||||
MAPRDB,
|
||||
|
||||
PIG,
|
||||
|
||||
PIG_HBASE,
|
||||
PIG_HCATALOG,
|
||||
|
||||
MAP_REDUCE,
|
||||
|
||||
SPARK,
|
||||
|
||||
@@ -18,12 +18,6 @@ public enum ECustomVersionType {
|
||||
|
||||
MAPRDB("Maprdb", ECustomVersionGroup.MAPRDB), //$NON-NLS-1$
|
||||
|
||||
PIG("Pig", ECustomVersionGroup.PIG), //$NON-NLS-1$
|
||||
|
||||
PIG_HBASE("Pig for HBase", ECustomVersionGroup.PIG_HBASE), //$NON-NLS-1$
|
||||
|
||||
PIG_HCATALOG("Pig for Hcatalog", ECustomVersionGroup.PIG_HCATALOG), //$NON-NLS-1$
|
||||
|
||||
MAP_REDUCE("Map Reduce", ECustomVersionGroup.MAP_REDUCE), //$NON-NLS-1$
|
||||
|
||||
SPARK("Spark", ECustomVersionGroup.SPARK), //$NON-NLS-1$
|
||||
|
||||
@@ -483,7 +483,7 @@ public class HadoopCustomVersionDefineDialog extends TitleAreaDialog {
|
||||
|
||||
private boolean isSupportHadoop() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopService.class)) {
|
||||
hadoopService = (IHadoopService) GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
hadoopService = GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
}
|
||||
|
||||
return hadoopService != null;
|
||||
@@ -503,11 +503,7 @@ public class HadoopCustomVersionDefineDialog extends TitleAreaDialog {
|
||||
private ECustomVersionType[] filterTypes(Object[] types) {
|
||||
Object[] filteredTypes = ArrayUtils.removeElement(types, ECustomVersionType.ALL);
|
||||
IDesignerCoreService designerCoreService = CoreRuntimePlugin.getInstance().getDesignerCoreService();
|
||||
INode node = designerCoreService.getRefrenceNode("tPigLoad"); //$NON-NLS-1$
|
||||
if (node == null) {
|
||||
filteredTypes = ArrayUtils.removeElement(filteredTypes, ECustomVersionType.PIG);
|
||||
}
|
||||
node = designerCoreService.getRefrenceNode("tMRConfiguration", ComponentCategory.CATEGORY_4_MAPREDUCE.getName());//$NON-NLS-1$
|
||||
INode node = designerCoreService.getRefrenceNode("tMRConfiguration", ComponentCategory.CATEGORY_4_MAPREDUCE.getName());//$NON-NLS-1$
|
||||
if (node == null) {
|
||||
filteredTypes = ArrayUtils.removeElement(filteredTypes, ECustomVersionType.MAP_REDUCE);
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ public class HadoopVersionDialog extends TitleAreaDialog {
|
||||
if (isFromExistVersion) {
|
||||
IHadoopService hadoopService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopService.class)) {
|
||||
hadoopService = (IHadoopService) GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
hadoopService = GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
}
|
||||
if (hadoopService != null) {
|
||||
for (ECustomVersionGroup group : existVersionSelectionMap.keySet()) {
|
||||
@@ -437,10 +437,7 @@ public class HadoopVersionDialog extends TitleAreaDialog {
|
||||
for (ECustomVersionType type : types) {
|
||||
if (type.getGroup() == group) {
|
||||
Set<String> hadoopLibraries = new HashSet<String>();
|
||||
if (ECustomVersionType.PIG == type || ECustomVersionType.PIG_HBASE == type
|
||||
|| ECustomVersionType.PIG_HCATALOG == type) {
|
||||
hadoopLibraries = getLibrariesForPig(type);
|
||||
} else if (ECustomVersionType.MAP_REDUCE == type) {
|
||||
if (ECustomVersionType.MAP_REDUCE == type) {
|
||||
hadoopLibraries = getLibrariesForMapReduce(type);
|
||||
} else if (ECustomVersionType.SPARK == type || ECustomVersionType.SPARK_STREAMING == type) {
|
||||
hadoopLibraries = getLibrariesForSpark(type);
|
||||
@@ -542,42 +539,6 @@ public class HadoopVersionDialog extends TitleAreaDialog {
|
||||
return neededLibraries;
|
||||
}
|
||||
|
||||
private Set<String> getLibrariesForPig(ECustomVersionType type) {
|
||||
Set<String> neededLibraries = new HashSet<String>();
|
||||
INode node = CoreRuntimePlugin.getInstance().getDesignerCoreService().getRefrenceNode("tPigLoad");//$NON-NLS-1$
|
||||
|
||||
IElementParameter elementParameter = node.getElementParameter("MAPREDUCE");//$NON-NLS-1$
|
||||
if (elementParameter != null) {
|
||||
elementParameter.setValue(true);
|
||||
}
|
||||
elementParameter = node.getElementParameter("DISTRIBUTION");//$NON-NLS-1$
|
||||
if (elementParameter != null) {
|
||||
elementParameter.setValue(distribution);
|
||||
}
|
||||
|
||||
elementParameter = node.getElementParameter("PIG_VERSION");//$NON-NLS-1$
|
||||
if (elementParameter != null) {
|
||||
elementParameter.setValue(version);
|
||||
}
|
||||
|
||||
elementParameter = node.getElementParameter("LOAD");//$NON-NLS-1$
|
||||
if (elementParameter != null) {
|
||||
if (ECustomVersionType.PIG_HBASE == type) {
|
||||
elementParameter.setValue("HBASESTORAGE");//$NON-NLS-1$
|
||||
} else if (ECustomVersionType.PIG_HCATALOG == type) {
|
||||
elementParameter.setValue("HCATLOADER");//$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
List<ModuleNeeded> modulesNeeded = node.getModulesNeeded();
|
||||
for (ModuleNeeded module : modulesNeeded) {
|
||||
if (module.isRequired(node.getElementParameters())) {
|
||||
neededLibraries.add(module.getModuleName());
|
||||
}
|
||||
}
|
||||
return neededLibraries;
|
||||
}
|
||||
|
||||
public Map<ECustomVersionType, Map<String, Object>> getTypeConfigurations() {
|
||||
return this.typeConfigurations;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,11 @@ public class ConnectionBean implements Cloneable {
|
||||
private static final String TOKEN = "token"; //$NON-NLS-1$
|
||||
|
||||
private static final String URL = "url"; //$NON-NLS-1$
|
||||
|
||||
private static final String STORECREDENTIALS = "storeCredentials"; //$NON-NLS-1$
|
||||
|
||||
private String credentials = ""; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC smallet ConnectionBean constructor comment.
|
||||
*/
|
||||
@@ -178,6 +183,9 @@ public class ConnectionBean implements Cloneable {
|
||||
public String getPassword() {
|
||||
try {
|
||||
if (conDetails.has(PASSWORD)) {
|
||||
if (isStoreCredentials() && credentials != null) {
|
||||
return this.credentials;
|
||||
}
|
||||
return conDetails.getString(PASSWORD);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
@@ -326,6 +334,7 @@ public class ConnectionBean implements Cloneable {
|
||||
toReturn.setWorkSpace(st[i++]);
|
||||
toReturn.setComplete(new Boolean(st[i++]));
|
||||
toReturn.setToken(new Boolean(st[i++]));
|
||||
toReturn.setStoreCredentials(new Boolean(st[i++]));
|
||||
JSONObject dynamicJson = new JSONObject();
|
||||
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);
|
||||
while (i < st.length) {
|
||||
@@ -408,4 +417,30 @@ public class ConnectionBean implements Cloneable {
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean isStoreCredentials() {
|
||||
try {
|
||||
if (conDetails.has(STORECREDENTIALS)) {
|
||||
return (Boolean) conDetails.get(STORECREDENTIALS);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setStoreCredentials(boolean store) {
|
||||
try {
|
||||
conDetails.put(STORECREDENTIALS, store);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getCredentials() {
|
||||
return this.credentials;
|
||||
}
|
||||
|
||||
public void setCredentials(String credentials) {
|
||||
this.credentials = credentials;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,4 +106,6 @@ public interface ISAPConstant {
|
||||
public static final String PROP_DB_USERNAME = "db.username";//$NON-NLS-1$
|
||||
|
||||
public static final String PROP_DB_PASSWORD = "db.password";//$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static final String PROP_DB_ADDITIONAL_PROPERTIES = "db.additionalProperties";//$NON-NLS-1$
|
||||
}
|
||||
@@ -281,9 +281,7 @@ public final class MetadataToolHelper {
|
||||
}
|
||||
|
||||
public static boolean isAllowSpecificCharacters() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
return coreUIPluginNode
|
||||
.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
return CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,9 +32,7 @@ import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.template.EDatabaseConnTemplate;
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
import org.talend.core.hadoop.IHadoopClusterService;
|
||||
import org.talend.core.hadoop.repository.HadoopRepositoryUtil;
|
||||
import org.talend.core.hadoop.version.custom.ECustomVersionGroup;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.metadata.EMetadataEncoding;
|
||||
@@ -443,6 +441,13 @@ public class RepositoryToComponentProperty {
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(dbPassword, false));
|
||||
}
|
||||
} else if ("SAPHANA_PROPERTIES_STRING".equals(value)) { //$NON-NLS-1$
|
||||
String dbParameters = TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES, connection);
|
||||
if (isContextMode(connection, dbParameters)) {
|
||||
return dbParameters;
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(dbParameters);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1536,22 +1541,6 @@ public class RepositoryToComponentProperty {
|
||||
}
|
||||
|
||||
if (value.equals("HADOOP_CUSTOM_JARS")) {
|
||||
if (targetComponent != null && targetComponent.startsWith("tPig")) {
|
||||
// for pig component
|
||||
String clusterID = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CLUSTER_ID);
|
||||
if (clusterID != null) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
|
||||
IHadoopClusterService hadoopClusterService = GlobalServiceRegister.getDefault()
|
||||
.getService(IHadoopClusterService.class);
|
||||
Map<String, String> hadoopCustomLibraries = hadoopClusterService.getHadoopCustomLibraries(clusterID);
|
||||
|
||||
if (EDatabaseTypeName.HBASE.getDisplayName().equals(connection.getDatabaseType())) {
|
||||
return hadoopCustomLibraries.get(ECustomVersionGroup.PIG_HBASE.getName()) == null ? ""
|
||||
: hadoopCustomLibraries.get(ECustomVersionGroup.PIG_HBASE.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ package org.talend.core.model.metadata.designerproperties;
|
||||
* DOC talend class global comment. Detailled comment
|
||||
*/
|
||||
public enum SapJcoVersion {
|
||||
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$
|
||||
SAP3("sap jco 3.*", "sapjco3.jar");//$NON-NLS-1$
|
||||
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAP3("sap jco 3.*", "com.sap.conn.jco.sapjco.jar");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private String displayName;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -133,4 +134,8 @@ public interface IProcess extends IElement {
|
||||
public String getComponentsType();
|
||||
|
||||
public INode getNodeByUniqueName(String uniqueName);
|
||||
|
||||
default List<? extends INode> getProcessNodes() {
|
||||
return new ArrayList<INode>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ public class JobInfo {
|
||||
|
||||
private boolean needUnloadProcessor;
|
||||
|
||||
private int includeESBFlag = 0;
|
||||
|
||||
public JobInfo(String jobId, String contextName, String version) {
|
||||
this.jobId = jobId;
|
||||
this.contextName = contextName;
|
||||
@@ -572,4 +574,13 @@ public class JobInfo {
|
||||
public boolean isNeedUnloadProcessor() {
|
||||
return this.needUnloadProcessor;
|
||||
}
|
||||
|
||||
public int getIncludeESBFlag() {
|
||||
return includeESBFlag;
|
||||
}
|
||||
|
||||
public void setIncludeESBFlag(int includeESBFlag) {
|
||||
this.includeESBFlag = includeESBFlag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -728,6 +728,46 @@ public final class ProcessUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isRoute(Property property) {
|
||||
return property!= null && (ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE) ||
|
||||
ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE));
|
||||
}
|
||||
|
||||
public static boolean isRouteWithChildJobs(IProcess process) {
|
||||
|
||||
if (process instanceof IProcess2) {
|
||||
Property p = ((IProcess2) process).getProperty();
|
||||
if (isRoute(p)) {
|
||||
return false;
|
||||
}
|
||||
Item item = p.getItem();
|
||||
return isRouteWithChildJobs(item);
|
||||
} else {
|
||||
for (INode node : process.getGraphicalNodes()) {
|
||||
if (node.getComponent().getName().equals("cTalendJob")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isRouteWithChildJobs(Item item) {
|
||||
|
||||
if (item!= null && item instanceof ProcessItem) {
|
||||
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
|
||||
if (obj instanceof NodeType) {
|
||||
if (((NodeType) obj).getComponentName().equals("cTalendJob")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public static int getAssertAmount(IProcess process) {
|
||||
int count = 0;
|
||||
|
||||
@@ -52,4 +52,12 @@ public interface IRepositoryPrefConstants {
|
||||
public static final String ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS = "allow_specific_characters_for_schema_columns";
|
||||
|
||||
public static final String REF_PROJECT_BRANCH_SETTING = "ref_project_branch_setting";
|
||||
|
||||
public static final String ITEM_EXPORT_DEPENDENCIES = "item_export_dependencies";
|
||||
|
||||
public static final String ITEM_IMPORT_DEPENDENCIES = "item_import_dependencies";
|
||||
|
||||
public static final String ITEM_IMPORT_BRANCH_DEPENDENCIES = "item_import_from_branch_dependencies";
|
||||
|
||||
public static final String ITEM_DISABLE_SCREENSHOT = "item_disable_screenshot";
|
||||
}
|
||||
|
||||
@@ -21,14 +21,13 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.ScriptContext;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.PatternCompiler;
|
||||
@@ -36,8 +35,7 @@ import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.oro.text.regex.Perl5Substitution;
|
||||
import org.apache.oro.text.regex.Util;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
@@ -50,14 +48,16 @@ import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
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.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.services.IGenericDBService;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
import delight.rhinosandox.RhinoSandbox;
|
||||
import delight.rhinosandox.RhinoSandboxes;
|
||||
|
||||
/**
|
||||
* Utilities to work with IContextParamet objects. <br/>
|
||||
*
|
||||
@@ -84,6 +84,12 @@ public final class ContextParameterUtils {
|
||||
|
||||
private static final String NON_CONTEXT_PATTERN = "[^a-zA-Z0-9_]"; //$NON-NLS-1$
|
||||
|
||||
private static final RhinoSandbox SANDBOX = RhinoSandboxes.create();
|
||||
|
||||
private static final Map<String, Object> CTX_VARS_LAST = new HashMap<String, Object>();
|
||||
|
||||
private static ReadWriteLock CTX_VARS_LOCK = new ReentrantReadWriteLock();
|
||||
|
||||
/**
|
||||
* Constructs a new ContextParameterUtils.
|
||||
*/
|
||||
@@ -206,10 +212,37 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
|
||||
|
||||
public static ScriptEngine getScriptEngine() {
|
||||
return engine;
|
||||
private static String preProcessScript(String script) {
|
||||
String newCode = script;
|
||||
CTX_VARS_LOCK.readLock().lock();
|
||||
try {
|
||||
Set<Entry<String, Object>> entries = CTX_VARS_LAST.entrySet();
|
||||
|
||||
for (Entry<String, Object> entry : entries) {
|
||||
String val = entry.getValue().toString();
|
||||
if (entry.getValue() instanceof String) {
|
||||
val = "\"" + val.replace("\"", "\\\"") + "\"";
|
||||
}
|
||||
|
||||
newCode = newCode.replace(JAVA_NEW_CONTEXT_PREFIX + entry.getKey(), val);
|
||||
}
|
||||
} finally {
|
||||
CTX_VARS_LOCK.readLock().unlock();
|
||||
}
|
||||
|
||||
return newCode;
|
||||
}
|
||||
|
||||
public static boolean isValidLiteralValue(String value) {
|
||||
String newCode = preProcessScript(value);
|
||||
try {
|
||||
SANDBOX.eval(null, newCode);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String convertContext2Literal4AnyVar(final String code, final IContext context) {
|
||||
@@ -223,23 +256,22 @@ public final class ContextParameterUtils {
|
||||
|
||||
Object result = code;
|
||||
|
||||
if (engine == null) {
|
||||
engine = new ScriptEngineManager().getEngineByName("JavaScript");
|
||||
Map<String, Object> varMap = getVarMapForScriptEngine(context);
|
||||
|
||||
CTX_VARS_LOCK.writeLock().lock();
|
||||
try {
|
||||
CTX_VARS_LAST.clear();
|
||||
CTX_VARS_LAST.putAll(varMap);
|
||||
} finally {
|
||||
CTX_VARS_LOCK.writeLock().unlock();
|
||||
}
|
||||
|
||||
if (engine == null) {
|
||||
throw new RuntimeException("can't find the script engine");
|
||||
}
|
||||
String newCode = preProcessScript(code);
|
||||
|
||||
Bindings binding = engine.getBindings(ScriptContext.ENGINE_SCOPE);
|
||||
if (binding != null) {
|
||||
binding.clear();
|
||||
Map<String, Object> varMap = getVarMapForScriptEngine(context);
|
||||
binding.put("context", varMap);
|
||||
}
|
||||
try {
|
||||
String replacement = " ";
|
||||
result = engine.eval(code.replace("\r\n", replacement).replace("\n", replacement).replace("\r", replacement));
|
||||
result = SANDBOX.eval(null,
|
||||
newCode.replace("\r\n", replacement).replace("\n", replacement).replace("\r", replacement));
|
||||
} catch (Exception e) {
|
||||
// ignore the exception
|
||||
}
|
||||
@@ -296,7 +328,7 @@ public final class ContextParameterUtils {
|
||||
List<String> mvnValues = new ArrayList<>();
|
||||
IGenericDBService dbService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericDBService.class)) {
|
||||
dbService = (IGenericDBService) GlobalServiceRegister.getDefault().getService(IGenericDBService.class);
|
||||
dbService = GlobalServiceRegister.getDefault().getService(IGenericDBService.class);
|
||||
}
|
||||
for (String value : values) {
|
||||
try {
|
||||
@@ -617,8 +649,11 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
|
||||
private static boolean isAllowSpecificCharacters() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
return coreUIPluginNode.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
if (Platform.isRunning()) {
|
||||
return CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isEmptyParameter(String source) {
|
||||
|
||||
@@ -27,9 +27,6 @@ import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
@@ -418,6 +415,52 @@ public class NodeUtil {
|
||||
return conns;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC
|
||||
* <p>
|
||||
* The method searches for the incoming node connections of type
|
||||
* on a processing path and returns the first ones only
|
||||
* </p>
|
||||
*
|
||||
* @param node
|
||||
* @param type - node type to look for
|
||||
* @return
|
||||
*/
|
||||
public static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, String type) {
|
||||
if (type == null)
|
||||
return new ArrayList<IConnection>();
|
||||
|
||||
Set<String> uniqueNamesDone = new HashSet<String>();
|
||||
List<? extends IConnection> allIncomingConnections = getFirstIncomingLineConnectionsOfType(node, uniqueNamesDone, type);
|
||||
|
||||
return allIncomingConnections;
|
||||
}
|
||||
|
||||
private static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, Set<String> uniqueNamesDone, String type) {
|
||||
List<IConnection> conns = new ArrayList<IConnection>();
|
||||
|
||||
List<? extends IConnection> incomingConnections = node.getIncomingConnections();
|
||||
if (incomingConnections != null) {
|
||||
|
||||
for (int i = 0; i < incomingConnections.size(); i++) {
|
||||
|
||||
IConnection connection = incomingConnections.get(i);
|
||||
INode nextNode = connection.getSource();
|
||||
|
||||
if (!uniqueNamesDone.contains(nextNode.getUniqueName())) {
|
||||
uniqueNamesDone.add(nextNode.getUniqueName());
|
||||
|
||||
if (type.equals((String)nextNode.getElementParameter("COMPONENT_NAME").getValue())) {
|
||||
conns.add(connection);
|
||||
} else {
|
||||
conns.addAll(getFirstIncomingLineConnectionsOfType(nextNode, uniqueNamesDone, type)); // follow this way
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return conns;
|
||||
}
|
||||
|
||||
public static INode getFirstMergeNode(INode node) {
|
||||
INode mergeNode = null;
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
@@ -1040,14 +1083,7 @@ public class NodeUtil {
|
||||
}
|
||||
|
||||
private static boolean isValidLiteralValue(String value) {
|
||||
ScriptEngine se = ContextParameterUtils.getScriptEngine();
|
||||
if(se==null) return true;
|
||||
try {
|
||||
se.eval(value);
|
||||
return true;
|
||||
} catch (ScriptException e) {
|
||||
return false;
|
||||
}
|
||||
return ContextParameterUtils.isValidLiteralValue(value);
|
||||
}
|
||||
|
||||
private static String checkStringQuotationMarks(String str) {
|
||||
@@ -1456,4 +1492,29 @@ public class NodeUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* TUP-32758:Used to judge if two components are compatible from name
|
||||
* for example tAmazonMysqlConnection and tMysqlConnection ,tAmazonOracleCommit and tOracleCommit
|
||||
*/
|
||||
public static boolean isCompatibleByName(String componentName1, String componentName2) {
|
||||
boolean isCompatable = false;
|
||||
if ( componentName1 ==null || componentName2 == null
|
||||
|| componentName1.length()<1 || componentName2.length() < 1) return false;
|
||||
if (componentName1.replaceFirst("t", "tAmazon").equals(componentName2) ||
|
||||
componentName2.replaceFirst("t", "tAmazon").equals(componentName1)) {
|
||||
isCompatable = true;
|
||||
}
|
||||
return isCompatable;
|
||||
}
|
||||
|
||||
public static boolean isDatabaseFamily(String orginalFamilyName) {
|
||||
boolean isDatabaseFamily = false;
|
||||
String rootFamily = "";
|
||||
rootFamily = orginalFamilyName != null ? orginalFamilyName.split("/")[0] : "";
|
||||
if (rootFamily.equals("Databases")) {
|
||||
isDatabaseFamily = true;
|
||||
}
|
||||
return isDatabaseFamily;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ import org.ops4j.pax.url.mvn.MavenResolver;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.service.cm.ManagedService;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
import org.osgi.util.tracker.ServiceTrackerCustomizer;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.network.IProxySelectorProvider;
|
||||
import org.talend.commons.utils.network.TalendProxySelector;
|
||||
@@ -47,39 +45,6 @@ public class TalendMavenResolver {
|
||||
|
||||
private static MavenResolver mavenResolver = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC wchen TalendMavenResolver constructor comment.
|
||||
*/
|
||||
static {
|
||||
// the tracker is use in case the service is modifed
|
||||
final BundleContext context = CoreRuntimePlugin.getInstance().getBundle().getBundleContext();
|
||||
ServiceTracker<org.ops4j.pax.url.mvn.MavenResolver, org.ops4j.pax.url.mvn.MavenResolver> serviceTracker = new ServiceTracker<org.ops4j.pax.url.mvn.MavenResolver, org.ops4j.pax.url.mvn.MavenResolver>(
|
||||
context, org.ops4j.pax.url.mvn.MavenResolver.class,
|
||||
new ServiceTrackerCustomizer<org.ops4j.pax.url.mvn.MavenResolver, org.ops4j.pax.url.mvn.MavenResolver>() {
|
||||
|
||||
@Override
|
||||
public org.ops4j.pax.url.mvn.MavenResolver addingService(
|
||||
ServiceReference<org.ops4j.pax.url.mvn.MavenResolver> reference) {
|
||||
return context.getService(reference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifiedService(ServiceReference<org.ops4j.pax.url.mvn.MavenResolver> reference,
|
||||
org.ops4j.pax.url.mvn.MavenResolver service) {
|
||||
mavenResolver = null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removedService(ServiceReference<org.ops4j.pax.url.mvn.MavenResolver> reference,
|
||||
org.ops4j.pax.url.mvn.MavenResolver service) {
|
||||
mavenResolver = null;
|
||||
}
|
||||
});
|
||||
serviceTracker.open();
|
||||
}
|
||||
|
||||
public static void updateMavenResolver(String resolverKey, Dictionary<String, String> props) throws Exception {
|
||||
if (!needUpdate(resolverKey)) {
|
||||
return;
|
||||
|
||||
@@ -126,6 +126,9 @@ public abstract class AbstractPropertyValueEvaluator implements PropertyValueEva
|
||||
}
|
||||
|
||||
if (GenericTypeUtils.isStringType(property)) {
|
||||
if (property.isFlag(Property.Flags.ENCRYPT)) {
|
||||
return TalendQuoteUtils.removeQuotes(stringValue);
|
||||
}
|
||||
return TalendQuoteUtils.removeQuotes(StringEscapeUtils.unescapeJava(stringValue));
|
||||
}
|
||||
return rawValue;
|
||||
|
||||
@@ -46,6 +46,8 @@ public interface MavenConstants {
|
||||
|
||||
static final String EXCLUDE_DELETED_ITEMS = "EXCLUDE_DELETED_ITEMS";
|
||||
|
||||
static final String SKIP_LOOP_DEPENDENCY_CHECK = "SKIP_LOOP_DEPENDENCY_CHECK";
|
||||
|
||||
static final String SKIP_FOLDERS = "SKIP_FOLDERS";
|
||||
|
||||
/*
|
||||
|
||||
@@ -80,4 +80,13 @@ public interface TalendProcessOptionConstants {
|
||||
*/
|
||||
public static final int MODULES_WITH_CODESJAR = 1 << 6;
|
||||
|
||||
/**
|
||||
* flag for check if is ESB job
|
||||
*/
|
||||
public static final int ISESB_CHECKED = 1;
|
||||
|
||||
public static final int ISESB_CHILDREN_INCLUDE = 1 << 1;
|
||||
|
||||
public static final int ISESB_CURRENT_INCLUDE = 1 << 2;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.core.runtime.projectsetting;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.ProjectScope;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
@@ -27,6 +28,7 @@ import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.documentation.ERepositoryActionName;
|
||||
@@ -195,6 +197,26 @@ public class ProjectPreferenceManager {
|
||||
// return qulifierPreference.getBoolean(key, false);
|
||||
return getPreferenceStore().getBoolean(key);
|
||||
}
|
||||
|
||||
public boolean isAllowSpecificCharacters() {
|
||||
String value = getValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
return Boolean.valueOf(value);
|
||||
}
|
||||
return false; // Default value
|
||||
}
|
||||
|
||||
public void setAllowSpecificCharacters(boolean isAllow) {
|
||||
setValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, isAllow);
|
||||
}
|
||||
|
||||
public boolean isDisableScreenshot() {
|
||||
return getPreferenceStore().getBoolean(IRepositoryPrefConstants.ITEM_DISABLE_SCREENSHOT);
|
||||
}
|
||||
|
||||
public void setDisableScreenshot(boolean isDisable) {
|
||||
getPreferenceStore().setValue(IRepositoryPrefConstants.ITEM_DISABLE_SCREENSHOT, isDisable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the configurations.
|
||||
|
||||
@@ -150,6 +150,8 @@ public interface IGenericWizardService extends IService {
|
||||
*/
|
||||
public ITreeContextualAction getDefaultAction(RepositoryNode node);
|
||||
|
||||
public ITreeContextualAction getGenericAction(String typeName, String location);
|
||||
|
||||
public void loadAdditionalJDBC();
|
||||
|
||||
public List<String> getAllAdditionalJDBCTypes();
|
||||
|
||||
@@ -27,47 +27,12 @@ import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.service.IUpdateService;
|
||||
import org.talend.utils.io.FilesUtils;
|
||||
import org.talend.utils.string.DigestUtil;
|
||||
|
||||
public class SharedStudioUtils {
|
||||
|
||||
public static final String FILE_EXTRA_FEATURE_INDEX = "extra_feature.index"; //$NON-NLS-1$
|
||||
|
||||
public static final String SIGNATURE_FILE_NAME_SUFFIX = ".sig"; //$NON-NLS-1$
|
||||
public static final String PROP_DEVMODE = "osgi.dev"; //$NON-NLS-1$
|
||||
|
||||
public static boolean updateExtraFeatureFile() {
|
||||
File userConfigFolder = new File(Platform.getConfigurationLocation().getURL().getPath());
|
||||
File studioConfigFolder = new File(Platform.getInstallLocation().getURL().getPath(), "configuration");//$NON-NLS-1$
|
||||
if (!userConfigFolder.getAbsolutePath().equals(studioConfigFolder.getAbsolutePath())) {
|
||||
File studioExtraFile = new File(studioConfigFolder, FILE_EXTRA_FEATURE_INDEX);
|
||||
File studioExtraSignFile = new File(studioConfigFolder, FILE_EXTRA_FEATURE_INDEX + SIGNATURE_FILE_NAME_SUFFIX);
|
||||
File userExtraFile = new File(userConfigFolder, FILE_EXTRA_FEATURE_INDEX);
|
||||
File userExtraSignFile = new File(userConfigFolder, FILE_EXTRA_FEATURE_INDEX + SIGNATURE_FILE_NAME_SUFFIX);
|
||||
boolean isNeedUpdate = false;
|
||||
if (!studioExtraSignFile.exists() && userExtraSignFile.exists()) {
|
||||
userExtraSignFile.delete();
|
||||
if (userExtraFile.exists()) {
|
||||
userExtraFile.delete();
|
||||
}
|
||||
return true;
|
||||
} else if (studioExtraSignFile.exists()) {
|
||||
isNeedUpdate = true;
|
||||
}
|
||||
if (isNeedUpdate) {
|
||||
try {
|
||||
FilesUtils.copyFile(studioExtraFile, userExtraFile);
|
||||
FilesUtils.copyFile(studioExtraSignFile, userExtraSignFile);
|
||||
} catch (IOException ex) {
|
||||
ExceptionHandler.process(ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isSharedStudioMode() {
|
||||
if (isDevEnvironment()) {
|
||||
return false;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.talend.core.service;
|
||||
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
@@ -14,6 +15,8 @@ public interface IResourcesDependenciesService extends IService {
|
||||
|
||||
public String getResourcePathForContext(IProcess process, String resourceContextValue);
|
||||
|
||||
public String getResourcePathForContext(IProcess process, String resourceContextValue, boolean forceRelative);
|
||||
|
||||
public String getResourceItemFilePath(String resourceContextValue);
|
||||
|
||||
public void refreshDependencyViewer();
|
||||
@@ -21,4 +24,12 @@ public interface IResourcesDependenciesService extends IService {
|
||||
public void setContextParameterChangeDirtyManually();
|
||||
|
||||
public void removeBuildJobCacheForResource(String resourceId);
|
||||
|
||||
public static IResourcesDependenciesService get() {
|
||||
GlobalServiceRegister register = GlobalServiceRegister.getDefault();
|
||||
if (register.isServiceRegistered(IResourcesDependenciesService.class)) {
|
||||
return register.getService(IResourcesDependenciesService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,4 +147,6 @@ public interface IJobletProviderService extends IService {
|
||||
|
||||
public void updateJobleModifiedRelated(Item item, String oldName, String newName);
|
||||
|
||||
public IProcess getJobletGEFProcessFromNode(INode node);
|
||||
|
||||
}
|
||||
|
||||
@@ -264,6 +264,40 @@ public final class TalendQuoteUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isStartEndsWithQuotation(String expression, boolean checkStart, boolean checkEnd) {
|
||||
if (StringUtils.isBlank(expression)) {
|
||||
return false;
|
||||
}
|
||||
boolean startsWith = false;
|
||||
boolean endsWith = false;
|
||||
|
||||
ECodeLanguage language = LanguageManager.getCurrentLanguage();
|
||||
switch (language) {
|
||||
case JAVA:
|
||||
startsWith = expression.startsWith(QUOTATION_MARK);
|
||||
endsWith = expression.endsWith(QUOTATION_MARK);
|
||||
if (checkStart && checkEnd) {
|
||||
return startsWith & endsWith;
|
||||
} else if (checkStart) {
|
||||
return startsWith;
|
||||
} else if (checkEnd) {
|
||||
return endsWith;
|
||||
}
|
||||
default: // PERL
|
||||
startsWith = expression.startsWith(SINGLE_QUOTE);
|
||||
endsWith = expression.endsWith(SINGLE_QUOTE);
|
||||
if (checkStart && checkEnd) {
|
||||
return startsWith & endsWith;
|
||||
} else if (checkStart) {
|
||||
return startsWith;
|
||||
} else if (checkEnd) {
|
||||
return endsWith;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String removeQuotes(String text, String quotation) {
|
||||
if (text == null) {
|
||||
return null;
|
||||
@@ -429,6 +463,8 @@ public final class TalendQuoteUtils {
|
||||
return QUOTATION_MARK;
|
||||
case H2:
|
||||
return QUOTATION_ESC_MARK;
|
||||
case SNOWFLAKE:
|
||||
return QUOTATION_MARK;
|
||||
// case JAVADB_DERBYCLIENT:
|
||||
// return QUOTATION_MARK;
|
||||
// case JAVADB_JCCJDBC:
|
||||
|
||||
@@ -196,6 +196,7 @@ public abstract class AbstractTalendFunctionParser extends AbstractFunctionParse
|
||||
function.setName(funcName);
|
||||
function.setDescription(des);
|
||||
function.setParameters(Arrays.asList(paras));
|
||||
function.setFullQualifiedName(fullName);
|
||||
if (!category.equals(EMPTY_STRING)) {
|
||||
function.setCategory(category);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.utils.json.JSONArray;
|
||||
import org.talend.utils.json.JSONException;
|
||||
@@ -45,6 +46,10 @@ public class Function implements Cloneable {
|
||||
|
||||
private boolean isUserDefined;
|
||||
|
||||
private boolean rountineJarDependencyMissing = true;
|
||||
|
||||
private String fullQualifiedName;
|
||||
|
||||
/**
|
||||
* yzhang Function constructor comment.
|
||||
*/
|
||||
@@ -517,6 +522,40 @@ public class Function implements Cloneable {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public String getFullQualifiedName() {
|
||||
return fullQualifiedName;
|
||||
}
|
||||
|
||||
public void setFullQualifiedName(String fullQualifiedName) {
|
||||
this.fullQualifiedName = fullQualifiedName;
|
||||
}
|
||||
|
||||
public String getRoutineJarName() {
|
||||
String[] fqns = fullQualifiedName.split("\\.");
|
||||
if (fqns.length > 1) {
|
||||
return fqns[fqns.length - 2];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isRoutineJar() {
|
||||
if (this.fullQualifiedName == null || this.fullQualifiedName.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return this.fullQualifiedName.contains("." + JavaUtils.JAVA_ROUTINESJAR_DIRECTORY + ".");
|
||||
}
|
||||
|
||||
public boolean isRoutineJarDependencyMissing() {
|
||||
if (!this.isRoutineJar()) {
|
||||
return false;
|
||||
}
|
||||
return this.rountineJarDependencyMissing;
|
||||
}
|
||||
|
||||
public void setRountineJarDependencyMissing(boolean rountineJarDependencyMissing) {
|
||||
this.rountineJarDependencyMissing = rountineJarDependencyMissing;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String toSerialized() throws JSONException {
|
||||
JSONObject functionObj = new JSONObject();
|
||||
|
||||
@@ -109,6 +109,11 @@ public class FunctionManager {
|
||||
parser = new RoutineFunctionParser();
|
||||
parser.parse();
|
||||
talendTypes = parser.getList();
|
||||
|
||||
parser = new RoutineJarsFunctionParser();
|
||||
parser.parse();
|
||||
talendTypes.addAll(parser.getList());
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.rowgenerator.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.jdt.core.ICompilationUnit;
|
||||
import org.eclipse.jdt.core.IJavaElement;
|
||||
import org.eclipse.jdt.core.IMember;
|
||||
import org.eclipse.jdt.core.IMethod;
|
||||
import org.eclipse.jdt.core.IPackageFragment;
|
||||
import org.eclipse.jdt.core.IPackageFragmentRoot;
|
||||
import org.eclipse.jdt.core.IType;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
import org.eclipse.jdt.internal.core.SourceType;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.repository.IRepositoryObject;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.utils.CodesJarResourceCache;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.RoutinesParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFilePackage;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.impl.ProcessTypeImpl;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IProxyRepositoryService;
|
||||
|
||||
/**
|
||||
* Created by bhe on Jun 24, 2021
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class RoutineJarsFunctionParser extends AbstractTalendFunctionParser {
|
||||
|
||||
public static final String MAVEN_PLUGIN_ID = "org.talend.designer.maven";
|
||||
|
||||
private List<String> systems = new ArrayList<String>();
|
||||
|
||||
private final Set<CodesJarInfo> infos = new HashSet<CodesJarInfo>();
|
||||
|
||||
public RoutineJarsFunctionParser() {
|
||||
super();
|
||||
initProcessCodesJarInfo();
|
||||
}
|
||||
|
||||
private void initProcessCodesJarInfo() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
IRepositoryObject process = (IRepositoryObject) service.getActiveProcess();
|
||||
|
||||
if (process == null || process.getProperty() == null || process.getProperty().getItem() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Item processItem = process.getProperty().getItem();
|
||||
|
||||
Set<CodesJarInfo> allSet = CodesJarResourceCache.getAllCodesJars();
|
||||
Set<RoutinesParameterType> rps = new HashSet<RoutinesParameterType>();
|
||||
if (processItem instanceof ProcessItem) {
|
||||
ProcessType pt = ((ProcessItem) processItem).getProcess();
|
||||
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
|
||||
// if it is test process
|
||||
int pidFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 2;
|
||||
int versionFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 4;
|
||||
ProcessTypeImpl pi = (ProcessTypeImpl) pt;
|
||||
if (pi.eClass() != null && StringUtils.equals(pi.eClass().getName(), "TestContainer")) {
|
||||
|
||||
try {
|
||||
Object pid = pi.eGet(pidFeature, true, false);
|
||||
Object version = pi.eGet(versionFeature, true, false);
|
||||
if (pid != null) {
|
||||
IProxyRepositoryService svc = IProxyRepositoryService.get();
|
||||
try {
|
||||
List<IRepositoryViewObject> vos = svc.getProxyRepositoryFactory().getAllVersion(pid.toString());
|
||||
for (IRepositoryViewObject vo : vos) {
|
||||
if (StringUtils.equals(vo.getVersion(), String.valueOf(version))) {
|
||||
Item parentProcessItem = vo.getProperty().getItem();
|
||||
if (parentProcessItem instanceof ProcessItem) {
|
||||
pt = ((ProcessItem) parentProcessItem).getProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
} else if (processItem instanceof JobletProcessItem) {
|
||||
ProcessType pt = ((JobletProcessItem) processItem).getJobletProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
|
||||
if (!rps.isEmpty()) {
|
||||
rps.forEach(rp -> {
|
||||
for (CodesJarInfo info : allSet) {
|
||||
if (StringUtils.equals(info.getId(), rp.getId())) {
|
||||
infos.add(info);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("restriction")
|
||||
public void parse() {
|
||||
typeMethods.clear();
|
||||
try {
|
||||
|
||||
Set<CodesJarInfo> jarInfos = CodesJarResourceCache.getAllCodesJars();
|
||||
|
||||
jarInfos.forEach(e -> {
|
||||
try {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
ITalendProcessJavaProject talendProcessJavaProject = service.getTalendCodesJarJavaProject(e);
|
||||
if (talendProcessJavaProject != null) {
|
||||
IFolder srcFolder = talendProcessJavaProject.getSrcFolder();
|
||||
IPackageFragmentRoot root = talendProcessJavaProject.getJavaProject()
|
||||
.getPackageFragmentRoot(srcFolder);
|
||||
final List<IJavaElement> elements = new ArrayList<IJavaElement>();
|
||||
|
||||
addEveryProjectElements(root, elements,
|
||||
getGroupId() + "." + JavaUtils.JAVA_ROUTINESJAR_DIRECTORY + "." + e.getLabel().toLowerCase());
|
||||
|
||||
// for (IJavaElement element : elements) {
|
||||
// see bug 8055,reversal the getLastName() method
|
||||
for (int i = elements.size(); i > 0; i--) {
|
||||
IJavaElement element = elements.get(i - 1);
|
||||
if (element instanceof ICompilationUnit) {
|
||||
ICompilationUnit compilationUnit = (ICompilationUnit) element;
|
||||
IType[] types = compilationUnit.getAllTypes();
|
||||
if (types.length > 0) {
|
||||
// SourceType sourceType = (SourceType) types[0];
|
||||
IMember sourceType = types[0];
|
||||
if (sourceType != null) {
|
||||
// processSourceType(sourceType, sourceType.getElementName(),
|
||||
// sourceType.getFullyQualifiedName(),
|
||||
// sourceType.getElementName(), false);
|
||||
processSourceType(sourceType, sourceType.getElementName(),
|
||||
types[0].getFullyQualifiedName(), sourceType.getElementName(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ExceptionHandler.process(ex);
|
||||
}
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.talend.designer.rowgenerator.data.AbstractTalendFunctionParser#processSourceType(org.eclipse.jdt.internal
|
||||
* .core.SourceType)
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
@Override
|
||||
protected void processSourceType(IMember member, String className, String fullName, String funcName, boolean isSystem) {
|
||||
try {
|
||||
if (member instanceof SourceType) {
|
||||
IMethod[] methods = ((SourceType) member).getMethods();
|
||||
for (IMethod method : methods) {
|
||||
super.processSourceType(method, className, fullName, method.getElementName(), systems.contains(className));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.designer.rowgenerator.data.AbstractTalendFunctionParser#getPackageFragment()
|
||||
*/
|
||||
@Override
|
||||
protected String getPackageFragment() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ITalendProcessJavaProject getTalendCodeProject() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Function parseJavaCommentToFunctions(String string, String className, String fullName, String funcName,
|
||||
boolean isSystem) {
|
||||
Function func = super.parseJavaCommentToFunctions(string, className, fullName, funcName, isSystem);
|
||||
|
||||
// set routine jars dependency missing or not
|
||||
infos.forEach(info -> {
|
||||
if (func.getRoutineJarName().equals(info.getLabel().toLowerCase())) {
|
||||
func.setRountineJarDependencyMissing(false);
|
||||
}
|
||||
});
|
||||
|
||||
return func;
|
||||
}
|
||||
|
||||
protected void addEveryProjectElements(IPackageFragmentRoot root, List<IJavaElement> elements, String packageFragment)
|
||||
throws JavaModelException {
|
||||
if (root == null || elements == null) {
|
||||
return;
|
||||
}
|
||||
// system
|
||||
IPackageFragment Pkg = root.getPackageFragment(packageFragment);
|
||||
if (Pkg != null && Pkg.exists()) {
|
||||
elements.addAll(Arrays.asList(Pkg.getChildren()));
|
||||
}
|
||||
|
||||
ProjectManager projectManager = ProjectManager.getInstance();
|
||||
|
||||
// referenced project.
|
||||
projectManager.retrieveReferencedProjects();
|
||||
for (Project p : projectManager.getReferencedProjects()) {
|
||||
IPackageFragment userPkg = root.getPackageFragment(packageFragment + "." + p.getLabel().toLowerCase()); //$NON-NLS-1$
|
||||
if (userPkg != null && userPkg.exists()) {
|
||||
elements.addAll(Arrays.asList(userPkg.getChildren()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String getGroupId() {
|
||||
Project p = ProjectManager.getInstance().getCurrentProject();
|
||||
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(p, MAVEN_PLUGIN_ID, false);
|
||||
return preferenceManager.getValue(MavenConstants.PROJECT_GROUPID);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
@@ -258,6 +259,8 @@ public interface IRunProcessService extends IService {
|
||||
|
||||
public boolean isExcludeDeletedItems(Property property);
|
||||
|
||||
public boolean getMavenPrefOptionStatus(String prefName);
|
||||
|
||||
public static IRunProcessService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
|
||||
@@ -269,5 +272,9 @@ public interface IRunProcessService extends IService {
|
||||
|
||||
void deleteTalendCodesJarProject(ERepositoryObjectType type, String projectTechName, String codesJarName,
|
||||
boolean deleteContent);
|
||||
|
||||
public void deleteOldVersionTalendJobProject(IRepositoryViewObject object);
|
||||
|
||||
public void checkAndUpdateDaikonDependencies();
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.Map;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.exception.LoginException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
@@ -565,4 +566,8 @@ public interface IProxyRepositoryFactory {
|
||||
|
||||
public void batchDeleteObjectPhysical4Remote(Project project, List<IRepositoryViewObject> objToDeleteList)
|
||||
throws PersistenceException;
|
||||
|
||||
public void deleteOldVersionPhysical(Project project, IRepositoryViewObject objToDelete, String version) throws PersistenceException;
|
||||
|
||||
public void batchDeleteOldVersionPhysical4Remote(Project project, List<IRepositoryViewObject> objToDeleteList, IProgressMonitor monitor) throws PersistenceException;
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ public class RepositoryConstants {
|
||||
public static final String REPOSITORY_CLOUD_APAC_ID = "cloud_apac"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_US_WEST_ID = "cloud_us_west"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_AUS_ID = "cloud_aus"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_CUSTOM_ID = "cloud_custom"; //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
id="org.talend.core.ui.token.AdditionalPackageTokenCollector"
|
||||
name="addtional package">
|
||||
</provider>
|
||||
<provider
|
||||
collector="org.talend.core.ui.token.AMCUsageTokenCollector"
|
||||
id="AMCUsageTokenCollector">
|
||||
</provider>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNotModifiable;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.DefaultTableLabelProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.ResetDBTypesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.tableviewer.TableViewerCreator;
|
||||
@@ -88,6 +90,14 @@ public class CustomTableManager {
|
||||
if (resetDBTypesButton != null) {
|
||||
resetDBTypesButton.getButton().setEnabled(false);
|
||||
}
|
||||
CasePushButton caseButton = tableEditorView.getExtendedToolbar().getCaseButton();
|
||||
if (caseButton != null) {
|
||||
caseButton.getButton().setEnabled(false);
|
||||
}
|
||||
QuotePushButton quoteButton = tableEditorView.getExtendedToolbar().getQuoteButton();
|
||||
if (quoteButton != null) {
|
||||
quoteButton.getButton().setEnabled(false);
|
||||
}
|
||||
} else {
|
||||
tableEditorView.getToolBar().getAddButton().getButton().addSelectionListener(new SelectionListener() {
|
||||
|
||||
@@ -170,6 +180,14 @@ public class CustomTableManager {
|
||||
if (resetDBTypesButton != null) {
|
||||
resetDBTypesButton.getButton().setEnabled(false);
|
||||
}
|
||||
CasePushButton caseButton = tableEditorView.getExtendedToolbar().getCaseButton();
|
||||
if (caseButton != null) {
|
||||
caseButton.getButton().setEnabled(false);
|
||||
}
|
||||
QuotePushButton quoteButton = tableEditorView.getExtendedToolbar().getQuoteButton();
|
||||
if (quoteButton != null) {
|
||||
quoteButton.getButton().setEnabled(false);
|
||||
}
|
||||
}
|
||||
if (linkedTable != null) {
|
||||
if (linkedTable.isReadOnly() && linkedTableEditorView != null) {
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.talend.commons.ui.command.CommandStackForComposite;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.composite.ThreeCompositesSashForm;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.ExtendedToolbarView;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.commons.ui.swt.tableviewer.IModifiedBeanListener;
|
||||
import org.talend.commons.ui.swt.tableviewer.ModifiedBeanEvent;
|
||||
@@ -67,6 +68,7 @@ import org.talend.core.model.utils.NodeUtil;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.core.ui.metadata.editor.AbstractMetadataTableEditorView;
|
||||
import org.talend.core.ui.metadata.editor.MetadataQuoteToolbarEditorView;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditorView;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
@@ -376,8 +378,19 @@ public class MetadataDialog extends Dialog {
|
||||
} else {
|
||||
metadataTableEditor = new MetadataTableEditor(outputMetaTable, titleOutput);
|
||||
}
|
||||
outputMetaView = new DialogMetadataTableEditorView(composite, SWT.NONE, metadataTableEditor, outputReadOnly, true,
|
||||
true, false);
|
||||
//enable dbcolumn manipulate feature only on Database output component
|
||||
String nodeFamily = "", rootFamily = "";
|
||||
if ( outputNode != null && outputNode.getComponent() != null ) {
|
||||
nodeFamily = outputNode.getComponent().getOriginalFamilyName();
|
||||
rootFamily = nodeFamily != null ? nodeFamily.split("/")[0] : "";
|
||||
}
|
||||
if (rootFamily.equals("Databases")) {
|
||||
outputMetaView = new DialogMetadataDBOutputTableEditorView(composite, SWT.NONE, metadataTableEditor, outputReadOnly, true,
|
||||
true, false);
|
||||
} else {
|
||||
outputMetaView = new DialogMetadataTableEditorView(composite, SWT.NONE, metadataTableEditor, outputReadOnly, true,
|
||||
true, false);
|
||||
}
|
||||
outputMetaView.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(outputNode));
|
||||
outputMetaView.setIsRepository(isRepository(outputNode, outputMetaTable));
|
||||
initializeMetadataTableView(outputMetaView, outputNode, outputMetaTable);
|
||||
@@ -544,8 +557,21 @@ public class MetadataDialog extends Dialog {
|
||||
} else {
|
||||
metadataTableEditorForOutput = new MetadataTableEditor(outputMetaTable, titleOutput + " (Output)");
|
||||
}
|
||||
outputMetaView = new DialogMetadataTableEditorView(compositesSachForm.getRightComposite(), SWT.NONE,
|
||||
metadataTableEditorForOutput, outputReadOnly, true, true, false);
|
||||
//Enable dbcolumn manipulate feature only on Database output component
|
||||
String nodeFamily = "", rootFamily = "";
|
||||
if ( outputNode != null && outputNode.getComponent() != null ) {
|
||||
nodeFamily = outputNode.getComponent().getOriginalFamilyName();
|
||||
rootFamily = nodeFamily != null ? nodeFamily.split("/")[0] : "";
|
||||
}
|
||||
if (rootFamily.equals("Databases")) {
|
||||
outputMetaView = new DialogMetadataDBOutputTableEditorView(compositesSachForm.getRightComposite(), SWT.NONE,
|
||||
metadataTableEditorForOutput, outputReadOnly, true, true, false);
|
||||
} else {
|
||||
outputMetaView = new DialogMetadataTableEditorView(compositesSachForm.getRightComposite(), SWT.NONE,
|
||||
metadataTableEditorForOutput, outputReadOnly, true, true, false);
|
||||
}
|
||||
|
||||
|
||||
outputMetaView.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(outputNode));
|
||||
outputMetaView.setIsRepository(isRepository(outputNode, outputMetaTable));
|
||||
initializeMetadataTableView(outputMetaView, outputNode, outputMetaTable);
|
||||
@@ -799,7 +825,22 @@ public class MetadataDialog extends Dialog {
|
||||
newTableViewerCreator.setLazyLoad(TableViewerCreator.getRecommandLazyLoad());
|
||||
}
|
||||
}
|
||||
|
||||
class DialogMetadataDBOutputTableEditorView extends MetadataTableEditorView {
|
||||
|
||||
public DialogMetadataDBOutputTableEditorView(Composite parentComposite, int mainCompositeStyle,
|
||||
ExtendedTableModel<IMetadataColumn> extendedTableModel, boolean readOnly, boolean toolbarVisible,
|
||||
boolean labelVisible, boolean initGraphicsComponents) {
|
||||
super(parentComposite, mainCompositeStyle, extendedTableModel, readOnly, toolbarVisible, labelVisible,
|
||||
initGraphicsComponents);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ExtendedToolbarView initToolBar() {
|
||||
return new MetadataQuoteToolbarEditorView(getMainComposite(), SWT.NONE, this.getExtendedTableViewer(), this.getCurrentDbms());
|
||||
}
|
||||
}
|
||||
|
||||
public static void setSingleAndStruct(boolean isSingle) {
|
||||
isSingleAndStruct = isSingle;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.editor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.core.ui.metadata.extended.command.MetadataCaseCommand;
|
||||
import org.talend.core.ui.metadata.extended.command.MetadataQuoteCommand;
|
||||
|
||||
|
||||
public class MetadataQuoteToolbarEditorView extends MetadataToolbarEditorView {
|
||||
|
||||
|
||||
public MetadataQuoteToolbarEditorView(Composite parent, int style, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, style, extendedTableViewer);
|
||||
}
|
||||
|
||||
public MetadataQuoteToolbarEditorView(Composite parent, int style, AbstractExtendedTableViewer extendedTableViewer, String dbmsId) {
|
||||
super(parent, style, extendedTableViewer, dbmsId);
|
||||
this.getQuoteButton().setDbmsId(dbmsId);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CasePushButton createCasePushButton() {
|
||||
return new CasePushButtonForExtendedTable(toolbar, extendedTableViewer) {
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToConvertCase, int[] selectionIndices, boolean isUpperCase) {
|
||||
return new MetadataCaseCommand(extendedTable, beansToConvertCase, selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected QuotePushButton createQuotePushButton() {
|
||||
return new QuotePushButtonForExtendedTable(toolbar, extendedTableViewer) {
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
return new MetadataQuoteCommand(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.extended.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.commands.ExtendedTableCaseCommand;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.impl.ConnectionFactoryImpl;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
|
||||
|
||||
public class MetadataCaseCommand extends ExtendedTableCaseCommand {
|
||||
|
||||
|
||||
/**
|
||||
* DOC MetadataCaseCommand constructor comment.
|
||||
*
|
||||
* @param extendedTableModel
|
||||
* @param beansToUppercase
|
||||
* @param selectionIndices
|
||||
* @param isUpperCase
|
||||
*/
|
||||
public MetadataCaseCommand(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, boolean isUpperCase) {
|
||||
super(extendedTable, beansToUppercase, selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertCase(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, boolean isUpperCase) {
|
||||
int index = 0;
|
||||
for (Object current : copiedObjectsList) {
|
||||
//get refreshed element
|
||||
current = extendedTable.getTableViewer().getElementAt(selectionIndices[index]);
|
||||
if (current instanceof IMetadataColumn) {
|
||||
IMetadataColumn copy = ((IMetadataColumn) current).clone();
|
||||
copy.setUsefulColumn(true);
|
||||
if (copy.getOriginalDbColumnName() != null && !StringUtils.isEmpty(copy.getOriginalDbColumnName())) {
|
||||
copy.setOriginalDbColumnName(isUpperCase ? copy.getOriginalDbColumnName().toUpperCase() : copy.getOriginalDbColumnName().toLowerCase());
|
||||
}
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
// Add a new statement to fix the MetadataColumn type.
|
||||
else if (current instanceof MetadataColumn) {
|
||||
MetadataTableEditor tableEditor = (MetadataTableEditor) extendedTable;
|
||||
MetadataColumn metadataColumn = (MetadataColumn) current;
|
||||
MetadataColumn newColumnCopy = new ConnectionFactoryImpl().copy(metadataColumn,
|
||||
isUpperCase ? StringUtils.upperCase(metadataColumn.getName()) : StringUtils.lowerCase(metadataColumn.getName()));
|
||||
IMetadataColumn copy = (ConvertionHelper.convertToIMetaDataColumn(newColumnCopy)).clone();
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
extendedTable.getTableViewer().getTable().select(selectionIndices);
|
||||
extendedTable.getTableViewer().getTable().notifyListeners(SWT.Selection, new Event());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.extended.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.commands.ExtendedTableQuoteCommand;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.impl.ConnectionFactoryImpl;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
|
||||
|
||||
public class MetadataQuoteCommand extends ExtendedTableQuoteCommand {
|
||||
|
||||
|
||||
/**
|
||||
* DOC MetadataQuoteCommand constructor comment.
|
||||
*
|
||||
* @param extendedTableModel
|
||||
* @param beansToQuote
|
||||
* @param selectionIndices
|
||||
*/
|
||||
public MetadataQuoteCommand(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
super(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toQuote(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
int index = 0;
|
||||
for (Object current : copiedObjectsList) {
|
||||
//get refreshed element
|
||||
current = extendedTable.getTableViewer().getElementAt(selectionIndices[index]);
|
||||
if (current instanceof IMetadataColumn) {
|
||||
IMetadataColumn copy = ((IMetadataColumn) current).clone();
|
||||
copy.setUsefulColumn(true);
|
||||
String oldDbColumnName = copy.getOriginalDbColumnName();
|
||||
if (oldDbColumnName != null) {
|
||||
String newDbColumnName = oldDbColumnName;
|
||||
if (isAddingQuote) {
|
||||
newDbColumnName = quote + newDbColumnName + quote;
|
||||
} else {
|
||||
newDbColumnName = StringUtils.removeStart(oldDbColumnName, quote);
|
||||
newDbColumnName = StringUtils.removeEnd(newDbColumnName, quote);
|
||||
}
|
||||
copy.setOriginalDbColumnName(newDbColumnName);
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
}
|
||||
// Add a new statement to fix the MetadataColumn type.
|
||||
else if (current instanceof MetadataColumn) {
|
||||
MetadataTableEditor tableEditor = (MetadataTableEditor) extendedTable;
|
||||
MetadataColumn metadataColumn = (MetadataColumn) current;
|
||||
String oldName = metadataColumn.getName();
|
||||
if (oldName != null) {
|
||||
String newName = oldName;
|
||||
if (isAddingQuote) {
|
||||
newName = quote + oldName + quote;
|
||||
} else {
|
||||
newName = StringUtils.removeStart(oldName, quote);
|
||||
newName = StringUtils.removeEnd(newName, quote);
|
||||
}
|
||||
MetadataColumn newColumnCopy = new ConnectionFactoryImpl().copy(metadataColumn, newName);
|
||||
IMetadataColumn copy = (ConvertionHelper.convertToIMetaDataColumn(newColumnCopy)).clone();
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
extendedTable.getTableViewer().getTable().select(selectionIndices);
|
||||
extendedTable.getTableViewer().getTable().notifyListeners(SWT.Selection, new Event());
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,17 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.preference;
|
||||
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
|
||||
public class SpecificSettingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
public SpecificSettingPreferencePage() {
|
||||
setPreferenceStore(CoreUIPlugin.getDefault().getPreferenceStore());
|
||||
setDescription("Specific settings");
|
||||
noDefaultAndApplyButton();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -32,8 +32,6 @@ public class SpecificSettingPreferencePage extends FieldEditorPreferencePage imp
|
||||
*/
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
addField(new BooleanFieldEditor(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,
|
||||
"Allow specific characters (UTF8,...) for columns of schemas", getFieldEditorParent()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.core.ui.preference.metadata;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
|
||||
@@ -27,8 +26,6 @@ public class MetadataPreferenceInitializer extends AbstractPreferenceInitializer
|
||||
public void initializeDefaultPreferences() {
|
||||
IPreferenceStore store = CoreUIPlugin.getDefault().getPreferenceStore();
|
||||
store.setDefault(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML, 500);
|
||||
store.setDefault(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.token;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
import org.eclipse.core.runtime.preferences.DefaultScope;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.IScopeContext;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.talend.commons.runtime.service.ICollectDataService;
|
||||
|
||||
import us.monoid.json.JSONObject;
|
||||
|
||||
public class AMCUsageTokenCollector extends AbstractTokenCollector {
|
||||
|
||||
@Override
|
||||
public JSONObject collect() throws Exception {
|
||||
Properties props = new Properties();
|
||||
ICollectDataService instance = ICollectDataService.getInstance("amc");
|
||||
if (instance != null) {
|
||||
props = instance.getCollectedData();
|
||||
} else {
|
||||
IScopeContext[] contexts = new IScopeContext[] { InstanceScope.INSTANCE, ConfigurationScope.INSTANCE,
|
||||
DefaultScope.INSTANCE };
|
||||
String plugin = "org.talend.amc";
|
||||
for (IScopeContext context : contexts) {
|
||||
IEclipsePreferences amc = context.getNode(plugin);
|
||||
if (amc != null) {
|
||||
if (amc.getBoolean(ICollectDataService.AMC_FILE_TYPE_USED, false)) {
|
||||
props.setProperty(ICollectDataService.AMC_PREVIEW_KEY, ICollectDataService.AMC_PREVIEW_FILEVALUE);
|
||||
} else if (amc.getBoolean(ICollectDataService.AMC_DATABASE_TYPE_USED, false)) {
|
||||
props.setProperty(ICollectDataService.AMC_PREVIEW_KEY, ICollectDataService.AMC_PREVIEW_DATABASEVALUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
JSONObject finalToken = new JSONObject();
|
||||
finalToken.put(ICollectDataService.AMC_PREVIEW_KEY, "<Empty>");
|
||||
for (Object key : props.keySet()) {
|
||||
finalToken.put((String) key, props.get(key));
|
||||
}
|
||||
return finalToken;
|
||||
}
|
||||
}
|
||||
@@ -374,6 +374,13 @@ public class TalendTextUtils {
|
||||
// for bug 12092
|
||||
boolean isSqlKeyword = KeywordsValidator.isSqlKeyword(temp, name.getProduct());
|
||||
|
||||
/*******************************************
|
||||
* This is a temp fix for snowflake database https://jira.talendforge.org/browse/TUP-31883
|
||||
*******************************************/
|
||||
if (EDatabaseTypeName.GENERAL_JDBC.equals(name) && temp.toUpperCase().equals("KEY")) {
|
||||
isSqlKeyword = false;
|
||||
}
|
||||
|
||||
boolean isH2 = EDatabaseTypeName.H2 == name;
|
||||
|
||||
// if the database type is IBMDB2/ORACLE and the field name contain lowercase character, should add quotes
|
||||
|
||||
@@ -25,8 +25,10 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarOutputStream;
|
||||
@@ -78,8 +80,6 @@ import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.components.EComponentType;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.Project;
|
||||
@@ -98,10 +98,8 @@ import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.relationship.Relation;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryObject;
|
||||
@@ -114,6 +112,7 @@ import org.talend.core.model.routines.RoutinesUtil;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
@@ -192,15 +191,15 @@ public class ProcessorUtilities {
|
||||
|
||||
private static final Set<ModuleNeeded> retrievedJarsForCurrentBuild = new HashSet<ModuleNeeded>();
|
||||
|
||||
private static final Set<String> esbJobs = new HashSet<String>();
|
||||
private static final Map<String, Integer> esbJobs = new HashMap<String, Integer>();
|
||||
|
||||
private static boolean isDebug = false;
|
||||
|
||||
private static boolean isCIMode = false;
|
||||
|
||||
private static boolean isDynamicJobAndCITest = false;
|
||||
|
||||
private static JobInfo mainJobInfo;
|
||||
|
||||
private static boolean needExportItemsForDQ = false;
|
||||
|
||||
public static void addOpenEditor(IEditorPart editor) {
|
||||
openedEditors.add(editor);
|
||||
@@ -441,6 +440,81 @@ public class ProcessorUtilities {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkProcessLoopDependencies(IProcess mainProcess, String id, String version,
|
||||
LinkedList<String> pathlink, Map<String, String> idToLatestVersion) {
|
||||
if (ItemCacheManager.LATEST_VERSION.contains(version)) {
|
||||
if (idToLatestVersion.get(id) == null) {
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(id);
|
||||
version = processItem.getProperty().getVersion();
|
||||
idToLatestVersion.put(id, version);
|
||||
} else {
|
||||
version = idToLatestVersion.get(id);
|
||||
}
|
||||
}
|
||||
String pathNode = id + "-" + version;
|
||||
if (pathlink.contains(pathNode)) {
|
||||
return true;
|
||||
}
|
||||
pathlink.add(pathNode);
|
||||
|
||||
boolean hasLoop = false;
|
||||
List<? extends INode> processNodes = mainProcess.getProcessNodes();
|
||||
for (INode node : processNodes) {
|
||||
if (!node.isActivate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IElementParameter processIdParam = node.getElementParameter("PROCESS_TYPE_PROCESS");
|
||||
if (processIdParam != null && StringUtils.isNotBlank((String) processIdParam.getValue())) {
|
||||
String jobIds = (String) processIdParam.getValue();
|
||||
String subNodeversion = (String) node.getElementParameter("PROCESS_TYPE_VERSION").getValue();
|
||||
for (String jobId : jobIds.split(ProcessorUtilities.COMMA)) {
|
||||
if (StringUtils.isBlank(jobId)) {
|
||||
continue;
|
||||
}
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(jobId, subNodeversion);
|
||||
if (processItem != null) {
|
||||
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
|
||||
IProcess subProcess = service.getProcessFromProcessItem(processItem);
|
||||
if (subProcess != null) {
|
||||
hasLoop = checkProcessLoopDependencies(subProcess, jobId, subNodeversion, pathlink,
|
||||
idToLatestVersion);
|
||||
}
|
||||
}
|
||||
if (hasLoop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IJobletProviderService.class)) {
|
||||
IJobletProviderService jobletService = GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (jobletService != null) {
|
||||
IProcess jobletProcess = jobletService.getJobletGEFProcessFromNode(node);
|
||||
if (jobletProcess != null) {
|
||||
String jobletId = jobletProcess.getId();
|
||||
IElementParameter projectTecNameParam = jobletProcess.getElementParameter("PROJECT_TECHNICAL_NAME");
|
||||
if (projectTecNameParam != null && StringUtils.isNotBlank((String) projectTecNameParam.getValue())) {
|
||||
jobletId = projectTecNameParam.getValue() + ":" + jobletId;
|
||||
}
|
||||
hasLoop = checkProcessLoopDependencies(jobletProcess, jobletId, jobletProcess.getVersion(), pathlink,
|
||||
idToLatestVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasLoop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasLoop) {
|
||||
pathlink.removeLast();
|
||||
}
|
||||
|
||||
return hasLoop;
|
||||
}
|
||||
|
||||
private static IProcessor generateCode(IProcessor processor2, JobInfo jobInfo, String selectedContextName,
|
||||
boolean statistics, boolean trace, boolean needContext, int option, IProgressMonitor progressMonitor)
|
||||
throws ProcessorException {
|
||||
@@ -540,11 +614,12 @@ public class ProcessorUtilities {
|
||||
jobInfo.setProcessor(processor);
|
||||
|
||||
if (isMainJob && selectedProcessItem != null) {
|
||||
Relation mainRelation = new Relation();
|
||||
mainRelation.setId(jobInfo.getJobId());
|
||||
mainRelation.setVersion(jobInfo.getJobVersion());
|
||||
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
|
||||
if (!IRunProcessService.get().getMavenPrefOptionStatus(MavenConstants.SKIP_LOOP_DEPENDENCY_CHECK)) {
|
||||
Property property = selectedProcessItem.getProperty();
|
||||
String jobId = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel() + ":" + property.getId();
|
||||
hasLoopDependency = checkProcessLoopDependencies(currentProcess, jobId, property.getVersion(),
|
||||
new LinkedList<String>(), new HashMap<String, String>());
|
||||
}
|
||||
// clean the previous code in case it has deleted subjob
|
||||
cleanSourceFolder(progressMonitor, currentProcess, processor);
|
||||
}
|
||||
@@ -626,7 +701,7 @@ public class ProcessorUtilities {
|
||||
|
||||
processor.setArguments(argumentsMap);
|
||||
|
||||
copyDQDroolsToSrc(selectedProcessItem);
|
||||
handelDQComponents(selectedProcessItem, currentProcess);
|
||||
// generate the code of the father after the childrens
|
||||
// so the code won't have any error during the check, and it will help to check
|
||||
// if the generation is really needed.
|
||||
@@ -647,233 +722,6 @@ public class ProcessorUtilities {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public static boolean checkLoopDependencies(Relation mainJobInfo, Map<String, String> idToLastestVersionMap)
|
||||
throws ProcessorException {
|
||||
List<Relation> itemsJobRelatedTo = getItemsRelation(mainJobInfo, idToLastestVersionMap);
|
||||
List<Relation> relationChecked = new ArrayList<>();
|
||||
relationChecked.add(mainJobInfo);
|
||||
return checkLoopDependencies(mainJobInfo, mainJobInfo, itemsJobRelatedTo, relationChecked, idToLastestVersionMap);
|
||||
}
|
||||
|
||||
private static boolean checkLoopDependencies(Relation mainRelation, Relation currentRelation,
|
||||
List<Relation> itemsJobRelatedTo,
|
||||
List<Relation> relationChecked, Map<String, String> idToLastestVersionMap) throws ProcessorException {
|
||||
boolean hasDependency = false;
|
||||
for (Relation relation : itemsJobRelatedTo) {
|
||||
try {
|
||||
// means the tRunjob deactivate, or one of the specific version tRunjon deactivate, skip
|
||||
Map<String, Set<String>> actTrunjobHM = getActivateTRunjobMap(currentRelation.getId(),
|
||||
currentRelation.getVersion());
|
||||
if (actTrunjobHM.get(relation.getId()) == null
|
||||
|| !actTrunjobHM.get(relation.getId()).contains(relation.getVersion())) {
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
|
||||
hasDependency = relation.getId().equals(mainRelation.getId())
|
||||
&& relation.getVersion().equals(mainRelation.getVersion());
|
||||
if (!hasDependency) {
|
||||
List<Relation> itemsChildJob = getItemsRelation(relation, idToLastestVersionMap);
|
||||
if (!relationChecked.contains(relation)) {
|
||||
relationChecked.add(relation);
|
||||
hasDependency = checkLoopDependencies(mainRelation, relation, itemsChildJob, relationChecked,
|
||||
idToLastestVersionMap);
|
||||
}
|
||||
if (!hasDependency) {
|
||||
for (Relation childRelation : itemsChildJob) {
|
||||
|
||||
try {
|
||||
// means the tRunjob deactivate, or one of the specific version tRunjon deactivate, skip
|
||||
Map<String, Set<String>> activateTRunjobMap = getActivateTRunjobMap(relation.getId(),
|
||||
relation.getVersion());
|
||||
if (activateTRunjobMap.get(childRelation.getId()) == null
|
||||
|| !activateTRunjobMap.get(childRelation.getId()).contains(childRelation.getVersion())) {
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
|
||||
hasDependency = checkLoopDependencies(childRelation, idToLastestVersionMap);
|
||||
if (hasDependency) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasDependency) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasDependency;
|
||||
}
|
||||
|
||||
private static Map<String, Set<String>> getActivateTRunjobMap(String id, String version) throws PersistenceException {
|
||||
Map<String, Set<String>> actTrunjobHM = new HashMap<String, Set<String>>();
|
||||
ProcessType processType = null;
|
||||
try {
|
||||
IRepositoryViewObject currentJobObject = ProxyRepositoryFactory.getInstance().getSpecificVersion(id, version, true);
|
||||
if (currentJobObject != null) {
|
||||
Item item = currentJobObject.getProperty().getItem();
|
||||
if (item instanceof ProcessItem) {
|
||||
processType = ((ProcessItem) item).getProcess();
|
||||
} else if (item instanceof JobletProcessItem) {
|
||||
processType = ((JobletProcessItem) item).getJobletProcess();
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
if (processType != null) {
|
||||
List<Project> allProjects = new ArrayList<Project>();
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects());
|
||||
|
||||
List<String> jobletsComponentsList = new ArrayList<String>();
|
||||
IComponentsFactory componentsFactory = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentsService.class)) {
|
||||
IComponentsService compService = GlobalServiceRegister.getDefault()
|
||||
.getService(IComponentsService.class);
|
||||
if (compService != null) {
|
||||
componentsFactory = compService.getComponentsFactory();
|
||||
for (IComponent component : componentsFactory.readComponents()) {
|
||||
if (component.getComponentType() == EComponentType.JOBLET) {
|
||||
jobletsComponentsList.add(component.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String jobletPaletteType = null;
|
||||
String frameWork = processType.getFramework();
|
||||
if (StringUtils.isBlank(frameWork)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_DI.getName();
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARK.getName();
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
|
||||
}
|
||||
|
||||
for (Object nodeObject : processType.getNode()) {
|
||||
NodeType node = (NodeType) nodeObject;
|
||||
// not tRunjob && not joblet then continue
|
||||
if (!node.getComponentName().equals("tRunJob") && !jobletsComponentsList.contains(node.getComponentName())) { // $NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
boolean nodeActivate = true;
|
||||
String processIds = null;
|
||||
String processVersion = null;
|
||||
for (Object elementParam : node.getElementParameter()) {
|
||||
ElementParameterType elemParamType = (ElementParameterType) elementParam;
|
||||
if ("PROCESS:PROCESS_TYPE_PROCESS".equals(elemParamType.getName())) { // $NON-NLS-1$
|
||||
processIds = elemParamType.getValue();
|
||||
if (StringUtils.isNotBlank(processIds)) {
|
||||
for (String jobId : processIds.split(ProcessorUtilities.COMMA)) {
|
||||
if (actTrunjobHM.get(jobId) == null) {
|
||||
actTrunjobHM.put(jobId, new HashSet<String>());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("PROCESS:PROCESS_TYPE_VERSION".equals(elemParamType.getName()) // $NON-NLS-1$
|
||||
|| "PROCESS_TYPE_VERSION".equals(elemParamType.getName())) { // $NON-NLS-1$
|
||||
processVersion = elemParamType.getValue();
|
||||
} else if ("ACTIVATE".equals(elemParamType.getName())) { // $NON-NLS-1$
|
||||
nodeActivate = Boolean.parseBoolean(elemParamType.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
if (nodeActivate) {
|
||||
if (StringUtils.isNotBlank(processIds)) {
|
||||
for (String jobId : processIds.split(ProcessorUtilities.COMMA)) {
|
||||
String actualVersion = processVersion;
|
||||
if (RelationshipItemBuilder.LATEST_VERSION.equals(processVersion)) {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion = null;
|
||||
lastVersion = ProxyRepositoryFactory.getInstance().getLastVersion(project, jobId);
|
||||
if (lastVersion != null) {
|
||||
actualVersion = lastVersion.getVersion();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (actTrunjobHM.get(jobId) != null) {
|
||||
actTrunjobHM.get(jobId).add(actualVersion);
|
||||
}
|
||||
|
||||
}
|
||||
} else if (componentsFactory != null && jobletPaletteType != null) {
|
||||
// for joblet
|
||||
IComponent cc = componentsFactory.get(node.getComponentName(), jobletPaletteType);
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IJobletProviderService.class)) {
|
||||
IJobletProviderService jobletService = GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
Property property = jobletService.getJobletComponentItem(cc);
|
||||
if (property != null && StringUtils.isNotBlank(property.getId())) {
|
||||
String jobletId = property.getId();
|
||||
if (actTrunjobHM.get(jobletId) == null) {
|
||||
actTrunjobHM.put(jobletId, new HashSet<String>());
|
||||
}
|
||||
String actualVersion = processVersion;
|
||||
if (RelationshipItemBuilder.LATEST_VERSION.equals(processVersion)) {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion = null;
|
||||
lastVersion = ProxyRepositoryFactory.getInstance().getLastVersion(project, jobletId);
|
||||
if (lastVersion != null) {
|
||||
actualVersion = lastVersion.getVersion();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actTrunjobHM.get(jobletId).add(actualVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return actTrunjobHM;
|
||||
}
|
||||
|
||||
private static List<Relation> getItemsRelation(Relation mainJobInfo, Map<String, String> idToLastestVersionMap) throws ProcessorException {
|
||||
List<Relation> itemsJobRelatedTo = new ArrayList<Relation>();
|
||||
try {
|
||||
List<Project> allProjects = new ArrayList<Project>();
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects());
|
||||
RelationshipItemBuilder instance = RelationshipItemBuilder.getInstance();
|
||||
if (instance != null) {
|
||||
itemsJobRelatedTo.addAll(instance.getItemsChildRelatedTo(mainJobInfo.getId(), mainJobInfo.getVersion(),
|
||||
mainJobInfo.getType(), RelationshipItemBuilder.JOB_RELATION));
|
||||
itemsJobRelatedTo.addAll(instance.getItemsChildRelatedTo(mainJobInfo.getId(), mainJobInfo.getVersion(),
|
||||
mainJobInfo.getType(), RelationshipItemBuilder.JOBLET_RELATION));
|
||||
for (Relation relation : itemsJobRelatedTo) {
|
||||
if (relation.getVersion().equals(RelationshipItemBuilder.LATEST_VERSION)) {
|
||||
if (idToLastestVersionMap.containsKey(relation.getId())) {
|
||||
relation.setVersion(idToLastestVersionMap.get(relation.getId()));
|
||||
} else {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion =
|
||||
ProxyRepositoryFactory.getInstance().getLastVersion(project, relation.getId());
|
||||
if (lastVersion != null) {
|
||||
relation.setVersion(lastVersion.getVersion());
|
||||
idToLastestVersionMap.put(relation.getId(), relation.getVersion());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
|
||||
return itemsJobRelatedTo;
|
||||
}
|
||||
|
||||
private static void setNeededResources(final Map<String, Object> argumentsMap, JobInfo jobInfo) {
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_NEED_XMLMAPPINGS,
|
||||
@@ -1267,11 +1115,11 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
if (isMainJob && selectedProcessItem != null) {
|
||||
Relation mainRelation = new Relation();
|
||||
mainRelation.setId(jobInfo.getJobId());
|
||||
mainRelation.setVersion(jobInfo.getJobVersion());
|
||||
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
|
||||
if (!IRunProcessService.get().getMavenPrefOptionStatus(MavenConstants.SKIP_LOOP_DEPENDENCY_CHECK)) {
|
||||
Property property = selectedProcessItem.getProperty();
|
||||
hasLoopDependency = checkProcessLoopDependencies(currentProcess, property.getId(), property.getVersion(),
|
||||
new LinkedList<String>(), new HashMap<String, String>());
|
||||
}
|
||||
// clean the previous code in case it has deleted subjob
|
||||
cleanSourceFolder(progressMonitor, currentProcess, processor);
|
||||
}
|
||||
@@ -1317,7 +1165,7 @@ public class ProcessorUtilities {
|
||||
checkMetadataDynamic(currentProcess, jobInfo);
|
||||
|
||||
int options = TalendProcessOptionConstants.MODULES_DEFAULT;
|
||||
if (isCIMode && BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
if (isCIMode() && BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
options |= TalendProcessOptionConstants.MODULES_WITH_CHILDREN;
|
||||
}
|
||||
Set<ModuleNeeded> neededLibraries = new HashSet<>();
|
||||
@@ -1397,7 +1245,7 @@ public class ProcessorUtilities {
|
||||
|
||||
processor.setArguments(argumentsMap);
|
||||
|
||||
copyDQDroolsToSrc(selectedProcessItem);
|
||||
handelDQComponents(selectedProcessItem, currentProcess);
|
||||
|
||||
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor,
|
||||
currentProcess, currentJobName, processor, isMainJob, codeGenerationNeeded);
|
||||
@@ -1534,12 +1382,13 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
|
||||
*
|
||||
*
|
||||
* Specail operation for DQ components:
|
||||
* - For tdqReportRun, set 'needExportItemsForDQ'to true so as the item folder can be exported
|
||||
* - For tRuleSurvivorship, copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
|
||||
* @param processItem
|
||||
*/
|
||||
private static void copyDQDroolsToSrc(ProcessItem processItem) {
|
||||
private static void handelDQComponents(ProcessItem processItem,IProcess currentProcess) {
|
||||
// 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be
|
||||
// used by
|
||||
// maven command 'include-survivorship-rules' to export.
|
||||
@@ -1551,6 +1400,20 @@ public class ProcessorUtilities {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// TDQ-19637 if it includes 'tDqReportRun',must export item folder
|
||||
if (!needExportItemsForDQ) {
|
||||
for (INode node : currentProcess.getGeneratingNodes()) {
|
||||
String componentName = node.getComponent().getName();
|
||||
if ("tDqReportRun".equals(componentName)) {
|
||||
needExportItemsForDQ = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be
|
||||
used by maven command 'include-survivorship-rules' to export.
|
||||
2.TDQ-14308 current drools file in 'src/resourcesmetadata/survivorship/' should be included to job jar.
|
||||
*/
|
||||
ExportFileResource resouece = new ExportFileResource();
|
||||
BuildExportManager.getInstance().exportDependencies(resouece, processItem);
|
||||
if (resouece.getAllResources().isEmpty()) {
|
||||
@@ -1802,13 +1665,16 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isEsbComponentName(componentName)) {
|
||||
addEsbJob(jobInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void recordESBIncludingFlag(JobInfo jobInfo, int esbIncludingOption) {
|
||||
int includeESBFlag = jobInfo.getIncludeESBFlag();
|
||||
includeESBFlag |= esbIncludingOption;
|
||||
jobInfo.setIncludeESBFlag(includeESBFlag);
|
||||
}
|
||||
|
||||
static void setGenerationInfoWithChildrenJob(INode node, JobInfo jobInfo, final JobInfo subJobInfo) {
|
||||
final LastGenerationInfo generationInfo = LastGenerationInfo.getInstance();
|
||||
|
||||
@@ -1917,6 +1783,13 @@ public class ProcessorUtilities {
|
||||
|
||||
static boolean hasLoopDependency = false;
|
||||
|
||||
private static void resetBuildFlagsAndCaches() {
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will generate the code of the process and all of this sub process.
|
||||
*
|
||||
@@ -1931,15 +1804,10 @@ public class ProcessorUtilities {
|
||||
if (monitors == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
JobInfo jobInfo = new JobInfo(processName, contextName, version);
|
||||
IProcessor process = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return process;
|
||||
}
|
||||
|
||||
@@ -1959,14 +1827,9 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(processId, contextName, version);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor process = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return process;
|
||||
}
|
||||
|
||||
@@ -1981,14 +1844,9 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(process, contextName);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2003,15 +1861,10 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(process, contextName, version);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor result =
|
||||
generateCode(jobInfo, contextName, statistics, trace, needContext, GENERATE_ALL_CHILDS, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2035,14 +1888,9 @@ public class ProcessorUtilities {
|
||||
ProcessUtils.isOptionChecked(argumentsMap, TalendProcessArgumentConstant.ARG_NEED_CONTEXT);
|
||||
int option = ProcessUtils.getOptionValue(argumentsMap, TalendProcessArgumentConstant.ARG_GENERATE_OPTION, 0);
|
||||
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, needContext, option, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2060,28 +1908,18 @@ public class ProcessorUtilities {
|
||||
JobInfo jobInfo = new JobInfo(process, contextName, version);
|
||||
jobInfo.setContext(context);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
result = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static IProcessor generateCode(ProcessItem process, String contextName, boolean statistics, boolean trace)
|
||||
throws ProcessorException {
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor returnValue = generateCode(process, contextName, statistics, trace, false);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -2109,29 +1947,19 @@ public class ProcessorUtilities {
|
||||
jobInfo = new JobInfo(process, context);
|
||||
}
|
||||
jobInfo.setApplyContextToChildren(applyToChildren);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, contextProperties,
|
||||
GENERATE_ALL_CHILDS, new NullProgressMonitor());
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return genCode;
|
||||
}
|
||||
|
||||
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
|
||||
boolean properties) throws ProcessorException {
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor returnValue =
|
||||
generateCode(process, context, statistics, trace, properties, new NullProgressMonitor());
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -2159,15 +1987,10 @@ public class ProcessorUtilities {
|
||||
} else {
|
||||
jobInfo = new JobInfo(process, context);
|
||||
}
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties,
|
||||
GENERATE_ALL_CHILDS, progressMonitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return genCode;
|
||||
}
|
||||
|
||||
@@ -2210,15 +2033,10 @@ public class ProcessorUtilities {
|
||||
+ (jobInfo.getJobName() != null ? jobInfo.getJobName() : jobInfo.getJobId());
|
||||
TimeMeasure.begin(timeMeasureGenerateCodesId);
|
||||
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor genCode = generateCode(processor, jobInfo, context.getName(), statistics, trace, properties,
|
||||
GENERATE_ALL_CHILDS, progressMonitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
|
||||
TimeMeasure.end(timeMeasureGenerateCodesId);
|
||||
// if active before, not disable and active still.
|
||||
@@ -2241,15 +2059,10 @@ public class ProcessorUtilities {
|
||||
}
|
||||
// achen modify to fix 0006107
|
||||
JobInfo jobInfo = new JobInfo(process, context);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option,
|
||||
new NullProgressMonitor());
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return genCode;
|
||||
}
|
||||
|
||||
@@ -2264,14 +2077,9 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(process, contextName);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, true, option, monitor);
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
resetBuildFlagsAndCaches();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2613,6 +2421,8 @@ public class ProcessorUtilities {
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
|
||||
}
|
||||
|
||||
boolean hasChildrenIncludeESB = false;
|
||||
for (NodeType node : nodes) {
|
||||
boolean activate = true;
|
||||
// check if node is active at least.
|
||||
@@ -2627,8 +2437,8 @@ public class ProcessorUtilities {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isEsbComponentName(node.getComponentName())) {
|
||||
addEsbJob(parentJobInfo);
|
||||
if (!firstChildOnly && isEsbComponentName(node.getComponentName())) {
|
||||
recordESBIncludingFlag(parentJobInfo, TalendProcessOptionConstants.ISESB_CURRENT_INCLUDE);
|
||||
}
|
||||
|
||||
boolean isCTalendJob = "cTalendJob".equalsIgnoreCase(node.getComponentName());
|
||||
@@ -2657,6 +2467,18 @@ public class ProcessorUtilities {
|
||||
jobInfo.setFatherJobInfo(parentJobInfo);
|
||||
if (!firstChildOnly) {
|
||||
getAllJobInfo(processItem.getProcess(), jobInfo, jobInfos, firstChildOnly, includeJoblet);
|
||||
if (jobInfo.getIncludeESBFlag() >= 2) {
|
||||
hasChildrenIncludeESB = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Optional<JobInfo> infoOptional = jobInfos.stream().filter(info -> info.equals(jobInfo))
|
||||
.findFirst();
|
||||
if (infoOptional.isPresent()) {
|
||||
JobInfo matchJobInfo = infoOptional.get();
|
||||
if (matchJobInfo.getIncludeESBFlag() >= 2) {
|
||||
hasChildrenIncludeESB = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2708,6 +2530,16 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// checked done set the esb including option
|
||||
if (!firstChildOnly) {
|
||||
recordESBIncludingFlag(parentJobInfo, TalendProcessOptionConstants.ISESB_CHECKED);
|
||||
if (hasChildrenIncludeESB) {
|
||||
recordESBIncludingFlag(parentJobInfo, TalendProcessOptionConstants.ISESB_CHILDREN_INCLUDE);
|
||||
}
|
||||
esbJobs.put(esbJobKey(parentJobInfo.getJobId(), parentJobInfo.getJobVersion()), parentJobInfo.getIncludeESBFlag());
|
||||
}
|
||||
|
||||
return jobInfos;
|
||||
}
|
||||
|
||||
@@ -2924,9 +2756,21 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static boolean isEsbJob(IProcess process, boolean checkCurrentProcess) {
|
||||
// get includeESBFlag from cache
|
||||
if (process instanceof IProcess2) {
|
||||
Property property = ((IProcess2) process).getProperty();
|
||||
String esbJobKey = esbJobKey(property.getId(), property.getVersion());
|
||||
if (esbJobs.get(esbJobKey) != null) {
|
||||
Integer esbOptions = esbJobs.get(esbJobKey);
|
||||
if (BitwiseOptionUtils.containOption(esbOptions, TalendProcessOptionConstants.ISESB_CHECKED)) {
|
||||
return checkCurrentProcess
|
||||
? BitwiseOptionUtils.containOption(esbOptions, TalendProcessOptionConstants.ISESB_CURRENT_INCLUDE)
|
||||
: esbOptions > 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (process instanceof IProcess2) {
|
||||
|
||||
if (checkCurrentProcess) {
|
||||
for (INode n : process.getGraphicalNodes()) {
|
||||
if (isEsbComponentName(n.getComponent().getName())) {
|
||||
@@ -2952,17 +2796,6 @@ public class ProcessorUtilities {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void addEsbJob(JobInfo jobInfo) {
|
||||
if (esbJobs.contains(esbJobKey(jobInfo.getJobId(), jobInfo.getJobVersion()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
esbJobs.add(esbJobKey(jobInfo.getJobId(), jobInfo.getJobVersion()));
|
||||
if (jobInfo.getFatherJobInfo() != null) {
|
||||
addEsbJob(jobInfo.getFatherJobInfo());
|
||||
}
|
||||
}
|
||||
|
||||
private static String esbJobKey(String processId, String version) {
|
||||
return processId + "_" + version;
|
||||
}
|
||||
@@ -3044,13 +2877,11 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static boolean isCIMode() {
|
||||
return isCIMode;
|
||||
// if it's CI mode , then the system property of maven.local.repository will store the value of studio
|
||||
// m2 path,otherwise it's null
|
||||
return System.getProperty("maven.local.repository") != null;
|
||||
}
|
||||
|
||||
public static void setCIMode(boolean isCIMode) {
|
||||
ProcessorUtilities.isCIMode = isCIMode;
|
||||
}
|
||||
|
||||
public static boolean hasRoutelet(ProcessItem prItem, String routelet) {
|
||||
EList<NodeType> nodeList = prItem.getProcess().getNode();
|
||||
|
||||
@@ -3106,4 +2937,8 @@ public class ProcessorUtilities {
|
||||
public static boolean isDynamicJobAndCITest() {
|
||||
return isDynamicJobAndCITest;
|
||||
}
|
||||
|
||||
public static boolean isNeedExportItemsForDQ() {
|
||||
return needExportItemsForDQ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
<classpathentry exported="true" kind="lib" path="lib/maven-model-builder-3.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/maven-repository-metadata-3.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/plexus-interpolation-1.19.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/plexus-utils-3.0.17.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
|
||||
@@ -16,7 +16,6 @@ Bundle-ClassPath: .,
|
||||
lib/maven-model-builder-3.2.1.jar,
|
||||
lib/maven-repository-metadata-3.2.1.jar,
|
||||
lib/plexus-interpolation-1.19.jar,
|
||||
lib/plexus-utils-3.0.17.jar,
|
||||
lib/commons-codec.jar,
|
||||
lib/httpclient.jar,
|
||||
lib/httpcore.jar,
|
||||
|
||||
Binary file not shown.
@@ -54,6 +54,17 @@
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-http</artifactId>
|
||||
<version>${wagon.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
|
||||
@@ -40,6 +40,12 @@
|
||||
<version>${project.version}</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-log4j-dependencies-tos</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-build</artifactId>
|
||||
|
||||
@@ -14,6 +14,31 @@
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -19,8 +19,33 @@
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
@@ -46,6 +71,37 @@
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<!-- Dependency versions -->
|
||||
<features-maven-plugin.version>2.2.9</features-maven-plugin.version>
|
||||
<maven-install-plugin.version>2.5.1</maven-install-plugin.version>
|
||||
<plexus-utils.version>2.1</plexus-utils.version>
|
||||
<plexus-utils.version>3.0.24</plexus-utils.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
@@ -21,6 +21,23 @@
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>2.5.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>3.0.24</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -10,10 +10,40 @@
|
||||
<artifactId>talend-compiler-plugin-tos</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-compiler-jdt</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -23,21 +23,66 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -48,6 +93,18 @@
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -60,6 +117,16 @@
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-log4j-dependencies-tos</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<dependencies>
|
||||
<!--add log4j dependency https://jira.talendforge.org/browse/TUP-31403 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<version>2.12.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.12.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.12.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-1.2-api</artifactId>
|
||||
<version>2.12.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeScope>runtime</includeScope>
|
||||
<outputDirectory>${basedir}/../tmp/repository</outputDirectory>
|
||||
<useRepositoryLayout>true</useRepositoryLayout>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user