Compare commits
1 Commits
bugfix/mas
...
vdrokov_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f17d4a3ea9 |
@@ -62,7 +62,6 @@
|
||||
<plugin id="org.talend.metadata.managment.ui" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.metadata.managment.ui.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.migrationTool" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.migrationTool.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.model" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.model.edit" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.model.edit.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
|
||||
@@ -57,4 +57,11 @@
|
||||
version="0.0.0"
|
||||
unpack="true"/>
|
||||
|
||||
<plugin
|
||||
id="org.talend.libraries.apache.lucene4"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="true"/>
|
||||
|
||||
</feature>
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
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,8 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.runtime.service;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
*/
|
||||
@@ -21,10 +19,6 @@ public interface P2InstallComponent {
|
||||
|
||||
boolean install();
|
||||
|
||||
default boolean install(IProgressMonitor monitor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean needRelaunch();
|
||||
|
||||
String getInstalledMessages();
|
||||
|
||||
@@ -16,6 +16,7 @@ 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;
|
||||
|
||||
@@ -108,11 +109,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;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
String creator = rs.getString("CREATOR"); //$NON-NLS-1$
|
||||
@@ -330,20 +331,18 @@ 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=? AND TBCREATOR = ? ORDER BY TBCREATOR, TBNAME, COLNO"; //$NON-NLS-1$
|
||||
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$
|
||||
|
||||
// for test
|
||||
// String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where NAME='NAME'";
|
||||
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, tableNamePattern);
|
||||
stmt.setString(2, schemaPattern);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
|
||||
// For real db2 for zos, should use these code.
|
||||
|
||||
@@ -25,6 +25,7 @@ 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"
|
||||
@@ -35,7 +36,6 @@ public class JtdsDatabaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
}
|
||||
|
||||
sql += " ORDER BY TABLE_SCHEM";
|
||||
java.sql.PreparedStatement statement = connection.prepareStatement(sql);
|
||||
return statement.executeQuery();
|
||||
return statement.executeQuery(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;
|
||||
|
||||
@@ -152,19 +152,15 @@ 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 ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE ? )"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " AND (OBJECT_NAME LIKE '" + tableNamePattern + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE '" + tableNamePattern + "')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
ResultSet rscv = null;
|
||||
PreparedStatement stmtcv = null;
|
||||
Statement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
try {
|
||||
stmtcv = connection.prepareStatement(sqlcv);
|
||||
if (tableNamePattern != null && !tableNamePattern.equals("%")) {
|
||||
stmtcv.setString(1, tableNamePattern);
|
||||
stmtcv.setString(2, tableNamePattern);
|
||||
}
|
||||
rscv = stmtcv.executeQuery();
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
while (rscv.next()) {
|
||||
String objectName = rscv.getString("OBJECT_NAME"); //$NON-NLS-1$
|
||||
if (objectName != null) {
|
||||
@@ -307,11 +303,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;
|
||||
PreparedStatement stmtcv = null;
|
||||
Statement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
try {
|
||||
stmtcv = connection.prepareStatement(sqlcv);
|
||||
rscv = stmtcv.executeQuery();
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
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;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
String creator = rs.getString("LIBNAME"); //$NON-NLS-1$
|
||||
@@ -147,21 +147,17 @@ 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 = ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sql = "SELECT * FROM SASHELP.VTABLE where LIBNAME = '" + schema + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
} else {
|
||||
sql = "SELECT * FROM SASHELP.VTABLE"; //$NON-NLS-1$
|
||||
}
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
if (schema != null) {
|
||||
stmt.setString(1, schema);
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("MEMNAME"); //$NON-NLS-1$
|
||||
@@ -233,20 +229,18 @@ 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=? AND LIBNAME = ? ORDER BY LIBNAME, MEMNAME, VARNUM"; //$NON-NLS-1$
|
||||
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$
|
||||
|
||||
// for test
|
||||
// String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where NAME='NAME'";
|
||||
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, tableNamePattern);
|
||||
stmt.setString(2, schemaPattern);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
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,12 +52,10 @@ public class Sybase16SADatabaseMetaData extends SybaseDatabaseMetaData {
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, login);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
@@ -115,7 +113,8 @@ 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 = ? )";
|
||||
+ ".dbo.sysusers where suid in (select suid from "+catalogName+".dbo.syslogins where name = '" + loginName
|
||||
+ "')";
|
||||
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,13 +54,10 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, login);
|
||||
stmt.setString(2, login);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
@@ -95,11 +92,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;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("name"); //$NON-NLS-1$
|
||||
@@ -139,9 +136,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 = ?"
|
||||
+ ") 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$
|
||||
+ ".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$
|
||||
}
|
||||
|
||||
@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,12 +97,13 @@ 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;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
String columnName = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.INDICESV WHERE UPPER(databasename) = UPPER(?) AND UPPER(tablename) = UPPER(?) AND UPPER(UniqueFlag) = UPPER('Y')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
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$
|
||||
rs = getResultSet(catalog, schema, table, sql);
|
||||
while (rs.next()) {
|
||||
columnName = rs.getString("ColumnName").trim(); //$NON-NLS-1$
|
||||
@@ -111,11 +112,8 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
list.add(r);
|
||||
}
|
||||
} else {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, schema);
|
||||
stmt.setString(2, table);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
|
||||
String pk = rs.getString("Primary?");//$NON-NLS-1$
|
||||
@@ -140,10 +138,10 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
|
||||
public ResultSet getResultSet(String catalog, String schema, String table, String sql) throws SQLException {
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -205,15 +203,17 @@ 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(?) AND tablekind " + addTypesToSql(types); //$NON-NLS-1$
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
|
||||
+ "') 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(?) AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
|
||||
+ "') AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// add the filter for table/views
|
||||
if (!StringUtils.isEmpty(tableNamePattern)) {
|
||||
sql = sql + " AND tablename LIKE ?";//$NON-NLS-1$ //$NON-NLS-2$
|
||||
sql = sql + " AND tablename LIKE '" + tableNamePattern + "'";//$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
|
||||
if (types != null && types.length > 0) {
|
||||
@@ -223,18 +223,11 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
}
|
||||
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
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();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("TableName").trim(); //$NON-NLS-1$
|
||||
@@ -333,33 +326,21 @@ 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(?) AND UPPER(tablename) = UPPER(?)" //$NON-NLS-1$
|
||||
+ " Order by tablename "; //$NON-NLS-1$ //$NON-NLS-3$
|
||||
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$
|
||||
}
|
||||
} else {
|
||||
sql = "HELP COLUMN \"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER(?)" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$
|
||||
// //$NON-NLS-3$
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
}
|
||||
}
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
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();
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
String tableName = tableNamePattern;
|
||||
String columnName = null;
|
||||
|
||||
@@ -12,14 +12,11 @@
|
||||
// ============================================================================
|
||||
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;
|
||||
@@ -626,7 +623,8 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
stream.close();
|
||||
|
||||
byte[] currentContent = item.getContent().getInnerContent();
|
||||
if (!isSameStringContent(innerContent, currentContent)) {
|
||||
|
||||
if (!Arrays.equals(innerContent, currentContent)) {
|
||||
item.getContent().setInnerContent(innerContent);
|
||||
Project project = getRepositoryContext().getProject();
|
||||
save(project, item);
|
||||
@@ -643,44 +641,6 @@ 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) {
|
||||
@@ -733,7 +693,8 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
stream.close();
|
||||
|
||||
byte[] currentContent = item.getContent().getInnerContent();
|
||||
if (!isSameStringContent(innerContent, currentContent)) {
|
||||
|
||||
if (!Arrays.equals(innerContent, currentContent)) {
|
||||
item.getContent().setInnerContent(innerContent);
|
||||
Project project = getRepositoryContext().getProject();
|
||||
save(project, item);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<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/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"/>
|
||||
|
||||
@@ -130,7 +130,5 @@ 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/delight-rhino-sandbox-0.0.15.jar,
|
||||
lib/rhino-1.7.13.jar
|
||||
lib/json_simple-1.1.jar
|
||||
Eclipse-RegisterBuddy: org.talend.testutils
|
||||
|
||||
@@ -12,9 +12,7 @@ bin.includes = META-INF/,\
|
||||
lib/,\
|
||||
talend_metadata_columns_schema.xsd,\
|
||||
talend_targetschema_columns_schema.xsd,\
|
||||
dist/,\
|
||||
lib/delight-rhino-sandbox-0.0.15.jar,\
|
||||
lib/rhino-1.7.13.jar
|
||||
dist/
|
||||
src.includes = META-INF/,\
|
||||
mappingMetadataTypes.xml,\
|
||||
mappings/,\
|
||||
|
||||
@@ -9,61 +9,19 @@
|
||||
</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-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>
|
||||
<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>
|
||||
|
||||
@@ -84,11 +84,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
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", //$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.2.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "log4j-1.2.17.jar",
|
||||
"accessors-smart-1.1.jar", "asm-5.0.3.jar" })),
|
||||
"Microsoft", "MSSQL_PROP", "mssql-jdbc.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
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$
|
||||
|
||||
@@ -26,6 +26,11 @@ public enum ECustomVersionGroup {
|
||||
|
||||
MAPRDB,
|
||||
|
||||
PIG,
|
||||
|
||||
PIG_HBASE,
|
||||
PIG_HCATALOG,
|
||||
|
||||
MAP_REDUCE,
|
||||
|
||||
SPARK,
|
||||
|
||||
@@ -18,6 +18,12 @@ 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 = GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
hadoopService = (IHadoopService) GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
}
|
||||
|
||||
return hadoopService != null;
|
||||
@@ -503,7 +503,11 @@ 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("tMRConfiguration", ComponentCategory.CATEGORY_4_MAPREDUCE.getName());//$NON-NLS-1$
|
||||
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$
|
||||
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 = GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
hadoopService = (IHadoopService) GlobalServiceRegister.getDefault().getService(IHadoopService.class);
|
||||
}
|
||||
if (hadoopService != null) {
|
||||
for (ECustomVersionGroup group : existVersionSelectionMap.keySet()) {
|
||||
@@ -437,7 +437,10 @@ public class HadoopVersionDialog extends TitleAreaDialog {
|
||||
for (ECustomVersionType type : types) {
|
||||
if (type.getGroup() == group) {
|
||||
Set<String> hadoopLibraries = new HashSet<String>();
|
||||
if (ECustomVersionType.MAP_REDUCE == type) {
|
||||
if (ECustomVersionType.PIG == type || ECustomVersionType.PIG_HBASE == type
|
||||
|| ECustomVersionType.PIG_HCATALOG == type) {
|
||||
hadoopLibraries = getLibrariesForPig(type);
|
||||
} else if (ECustomVersionType.MAP_REDUCE == type) {
|
||||
hadoopLibraries = getLibrariesForMapReduce(type);
|
||||
} else if (ECustomVersionType.SPARK == type || ECustomVersionType.SPARK_STREAMING == type) {
|
||||
hadoopLibraries = getLibrariesForSpark(type);
|
||||
@@ -539,6 +542,42 @@ 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;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,4 @@ 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$
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ 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;
|
||||
@@ -441,13 +443,6 @@ 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;
|
||||
}
|
||||
@@ -1537,6 +1532,22 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,4 @@ 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";
|
||||
}
|
||||
|
||||
@@ -21,13 +21,14 @@ 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;
|
||||
@@ -35,7 +36,6 @@ 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.Platform;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
@@ -55,9 +55,6 @@ 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,12 +81,6 @@ 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.
|
||||
*/
|
||||
@@ -212,37 +203,10 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
private static ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
|
||||
|
||||
public static ScriptEngine getScriptEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
public static String convertContext2Literal4AnyVar(final String code, final IContext context) {
|
||||
@@ -256,22 +220,23 @@ public final class ContextParameterUtils {
|
||||
|
||||
Object result = code;
|
||||
|
||||
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) {
|
||||
engine = new ScriptEngineManager().getEngineByName("JavaScript");
|
||||
}
|
||||
|
||||
String newCode = preProcessScript(code);
|
||||
if (engine == null) {
|
||||
throw new RuntimeException("can't find the script engine");
|
||||
}
|
||||
|
||||
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 = SANDBOX.eval(null,
|
||||
newCode.replace("\r\n", replacement).replace("\n", replacement).replace("\r", replacement));
|
||||
result = engine.eval(code.replace("\r\n", replacement).replace("\n", replacement).replace("\r", replacement));
|
||||
} catch (Exception e) {
|
||||
// ignore the exception
|
||||
}
|
||||
@@ -649,12 +614,7 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
|
||||
private static boolean isAllowSpecificCharacters() {
|
||||
if (Platform.isRunning()) {
|
||||
return CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
} else {
|
||||
// Can not get the value if current code is not working in studio
|
||||
return false;
|
||||
}
|
||||
return CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
}
|
||||
|
||||
public static boolean isEmptyParameter(String source) {
|
||||
|
||||
@@ -27,6 +27,9 @@ 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;
|
||||
@@ -1083,7 +1086,14 @@ public class NodeUtil {
|
||||
}
|
||||
|
||||
private static boolean isValidLiteralValue(String value) {
|
||||
return ContextParameterUtils.isValidLiteralValue(value);
|
||||
ScriptEngine se = ContextParameterUtils.getScriptEngine();
|
||||
if(se==null) return true;
|
||||
try {
|
||||
se.eval(value);
|
||||
return true;
|
||||
} catch (ScriptException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static String checkStringQuotationMarks(String str) {
|
||||
|
||||
@@ -48,8 +48,6 @@ 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";
|
||||
|
||||
/*
|
||||
|
||||
@@ -150,8 +150,6 @@ public interface IGenericWizardService extends IService {
|
||||
*/
|
||||
public ITreeContextualAction getDefaultAction(RepositoryNode node);
|
||||
|
||||
public ITreeContextualAction getGenericAction(String typeName, String location);
|
||||
|
||||
public void loadAdditionalJDBC();
|
||||
|
||||
public List<String> getAllAdditionalJDBCTypes();
|
||||
|
||||
@@ -258,8 +258,6 @@ 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);
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
id="org.talend.core.ui.token.AdditionalPackageTokenCollector"
|
||||
name="addtional package">
|
||||
</provider>
|
||||
<provider
|
||||
collector="org.talend.core.ui.token.AMCUsageTokenCollector"
|
||||
id="AMCUsageTokenCollector">
|
||||
</provider>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
|
||||
@@ -16,9 +16,7 @@ import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.properties.Item;
|
||||
|
||||
@@ -30,22 +28,4 @@ public interface IOpenJobScriptActionService extends IService {
|
||||
public Action getOpenJobScriptAction(IWorkbenchWindow window);
|
||||
|
||||
public IFile createWorkspaceLink(IProject fsProject, Item item) throws CoreException;
|
||||
|
||||
/**
|
||||
* If it's a jobscript editor, set readonly parameter
|
||||
*
|
||||
* @param editorPart
|
||||
* @param readonly
|
||||
* @return true: set readonly parameter successfully
|
||||
*/
|
||||
public boolean setEditorReadonly(IEditorPart editorPart, boolean readonly);
|
||||
|
||||
public static IOpenJobScriptActionService get() {
|
||||
GlobalServiceRegister gsr = GlobalServiceRegister.getDefault();
|
||||
if (gsr.isServiceRegistered(IOpenJobScriptActionService.class)) {
|
||||
return gsr.getService(IOpenJobScriptActionService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.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;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,6 @@ 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;
|
||||
@@ -457,14 +456,9 @@ public class ProcessorUtilities {
|
||||
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);
|
||||
}
|
||||
}
|
||||
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
|
||||
IProcess subProcess = service.getProcessFromProcessItem(processItem);
|
||||
hasLoop = checkProcessLoopDependencies(subProcess, jobId, subNodeversion, pathlink, idToLatestVersion);
|
||||
if (hasLoop) {
|
||||
break;
|
||||
}
|
||||
@@ -598,12 +592,10 @@ public class ProcessorUtilities {
|
||||
jobInfo.setProcessor(processor);
|
||||
|
||||
if (isMainJob && selectedProcessItem != null) {
|
||||
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>());
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -1054,11 +1046,9 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
if (isMainJob && selectedProcessItem != null) {
|
||||
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>());
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<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,6 +16,7 @@ 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.
@@ -99,22 +99,6 @@
|
||||
<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>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -62,11 +62,6 @@
|
||||
<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.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
<artifactId>tycho-compiler-jdt</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.23.0-SNAPSHOT</tacokit.components.version>
|
||||
<tacokit.components.version>1.22.0-SNAPSHOT</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.33.1</tcomp.version>
|
||||
<slf4j.version>1.7.28</slf4j.version>
|
||||
<tcomp.version>1.32.0</tcomp.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -15,19 +15,6 @@
|
||||
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.talend.daikon</groupId>
|
||||
<artifactId>crypto-utils</artifactId>
|
||||
<version>${org.talend.daikon.crypto-utils.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson</groupId>
|
||||
<artifactId>jackson-bom</artifactId>
|
||||
<version>2.10.1</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -55,20 +42,6 @@
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<addParentPoms>true</addParentPoms>
|
||||
<copyPom>true</copyPom>
|
||||
<includeScope>compile</includeScope>
|
||||
<outputDirectory>${basedir}/../tmp/repository</outputDirectory>
|
||||
<useRepositoryLayout>true</useRepositoryLayout>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -15,5 +15,4 @@ MavenProjectSettingPage.filterExampleMessage=Filter examples:\nlabel=myJob
|
||||
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
|
||||
MavenProjectSettingPage.excludeDeletedItems=Exclude deleted items
|
||||
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize poms button to apply the new settings.
|
||||
MavenProjectSettingPage.skipFolders=Skip folders
|
||||
BuildProjectSettingPage.allowRecursiveJobs=Allow recursive jobs (Not supported - for compatibility only)
|
||||
MavenProjectSettingPage.skipFolders=Skip folders
|
||||
@@ -12,50 +12,15 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.maven.ui.setting.project.page;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.projectsetting.EmptyProjectSettingPage;
|
||||
import org.talend.designer.maven.DesignerMavenPlugin;
|
||||
import org.talend.designer.maven.ui.i18n.Messages;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
*/
|
||||
public class BuildProjectSettingPage extends EmptyProjectSettingPage {
|
||||
|
||||
private IPreferenceStore preferenceStore;
|
||||
|
||||
private Button allowRecursiveJobsCheckbox;
|
||||
|
||||
public BuildProjectSettingPage() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPreferenceName() {
|
||||
return DesignerMavenPlugin.PLUGIN_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
Composite parent = getFieldEditorParent();
|
||||
parent.setLayout(new GridLayout());
|
||||
preferenceStore = getPreferenceStore();
|
||||
allowRecursiveJobsCheckbox = new Button(parent, SWT.CHECK);
|
||||
allowRecursiveJobsCheckbox.setText(Messages.getString("BuildProjectSettingPage.allowRecursiveJobs")); //$NON-NLS-1$
|
||||
allowRecursiveJobsCheckbox.setSelection(!preferenceStore.getBoolean(MavenConstants.SKIP_LOOP_DEPENDENCY_CHECK));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performOk() {
|
||||
boolean performOk = super.performOk();
|
||||
if (preferenceStore != null) {
|
||||
preferenceStore.setValue(MavenConstants.SKIP_LOOP_DEPENDENCY_CHECK, !allowRecursiveJobsCheckbox.getSelection());
|
||||
}
|
||||
return performOk;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,11 +46,6 @@
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -68,11 +63,6 @@
|
||||
<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>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -127,11 +117,6 @@
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -30,7 +30,6 @@ import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.runtime.projectsetting.IProjectSettingTemplateConstants;
|
||||
import org.talend.designer.maven.template.MavenTemplateManager;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
@@ -117,13 +116,7 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
|
||||
} else {
|
||||
isDeployed = true;
|
||||
}
|
||||
boolean isCIMode = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService runProcessService = GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
isCIMode = runProcessService.isCIMode();
|
||||
}
|
||||
if (isCIMode || ignoreModuleInstallationStatus() || isDeployed) {
|
||||
if (ignoreModuleInstallationStatus() || isDeployed) {
|
||||
dependency = PomUtil.createModuleDependency(module.getMavenUri());
|
||||
if (module.isExcluded())
|
||||
dependency.setScope("provided");
|
||||
|
||||
@@ -315,12 +315,6 @@ public class PomIdsHelper {
|
||||
return manager.getBoolean(MavenConstants.EXCLUDE_DELETED_ITEMS);
|
||||
}
|
||||
|
||||
public static boolean getMavenPrefOptionStatus(String prefName) {
|
||||
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
ProjectPreferenceManager manager = getPreferenceManager(projectTechName);
|
||||
return manager.getBoolean(prefName);
|
||||
}
|
||||
|
||||
private static String getGroupId(String projectTechName, String baseName, Property property) {
|
||||
if (projectTechName == null) {
|
||||
projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
@@ -399,7 +393,6 @@ public class PomIdsHelper {
|
||||
if (PluginChecker.isTIS()) {
|
||||
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, true);
|
||||
}
|
||||
preferenceStore.setValue(MavenConstants.SKIP_LOOP_DEPENDENCY_CHECK, true);
|
||||
}
|
||||
preferenceManager.save();
|
||||
preferenceManagers.put(projectTechName, preferenceManager);
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/axis2-metadata-1.7.9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/axis2-java2wsdl-1.7.9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/axis2-codegen-1.7.9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/woden-api-1.0M9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/axiom-api-1.2.13.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/axiom-impl-1.2.13.jar"/>
|
||||
@@ -14,7 +11,7 @@
|
||||
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/neethi-3.0.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/wstx-asl-3.2.9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.0.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="class"/>
|
||||
|
||||
@@ -22,11 +22,8 @@ Bundle-ClassPath: lib/activation-1.1.jar,
|
||||
lib/mail-1.4.jar,
|
||||
lib/neethi-3.0.1.jar,
|
||||
lib/wstx-asl-3.2.9.jar,
|
||||
lib/xmlschema-core-2.2.1.jar,
|
||||
lib/xmlschema-core-2.0.1.jar,
|
||||
lib/woden-api-1.0M9.jar,
|
||||
lib/axis2-codegen-1.7.9.jar,
|
||||
lib/axis2-java2wsdl-1.7.9.jar,
|
||||
lib/axis2-metadata-1.7.9.jar,
|
||||
.
|
||||
Export-Package: com.ctc.wstx.api,
|
||||
com.ctc.wstx.cfg,
|
||||
@@ -132,7 +129,6 @@ Export-Package: com.ctc.wstx.api,
|
||||
org.apache.axis2.i18n,
|
||||
org.apache.axis2.java.security,
|
||||
org.apache.axis2.jaxrs,
|
||||
org.apache.axis2.jaxws.description,
|
||||
org.apache.axis2.jsr181,
|
||||
org.apache.axis2.modules,
|
||||
org.apache.axis2.namespace,
|
||||
@@ -174,8 +170,6 @@ Export-Package: com.ctc.wstx.api,
|
||||
org.apache.ws.commons.schema.internal,
|
||||
org.apache.ws.commons.schema.resolver,
|
||||
org.apache.ws.commons.schema.utils,
|
||||
org.apache.ws.java2wsdl,
|
||||
org.apache.ws.java2wsdl.utils,
|
||||
org.codehaus.stax2,
|
||||
org.codehaus.stax2.evt,
|
||||
org.codehaus.stax2.io,
|
||||
|
||||
@@ -46,31 +46,6 @@
|
||||
<artifactId>axis2-transport-local</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.axis2</groupId>
|
||||
<artifactId>axis2-codegen</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.axis2</groupId>
|
||||
<artifactId>axis2-metadata</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.axis2</groupId>
|
||||
<artifactId>axis2-java2wsdl</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.axis2</groupId>
|
||||
<artifactId>axis2-adb-codegen</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.ws.xmlschema</groupId>
|
||||
<artifactId>xmlschema-core</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
19
main/plugins/org.talend.libraries.apache.lucene4/.classpath
Normal file
19
main/plugins/org.talend.libraries.apache.lucene4/.classpath
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-analyzers-common-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-core-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-expressions-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-grouping-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-highlighter-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-join-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-memory-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-misc-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-queries-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-queryparser-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-sandbox-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-spatial-4.10.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/lucene-suggest-4.10.4.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
28
main/plugins/org.talend.libraries.apache.lucene4/.project
Normal file
28
main/plugins/org.talend.libraries.apache.lucene4/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.talend.libraries.apache.lucene4</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,171 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Apache Lucene4 Library
|
||||
Bundle-SymbolicName: org.talend.libraries.apache.lucene4
|
||||
Bundle-Version: 7.4.1.qualifier
|
||||
Export-Package: org.apache.lucene;version="4.10.4",
|
||||
org.apache.lucene.analysis;version="4.10.4",
|
||||
org.apache.lucene.analysis.ar;version="4.10.4",
|
||||
org.apache.lucene.analysis.bg;version="4.10.4",
|
||||
org.apache.lucene.analysis.br;version="4.10.4",
|
||||
org.apache.lucene.analysis.ca;version="4.10.4",
|
||||
org.apache.lucene.analysis.charfilter;version="4.10.4",
|
||||
org.apache.lucene.analysis.cjk;version="4.10.4",
|
||||
org.apache.lucene.analysis.ckb;version="4.10.4",
|
||||
org.apache.lucene.analysis.cn;version="4.10.4",
|
||||
org.apache.lucene.analysis.commongrams;version="4.10.4",
|
||||
org.apache.lucene.analysis.compound;version="4.10.4",
|
||||
org.apache.lucene.analysis.compound.hyphenation;version="4.10.4",
|
||||
org.apache.lucene.analysis.core;version="4.10.4",
|
||||
org.apache.lucene.analysis.cz;version="4.10.4",
|
||||
org.apache.lucene.analysis.da;version="4.10.4",
|
||||
org.apache.lucene.analysis.de;version="4.10.4",
|
||||
org.apache.lucene.analysis.el;version="4.10.4",
|
||||
org.apache.lucene.analysis.en;version="4.10.4",
|
||||
org.apache.lucene.analysis.es;version="4.10.4",
|
||||
org.apache.lucene.analysis.eu;version="4.10.4",
|
||||
org.apache.lucene.analysis.fa;version="4.10.4",
|
||||
org.apache.lucene.analysis.fi;version="4.10.4",
|
||||
org.apache.lucene.analysis.fr;version="4.10.4",
|
||||
org.apache.lucene.analysis.ga;version="4.10.4",
|
||||
org.apache.lucene.analysis.gl;version="4.10.4",
|
||||
org.apache.lucene.analysis.hi;version="4.10.4",
|
||||
org.apache.lucene.analysis.hu;version="4.10.4",
|
||||
org.apache.lucene.analysis.hunspell;version="4.10.4",
|
||||
org.apache.lucene.analysis.hy;version="4.10.4",
|
||||
org.apache.lucene.analysis.id;version="4.10.4",
|
||||
org.apache.lucene.analysis.in;version="4.10.4",
|
||||
org.apache.lucene.analysis.it;version="4.10.4",
|
||||
org.apache.lucene.analysis.lv;version="4.10.4",
|
||||
org.apache.lucene.analysis.miscellaneous;version="4.10.4",
|
||||
org.apache.lucene.analysis.ngram;version="4.10.4",
|
||||
org.apache.lucene.analysis.nl;version="4.10.4",
|
||||
org.apache.lucene.analysis.no;version="4.10.4",
|
||||
org.apache.lucene.analysis.path;version="4.10.4",
|
||||
org.apache.lucene.analysis.pattern;version="4.10.4",
|
||||
org.apache.lucene.analysis.payloads;version="4.10.4",
|
||||
org.apache.lucene.analysis.position;version="4.10.4",
|
||||
org.apache.lucene.analysis.pt;version="4.10.4",
|
||||
org.apache.lucene.analysis.query;version="4.10.4",
|
||||
org.apache.lucene.analysis.reverse;version="4.10.4",
|
||||
org.apache.lucene.analysis.ro;version="4.10.4",
|
||||
org.apache.lucene.analysis.ru;version="4.10.4",
|
||||
org.apache.lucene.analysis.shingle;version="4.10.4",
|
||||
org.apache.lucene.analysis.sinks;version="4.10.4",
|
||||
org.apache.lucene.analysis.snowball;version="4.10.4",
|
||||
org.apache.lucene.analysis.standard;version="4.10.4",
|
||||
org.apache.lucene.analysis.standard.std31;version="4.10.4",
|
||||
org.apache.lucene.analysis.standard.std34;version="4.10.4",
|
||||
org.apache.lucene.analysis.standard.std36;version="4.10.4",
|
||||
org.apache.lucene.analysis.standard.std40;version="4.10.4",
|
||||
org.apache.lucene.analysis.sv;version="4.10.4",
|
||||
org.apache.lucene.analysis.synonym;version="4.10.4",
|
||||
org.apache.lucene.analysis.th;version="4.10.4",
|
||||
org.apache.lucene.analysis.tokenattributes;version="4.10.4",
|
||||
org.apache.lucene.analysis.tr;version="4.10.4",
|
||||
org.apache.lucene.analysis.util;version="4.10.4",
|
||||
org.apache.lucene.analysis.wikipedia;version="4.10.4",
|
||||
org.apache.lucene.codecs;version="4.10.4",
|
||||
org.apache.lucene.codecs.blocktree;version="4.10.4",
|
||||
org.apache.lucene.codecs.compressing;version="4.10.4",
|
||||
org.apache.lucene.codecs.idversion;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene3x;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene40;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene41;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene410;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene42;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene45;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene46;version="4.10.4",
|
||||
org.apache.lucene.codecs.lucene49;version="4.10.4",
|
||||
org.apache.lucene.codecs.perfield;version="4.10.4",
|
||||
org.apache.lucene.collation;version="4.10.4",
|
||||
org.apache.lucene.collation.tokenattributes;version="4.10.4",
|
||||
org.apache.lucene.document;version="4.10.4",
|
||||
org.apache.lucene.expressions;version="4.10.4",
|
||||
org.apache.lucene.expressions.js;version="4.10.4",
|
||||
org.apache.lucene.index;version="4.10.4",
|
||||
org.apache.lucene.index.memory;version="4.10.4",
|
||||
org.apache.lucene.index.sorter;version="4.10.4",
|
||||
org.apache.lucene.misc;version="4.10.4",
|
||||
org.apache.lucene.queries;version="4.10.4",
|
||||
org.apache.lucene.queries.function;version="4.10.4",
|
||||
org.apache.lucene.queries.function.docvalues;version="4.10.4",
|
||||
org.apache.lucene.queries.function.valuesource;version="4.10.4",
|
||||
org.apache.lucene.queries.mlt;version="4.10.4",
|
||||
org.apache.lucene.queryparser.analyzing;version="4.10.4",
|
||||
org.apache.lucene.queryparser.classic;version="4.10.4",
|
||||
org.apache.lucene.queryparser.complexPhrase;version="4.10.4",
|
||||
org.apache.lucene.queryparser.ext;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.builders;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.config;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.messages;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.nodes;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.parser;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.processors;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.core.util;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.messages;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.precedence;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.precedence.processors;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.standard;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.standard.builders;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.standard.config;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.standard.nodes;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.standard.parser;version="4.10.4",
|
||||
org.apache.lucene.queryparser.flexible.standard.processors;version="4.10.4",
|
||||
org.apache.lucene.queryparser.simple;version="4.10.4",
|
||||
org.apache.lucene.queryparser.surround.parser;version="4.10.4",
|
||||
org.apache.lucene.queryparser.surround.query;version="4.10.4",
|
||||
org.apache.lucene.queryparser.xml;version="4.10.4",
|
||||
org.apache.lucene.queryparser.xml.builders;version="4.10.4",
|
||||
org.apache.lucene.sandbox.queries;version="4.10.4",
|
||||
org.apache.lucene.sandbox.queries.regex;version="4.10.4",
|
||||
org.apache.lucene.search;version="4.10.4",
|
||||
org.apache.lucene.search.grouping;version="4.10.4",
|
||||
org.apache.lucene.search.grouping.function;version="4.10.4",
|
||||
org.apache.lucene.search.grouping.term;version="4.10.4",
|
||||
org.apache.lucene.search.highlight;version="4.10.4",
|
||||
org.apache.lucene.search.join;version="4.10.4",
|
||||
org.apache.lucene.search.payloads;version="4.10.4",
|
||||
org.apache.lucene.search.postingshighlight;version="4.10.4",
|
||||
org.apache.lucene.search.similarities;version="4.10.4",
|
||||
org.apache.lucene.search.spans;version="4.10.4",
|
||||
org.apache.lucene.search.spell;version="4.10.4",
|
||||
org.apache.lucene.search.suggest;version="4.10.4",
|
||||
org.apache.lucene.search.suggest.analyzing;version="4.10.4",
|
||||
org.apache.lucene.search.suggest.fst;version="4.10.4",
|
||||
org.apache.lucene.search.suggest.jaspell;version="4.10.4",
|
||||
org.apache.lucene.search.suggest.tst;version="4.10.4",
|
||||
org.apache.lucene.search.vectorhighlight;version="4.10.4",
|
||||
org.apache.lucene.spatial;version="4.10.4",
|
||||
org.apache.lucene.spatial.bbox;version="4.10.4",
|
||||
org.apache.lucene.spatial.prefix;version="4.10.4",
|
||||
org.apache.lucene.spatial.prefix.tree;version="4.10.4",
|
||||
org.apache.lucene.spatial.query;version="4.10.4",
|
||||
org.apache.lucene.spatial.serialized;version="4.10.4",
|
||||
org.apache.lucene.spatial.util;version="4.10.4",
|
||||
org.apache.lucene.spatial.vector;version="4.10.4",
|
||||
org.apache.lucene.store;version="4.10.4",
|
||||
org.apache.lucene.util;version="4.10.4",
|
||||
org.apache.lucene.util.automaton;version="4.10.4",
|
||||
org.apache.lucene.util.fst;version="4.10.4",
|
||||
org.apache.lucene.util.mutable;version="4.10.4",
|
||||
org.apache.lucene.util.packed;version="4.10.4",
|
||||
org.tartarus.snowball;version="4.10.4",
|
||||
org.tartarus.snowball.ext;version="4.10.4"
|
||||
Bundle-ClassPath: .,
|
||||
lib/lucene-analyzers-common-4.10.4.jar,
|
||||
lib/lucene-core-4.10.4.jar,
|
||||
lib/lucene-expressions-4.10.4.jar,
|
||||
lib/lucene-grouping-4.10.4.jar,
|
||||
lib/lucene-highlighter-4.10.4.jar,
|
||||
lib/lucene-join-4.10.4.jar,
|
||||
lib/lucene-memory-4.10.4.jar,
|
||||
lib/lucene-misc-4.10.4.jar,
|
||||
lib/lucene-queries-4.10.4.jar,
|
||||
lib/lucene-queryparser-4.10.4.jar,
|
||||
lib/lucene-sandbox-4.10.4.jar,
|
||||
lib/lucene-spatial-4.10.4.jar,
|
||||
lib/lucene-suggest-4.10.4.jar
|
||||
Bundle-Vendor: .Talend SA.
|
||||
Bundle-ActivationPolicy: lazy
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -0,0 +1,15 @@
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/lucene-analyzers-common-4.10.4.jar,\
|
||||
lib/lucene-core-4.10.4.jar,\
|
||||
lib/lucene-expressions-4.10.4.jar,\
|
||||
lib/lucene-grouping-4.10.4.jar,\
|
||||
lib/lucene-highlighter-4.10.4.jar,\
|
||||
lib/lucene-join-4.10.4.jar,\
|
||||
lib/lucene-memory-4.10.4.jar,\
|
||||
lib/lucene-misc-4.10.4.jar,\
|
||||
lib/lucene-queries-4.10.4.jar,\
|
||||
lib/lucene-queryparser-4.10.4.jar,\
|
||||
lib/lucene-sandbox-4.10.4.jar,\
|
||||
lib/lucene-spatial-4.10.4.jar,\
|
||||
lib/lucene-suggest-4.10.4.jar
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,240 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
|
||||
Some code in src/java/org/apache/lucene/util/UnicodeUtil.java was
|
||||
derived from unicode conversion examples available at
|
||||
http://www.unicode.org/Public/PROGRAMS/CVTUTF. Here is the copyright
|
||||
from those sources:
|
||||
|
||||
/*
|
||||
* Copyright 2001-2004 Unicode, Inc.
|
||||
*
|
||||
* Disclaimer
|
||||
*
|
||||
* This source code is provided as is by Unicode, Inc. No claims are
|
||||
* made as to fitness for any particular purpose. No warranties of any
|
||||
* kind are expressed or implied. The recipient agrees to determine
|
||||
* applicability of information provided. If this file has been
|
||||
* purchased on magnetic or optical media from Unicode, Inc., the
|
||||
* sole remedy for any claim will be exchange of defective media
|
||||
* within 90 days of receipt.
|
||||
*
|
||||
* Limitations on Rights to Redistribute This Code
|
||||
*
|
||||
* Unicode, Inc. hereby grants the right to freely use the information
|
||||
* supplied in this file in the creation of products supporting the
|
||||
* Unicode Standard, and to make copies of this file in any form
|
||||
* for internal or external distribution as long as this notice
|
||||
* remains attached.
|
||||
*/
|
||||
|
||||
|
||||
Some code in src/java/org/apache/lucene/util/ArrayUtil.java was
|
||||
derived from Python 2.4.2 sources available at
|
||||
http://www.python.org. Full license is here:
|
||||
|
||||
http://www.python.org/download/releases/2.4.2/license/
|
||||
|
||||
|
||||
12
main/plugins/org.talend.libraries.apache.lucene4/pom.xml
Normal file
12
main/plugins/org.talend.libraries.apache.lucene4/pom.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.4.1-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.lucene4</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
@@ -541,9 +541,9 @@ public class ModulesNeededProvider {
|
||||
Property property = findRoutinesPropery(infor.getId(), infor.getName(), routines, type);
|
||||
if (property != null) {
|
||||
if (((RoutineItem) property.getItem()).isBuiltIn()) {
|
||||
systemRoutines.add(property.getId());
|
||||
systemRoutines.add(infor.getId());
|
||||
} else {
|
||||
userRoutines.add(property.getId());
|
||||
userRoutines.add(infor.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,6 @@ public final class OtherConnectionContextUtils {
|
||||
DbSchema,
|
||||
DbUsername,
|
||||
DbPassword,
|
||||
DbParameters,
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -612,10 +611,6 @@ public final class OtherConnectionContextUtils {
|
||||
conn.getValue(TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_PASSWORD, conn), false),
|
||||
JavaTypesManager.PASSWORD);
|
||||
break;
|
||||
case DbParameters:
|
||||
ConnectionContextHelper.createParameters(varList, paramName,
|
||||
TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES, conn));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -727,10 +722,6 @@ public final class OtherConnectionContextUtils {
|
||||
TaggedValueHelper.setTaggedValue(sapConn, ISAPConstant.PROP_DB_PASSWORD,
|
||||
ContextParameterUtils.getNewScriptCode(sapBasicVarName, LANGUAGE));
|
||||
break;
|
||||
case DbParameters:
|
||||
TaggedValueHelper.setTaggedValue(sapConn, ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES,
|
||||
ContextParameterUtils.getNewScriptCode(sapBasicVarName, LANGUAGE));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -777,14 +768,11 @@ public final class OtherConnectionContextUtils {
|
||||
TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_USERNAME, conn)));
|
||||
String dbPassword = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,
|
||||
conn.getValue(TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_PASSWORD, conn), false)));
|
||||
String dbParameters = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,
|
||||
TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES, conn)));
|
||||
TaggedValueHelper.setTaggedValue(conn, ISAPConstant.PROP_DB_HOST, dbHost);
|
||||
TaggedValueHelper.setTaggedValue(conn, ISAPConstant.PROP_DB_PORT, dbPort);
|
||||
TaggedValueHelper.setTaggedValue(conn, ISAPConstant.PROP_DB_SCHEMA, dbSchema);
|
||||
TaggedValueHelper.setTaggedValue(conn, ISAPConstant.PROP_DB_USERNAME, dbUsername);
|
||||
TaggedValueHelper.setTaggedValue(conn, ISAPConstant.PROP_DB_PASSWORD, conn.getValue(dbPassword, true));
|
||||
TaggedValueHelper.setTaggedValue(conn, ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES, dbParameters);
|
||||
}
|
||||
|
||||
public static SAPConnection cloneOriginalValueSAPConnection(SAPConnection fileConn, ContextType contextType) {
|
||||
@@ -825,14 +813,11 @@ public final class OtherConnectionContextUtils {
|
||||
TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_USERNAME, fileConn));
|
||||
String dbPassword = ConnectionContextHelper.getOriginalValue(contextType,
|
||||
fileConn.getValue(TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_PASSWORD, fileConn), false));
|
||||
String dbParameters = ConnectionContextHelper.getOriginalValue(contextType,
|
||||
TaggedValueHelper.getValueString(ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES, fileConn));
|
||||
TaggedValueHelper.setTaggedValue(cloneConn, ISAPConstant.PROP_DB_HOST, dbHost);
|
||||
TaggedValueHelper.setTaggedValue(cloneConn, ISAPConstant.PROP_DB_PORT, dbPort);
|
||||
TaggedValueHelper.setTaggedValue(cloneConn, ISAPConstant.PROP_DB_SCHEMA, dbSchema);
|
||||
TaggedValueHelper.setTaggedValue(cloneConn, ISAPConstant.PROP_DB_USERNAME, dbUsername);
|
||||
TaggedValueHelper.setTaggedValue(cloneConn, ISAPConstant.PROP_DB_PASSWORD, dbPassword);
|
||||
TaggedValueHelper.setTaggedValue(cloneConn, ISAPConstant.PROP_DB_ADDITIONAL_PROPERTIES, dbParameters);
|
||||
|
||||
ConnectionContextHelper.cloneConnectionProperties(fileConn, cloneConn);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ Require-Bundle: org.eclipse.ui,
|
||||
org.apache.commons.logging,
|
||||
org.apache.commons.collections,
|
||||
org.apache.commons.lang,
|
||||
org.apache.axis,
|
||||
org.talend.libraries.mdm;resolution:=optional,
|
||||
org.talend.common.ui.runtime,
|
||||
org.talend.core.runtime,
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.core.model.metadata.builder.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
@@ -388,12 +387,12 @@ public class ExtractMetaDataFromDataBase {
|
||||
private static boolean checkSybaseDB(Connection connection, String database) {
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
if (extractMeta != null) {
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
stmt = connection.prepareStatement("sp_helpdb " + database);
|
||||
stmt = connection.createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
resultSet = stmt.executeQuery();
|
||||
resultSet = stmt.executeQuery("sp_helpdb " + database);
|
||||
return true;
|
||||
} catch (SQLException e) {
|
||||
ExceptionHandler.process(e);
|
||||
@@ -706,23 +705,25 @@ public class ExtractMetaDataFromDataBase {
|
||||
tableComment = tablesSet.getString(GetTable.REMARKS.name());
|
||||
}
|
||||
if (StringUtils.isBlank(tableComment)) {
|
||||
if (connection != null) {
|
||||
tableComment = executeGetCommentStatement(connection, tableName);
|
||||
String selectRemarkOnTable = getSelectRemarkOnTable(tableName);
|
||||
if (selectRemarkOnTable != null && connection != null) {
|
||||
tableComment = executeGetCommentStatement(selectRemarkOnTable, connection);
|
||||
}
|
||||
}
|
||||
return tableComment;
|
||||
}
|
||||
|
||||
private static String executeGetCommentStatement(Connection connection, String tableName) {
|
||||
String sql = "SELECT TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_NAME=?";
|
||||
private static String getSelectRemarkOnTable(String tableName) {
|
||||
return "SELECT TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_NAME='" + tableName + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
private static String executeGetCommentStatement(String queryStmt, Connection connection) {
|
||||
String comment = null;
|
||||
PreparedStatement statement = null;
|
||||
Statement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
statement = connection.prepareStatement(sql);
|
||||
statement.setString(1, tableName);
|
||||
statement.execute();
|
||||
statement = connection.createStatement();
|
||||
statement.execute(queryStmt);
|
||||
|
||||
// get the results
|
||||
resultSet = statement.getResultSet();
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.talend.core.model.metadata.builder.database.manager;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Driver;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
@@ -1068,9 +1067,9 @@ public class ExtractManager {
|
||||
try {
|
||||
if (!tableInfoParameters.isUsedName()) {
|
||||
if (tableInfoParameters.getSqlFiter() != null && !"".equals(tableInfoParameters.getSqlFiter())) { //$NON-NLS-1$
|
||||
PreparedStatement stmt = extractMeta.getConn().prepareStatement(tableInfoParameters.getSqlFiter());
|
||||
Statement stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
ResultSet rsTables = stmt.executeQuery(tableInfoParameters.getSqlFiter());
|
||||
itemTablesName = ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables, extractMeta.getConn());
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
|
||||
@@ -14,9 +14,9 @@ package org.talend.core.model.metadata.builder.database.manager.dbs;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -68,17 +68,15 @@ public class IBMDB2ExtractManager extends ExtractManager {
|
||||
|
||||
@Override
|
||||
public String getTableNameBySynonyms(Connection conn, String tableName) {
|
||||
PreparedStatement sta = null;
|
||||
Statement sta = null;
|
||||
ResultSet resultSet = null;
|
||||
|
||||
try {
|
||||
if (conn != null && conn.getMetaData().getDatabaseProductName().startsWith(DATABASE_PRODUCT_NAME)) {
|
||||
String sql = "SELECT NAME,BASE_NAME FROM SYSIBM.SYSTABLES where TYPE='A' and name =?";
|
||||
sta = conn.prepareStatement(sql);
|
||||
sta.setString(1, tableName);
|
||||
|
||||
String sql = "SELECT NAME,BASE_NAME FROM SYSIBM.SYSTABLES where TYPE='A' and name ='" + tableName + "'";
|
||||
sta = conn.createStatement();
|
||||
ExtractMetaDataUtils.getInstance().setQueryStatementTimeout(sta);
|
||||
resultSet = sta.executeQuery();
|
||||
resultSet = sta.executeQuery(sql);
|
||||
while (resultSet.next()) {
|
||||
String baseName = resultSet.getString("base_name").trim();
|
||||
return baseName;
|
||||
@@ -115,16 +113,15 @@ public class IBMDB2ExtractManager extends ExtractManager {
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
// need to retrieve columns of synonym by useing sql rather than get them from jdbc metadata
|
||||
String synSQL = "SELECT a.*\n" + "FROM SYSCAT.COLUMNS a\n" + "LEFT OUTER JOIN SYSIBM.SYSTABLES b\n"
|
||||
+ "ON a.TABNAME = b.NAME\n" + "AND a.TABSCHEMA = b.CREATOR\n" + "where a.TABNAME =?\n";
|
||||
+ "ON a.TABNAME = b.NAME\n" + "AND a.TABSCHEMA = b.CREATOR\n" + "where a.TABNAME =" + "\'" + tableName
|
||||
+ "\'\n";
|
||||
if (!("").equals(metadataConnection.getSchema())) {
|
||||
synSQL += "AND b.CREATOR =\'" + metadataConnection.getSchema() + "\'";
|
||||
}
|
||||
synSQL += "ORDER BY a.COLNO";
|
||||
PreparedStatement sta = extractMeta.getConn().prepareStatement(synSQL);
|
||||
sta.setString(1, tableName);
|
||||
|
||||
Statement sta = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(sta);
|
||||
ResultSet columns = sta.executeQuery();
|
||||
ResultSet columns = sta.executeQuery(synSQL);
|
||||
String typeName = null;
|
||||
int index = 0;
|
||||
List<String> columnLabels = new ArrayList<String>();
|
||||
|
||||
@@ -14,9 +14,9 @@ package org.talend.core.model.metadata.builder.database.manager.dbs;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -93,8 +93,8 @@ public class ImpalaExtractManager extends ExtractManager {
|
||||
DatabaseMetaData metaData = conn.getMetaData();
|
||||
if (!tableInfoParameters.isUsedName()) {
|
||||
if (tableInfoParameters.getSqlFiter() != null && !"".equals(tableInfoParameters.getSqlFiter())) { //$NON-NLS-1$
|
||||
PreparedStatement stmt = conn.prepareStatement(tableInfoParameters.getSqlFiter());
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
Statement stmt = conn.createStatement();
|
||||
ResultSet rsTables = stmt.executeQuery(tableInfoParameters.getSqlFiter());
|
||||
itemTablesName = ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables, conn);
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.sql.DatabaseMetaData;
|
||||
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,16 +53,16 @@ public class MSSQLExtractManager extends ExtractManager {
|
||||
@Override
|
||||
public String getTableNameBySynonyms(Connection conn, String tableName) {
|
||||
|
||||
PreparedStatement sta = null;
|
||||
Statement sta = null;
|
||||
ResultSet resultSet = null;
|
||||
|
||||
try {
|
||||
if (conn != null && conn.getMetaData().getDatabaseProductName().equals(EDatabaseTypeName.MSSQL.getDisplayName())) {
|
||||
String sql = "SELECT object_id ,parent_object_id as parentid, name AS object_name , base_object_name as base_name from sys.synonyms where name =?";
|
||||
sta = conn.prepareStatement(sql);
|
||||
sta.setString(1, tableName);
|
||||
String sql = "SELECT object_id ,parent_object_id as parentid, name AS object_name , base_object_name as base_name from sys.synonyms where name ='"
|
||||
+ tableName + "'";
|
||||
sta = conn.createStatement();
|
||||
ExtractMetaDataUtils.getInstance().setQueryStatementTimeout(sta);
|
||||
resultSet = sta.executeQuery();
|
||||
resultSet = sta.executeQuery(sql);
|
||||
while (resultSet.next()) {
|
||||
String baseName = resultSet.getString("base_name").trim();
|
||||
if (baseName.contains(".") && baseName.length() > 2) {
|
||||
@@ -123,25 +124,16 @@ public class MSSQLExtractManager extends ExtractManager {
|
||||
}
|
||||
}
|
||||
// need to retrieve columns of synonym by useing sql rather than get them from jdbc metadata
|
||||
String synSQL = "select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME =?";
|
||||
String synSQL = "select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME =\'" + TABLE_NAME + "\'";
|
||||
if (null != TABLE_SCHEMA) {
|
||||
synSQL += "\nand TABLE_SCHEMA =?";
|
||||
synSQL += "\nand TABLE_SCHEMA =\'" + TABLE_SCHEMA + "\'";
|
||||
}
|
||||
if (!("").equals(metadataConnection.getDatabase())) {
|
||||
synSQL += "\nand TABLE_CATALOG =?";
|
||||
}
|
||||
PreparedStatement sta = extractMeta.getConn().prepareStatement(synSQL);
|
||||
sta.setString(1, TABLE_NAME);
|
||||
int idx = 2;
|
||||
if (null != TABLE_SCHEMA) {
|
||||
sta.setString(idx, TABLE_SCHEMA);
|
||||
idx++;
|
||||
}
|
||||
if (!("").equals(metadataConnection.getDatabase())) {
|
||||
sta.setString(idx, metadataConnection.getDatabase());
|
||||
synSQL += "\nand TABLE_CATALOG =\'" + metadataConnection.getDatabase() + "\'";
|
||||
}
|
||||
Statement sta = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(sta);
|
||||
ResultSet columns = sta.executeQuery();
|
||||
ResultSet columns = sta.executeQuery(synSQL);
|
||||
String typeName = null;
|
||||
int index = 0;
|
||||
List<String> columnLabels = new ArrayList<String>();
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -71,22 +72,20 @@ public class OracleExtractManager extends ExtractManager {
|
||||
protected List<String> getTablesToFilter(IMetadataConnection metadataConnection) {
|
||||
|
||||
List<String> tablesToFilter = new ArrayList<String>();
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt;
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
try {
|
||||
stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
if (EDatabaseTypeName.ORACLEFORSID.getDisplayName().equals(metadataConnection.getDbType())
|
||||
|| EDatabaseTypeName.ORACLESN.getDisplayName().equals(metadataConnection.getDbType())
|
||||
|| EDatabaseTypeName.ORACLE_CUSTOM.getDisplayName().equals(metadataConnection.getDbType())
|
||||
|| EDatabaseTypeName.ORACLE_OCI.getDisplayName().equals(metadataConnection.getDbType())) {
|
||||
stmt = extractMeta.getConn().prepareStatement(ORACLE_10G_RECBIN_SQL);
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
ResultSet rsTables = stmt.executeQuery(ORACLE_10G_RECBIN_SQL);
|
||||
tablesToFilter = ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables, extractMeta.getConn());
|
||||
rsTables.close();
|
||||
}
|
||||
if (stmt != null) {
|
||||
stmt.close();
|
||||
}
|
||||
stmt.close();
|
||||
} catch (SQLException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -105,12 +104,11 @@ public class OracleExtractManager extends ExtractManager {
|
||||
List<String> tablesToFilter = getTablesToFilter(metadataConnection);
|
||||
|
||||
try {
|
||||
PreparedStatement stmt = extractMeta.getConn().prepareStatement(GET_ALL_SYNONYMS);
|
||||
Statement stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
ResultSet rsTables = stmt.executeQuery(GET_ALL_SYNONYMS);
|
||||
getMetadataTables(medataTables, rsTables, dbMetaData.supportsSchemasInTableDefinitions(), tablesToFilter, limit);
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
} catch (SQLException e) {
|
||||
ExceptionHandler.process(e);
|
||||
log.error(e.toString());
|
||||
@@ -129,20 +127,18 @@ public class OracleExtractManager extends ExtractManager {
|
||||
@Override
|
||||
public String getTableNameBySynonyms(Connection conn, String tableName) {
|
||||
// bug TDI-19382
|
||||
PreparedStatement sta = null;
|
||||
Statement sta = null;
|
||||
ResultSet resultSet = null;
|
||||
|
||||
try {
|
||||
if (conn != null && conn.getMetaData().getDatabaseProductName().equals(DATABASE_PRODUCT_NAME)) {
|
||||
String sql = "select TABLE_NAME from ALL_SYNONYMS where SYNONYM_NAME = ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
String sql = "select TABLE_NAME from ALL_SYNONYMS where SYNONYM_NAME = '" + tableName + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// String sql = "select * from all_tab_columns where upper(table_name)='" + name +
|
||||
// "' order by column_id";
|
||||
// Statement sta;
|
||||
sta = conn.prepareStatement(sql);
|
||||
sta.setString(1, tableName);
|
||||
|
||||
sta = conn.createStatement();
|
||||
ExtractMetaDataUtils.getInstance().setQueryStatementTimeout(sta);
|
||||
resultSet = sta.executeQuery();
|
||||
resultSet = sta.executeQuery(sql);
|
||||
while (resultSet.next()) {
|
||||
return resultSet.getString("TABLE_NAME"); //$NON-NLS-1$
|
||||
}
|
||||
@@ -177,25 +173,19 @@ public class OracleExtractManager extends ExtractManager {
|
||||
// need to retrieve columns of synonym by useing sql rather than get them from jdbc metadata
|
||||
String synSQL = "SELECT all_tab_columns.*\n" + "FROM all_tab_columns\n" + "LEFT OUTER JOIN all_synonyms\n"
|
||||
+ "ON all_tab_columns.TABLE_NAME = all_synonyms.TABLE_NAME\n"
|
||||
+ "AND ALL_SYNONYMS.TABLE_OWNER = all_tab_columns.OWNER\n" + "WHERE all_synonyms.SYNONYM_NAME =?\n";
|
||||
+ "AND ALL_SYNONYMS.TABLE_OWNER = all_tab_columns.OWNER\n" + "WHERE all_synonyms.SYNONYM_NAME =" + "\'"
|
||||
+ synonymName + "\'\n";
|
||||
// bug TDI-19382
|
||||
if (!("").equals(metadataConnection.getSchema())) {
|
||||
synSQL += "and all_synonyms.OWNER =?";
|
||||
} else if (table.eContainer() instanceof Schema) {
|
||||
synSQL += "and all_synonyms.OWNER =?";
|
||||
}
|
||||
synSQL += " ORDER BY all_tab_columns.COLUMN_NAME"; //$NON-NLS-1$
|
||||
PreparedStatement sta = extractMeta.getConn().prepareStatement(synSQL);
|
||||
sta.setString(1, synonymName);
|
||||
int idx = 2;
|
||||
if (!("").equals(metadataConnection.getSchema())) {
|
||||
sta.setString(idx, metadataConnection.getSchema());
|
||||
synSQL += "and all_synonyms.OWNER =\'" + metadataConnection.getSchema() + "\'";
|
||||
} else if (table.eContainer() instanceof Schema) {
|
||||
Schema schema = (Schema) table.eContainer();
|
||||
sta.setString(idx, schema.getName());
|
||||
synSQL += "and all_synonyms.OWNER =\'" + schema.getName() + "\'";
|
||||
}
|
||||
synSQL += " ORDER BY all_tab_columns.COLUMN_NAME"; //$NON-NLS-1$
|
||||
Statement sta = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(sta);
|
||||
ResultSet columns = sta.executeQuery();
|
||||
ResultSet columns = sta.executeQuery(synSQL);
|
||||
String typeName = null;
|
||||
int index = 0;
|
||||
List<String> columnLabels = new ArrayList<String>();
|
||||
@@ -257,11 +247,10 @@ public class OracleExtractManager extends ExtractManager {
|
||||
throws SQLException {
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
if (extractMeta.isUseAllSynonyms()) {
|
||||
String sql = "select * from all_tab_columns where table_name=? ORDER BY all_tab_columns.COLUMN_NAME"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
PreparedStatement stmt = extractMeta.getConn().prepareStatement(sql);
|
||||
stmt.setString(1, tableName);
|
||||
String sql = "select * from all_tab_columns where table_name='" + tableName + "' ORDER BY all_tab_columns.COLUMN_NAME"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
Statement stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
return stmt.executeQuery();
|
||||
return stmt.executeQuery(sql);
|
||||
} else {
|
||||
return super.getColumnsResultSet(dbMetaData, catalogName, schemaName, tableName);
|
||||
}
|
||||
@@ -271,10 +260,10 @@ public class OracleExtractManager extends ExtractManager {
|
||||
public void synchroViewStructure(String catalogName, String schemaName, String tableName) throws SQLException {
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
ResultSet results = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
String sql = null;
|
||||
if (extractMeta.isUseAllSynonyms()) {
|
||||
sql = "select * from all_tab_columns where table_name=?"; //$NON-NLS-1$
|
||||
sql = "select * from all_tab_columns where table_name='" + tableName + "'"; //$NON-NLS-1$
|
||||
} else {
|
||||
StringBuffer sqlBuffer = new StringBuffer();
|
||||
sqlBuffer.append("SELECT * FROM ");
|
||||
@@ -285,12 +274,9 @@ public class OracleExtractManager extends ExtractManager {
|
||||
sql = sqlBuffer.toString();
|
||||
}
|
||||
try {
|
||||
stmt = extractMeta.getConn().prepareStatement(sql);
|
||||
if (extractMeta.isUseAllSynonyms()) {
|
||||
stmt.setString(1, tableName);
|
||||
}
|
||||
stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
results = stmt.executeQuery();
|
||||
results = stmt.executeQuery(sql);
|
||||
} finally {
|
||||
if (results != null) {
|
||||
results.close();
|
||||
@@ -316,8 +302,8 @@ public class OracleExtractManager extends ExtractManager {
|
||||
PreparedStatement statement = null;
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
try {
|
||||
statement = extractMeta.getConn().prepareStatement("SELECT COMMENTS FROM USER_COL_COMMENTS WHERE TABLE_NAME=?"); //$NON-NLS-1$
|
||||
statement.setString(1, tableName);
|
||||
statement = extractMeta.getConn().prepareStatement("SELECT COMMENTS FROM USER_COL_COMMENTS WHERE TABLE_NAME='" //$NON-NLS-1$
|
||||
+ tableName + "'"); //$NON-NLS-1$
|
||||
extractMeta.setQueryStatementTimeout(statement);
|
||||
if (statement.execute()) {
|
||||
keys = statement.getResultSet();
|
||||
@@ -351,9 +337,9 @@ public class OracleExtractManager extends ExtractManager {
|
||||
&& !metadataConnection.getDbVersionString().equals(EDatabaseVersion4Drivers.ORACLE_8.getVersionValue())) {
|
||||
ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
|
||||
try {
|
||||
PreparedStatement stmt = extractMeta.getConn().prepareStatement(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
|
||||
Statement stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
ResultSet rsTables = stmt.executeQuery(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
|
||||
itemTablesName.removeAll(ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables, extractMeta.getConn()));
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
@@ -373,27 +359,27 @@ public class OracleExtractManager extends ExtractManager {
|
||||
if (con != null && con.toString().contains("oracle.jdbc.driver") //$NON-NLS-1$
|
||||
&& extractMeta.isUseAllSynonyms()) {
|
||||
Set<String> nameFiters = tableInfoParameters.getNameFilters();
|
||||
Statement stmt = con.createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
|
||||
StringBuffer filters = new StringBuffer();
|
||||
if (!nameFiters.isEmpty()) {
|
||||
filters.append(" and ("); //$NON-NLS-1$
|
||||
final String tStr = " all_synonyms.synonym_name like ?"; //$NON-NLS-1$
|
||||
for (int i = 0; i < nameFiters.size(); i++) {
|
||||
final String tStr = " all_synonyms.synonym_name like '"; //$NON-NLS-1$
|
||||
int i = 0;
|
||||
for (String s : nameFiters) {
|
||||
if (i != 0) {
|
||||
filters.append(" or "); //$NON-NLS-1$
|
||||
}
|
||||
filters.append(tStr);
|
||||
filters.append(s);
|
||||
filters.append('\'');
|
||||
i++;
|
||||
|
||||
}
|
||||
filters.append(')');
|
||||
}
|
||||
PreparedStatement stmt = con.prepareStatement(GET_ALL_SYNONYMS + filters.toString());
|
||||
int i = 1;
|
||||
for (String s : nameFiters) {
|
||||
stmt.setString(i, s);
|
||||
i++;
|
||||
}
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
ResultSet rsTables = stmt.executeQuery(GET_ALL_SYNONYMS + filters.toString());
|
||||
itemTablesName = ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables, extractMeta.getConn());
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
|
||||
@@ -15,8 +15,8 @@ package org.talend.metadata.managment.connection.manager;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Driver;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -25,6 +25,8 @@ import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
@@ -54,8 +56,6 @@ import org.talend.metadata.managment.hive.handler.HDP200YarnHandler;
|
||||
import org.talend.metadata.managment.hive.handler.HiveConnectionHandler;
|
||||
import org.talend.metadata.managment.hive.handler.Mapr212Handler;
|
||||
|
||||
import metadata.managment.i18n.Messages;
|
||||
|
||||
/**
|
||||
* Created by Marvin Wang on Mar 13, 2013.
|
||||
*/
|
||||
@@ -492,18 +492,26 @@ public class HiveConnectionManager extends DataBaseConnectionManager {
|
||||
}
|
||||
String jdbcPropertiesStr = String.valueOf(jdbcPropertiesObj);
|
||||
List<Map<String, Object>> jdbcProperties = HadoopRepositoryUtil.getHadoopPropertiesList(jdbcPropertiesStr);
|
||||
Statement statement = null;
|
||||
try {
|
||||
statement = dbConn.createStatement();
|
||||
for (Map<String, Object> propMap : jdbcProperties) {
|
||||
String key = TalendQuoteUtils.removeQuotesIfExist(String.valueOf(propMap.get("PROPERTY"))); //$NON-NLS-1$
|
||||
String value = TalendQuoteUtils.removeQuotesIfExist(String.valueOf(propMap.get("VALUE"))); //$NON-NLS-1$
|
||||
if (StringUtils.isNotEmpty(key) && value != null) {
|
||||
PreparedStatement ps = dbConn.prepareStatement("SET " + key + "=" + value);
|
||||
ps.execute(); // $NON-NLS-1$ //$NON-NLS-2$
|
||||
ps.close();
|
||||
statement.execute("SET " + key + "=" + value); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
if (statement != null) {
|
||||
try {
|
||||
statement.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Driver;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -148,7 +148,7 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
}
|
||||
}
|
||||
java.sql.Connection sqlConnection = null;
|
||||
PreparedStatement stmt = null;
|
||||
Statement stmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
// MetadataConnectionUtils.setMetadataCon(metadataBean);
|
||||
@@ -176,8 +176,8 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
String databaseType = dbconn.getDatabaseType();
|
||||
// TDQ-16331 Azure Mysql must use 'select version()' to get correct version
|
||||
if (EDatabaseTypeName.MYSQL.getDisplayName().equals(databaseType)) {
|
||||
stmt = sqlConnection.prepareStatement("select version()");
|
||||
rs = stmt.executeQuery(); // $NON-NLS-1$
|
||||
stmt = sqlConnection.createStatement();
|
||||
rs = stmt.executeQuery("select version()"); //$NON-NLS-1$
|
||||
while (rs.next()) {
|
||||
productVersion = rs.getString(1);
|
||||
}
|
||||
@@ -1021,12 +1021,12 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
isOracle = MetadataConnectionUtils.isOracle(c);
|
||||
isOracleJdbc = MetadataConnectionUtils.isOracleJDBC(c);
|
||||
if ((isOracleJdbc || isOracle) && !isOracle8i) {// oracle and not oracle8
|
||||
PreparedStatement stmt;
|
||||
Statement stmt;
|
||||
try {
|
||||
// MOD qiongli TDQ-4732 use the common method to create statement both DI and DQ,avoid Exception
|
||||
// for top.
|
||||
stmt = dbJDBCMetadata.getConnection().prepareStatement(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
stmt = dbJDBCMetadata.getConnection().createStatement();
|
||||
ResultSet rsTables = stmt.executeQuery(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
|
||||
tablesToFilter = ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables,
|
||||
dbJDBCMetadata.getConnection());
|
||||
rsTables.close();
|
||||
@@ -1124,15 +1124,14 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
&& dbJDBCMetadata.getDatabaseProductName().equals("Microsoft SQL Server")) { //$NON-NLS-1$
|
||||
for (String element : tableType) {
|
||||
if (element.equals("SYNONYM")) { //$NON-NLS-1$
|
||||
Statement stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
String schemaname = schemaPattern + ".sysobjects"; //$NON-NLS-1$
|
||||
String sql = "select name from " + schemaname + " where xtype='SN'"; //$NON-NLS-1$//$NON-NLS-2$
|
||||
if ("dbo".equalsIgnoreCase(schemaPattern)) { //$NON-NLS-1$
|
||||
PreparedStatement stmt = extractMeta.getConn().prepareStatement(sql);
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
|
||||
// SELECT name AS object_name ,SCHEMA_NAME(schema_id) AS schema_name FROM sys.objects where
|
||||
// type='SN'
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
ResultSet rsTables = stmt.executeQuery(sql);
|
||||
while (rsTables.next()) {
|
||||
String nameKey = rsTables.getString("name").trim(); //$NON-NLS-1$
|
||||
|
||||
@@ -1144,8 +1143,6 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
metadatatable.setLabel(metadatatable.getName());
|
||||
list.add(metadatatable);
|
||||
}
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1153,12 +1150,10 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
&& dbJDBCMetadata.getDatabaseProductName().startsWith("DB2/")) { //$NON-NLS-1$
|
||||
for (String element : tableType) {
|
||||
if (element.equals("SYNONYM")) { //$NON-NLS-1$
|
||||
String sql = "SELECT NAME FROM SYSIBM.SYSTABLES where TYPE='A' and BASE_SCHEMA = ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
PreparedStatement stmt = extractMeta.getConn().prepareStatement(sql);
|
||||
stmt.setString(1, schemaPattern);
|
||||
|
||||
Statement stmt = extractMeta.getConn().createStatement();
|
||||
extractMeta.setQueryStatementTimeout(stmt);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
String sql = "SELECT NAME FROM SYSIBM.SYSTABLES where TYPE='A' and BASE_SCHEMA = '" + schemaPattern + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ResultSet rsTables = stmt.executeQuery(sql);
|
||||
while (rsTables.next()) {
|
||||
String nameKey = rsTables.getString("NAME").trim(); //$NON-NLS-1$
|
||||
|
||||
@@ -1170,8 +1165,6 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
metadatatable.setLabel(metadatatable.getName());
|
||||
list.add(metadatatable);
|
||||
}
|
||||
rsTables.close();
|
||||
stmt.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1284,12 +1277,12 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
boolean isOracleJdbc = MetadataConnectionUtils.isOracleJDBC(c);
|
||||
// MetadataConnectionUtils.isOracle8i(connection)
|
||||
if ((isOracle || isOracleJdbc) && !flag) {// oracle and not oracle8
|
||||
Statement stmt;
|
||||
try {
|
||||
// MOD qiongli TDQ-4732 use the common method to create statement both DI and DQ,avoid Exception
|
||||
// for top.
|
||||
PreparedStatement stmt = dbJDBCMetadata.getConnection()
|
||||
.prepareStatement(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
|
||||
ResultSet rsTables = stmt.executeQuery();
|
||||
stmt = dbJDBCMetadata.getConnection().createStatement();
|
||||
ResultSet rsTables = stmt.executeQuery(TableInfoParameters.ORACLE_10G_RECBIN_SQL);
|
||||
tablesToFilter = ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables,
|
||||
dbJDBCMetadata.getConnection());
|
||||
rsTables.close();
|
||||
@@ -1889,11 +1882,11 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
|
||||
*/
|
||||
private String executeGetCommentStatement(String queryStmt, java.sql.Connection connection) {
|
||||
String comment = null;
|
||||
PreparedStatement statement = null;
|
||||
Statement statement = null;
|
||||
ResultSet resultSet = null;
|
||||
try {
|
||||
statement = connection.prepareStatement(queryStmt);
|
||||
statement.execute();
|
||||
statement = connection.createStatement();
|
||||
statement.execute(queryStmt);
|
||||
|
||||
// get the results
|
||||
resultSet = statement.getResultSet();
|
||||
|
||||
@@ -15,10 +15,10 @@ package org.talend.metadata.managment.utils;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Driver;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -1340,10 +1340,10 @@ public class MetadataConnectionUtils {
|
||||
*/
|
||||
public static String getColumnTypeName(java.sql.Connection connection, String tableName, int colIndex) {
|
||||
String columnTypeName = null;
|
||||
PreparedStatement statement = null;
|
||||
Statement statement = null;
|
||||
try {
|
||||
statement = connection.prepareStatement("SELECT FIRST 1 * FROM " + tableName + ";");
|
||||
ResultSet resultSet = statement.executeQuery(); // $NON-NLS-1$ //$NON-NLS-2$
|
||||
statement = connection.createStatement();
|
||||
ResultSet resultSet = statement.executeQuery("SELECT FIRST 1 * FROM " + tableName + ";"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ResultSetMetaData rsMetaData = resultSet.getMetaData();
|
||||
columnTypeName = rsMetaData.getColumnTypeName(colIndex);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -16,7 +16,6 @@ Application.workspaceInvalidMessage=Selected workspace is not valid; choose a di
|
||||
Application.workspaceNotExiste=Workspace not exist, cannot start instances in this path.
|
||||
Application.doNotSupportJavaVersionYetPoweredbyTalend=The Studio does not support Java 8. Java 7 is the recommended JVM version to be used. Refer to the following KB article on Talend Help Center for more information (requires a MyTalend account registration):
|
||||
Application.doNotSupportJavaVersionYetNoPoweredbyTalend=The Studio does not support Java 8. Java 7 is the recommended JVM version to be used.
|
||||
Application.InstallingPatchesTaskName=Installing patches...
|
||||
ApplicationActionBarAdvisor.menuFileLabel=&File
|
||||
ApplicationActionBarAdvisor.menuEditLabel=&Edit
|
||||
ApplicationActionBarAdvisor.navigateLabel=&Navigate
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.rcp.intro;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
@@ -22,7 +21,6 @@ import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.adaptor.EclipseStarter;
|
||||
@@ -30,8 +28,6 @@ import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
import org.eclipse.equinox.app.IApplication;
|
||||
import org.eclipse.equinox.app.IApplicationContext;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.wizard.WizardDialog;
|
||||
import org.eclipse.osgi.service.datalocation.Location;
|
||||
@@ -292,7 +288,6 @@ public class Application implements IApplication {
|
||||
|
||||
}
|
||||
|
||||
private boolean installed = false;
|
||||
private boolean installLocalPatches() {
|
||||
try {
|
||||
final boolean forceCheck = Boolean.getBoolean("talend.studio.localpatch.forcecheck");
|
||||
@@ -324,27 +319,7 @@ public class Application implements IApplication {
|
||||
boolean needRelaunch = false;
|
||||
final PatchComponent patchComponent = PatchComponentHelper.getPatchComponent();
|
||||
if (patchComponent != null) {
|
||||
Shell shell = Display.getDefault().getActiveShell();
|
||||
if (shell == null) {
|
||||
shell = new Shell();
|
||||
}
|
||||
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
|
||||
IRunnableWithProgress runnable = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
monitor.beginTask(Messages.getString("Application.InstallingPatchesTaskName"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
|
||||
installed = patchComponent.install(monitor);
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
dialog.run(true, false, runnable);
|
||||
} catch (InvocationTargetException | InterruptedException e) {
|
||||
log.log(Level.ERROR, e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
final boolean installed = patchComponent.install();
|
||||
if (installed) {
|
||||
final String installedMessages = patchComponent.getInstalledMessages();
|
||||
if (installedMessages != null) {
|
||||
@@ -360,7 +335,6 @@ public class Application implements IApplication {
|
||||
if (StringUtils.isNotEmpty(patchComponent.getFailureMessage())) {
|
||||
log.log(Level.ERROR, patchComponent.getFailureMessage());
|
||||
}
|
||||
installed = false;
|
||||
}
|
||||
|
||||
final ComponentsInstallComponent installComponent = LocalComponentInstallHelper.getComponent();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class DynamicContentProviderGeneric extends DynamicContentProvider {
|
||||
if (PluginChecker.isStudioLite()) {
|
||||
branding = "LITE";
|
||||
} else {
|
||||
branding = System.getProperty("talend.license.branding");
|
||||
System.getProperty("talend.license.branding");
|
||||
if (branding == null || "".equals(branding)) {
|
||||
branding = dBranding;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ Bundle-Name: Registration Plug-in
|
||||
Bundle-SymbolicName: org.talend.registration;singleton:=true
|
||||
Bundle-Version: 7.4.1.qualifier
|
||||
Bundle-Vendor: .Talend SA.
|
||||
Require-Bundle: javax.xml.rpc,
|
||||
Require-Bundle: org.apache.axis,
|
||||
javax.xml.rpc,
|
||||
org.eclipse.ui,
|
||||
org.talend.core.runtime,
|
||||
org.talend.core.ui,
|
||||
@@ -14,8 +15,7 @@ Require-Bundle: javax.xml.rpc,
|
||||
org.talend.metadata.managment,
|
||||
org.talend.common.ui.runtime,
|
||||
org.eclipse.ui.intro,
|
||||
org.talend.commons.ui,
|
||||
org.talend.libraries.apache.axis2
|
||||
org.talend.commons.ui
|
||||
Export-Package: org.talend.registration,
|
||||
org.talend.registration.license,
|
||||
org.talend.registration.register,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
package org.talend.registration.register.proxy;
|
||||
|
||||
public interface RegisterUser {
|
||||
public interface RegisterUser extends javax.xml.rpc.Service {
|
||||
public java.lang.String getRegisterUserPortAddress();
|
||||
|
||||
public org.talend.registration.register.proxy.RegisterUserPortType getRegisterUserPort() throws javax.xml.rpc.ServiceException;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,12 +6,20 @@
|
||||
|
||||
package org.talend.registration.register.proxy;
|
||||
|
||||
public class RegisterUserLocator implements
|
||||
public class RegisterUserLocator extends org.apache.axis.client.Service implements
|
||||
org.talend.registration.register.proxy.RegisterUser {
|
||||
|
||||
public RegisterUserLocator() {
|
||||
}
|
||||
|
||||
public RegisterUserLocator(org.apache.axis.EngineConfiguration config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
public RegisterUserLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
|
||||
super(wsdlLoc, sName);
|
||||
}
|
||||
|
||||
// Use to get a proxy class for RegisterUserPort
|
||||
private java.lang.String RegisterUserPort_address = "https://www.talend.com/TalendRegisterWS/registerws.php";
|
||||
|
||||
@@ -45,9 +53,10 @@ public class RegisterUserLocator implements
|
||||
throws javax.xml.rpc.ServiceException {
|
||||
try {
|
||||
org.talend.registration.register.proxy.RegisterUserBindingStub _stub = new org.talend.registration.register.proxy.RegisterUserBindingStub(
|
||||
portAddress.toString());
|
||||
portAddress, this);
|
||||
_stub.setPortName(getRegisterUserPortWSDDServiceName());
|
||||
return _stub;
|
||||
} catch (org.apache.axis2.AxisFault e) {
|
||||
} catch (org.apache.axis.AxisFault e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +73,8 @@ public class RegisterUserLocator implements
|
||||
try {
|
||||
if (org.talend.registration.register.proxy.RegisterUserPortType.class.isAssignableFrom(serviceEndpointInterface)) {
|
||||
org.talend.registration.register.proxy.RegisterUserBindingStub _stub = new org.talend.registration.register.proxy.RegisterUserBindingStub(
|
||||
RegisterUserPort_address);
|
||||
new java.net.URL(RegisterUserPort_address), this);
|
||||
_stub.setPortName(getRegisterUserPortWSDDServiceName());
|
||||
return _stub;
|
||||
}
|
||||
} catch (java.lang.Throwable t) {
|
||||
@@ -88,6 +98,7 @@ public class RegisterUserLocator implements
|
||||
return getRegisterUserPort();
|
||||
} else {
|
||||
java.rmi.Remote _stub = getPort(serviceEndpointInterface);
|
||||
((org.apache.axis.client.Stub) _stub).setPortName(portName);
|
||||
return _stub;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,4 +217,79 @@ public class UserRegistration implements java.io.Serializable {
|
||||
return _hashCode;
|
||||
}
|
||||
|
||||
// Type metadata
|
||||
private static org.apache.axis.description.TypeDesc typeDesc =
|
||||
new org.apache.axis.description.TypeDesc(UserRegistration.class, true);
|
||||
|
||||
static {
|
||||
typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.talend.com/TalendRegisterWS/wsdl", "UserRegistration"));
|
||||
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("id");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "id"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("email");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "email"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("country");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "country"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("designer_version");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "designer_version"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("productname");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "productname"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("registration_date");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "registration_date"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return type metadata object
|
||||
*/
|
||||
public static org.apache.axis.description.TypeDesc getTypeDesc() {
|
||||
return typeDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Custom Serializer
|
||||
*/
|
||||
public static org.apache.axis.encoding.Serializer getSerializer(
|
||||
java.lang.String mechType,
|
||||
java.lang.Class _javaType,
|
||||
javax.xml.namespace.QName _xmlType) {
|
||||
return
|
||||
new org.apache.axis.encoding.ser.BeanSerializer(
|
||||
_javaType, _xmlType, typeDesc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Custom Deserializer
|
||||
*/
|
||||
public static org.apache.axis.encoding.Deserializer getDeserializer(
|
||||
java.lang.String mechType,
|
||||
java.lang.Class _javaType,
|
||||
javax.xml.namespace.QName _xmlType) {
|
||||
return
|
||||
new org.apache.axis.encoding.ser.BeanDeserializer(
|
||||
_javaType, _xmlType, typeDesc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ Bundle-Version: 7.4.1.qualifier
|
||||
Bundle-Activator: org.talend.repository.metadata.Activator
|
||||
Require-Bundle: org.apache.commons.lang,
|
||||
org.apache.log4j,
|
||||
org.apache.axis,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.emf.ecore.xmi,
|
||||
org.eclipse.gef,
|
||||
@@ -19,6 +20,7 @@ Require-Bundle: org.apache.commons.lang,
|
||||
org.talend.libraries.jexcel;resolution:=optional,
|
||||
org.talend.libraries.excel,
|
||||
org.talend.libraries.jxplorer;resolution:=optional,
|
||||
org.talend.libraries.salesforce;resolution:=optional,
|
||||
javax.xml.rpc,
|
||||
org.talend.model,
|
||||
org.talend.commons.ui,
|
||||
|
||||
@@ -165,6 +165,13 @@
|
||||
isReadAction="true"
|
||||
level="10"
|
||||
name="Metadata/Create file Excel"/>
|
||||
<Action
|
||||
class="org.talend.repository.metadata.ui.actions.metadata.CreateSalesforceSchemaAction"
|
||||
id="org.talend.repository.actions.createsalesforceschema"
|
||||
isEditAction="true"
|
||||
isReadAction="true"
|
||||
level="10"
|
||||
name="Metadata/Create Salesforce"/>
|
||||
|
||||
<Action
|
||||
class="org.talend.repository.metadata.ui.actions.metadata.CreateGenericSchemaAction"
|
||||
@@ -190,6 +197,20 @@
|
||||
level="10"
|
||||
name="Metadata/Create WSDL schemas">
|
||||
</Action>
|
||||
<Action
|
||||
class="org.talend.repository.metadata.ui.actions.metadata.CreateSalesforceModulesAction"
|
||||
id="org.talend.repository.actions.createSalesforceModulesAction"
|
||||
isEditAction="true"
|
||||
isReadAction="true"
|
||||
level="10"
|
||||
name="Metadata/Create Salesforce Modules"/>
|
||||
<Action
|
||||
class="org.talend.repository.metadata.ui.actions.metadata.CreateSalesforceSchemasAction"
|
||||
id="org.talend.repository.actions.CreateSalesforceSchemasAction"
|
||||
isEditAction="true"
|
||||
isReadAction="true"
|
||||
level="10"
|
||||
name="Metadata/Create Salesforce Schemas"/>
|
||||
<Action
|
||||
class="org.talend.repository.metadata.ui.actions.metadata.ImportSchemaFileAction"
|
||||
id="org.talend.repository.actions.ImportSchemaFileAction"
|
||||
|
||||
@@ -55,6 +55,7 @@ import org.talend.repository.ui.wizards.metadata.connection.files.excel.ExcelFil
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.ldif.LdifFileWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.positional.FilePositionalWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.regexp.RegexpFileWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceSchemaWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.xml.XmlFileWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.genericshema.GenericSchemaWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.ldap.LDAPSchemaWizard;
|
||||
@@ -149,6 +150,8 @@ public class MetadataService implements IMetadataService {
|
||||
relatedWizard = new LDAPSchemaWizard(PlatformUI.getWorkbench(), creation, realNode, null, false);
|
||||
} else if (objectType.equals(ERepositoryObjectType.METADATA_FILE_EXCEL)) {
|
||||
relatedWizard = new ExcelFileWizard(PlatformUI.getWorkbench(), creation, realNode, null);
|
||||
} else if (objectType.equals(ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA)) {
|
||||
relatedWizard = new SalesforceSchemaWizard(PlatformUI.getWorkbench(), creation, realNode, null, false);
|
||||
} else if (objectType.equals(ERepositoryObjectType.METADATA_FILE_EBCDIC)) {
|
||||
if (PluginChecker.isEBCDICPluginLoaded()) {
|
||||
IProviderService iebcdicService = GlobalServiceRegister.getDefault().findService("IEBCDICProviderService");
|
||||
|
||||
@@ -52,6 +52,8 @@ import org.talend.core.model.metadata.builder.connection.LdifFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.PositionalFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.RegexpFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.SalesforceModuleUnit;
|
||||
import org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.WSDLSchemaConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.XmlFileConnection;
|
||||
import org.talend.core.model.metadata.builder.database.ExtractMetaDataFromDataBase;
|
||||
@@ -69,6 +71,7 @@ import org.talend.core.model.properties.LdifFileConnectionItem;
|
||||
import org.talend.core.model.properties.PositionalFileConnectionItem;
|
||||
import org.talend.core.model.properties.RegExFileConnectionItem;
|
||||
import org.talend.core.model.properties.SAPConnectionItem;
|
||||
import org.talend.core.model.properties.SalesforceSchemaConnectionItem;
|
||||
import org.talend.core.model.properties.WSDLSchemaConnectionItem;
|
||||
import org.talend.core.model.properties.XmlFileConnectionItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
@@ -96,6 +99,9 @@ import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.ui.views.IRepositoryView;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceModulesWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceSchemaTableWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceSchemasWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.genericshema.GenericSchemaTableWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.ldap.LDAPSchemaTableWizard;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.wsdl.WSDLSchemaTableWizard;
|
||||
@@ -693,6 +699,174 @@ public abstract class AbstractCreateTableAction extends AbstractCreateAction {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC YeXiaowei Comment method "createSalesforceSchemaWizard".
|
||||
*
|
||||
* @param selection
|
||||
* @param forceReadOnly
|
||||
*/
|
||||
public void createSalesforceSchemaWizard(RepositoryNode node, final boolean forceReadOnly) {
|
||||
SalesforceSchemaConnection connection = null;
|
||||
MetadataTable metadataTable = null;
|
||||
|
||||
boolean creation = false;
|
||||
if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
String tableLabel = (String) node.getProperties(EProperties.LABEL);
|
||||
|
||||
SalesforceSchemaConnectionItem item = null;
|
||||
if (nodeType == ERepositoryObjectType.METADATA_CON_TABLE) {
|
||||
if (node.getParent().isBin() && node.getParent().getObject() == null) {
|
||||
item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
} else {
|
||||
item = (SalesforceSchemaConnectionItem) node.getParent().getObject().getProperty().getItem();
|
||||
}
|
||||
connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
metadataTable = TableHelper.findByLabel(connection, tableLabel);
|
||||
creation = false;
|
||||
} else if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
|
||||
item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
String nextId = ProxyRepositoryFactory.getInstance().getNextId();
|
||||
metadataTable.setId(nextId);
|
||||
metadataTable.setLabel(getStringIndexed(metadataTable.getLabel()));
|
||||
GenericPackage g = (GenericPackage) ConnectionHelper.getPackage(connection.getName(), connection,
|
||||
GenericPackage.class);
|
||||
if (g != null) { // hywang
|
||||
g.getOwnedElement().add(metadataTable);
|
||||
} else {
|
||||
GenericPackage gpkg = ConnectionFactory.eINSTANCE.createGenericPackage();
|
||||
PackageHelper.addMetadataTable(metadataTable, gpkg);
|
||||
ConnectionHelper.addPackage(gpkg, connection);
|
||||
|
||||
}
|
||||
creation = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
initContextMode(item);
|
||||
|
||||
if (metadataTable.eContainer() instanceof SalesforceModuleUnit) {
|
||||
SalesforceModuleUnit unit = (SalesforceModuleUnit) metadataTable.eContainer();
|
||||
connection.setModuleName(unit.getModuleName());
|
||||
}
|
||||
// set the repositoryObject, lock and set isRepositoryObjectEditable
|
||||
SalesforceSchemaTableWizard salesforceSchemaWizard = new SalesforceSchemaTableWizard(PlatformUI.getWorkbench(),
|
||||
creation, item, metadataTable, forceReadOnly);
|
||||
salesforceSchemaWizard.setRepositoryObject(node.getObject());
|
||||
|
||||
WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), salesforceSchemaWizard);
|
||||
handleWizard(node, wizardDialog);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC YeXiaowei Comment method "createSalesforceSchemaWizard".
|
||||
*
|
||||
* @param selection
|
||||
* @param forceReadOnly
|
||||
*/
|
||||
public void createSalesforceSchemasWizard(RepositoryNode node, final boolean forceReadOnly) {
|
||||
SalesforceSchemaConnection connection = null;
|
||||
MetadataTable metadataTable = null;
|
||||
boolean creation = false;
|
||||
if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
String tableLabel = (String) node.getProperties(EProperties.LABEL);
|
||||
|
||||
SalesforceSchemaConnectionItem item = null;
|
||||
// if (nodeType == ERepositoryObjectType.METADATA_CON_TABLE) {
|
||||
//
|
||||
// item = (SalesforceSchemaConnectionItem) node.getParent().getObject().getProperty().getItem();
|
||||
// connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
// metadataTable = TableHelper.findByLabel(connection, tableLabel);
|
||||
// creation = false;
|
||||
// } else if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
|
||||
// item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
// connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
// metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
// String nextId = ProxyRepositoryFactory.getInstance().getNextId();
|
||||
// metadataTable.setId(nextId);
|
||||
// metadataTable.setLabel(getStringIndexed(metadataTable.getLabel()));
|
||||
// creation = true;
|
||||
// } else
|
||||
if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_MODULE) {
|
||||
item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
metadataTable = TableHelper.findByLabel(connection, tableLabel);
|
||||
creation = false;
|
||||
} else {
|
||||
return;
|
||||
|
||||
}
|
||||
initContextMode(item);
|
||||
if (metadataTable.eContainer() instanceof SalesforceModuleUnit) {
|
||||
SalesforceModuleUnit unit = (SalesforceModuleUnit) metadataTable.eContainer();
|
||||
connection.setModuleName(unit.getModuleName());
|
||||
}
|
||||
// set the repositoryObject, lock and set isRepositoryObjectEditable
|
||||
SalesforceSchemasWizard salesforceSchemasWizard = new SalesforceSchemasWizard(PlatformUI.getWorkbench(), creation,
|
||||
node.getObject(), metadataTable, getExistingNames(), forceReadOnly, null, null, node.getProperties(
|
||||
EProperties.LABEL).toString());
|
||||
// salesforceSchemaWizard.setRepositoryObject(node.getObject());
|
||||
|
||||
WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), salesforceSchemasWizard);
|
||||
handleWizard(node, wizardDialog);
|
||||
}
|
||||
}
|
||||
|
||||
public void createSalesforceModuleWizard(RepositoryNode node, final boolean forceReadOnly) {
|
||||
SalesforceSchemaConnection connection = null;
|
||||
MetadataTable metadataTable = null;
|
||||
boolean creation = false;
|
||||
if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
String tableLabel = (String) node.getProperties(EProperties.LABEL);
|
||||
|
||||
SalesforceSchemaConnectionItem item = null;
|
||||
if (nodeType == ERepositoryObjectType.METADATA_CON_TABLE) {
|
||||
if (node.getParent().isBin() && node.getParent().getObject() == null) {
|
||||
item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
} else {
|
||||
item = (SalesforceSchemaConnectionItem) node.getParent().getObject().getProperty().getItem();
|
||||
}
|
||||
connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
metadataTable = TableHelper.findByLabel(connection, tableLabel);
|
||||
creation = false;
|
||||
} else if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
|
||||
item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
String nextId = ProxyRepositoryFactory.getInstance().getNextId();
|
||||
metadataTable.setId(nextId);
|
||||
metadataTable.setLabel(getStringIndexed(metadataTable.getLabel()));
|
||||
creation = false;
|
||||
} else if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_MODULE) {
|
||||
item = (SalesforceSchemaConnectionItem) node.getObject().getProperty().getItem();
|
||||
connection = (SalesforceSchemaConnection) item.getConnection();
|
||||
metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
String nextId = ProxyRepositoryFactory.getInstance().getNextId();
|
||||
metadataTable.setId(nextId);
|
||||
metadataTable.setLabel(getStringIndexed(metadataTable.getLabel()));
|
||||
creation = false;
|
||||
} else {
|
||||
return;
|
||||
|
||||
}
|
||||
initContextMode(item);
|
||||
// set the repositoryObject, lock and set isRepositoryObjectEditable
|
||||
SalesforceModulesWizard salesforceSchemaWizard = new SalesforceModulesWizard(PlatformUI.getWorkbench(), creation,
|
||||
node.getObject(), metadataTable, getExistingNames(), forceReadOnly, null, null);
|
||||
// salesforceSchemaWizard.setRepositoryObject(node.getObject());
|
||||
|
||||
WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), salesforceSchemaWizard);
|
||||
handleWizard(node, wizardDialog);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC hwang Comment method "createSAPSchemaWizard".
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.repository.metadata.ui.actions.metadata;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.SubscriberTable;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject;
|
||||
import org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.metadata.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.ui.views.IRepositoryView;
|
||||
|
||||
/**
|
||||
* Action used to create table on metadata.<br/>
|
||||
*
|
||||
* $Id: CreateTableAction.java 54939 2011-02-11 01:34:57Z mhirt $
|
||||
*
|
||||
*/
|
||||
public class CreateSalesforceModulesAction extends AbstractCreateTableAction {
|
||||
|
||||
protected static Logger log = Logger.getLogger(CreateConnectionAction.class);
|
||||
|
||||
protected static final String PID = "org.talend.repository"; //$NON-NLS-1$
|
||||
|
||||
protected static final String CREATE_LABEL = Messages.getString("CreateSalesforceModulesAction.retriveModules"); //$NON-NLS-1$
|
||||
|
||||
protected static final String EDIT_LABEL = Messages.getString("CreateSalesforceModulesAction.retriveModules"); //$NON-NLS-1$
|
||||
|
||||
private RepositoryNode node;
|
||||
|
||||
public CreateSalesforceModulesAction(boolean isToolBar) {
|
||||
super();
|
||||
setToolbar(isToolBar);
|
||||
this.setText(CREATE_LABEL);
|
||||
this.setToolTipText(CREATE_LABEL);
|
||||
this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.METADATA_TABLE_ICON));
|
||||
}
|
||||
|
||||
public CreateSalesforceModulesAction() {
|
||||
super();
|
||||
this.setText(CREATE_LABEL);
|
||||
this.setToolTipText(CREATE_LABEL);
|
||||
this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.METADATA_TABLE_ICON));
|
||||
}
|
||||
|
||||
/**
|
||||
* yzhang CreateTableAction constructor comment.
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
public CreateSalesforceModulesAction(RepositoryNode node) {
|
||||
this();
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
protected void doRun() {
|
||||
RepositoryNode metadataNode = null;
|
||||
if (node == null && repositoryNode != null) {
|
||||
node = repositoryNode;
|
||||
}
|
||||
if (node == null) {
|
||||
// RepositoryNode metadataNode = getViewPart().getRoot().getChildren().get(6);
|
||||
metadataNode = getMetadataNode(getCurrentRepositoryNode());
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
node = (RepositoryNode) selection.getFirstElement();
|
||||
// Force focus to the repositoryView and open Metadata and DbConnection nodes
|
||||
IRepositoryView viewPart = getViewPart();
|
||||
if (viewPart != null) {
|
||||
viewPart.setFocus();
|
||||
viewPart.expand(metadataNode, true);
|
||||
}
|
||||
} else {
|
||||
metadataNode = getMetadataNode(node);
|
||||
}
|
||||
|
||||
// Init the content of the Wizard
|
||||
init(node);
|
||||
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
|
||||
if (ERepositoryObjectType.METADATA_CON_TABLE.equals(nodeType)
|
||||
|| ERepositoryObjectType.METADATA_CON_COLUMN.equals(nodeType)) {
|
||||
final IRepositoryViewObject object = node.getObject();
|
||||
if (object instanceof MetadataTableRepositoryObject) {
|
||||
MetadataTable table = ((MetadataTableRepositoryObject) object).getTable();
|
||||
if (table instanceof SubscriberTable) {
|
||||
this.node = null;
|
||||
return;
|
||||
}
|
||||
} else if (object instanceof MetadataColumnRepositoryObject) {
|
||||
MetadataTable table = ((MetadataColumnRepositoryObject) object).getTdColumn().getTable();
|
||||
this.node = node.getParent().getParent();
|
||||
if (table instanceof SubscriberTable) {
|
||||
this.node = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConnectionItem connectionItem = (ConnectionItem) object.getProperty().getItem();
|
||||
nodeType = ERepositoryObjectType.getItemType(connectionItem);
|
||||
|
||||
}
|
||||
createSalesforceModuleWizard(node, false);
|
||||
|
||||
this.node = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getClassForDoubleClick() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.talend.repository.ui.actions.metadata.AbstractCreateAction#init(org.talend.repository.model.RepositoryNode)
|
||||
*/
|
||||
@Override
|
||||
protected void init(RepositoryNode node) {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
|
||||
setEnabled(false);
|
||||
} else {
|
||||
if (ENodeType.REPOSITORY_ELEMENT.equals(node.getType())) {
|
||||
if (node.getObject().getRepositoryStatus() == ERepositoryStatus.DELETED
|
||||
|| node.getObject().getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
if (ERepositoryObjectType.METADATA_CON_TABLE.equals(nodeType)
|
||||
|| ERepositoryObjectType.METADATA_CON_COLUMN.equals(nodeType)) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
if (ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA.equals(nodeType)) {
|
||||
setText(CREATE_LABEL);
|
||||
collectChildNames(node);
|
||||
if (isLastVersion(node)) {
|
||||
setEnabled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// if (ERepositoryObjectType.METADATA_CON_QUERY.equals(nodeType)) {
|
||||
// setEnabled(false);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,23 +13,22 @@
|
||||
package org.talend.repository.metadata.ui.actions.metadata;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.wizard.WizardDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.runtime.image.OverlayImageProvider;
|
||||
import org.talend.commons.ui.swt.actions.ITreeContextualAction;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.properties.SalesforceSchemaConnectionItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.ui.actions.metadata.AbstractCreateAction;
|
||||
import org.talend.core.runtime.services.IGenericWizardService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.metadata.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceSchemaWizard;
|
||||
|
||||
/**
|
||||
* DOC yexiaowei class global comment. Detailled comment
|
||||
@@ -39,13 +38,21 @@ public class CreateSalesforceSchemaAction extends AbstractCreateAction {
|
||||
|
||||
private static final String CREATE_LABEL = Messages.getString("CreateSalesforceSchemaAction.createConnection"); //$NON-NLS-1$
|
||||
|
||||
private static final String EDIT_LABEL = Messages.getString("CreateSalesforceSchemaAction.editConnection"); //$NON-NLS-1$
|
||||
|
||||
private static final String OPEN_LABEL = Messages.getString("CreateSalesforceSchemaAction.editConnection"); //$NON-NLS-1$
|
||||
|
||||
protected static final int WIZARD_WIDTH = 800;
|
||||
|
||||
protected static final int WIZARD_HEIGHT = 520;
|
||||
|
||||
private boolean creation = false;
|
||||
|
||||
ImageDescriptor defaultImage = ImageProvider.getImageDesc(ECoreImage.METADATA_SALESFORCE_SCHEMA_ICON);
|
||||
|
||||
ImageDescriptor createImage = OverlayImageProvider.getImageWithNew(ImageProvider
|
||||
.getImage(ECoreImage.METADATA_SALESFORCE_SCHEMA_ICON));
|
||||
|
||||
private AbstractCreateAction createAction;
|
||||
|
||||
public CreateSalesforceSchemaAction() {
|
||||
super();
|
||||
|
||||
@@ -65,47 +72,45 @@ public class CreateSalesforceSchemaAction extends AbstractCreateAction {
|
||||
|
||||
@Override
|
||||
protected void doRun() {
|
||||
|
||||
if (repositoryNode == null) {
|
||||
repositoryNode = getCurrentRepositoryNode();
|
||||
}
|
||||
|
||||
if (isToolbar()) {
|
||||
ERepositoryObjectType salesforceType = ERepositoryObjectType.getType("salesforce");
|
||||
if (repositoryNode != null && repositoryNode.getContentType() != salesforceType) {
|
||||
if (repositoryNode != null && repositoryNode.getContentType() != ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
|
||||
repositoryNode = null;
|
||||
}
|
||||
if (repositoryNode == null || (repositoryNode.getType() != ENodeType.SIMPLE_FOLDER
|
||||
&& repositoryNode.getType() != ENodeType.SYSTEM_FOLDER)) {
|
||||
repositoryNode = getRepositoryNodeForDefault(salesforceType);
|
||||
if (repositoryNode == null) {
|
||||
repositoryNode = getRepositoryNodeForDefault(ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA);
|
||||
}
|
||||
}
|
||||
|
||||
WizardDialog wizardDialog = null;
|
||||
if (isToolbar()) {
|
||||
init(repositoryNode);
|
||||
SalesforceSchemaWizard salesForceSchemaWizard = new SalesforceSchemaWizard(PlatformUI.getWorkbench(), creation,
|
||||
repositoryNode, getExistingNames(), false);
|
||||
salesForceSchemaWizard.setToolbar(true);
|
||||
wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), salesForceSchemaWizard);// TODO send
|
||||
} else {
|
||||
wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), new SalesforceSchemaWizard(
|
||||
PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames(), false));
|
||||
}
|
||||
|
||||
ITreeContextualAction defaultAction = getGenericAction(repositoryNode);
|
||||
if (defaultAction instanceof AbstractCreateAction) {
|
||||
createAction = (AbstractCreateAction) defaultAction;
|
||||
createAction.setCurrentRepositoryNode(repositoryNode);
|
||||
createAction.init(null, new StructuredSelection(repositoryNode));
|
||||
createAction.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
wizardDialog.setPageSize(WIZARD_WIDTH, WIZARD_HEIGHT);
|
||||
wizardDialog.create();
|
||||
wizardDialog.open();
|
||||
|
||||
private ITreeContextualAction getGenericAction(RepositoryNode repositoryNode) {
|
||||
IGenericWizardService wizardService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
|
||||
wizardService = (IGenericWizardService) GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
|
||||
}
|
||||
ITreeContextualAction defaultAction = null;
|
||||
if (wizardService != null) {
|
||||
ERepositoryObjectType repObjType = (ERepositoryObjectType) repositoryNode.getProperties(EProperties.CONTENT_TYPE);
|
||||
defaultAction = wizardService.getGenericAction(repObjType.getType(), null);
|
||||
}
|
||||
return defaultAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init(RepositoryNode node) {
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
if (!ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA.equals(nodeType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
switch (node.getType()) {
|
||||
case SIMPLE_FOLDER:
|
||||
@@ -120,8 +125,21 @@ public class CreateSalesforceSchemaAction extends AbstractCreateAction {
|
||||
}
|
||||
this.setText(CREATE_LABEL);
|
||||
collectChildNames(node);
|
||||
creation = true;
|
||||
this.setImageDescriptor(createImage);
|
||||
break;
|
||||
case REPOSITORY_ELEMENT:
|
||||
if (factory.isPotentiallyEditable(node.getObject())) {
|
||||
this.setText(EDIT_LABEL);
|
||||
this.setImageDescriptor(defaultImage);
|
||||
collectSiblingNames(node);
|
||||
} else {
|
||||
this.setText(OPEN_LABEL);
|
||||
this.setImageDescriptor(defaultImage);
|
||||
}
|
||||
collectSiblingNames(node);
|
||||
creation = false;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.repository.metadata.ui.actions.metadata;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.SubscriberTable;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject;
|
||||
import org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.metadata.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.ui.views.IRepositoryView;
|
||||
|
||||
/**
|
||||
* Action used to create table on metadata.<br/>
|
||||
*
|
||||
* $Id: CreateTableAction.java 54939 2011-02-11 01:34:57Z mhirt $
|
||||
*
|
||||
*/
|
||||
public class CreateSalesforceSchemasAction extends AbstractCreateTableAction {
|
||||
|
||||
protected static Logger log = Logger.getLogger(CreateConnectionAction.class);
|
||||
|
||||
protected static final String PID = "org.talend.repository"; //$NON-NLS-1$
|
||||
|
||||
protected static final String CREATE_LABEL = Messages.getString("CreateSalesforceSchemasAction.createSchemas");//$NON-NLS-1$
|
||||
|
||||
protected static final String EDIT_LABEL = Messages.getString("CreateSalesforceSchemasAction.editSchemas");//$NON-NLS-1$
|
||||
|
||||
private RepositoryNode node;
|
||||
|
||||
public CreateSalesforceSchemasAction(boolean isToolBar) {
|
||||
super();
|
||||
setToolbar(isToolBar);
|
||||
this.setText(CREATE_LABEL);
|
||||
this.setToolTipText(CREATE_LABEL);
|
||||
this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.METADATA_TABLE_ICON));
|
||||
}
|
||||
|
||||
public CreateSalesforceSchemasAction() {
|
||||
super();
|
||||
this.setText(CREATE_LABEL);
|
||||
this.setToolTipText(CREATE_LABEL);
|
||||
this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.METADATA_TABLE_ICON));
|
||||
}
|
||||
|
||||
/**
|
||||
* yzhang CreateTableAction constructor comment.
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
public CreateSalesforceSchemasAction(RepositoryNode node) {
|
||||
this();
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
protected void doRun() {
|
||||
RepositoryNode metadataNode = null;
|
||||
if (node == null && repositoryNode != null) {
|
||||
node = repositoryNode;
|
||||
}
|
||||
if (node == null) {
|
||||
// RepositoryNode metadataNode = getViewPart().getRoot().getChildren().get(6);
|
||||
metadataNode = getMetadataNode(getCurrentRepositoryNode());
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
node = (RepositoryNode) selection.getFirstElement();
|
||||
// Force focus to the repositoryView and open Metadata and DbConnection nodes
|
||||
IRepositoryView viewPart = getViewPart();
|
||||
if (viewPart != null) {
|
||||
viewPart.setFocus();
|
||||
viewPart.expand(metadataNode, true);
|
||||
}
|
||||
} else {
|
||||
metadataNode = getMetadataNode(node);
|
||||
}
|
||||
|
||||
// Init the content of the Wizard
|
||||
init(node);
|
||||
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
|
||||
if (ERepositoryObjectType.METADATA_CON_TABLE.equals(nodeType)
|
||||
|| ERepositoryObjectType.METADATA_CON_COLUMN.equals(nodeType)) {
|
||||
final IRepositoryViewObject object = node.getObject();
|
||||
if (object instanceof MetadataTableRepositoryObject) {
|
||||
MetadataTable table = ((MetadataTableRepositoryObject) object).getTable();
|
||||
if (table instanceof SubscriberTable) {
|
||||
this.node = null;
|
||||
return;
|
||||
}
|
||||
} else if (object instanceof MetadataColumnRepositoryObject) {
|
||||
MetadataTable table = ((MetadataColumnRepositoryObject) object).getTdColumn().getTable();
|
||||
this.node = node.getParent().getParent();
|
||||
if (table instanceof SubscriberTable) {
|
||||
this.node = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConnectionItem connectionItem = (ConnectionItem) object.getProperty().getItem();
|
||||
nodeType = ERepositoryObjectType.getItemType(connectionItem);
|
||||
|
||||
}
|
||||
createSalesforceSchemasWizard(node, false);
|
||||
|
||||
this.node = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getClassForDoubleClick() {
|
||||
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
|
||||
if (service != null) {
|
||||
return service.getClassForSalesforceModule();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.talend.repository.ui.actions.metadata.AbstractCreateAction#init(org.talend.repository.model.RepositoryNode)
|
||||
*/
|
||||
@Override
|
||||
protected void init(RepositoryNode node) {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
|
||||
setEnabled(false);
|
||||
} else {
|
||||
if (ENodeType.REPOSITORY_ELEMENT.equals(node.getType())) {
|
||||
if (node.getObject().getRepositoryStatus() == ERepositoryStatus.DELETED
|
||||
|| node.getObject().getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
if (ERepositoryObjectType.METADATA_CON_TABLE.equals(nodeType)
|
||||
|| ERepositoryObjectType.METADATA_CON_COLUMN.equals(nodeType)) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
if (ERepositoryObjectType.METADATA_SALESFORCE_MODULE.equals(nodeType)) {
|
||||
setText(CREATE_LABEL);
|
||||
collectChildNames(node);
|
||||
if (isLastVersion(node)) {
|
||||
setEnabled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// if (ERepositoryObjectType.METADATA_CON_QUERY.equals(nodeType)) {
|
||||
// setEnabled(false);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,6 +166,8 @@ public class CreateTableAction extends AbstractCreateTableAction {
|
||||
createLDAPSchemaWizard(node, false);
|
||||
} else if (ERepositoryObjectType.METADATA_WSDL_SCHEMA.equals(nodeType)) {
|
||||
createWSDLSchemaWizard(node, false);
|
||||
} else if (ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA.equals(nodeType)) {
|
||||
createSalesforceSchemaWizard(node, false);
|
||||
} else if (ERepositoryObjectType.METADATA_SAPCONNECTIONS != null
|
||||
&& ERepositoryObjectType.METADATA_SAPCONNECTIONS.equals(nodeType)) {
|
||||
createSAPSchemaWizard(node, false);
|
||||
|
||||
@@ -170,6 +170,8 @@ public class ReadTableAction extends AbstractCreateTableAction {
|
||||
createGenericSchemaWizard(node, true);
|
||||
} else if (ERepositoryObjectType.METADATA_LDAP_SCHEMA.equals(nodeType)) {
|
||||
createLDAPSchemaWizard(node, true);
|
||||
} else if (ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA.equals(nodeType)) {
|
||||
createSalesforceSchemaWizard(node, true);
|
||||
} else { // handle the schemas of extensive nodes.
|
||||
createExtenseNodeSchemaWizard(nodeType, node, true);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,686 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.repository.metadata.ui.wizards.form;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.IMetadataContextModeManager;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection;
|
||||
import org.talend.core.model.process.AbstractNode;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.utils.RepositoryManagerHelper;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.metadata.managment.ui.wizard.AbstractForm;
|
||||
import org.talend.repository.metadata.i18n.Messages;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.ISalesforceModuleParser;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceModuleParseAPI;
|
||||
import org.talend.repository.ui.wizards.metadata.connection.files.salesforce.SalesforceModuleParserPartner;
|
||||
import org.talend.salesforce.SforceConnection;
|
||||
import org.talend.salesforce.SforceManagement;
|
||||
import org.talend.salesforce.SforceSessionConnection;
|
||||
import org.talend.salesforce.oauth.OAuthClient;
|
||||
import org.talend.salesforce.oauth.Token;
|
||||
|
||||
import com.salesforce.soap.partner.DescribeSObjectResult;
|
||||
import com.salesforce.soap.partner.Field;
|
||||
import com.sforce.soap.enterprise.DescribeGlobalResult;
|
||||
import com.sforce.soap.enterprise.SoapBindingStub;
|
||||
import com.sforce.soap.enterprise.fault.UnexpectedErrorFault;
|
||||
|
||||
/**
|
||||
* DOC YeXiaowei class global comment. Detailled comment <br/>
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractSalesforceStepForm extends AbstractForm {
|
||||
|
||||
protected int maximumRowsToPreview = RepositoryManagerHelper.getMaximumRowsToPreview();
|
||||
|
||||
protected SalesforceSchemaConnection connection;
|
||||
|
||||
protected AbstractNode fakeSalesforceNode = null;
|
||||
|
||||
private final String tSalesforceUniqueName = "tSalesforceInput"; //$NON-NLS-1$
|
||||
|
||||
private final String BASIC = "basic";
|
||||
|
||||
private SalesforceModuleParseAPI salesforceAPI = null;
|
||||
|
||||
private IMetadataContextModeManager contextModeManager;
|
||||
|
||||
private SoapBindingStub binding = null;
|
||||
|
||||
private SforceManagement sforceMgr = null;
|
||||
|
||||
// private com.salesforce.soap.partner.SoapBindingStub bindingPartner = null;
|
||||
|
||||
public static final String TSALESFORCE_INPUT_URL = "https://login.salesforce.com/services/Soap/u/34.0"; //$NON-NLS-1$
|
||||
|
||||
public static final String TSALESFORCE_INPUT_URL_OAUTH = "https://login.salesforce.com/services/oauth2"; //$NON-NLS-1$
|
||||
|
||||
public static final String TSALESFORCE_VERSION = "34.0";
|
||||
|
||||
public static final String TSALESFORCE_PARTNER_INPUT_URL = "https://test.salesforce.com/services/Soap/u/10.0"; //$NON-NLS-1$
|
||||
|
||||
// note that tSalesforceInput use a different url, if the web service is called by wizard we should use
|
||||
// DEFAULT_WEB_SERVICE_URL, if the web service is called by tSalesforceInput we should use TSALESFORCE_INPUT_URL
|
||||
public static final String DEFAULT_WEB_SERVICE_URL = "https://www.salesforce.com/services/Soap/u/8.0"; //$NON-NLS-1$
|
||||
|
||||
public static final String DEFAULT_WEB_SERVICE_FOR_SOQL_URL = "https://www.salesforce.com/services/Soap/c/8.0"; //$NON-NLS-1$
|
||||
|
||||
public static final String TSALESFORCE_CUSTOM_MODULE = "org.talend.salesforce.custom.module"; //$NON-NLS-1$
|
||||
|
||||
public static final String TSALESFORCE_CUSTOM_MODULE_SPILT = ","; //$NON-NLS-1$
|
||||
|
||||
public boolean useAlphbet;
|
||||
|
||||
public IMetadataTable metadataTableOrder;
|
||||
|
||||
public IMetadataTable metadataTableClone;
|
||||
|
||||
public AbstractSalesforceStepForm(Composite parent, ConnectionItem connectionItem, String[] existingNames,
|
||||
SalesforceModuleParseAPI salesforceAPI) {
|
||||
super(parent, SWT.NONE, existingNames);
|
||||
setConnectionItem(connectionItem);
|
||||
this.salesforceAPI = salesforceAPI;
|
||||
}
|
||||
|
||||
public AbstractSalesforceStepForm(Composite parent, ConnectionItem connectionItem, SalesforceModuleParseAPI salesforceAPI) {
|
||||
this(parent, connectionItem, null, salesforceAPI);
|
||||
}
|
||||
|
||||
public AbstractSalesforceStepForm(Composite parent, ConnectionItem connectionItem, MetadataTable metadataTable,
|
||||
String[] existingNames, SalesforceModuleParseAPI salesforceAPI) {
|
||||
super(parent, SWT.NONE, existingNames);
|
||||
setConnectionItem(connectionItem);
|
||||
this.salesforceAPI = salesforceAPI;
|
||||
}
|
||||
|
||||
protected SalesforceSchemaConnection getConnection() {
|
||||
return (SalesforceSchemaConnection) connectionItem.getConnection();
|
||||
}
|
||||
|
||||
public boolean isPerlProject() {
|
||||
ECodeLanguage codeLanguage = LanguageManager.getCurrentLanguage();
|
||||
return (codeLanguage == ECodeLanguage.PERL);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC YeXiaowei Comment method "getSalesforceComponent".
|
||||
*
|
||||
* @return Always not null
|
||||
*/
|
||||
public INode getSalesforceNode() {
|
||||
return CoreRuntimePlugin.getInstance().getDesignerCoreService().getRefrenceNode(tSalesforceUniqueName);
|
||||
}
|
||||
|
||||
public IMetadataTable getMetadatasForSalesforce(String endPoint, String user, String pass, String timeOut, String moduleName,
|
||||
String betchSize, boolean useProxy, boolean useHttp, String proxyHost, String proxyPort, String proxyUsername,
|
||||
String proxyPassword, boolean update) {
|
||||
|
||||
IMetadataTable result = null;
|
||||
String proxy = null;
|
||||
if (useProxy) {
|
||||
proxy = SalesforceModuleParseAPI.USE_SOCKS_PROXY;
|
||||
} else if (useHttp) {
|
||||
proxy = SalesforceModuleParseAPI.USE_HTTP_PROXY;
|
||||
}
|
||||
if (!moduleName.equals(salesforceAPI.getCurrentModuleName())) {
|
||||
result = getMetadataTableBySalesforceServerAPI(endPoint, user, pass, timeOut, moduleName, proxy, proxyHost,
|
||||
proxyPort, proxyUsername, proxyPassword);
|
||||
if (result == null) {
|
||||
result = getMetadataTableFromConfigFile(moduleName);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
if (update) {
|
||||
result = getMetadataTableBySalesforceServerAPI(endPoint, user, pass, timeOut, moduleName, proxy, proxyHost,
|
||||
proxyPort, proxyUsername, proxyPassword);
|
||||
if (result == null) {
|
||||
result = getMetadataTableFromConfigFile(moduleName);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
IMetadataTable metadataTable = new org.talend.core.model.metadata.MetadataTable();
|
||||
metadataTable.setListColumns(salesforceAPI.getCurrentMetadataColumns());
|
||||
return metadataTable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Field[] fetchSFDescriptionField(String module, org.talend.salesforce.SforceManagement sforceManagement) {
|
||||
|
||||
DescribeSObjectResult r;
|
||||
try {
|
||||
r = sforceManagement.describeSObject(module);
|
||||
Field[] fields = r.getFields();
|
||||
return fields;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private IMetadataColumn parseFieldToMetadataColumn(Field field) {
|
||||
|
||||
if (field == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
IMetadataColumn mdColumn = new org.talend.core.model.metadata.MetadataColumn();
|
||||
|
||||
mdColumn.setLabel(field.getName());
|
||||
mdColumn.setKey(false);
|
||||
|
||||
String type = field.getType().toString();
|
||||
String talendType = "String"; //$NON-NLS-1$
|
||||
if (type.equals("boolean")) { //$NON-NLS-1$
|
||||
talendType = "Boolean"; //$NON-NLS-1$
|
||||
} else if (type.equals("int")) { //$NON-NLS-1$
|
||||
talendType = "Integer"; //$NON-NLS-1$
|
||||
} else if (type.equals("date") || type.equals("datetime")) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||
talendType = "Date"; //$NON-NLS-1$
|
||||
} else if (type.equals("double") || type.equals("currency")) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||
talendType = "Double"; //$NON-NLS-1$
|
||||
} else {
|
||||
talendType = "String"; //$NON-NLS-1$
|
||||
}
|
||||
// mdColumn.setType(talendType);
|
||||
mdColumn.setTalendType("id_" + talendType); // How to transfer type? TODO //$NON-NLS-1$
|
||||
// mdColumn.setNullable(field.isNillable());
|
||||
mdColumn.setNullable(field.getNillable());
|
||||
|
||||
if (type.equals("date")) { //$NON-NLS-1$
|
||||
mdColumn.setPattern("\"yyyy-MM-dd\""); //$NON-NLS-1$
|
||||
} else if (type.equals("datetime")) { //$NON-NLS-1$
|
||||
mdColumn.setPattern("\"yyyy-MM-dd\'T\'HH:mm:ss\'.000Z\'\""); //$NON-NLS-1$
|
||||
} else {
|
||||
mdColumn.setPattern(null);
|
||||
}
|
||||
if ("String".equals(talendType)) { //$NON-NLS-1$
|
||||
mdColumn.setLength(field.getLength());
|
||||
mdColumn.setPrecision(field.getPrecision());
|
||||
} else {
|
||||
mdColumn.setLength(field.getPrecision());
|
||||
mdColumn.setPrecision(field.getScale());
|
||||
}
|
||||
mdColumn.setDefault(field.getDefaultValueFormula());
|
||||
|
||||
return mdColumn;
|
||||
|
||||
}
|
||||
|
||||
private IMetadataTable getMetadataTableBySalesforceServerAPIForOauth(final String endPoint, final String consumeKey,
|
||||
final String consumeSecret, final String callbackHost, final String callbackPort, final String salesforceVersion,
|
||||
final String token, final String timeOut, final String moduleName) {
|
||||
IMetadataTable metadataTable = new org.talend.core.model.metadata.MetadataTable();
|
||||
if (consumeKey == null || consumeSecret == null
|
||||
|| consumeKey.equals("") || consumeSecret.equals("") || moduleName == null || moduleName.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
return null;
|
||||
}
|
||||
org.talend.salesforce.SforceManagement sforceManagement = null;
|
||||
try {
|
||||
OAuthClient client = new OAuthClient();
|
||||
client.setBaseOAuthURL(endPoint);
|
||||
client.setCallbackHost(callbackHost);
|
||||
client.setCallbackPort(Integer.parseInt(callbackPort));
|
||||
client.setClientID(consumeKey);
|
||||
client.setClientSecret(consumeSecret);
|
||||
Token tokenFile = salesforceAPI.login(endPoint, consumeKey, consumeSecret, callbackHost, callbackPort,
|
||||
salesforceVersion, token, timeOut);
|
||||
String url = OAuthClient.getSOAPEndpoint(tokenFile, salesforceVersion);
|
||||
SforceConnection sforceConn = new SforceSessionConnection.Builder(url, tokenFile.getAccess_token())
|
||||
.setTimeout(Integer.parseInt(timeOut)).needCompression(false).build();
|
||||
sforceManagement = new org.talend.salesforce.SforceManagementImpl(sforceConn);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
Field[] fields = fetchSFDescriptionField(moduleName, sforceManagement);
|
||||
List<IMetadataColumn> res = new ArrayList<IMetadataColumn>();
|
||||
for (Field field : fields) {
|
||||
res.add(parseFieldToMetadataColumn(field));
|
||||
}
|
||||
if (res.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
metadataTable.setListColumns(res);
|
||||
return metadataTable;
|
||||
}
|
||||
|
||||
private IMetadataTable getMetadataTableBySalesforceServerAPI(final String endPoint, final String user, final String pass,
|
||||
final String timeOut, final String moduleName, final String proxy, final String proxyHost, final String proxyPort,
|
||||
final String proxyUsername, final String proxyPassword) {
|
||||
IMetadataTable metadataTable = new org.talend.core.model.metadata.MetadataTable();
|
||||
|
||||
if (user == null || pass == null || user.equals("") || pass.equals("") || moduleName == null || moduleName.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
return null;
|
||||
}
|
||||
|
||||
// ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
|
||||
// try {
|
||||
// dialog.run(true, false, new IRunnableWithProgress() {
|
||||
//
|
||||
// public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
//
|
||||
// monitor.beginTask(Messages.getString("AbstractSalesforceStepForm.fetchModule", moduleName), //$NON-NLS-1$
|
||||
// IProgressMonitor.UNKNOWN);
|
||||
boolean socksProxy = false;
|
||||
boolean httpProxy = false;
|
||||
boolean httpsProxy = false;
|
||||
if (SalesforceModuleParseAPI.USE_SOCKS_PROXY.equals(proxy)) {
|
||||
socksProxy = true;
|
||||
}
|
||||
if (SalesforceModuleParseAPI.USE_HTTP_PROXY.equals(proxy)) {
|
||||
if (endPoint.startsWith("https")) {
|
||||
httpsProxy = true;
|
||||
} else {
|
||||
httpProxy = true;
|
||||
}
|
||||
|
||||
}
|
||||
salesforceAPI.resetAllProxy();
|
||||
salesforceAPI.setProxy(proxyHost, proxyPort, proxyUsername, proxyPassword, httpProxy, socksProxy, httpsProxy);
|
||||
if (!salesforceAPI.isLogin()) {
|
||||
try {
|
||||
|
||||
ArrayList loginList = salesforceAPI.login(endPoint, user, pass, timeOut);
|
||||
for (int i = 0; i < loginList.size(); i++) {
|
||||
if (loginList.get(i) instanceof SoapBindingStub) {
|
||||
binding = (SoapBindingStub) loginList.get(i);
|
||||
}
|
||||
if (loginList.get(i) instanceof SforceManagement) {
|
||||
sforceMgr = (SforceManagement) loginList.get(i);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
salesforceAPI.fetchMetaDataColumns(moduleName);
|
||||
salesforceAPI.resetAllProxy();
|
||||
// monitor.done();
|
||||
// }
|
||||
// });
|
||||
// } catch (InvocationTargetException e1) {
|
||||
// ExceptionHandler.process(e1);
|
||||
// } catch (InterruptedException e2) {
|
||||
// ExceptionHandler.process(e2);
|
||||
// }
|
||||
|
||||
if (salesforceAPI.getCurrentMetadataColumns() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
metadataTable.setListColumns(salesforceAPI.getCurrentMetadataColumns());
|
||||
return metadataTable;
|
||||
}
|
||||
|
||||
protected SalesforceModuleParseAPI checkSalesfoceLogin(final String proxy, final String endPoint, final String username,
|
||||
final String password, final String timeOut, final String proxyHost, final String proxyPort,
|
||||
final String proxyUsername, final String proxyPassword) {
|
||||
final List<String> errors = new ArrayList<String>();
|
||||
|
||||
salesforceAPI.setLogin(false);
|
||||
|
||||
ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
|
||||
try {
|
||||
dialog.run(true, false, new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
|
||||
monitor.beginTask(Messages.getString("AbstractSalesforceStepForm.tryToLogin"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
|
||||
|
||||
if (salesforceAPI == null) {
|
||||
try {
|
||||
salesforceAPI = new SalesforceModuleParseAPI();
|
||||
} catch (Throwable e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
boolean socksProxy = false;
|
||||
boolean httpProxy = false;
|
||||
boolean httpsProxy = false;
|
||||
if (SalesforceModuleParseAPI.USE_SOCKS_PROXY.equals(proxy)) {
|
||||
socksProxy = true;
|
||||
}
|
||||
if (SalesforceModuleParseAPI.USE_HTTP_PROXY.equals(proxy)) {
|
||||
if (endPoint.startsWith("https")) {
|
||||
httpsProxy = true;
|
||||
} else {
|
||||
httpProxy = true;
|
||||
}
|
||||
}
|
||||
salesforceAPI.resetAllProxy();
|
||||
|
||||
salesforceAPI.setProxy(proxyHost, proxyPort, proxyUsername, proxyPassword, httpProxy, socksProxy, httpsProxy);
|
||||
try {
|
||||
// binding ;
|
||||
ArrayList loginList = salesforceAPI.login(endPoint, username, password, timeOut);
|
||||
if (loginList != null) {
|
||||
for (int i = 0; i < loginList.size(); i++) {
|
||||
if (loginList.get(i) instanceof SoapBindingStub) {
|
||||
binding = (SoapBindingStub) loginList.get(i);
|
||||
}
|
||||
if (loginList.get(i) instanceof SforceManagement) {
|
||||
sforceMgr = (SforceManagement) loginList.get(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
salesforceAPI.setLogin(true);
|
||||
} catch (Throwable e) {
|
||||
errors.add(e.getMessage());
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
salesforceAPI.resetAllProxy();
|
||||
}
|
||||
monitor.done();
|
||||
}
|
||||
});
|
||||
} catch (InvocationTargetException e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
} catch (InterruptedException e2) {
|
||||
ExceptionHandler.process(e2);
|
||||
}
|
||||
|
||||
if (salesforceAPI.isLogin()) {
|
||||
MessageDialog.openInformation(getShell(), Messages.getString("SalesforceForm.checkConnectionTitle"), //$NON-NLS-1$
|
||||
Messages.getString("SalesforceForm.checkIsDone")); //$NON-NLS-1$
|
||||
} else {
|
||||
String mainMsg = Messages.getString("SalesforceForm.checkFailure") + " " //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ Messages.getString("SalesforceForm.checkFailureTip"); //$NON-NLS-1$
|
||||
String error = errors.size() > 0 ? errors.get(0) : ""; //$NON-NLS-1$
|
||||
new ErrorDialogWidthDetailArea(getShell(), PID, mainMsg, error);
|
||||
}
|
||||
|
||||
return salesforceAPI;
|
||||
}
|
||||
|
||||
protected DescribeGlobalResult describeGlobal() throws UnexpectedErrorFault, RemoteException {
|
||||
if (salesforceAPI.isLogin()) {
|
||||
if (binding != null) {
|
||||
return binding.describeGlobal();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected com.salesforce.soap.partner.DescribeGlobalResult describeGlobalPartner() throws RemoteException {
|
||||
if (salesforceAPI.isLogin()) {
|
||||
ISalesforceModuleParser currentAPI = salesforceAPI.getCurrentAPI();
|
||||
if (currentAPI instanceof SalesforceModuleParserPartner) {
|
||||
SalesforceModuleParserPartner partner = (SalesforceModuleParserPartner) currentAPI;
|
||||
try {
|
||||
sforceMgr.describeSObjects(null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private IMetadataTable getMetadataTableFromConfigFile(String moduleName) {
|
||||
|
||||
INode node = getSalesforceNode();
|
||||
|
||||
IElementParameter currentModuleNameParam = node.getElementParameter("MODULENAME"); //$NON-NLS-1$
|
||||
currentModuleNameParam.setValue(moduleName);
|
||||
|
||||
node.getComponent().createElementParameters(node);
|
||||
|
||||
IElementParameter schemaParam = node.getElementParameter("SCHEMA"); //$NON-NLS-1$
|
||||
|
||||
if (schemaParam == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
schemaParam.setValueToDefault(node.getElementParameters()); // Call this method to recompute some parameters
|
||||
// value.
|
||||
|
||||
IMetadataTable metadataTable = (IMetadataTable) schemaParam.getValue();
|
||||
|
||||
return metadataTable;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC zli Comment method "readMetadataDetail".
|
||||
*/
|
||||
public IMetadataTable readMetadataDetail() {
|
||||
SalesforceSchemaConnection connection2 = getConnection();
|
||||
String moduleName = connection2.getModuleName();
|
||||
|
||||
if (moduleName == null || moduleName.equals("")) { //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
String webServiceUrl = connection2.getWebServiceUrl();
|
||||
String userName = connection2.getUserName();
|
||||
String password = connection2.getValue(connection2.getPassword(), false);
|
||||
String timeOut = connection2.getTimeOut();
|
||||
// add for feature 7507
|
||||
String betchSize = connection2.getBatchSize();
|
||||
boolean useProxy = connection2.isUseProxy();
|
||||
boolean useHttp = connection2.isUseHttpProxy();
|
||||
String proxyHost = connection2.getProxyHost();
|
||||
String proxyPort = connection2.getProxyPort();
|
||||
String proxyUsername = connection2.getProxyUsername();
|
||||
String proxyPassword = connection2.getValue(connection2.getProxyPassword(), false);
|
||||
|
||||
String webServiceUrlForOauth = connection2.getWebServiceUrlTextForOAuth();
|
||||
String comsumeKey = connection2.getConsumeKey();
|
||||
String consumeSecret = connection2.getValue(connection2.getConsumeSecret(), false);
|
||||
String callbackHost = connection2.getCallbackHost();
|
||||
String callbackPort = connection2.getCallbackPort();
|
||||
String salesforceVersion = connection2.getSalesforceVersion();
|
||||
String token = connection2.getToken();
|
||||
String loginType = connection2.getLoginType();
|
||||
|
||||
if (isContextMode() && getContextModeManager() != null) {
|
||||
webServiceUrl = getContextModeManager().getOriginalValue(webServiceUrl);
|
||||
userName = getContextModeManager().getOriginalValue(userName);
|
||||
password = getContextModeManager().getOriginalValue(password);
|
||||
timeOut = getContextModeManager().getOriginalValue(timeOut);
|
||||
betchSize = getContextModeManager().getOriginalValue(betchSize);
|
||||
useProxy = Boolean.valueOf(getContextModeManager().getOriginalValue(String.valueOf(useProxy)));
|
||||
useHttp = Boolean.valueOf(getContextModeManager().getOriginalValue(String.valueOf(useHttp)));
|
||||
proxyHost = getContextModeManager().getOriginalValue(proxyHost);
|
||||
proxyPort = getContextModeManager().getOriginalValue(proxyPort);
|
||||
proxyUsername = getContextModeManager().getOriginalValue(proxyUsername);
|
||||
proxyPassword = getContextModeManager().getOriginalValue(proxyPassword);
|
||||
|
||||
webServiceUrlForOauth = getContextModeManager().getOriginalValue(webServiceUrlForOauth);
|
||||
comsumeKey = getContextModeManager().getOriginalValue(comsumeKey);
|
||||
consumeSecret = getContextModeManager().getOriginalValue(consumeSecret);
|
||||
callbackHost = getContextModeManager().getOriginalValue(callbackHost);
|
||||
callbackPort = getContextModeManager().getOriginalValue(callbackPort);
|
||||
salesforceVersion = getContextModeManager().getOriginalValue(salesforceVersion);
|
||||
token = getContextModeManager().getOriginalValue(token);
|
||||
loginType = getContextModeManager().getOriginalValue(loginType);
|
||||
}
|
||||
|
||||
if (loginType.equalsIgnoreCase(BASIC)) {
|
||||
metadataTableOrder = getMetadatasForSalesforce(webServiceUrl, userName, password, timeOut, moduleName, betchSize,
|
||||
useProxy, useHttp, proxyHost, proxyPort, proxyUsername, proxyPassword, true);
|
||||
} else {
|
||||
metadataTableOrder = getMetadataTableBySalesforceServerAPIForOauth(webServiceUrlForOauth, comsumeKey, consumeSecret,
|
||||
callbackHost, callbackPort, salesforceVersion, token, timeOut, moduleName);
|
||||
if (metadataTableOrder == null) {
|
||||
metadataTableOrder = getMetadataTableFromConfigFile(moduleName);
|
||||
}
|
||||
}
|
||||
return metadataTableOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC zli Comment method "modifyMetadataTable".
|
||||
*/
|
||||
public IMetadataTable modifyMetadataTable() {
|
||||
if (metadataTableOrder != null) {
|
||||
List<IMetadataColumn> listColumns = metadataTableOrder.getListColumns();
|
||||
if (listColumns != null) {
|
||||
|
||||
Object[] array = listColumns.toArray();
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
for (int j = i + 1; j < array.length; j++) {
|
||||
|
||||
String labela = ((MetadataColumn) array[i]).getLabel();
|
||||
String labelb = ((MetadataColumn) array[j]).getLabel();
|
||||
if (labela.compareTo(labelb) > 0) {
|
||||
MetadataColumn metadataColumn = (MetadataColumn) array[i];
|
||||
array[i] = array[j];
|
||||
array[j] = metadataColumn;
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Object> asList = Arrays.asList(array);
|
||||
List<IMetadataColumn> aa = new ArrayList();
|
||||
if (asList != null && asList.size() > 0) {
|
||||
Object object = asList.get(0);
|
||||
if (object instanceof MetadataColumn) {
|
||||
for (int i = 0; i < asList.size(); i++) {
|
||||
aa.add(i, (MetadataColumn) asList.get(i));
|
||||
}
|
||||
metadataTableOrder.setListColumns(aa);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return metadataTableOrder;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.swt.utils.AbstractForm#adaptFormToReadOnly()
|
||||
*/
|
||||
@Override
|
||||
protected void adaptFormToReadOnly() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.swt.utils.AbstractForm#addFields()
|
||||
*/
|
||||
@Override
|
||||
protected void addFields() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.swt.utils.AbstractForm#addFieldsListeners()
|
||||
*/
|
||||
@Override
|
||||
protected void addFieldsListeners() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.swt.utils.AbstractForm#addUtilsButtonListeners()
|
||||
*/
|
||||
@Override
|
||||
protected void addUtilsButtonListeners() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.swt.utils.AbstractForm#checkFieldsValue()
|
||||
*/
|
||||
@Override
|
||||
protected boolean checkFieldsValue() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.swt.utils.AbstractForm#initialize()
|
||||
*/
|
||||
@Override
|
||||
protected void initialize() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for salesforceAPI.
|
||||
*
|
||||
* @return the salesforceAPI
|
||||
*/
|
||||
public SalesforceModuleParseAPI getSalesforceAPI() {
|
||||
return this.salesforceAPI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the salesforceAPI.
|
||||
*
|
||||
* @param salesforceAPI the salesforceAPI to set
|
||||
*/
|
||||
public void setSalesforceAPI(SalesforceModuleParseAPI salesforceAPI) {
|
||||
this.salesforceAPI = salesforceAPI;
|
||||
}
|
||||
|
||||
public IMetadataContextModeManager getContextModeManager() {
|
||||
return this.contextModeManager;
|
||||
}
|
||||
|
||||
public void setContextModeManager(IMetadataContextModeManager contextModeManager) {
|
||||
this.contextModeManager = contextModeManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC Administrator Comment method "getTableByLabel".
|
||||
*
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
protected MetadataTable getTableByLabel(String label) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user