Compare commits

...

37 Commits

Author SHA1 Message Date
nrousseau
b7b1e79a01 TPS-1070 patch: [5.4.1]NoClassDefFoundError when execute rule in no GUI
server(TDI-32615)
https://jira.talendforge.org/browse/TPS-1070
2015-09-07 14:11:19 +08:00
xhkong
2780290c2c TDI-33278 Column length should be visible when length value is
zero
https://jira.talendforge.org/browse/TDI-33278
(fix the cell null → 0 & 0 → null)
2015-08-03 19:19:25 +08:00
xhkong
c0f67fb7b1 Revert "TDI-33278 Column length should be visible when length value is zero https://jira.talendforge.org/browse/TDI-33278 (fix the cell null → 0 & 0 → null)"
This reverts commit 2096e468ce.
2015-08-03 19:15:21 +08:00
xhkong
2096e468ce TDI-33278 Column length should be visible when length value is
zero
https://jira.talendforge.org/browse/TDI-33278
(fix the cell null → 0 & 0 → null)
2015-08-03 19:10:52 +08:00
xhkong
0effa6b031 TDI-33278 Column length should be visible when length value is zero
https://jira.talendforge.org/browse/TDI-33278
2015-07-31 13:40:45 +08:00
iwangtalend
d9ae3739f5 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:08:44 +02:00
iwangtalend
03eb0980fc TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:08:33 +02:00
iwangtalend
825899757f TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:08:19 +02:00
iwangtalend
3c32958006 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:07:04 +02:00
iwangtalend
409f2d7d73 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:06:51 +02:00
iwangtalend
982c7ddffe TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:06:39 +02:00
iwangtalend
ca08f98474 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:06:26 +02:00
iwangtalend
11b42186bd TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:06:14 +02:00
iwangtalend
2486951d4d TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:06:01 +02:00
iwangtalend
f42bc931ec TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:05:47 +02:00
iwangtalend
eae0097086 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:05:33 +02:00
iwangtalend
bcda460b3e TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:05:18 +02:00
iwangtalend
cf6037bb60 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:05:06 +02:00
iwangtalend
34f6b70ad3 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:04:53 +02:00
iwangtalend
b7bb4661ec TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:04:41 +02:00
iwangtalend
2074a9569a TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:01:26 +02:00
iwangtalend
ebc2d62723 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 16:59:40 +02:00
iwangtalend
0e88de7f79 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 16:59:19 +02:00
iwangtalend
9c6a817270 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 16:58:43 +02:00
iwangtalend
af4eb2fcc1 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 16:57:33 +02:00
zshen-talend
5dc8713144 Merge pull request #200 from xqliu-talend/patch/5.4.1
TPS-951 TDQ-10298 show the rule name if it contain . and _
2015-05-25 17:02:28 +08:00
xqliu-talend
65df226960 TPS-951 TDQ-10298 show the rule name if it contain . and _ 2015-05-25 16:59:32 +08:00
hwang
b12fb7da66 TPS-750:[5.4.1] tFileInputEBCDIC - Schema editor: And to ensure this is
fixed in 5.6.1 (TDI-30936)
2014-11-12 17:00:21 +08:00
cmeng-talend
fb6a6d8877 TPS-725 : [5.4.1] Unable to retrieve salesforce modules from Salesforce
metadata connection(TDI-30366)
https://jira.talendforge.org/browse/TPS-725
2014-10-09 11:34:07 +08:00
Sébastien Gandon
390ce07a72 TPS-621 : [5.4.1] CDC component: Conversion into short table names in GUI (TDI-29052). 2014-06-22 14:47:05 +02:00
Sébastien Gandon
09b25f20a7 Commited by ldong for TPS-612:[5.4.1]studio stop responding when open data preview of table view stored in the reference project(TDI-28875). 2014-06-22 14:47:05 +02:00
Sébastien Gandon
8b10b93e9b Commited by ldong for TPS-619:[5.4.1] Studio Gives java.lang.unsupportedoperation exception when changing projects (TUP-1814). 2014-06-22 14:47:05 +02:00
Sébastien Gandon
4adbcafe6b Commited by ldong for Patch TPS-578:[5.4.1]Impossible to use Update site / archiva system(TUP-1645). 2014-06-22 14:47:05 +02:00
Sébastien Gandon
4ec56e7a4b Committed by hcyi for Patch TPS-580 : [5.4.1] Metadata wizard doesn't display tables starting with '/' (TDI-28578). 2014-06-22 14:47:05 +02:00
Sébastien Gandon
b9a7b126a1 commit for TPS-582. 2014-06-22 14:47:04 +02:00
Sébastien Gandon
92552edda6 Committed by hcyi for patch TPS-581 : [5.4.1]Metadata wizard does not show tables and views for IBM DB2 (TUP-1615). 2014-06-22 14:47:04 +02:00
Sébastien Gandon
ccd6bfe275 bug TDI-28435 fixed : Generation fails after generate another project's job with the same name routines. 2014-06-22 14:47:04 +02:00
56 changed files with 787 additions and 265 deletions

View File

@@ -54,4 +54,7 @@ XmlNodeRetriever.prposal1Node=proposal1Nodes \:
XmlNodeRetriever.singleQuotes='
XmlNodeRetriever.xPathExpression=xPathExpression = '
VersionUtils.readPropertyFileError=Error to read property in talend.properties file.
AS400ResultSet.unknowCloumn=Invalid argument\: unknown column name
AS400ResultSet.parameterIndex=Invalid argument\: parameter index
AS400ResultSet.outofRange=\ is out of range.

View File

@@ -13,8 +13,14 @@
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;
import org.apache.commons.lang.StringUtils;
/**
* created by zshen on Apr 12, 2013 Detailled comment
@@ -22,6 +28,25 @@ import java.sql.SQLException;
*/
public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
private static final String[] TABLE_META = {
"TABLE_TYPE", "TABLE_NAME", "SYSTEM_TABLE_NAME", "TABLE_SCHEMA", "SYSTEM_TABLE_SCHEMA" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
private String T = "T";//$NON-NLS-1$
private String V = "V";//$NON-NLS-1$
private String S = "S";//$NON-NLS-1$
private String A = "A";//$NON-NLS-1$
private String TABLE = "TABLE"; //$NON-NLS-1$
private String VIEW = "VIEW"; //$NON-NLS-1$
private String SYNONYM = "SYNONYM"; //$NON-NLS-1$
private String ALIAS = "ALIAS"; //$NON-NLS-1$
public AS400DatabaseMetaData(Connection conn) throws SQLException {
super(conn);
}
@@ -69,8 +94,101 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
*/
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
String sql;
String and;
if (schemaPattern != null) {
sql = "SELECT TYPE,TABLE_NAME, SYSTEM_TABLE_NAME, TABLE_SCHEMA , SYSTEM_TABLE_SCHEMA FROM QSYS2.SYSTABLES WHERE TABLE_SCHEMA = '"
+ schemaPattern + "'";
and = " and ";
} else {
sql = "SELECT TYPE,TABLE_NAME, SYSTEM_TABLE_NAME, TABLE_SCHEMA , SYSTEM_TABLE_SCHEMA FROM QSYS2.SYSTABLES";
and = " where ";
}
sql = addTypesToSql(sql, types, and);
if (!StringUtils.isEmpty(tableNamePattern)) {
sql = sql + " and NAME like ?";//$NON-NLS-1$
}
ResultSet rs = null;
PreparedStatement stmt = null;
List<String[]> list = new ArrayList<String[]>();
try {
stmt = connection.prepareStatement(sql);
if (!StringUtils.isEmpty(tableNamePattern)) {
stmt.setString(1, tableNamePattern);
}// ~
rs = stmt.executeQuery();
while (rs.next()) {
String type = rs.getString("TYPE"); //$NON-NLS-1$
String table_name = rs.getString("TABLE_NAME"); //$NON-NLS-1$
String system_table_name = rs.getString("SYSTEM_TABLE_NAME"); //$NON-NLS-1$
String table_schema = rs.getString("TABLE_SCHEMA"); //$NON-NLS-1$
String system_table_schema = rs.getString("SYSTEM_TABLE_SCHEMA");
String[] r = new String[] { type, table_name, system_table_name, table_schema, system_table_schema }; //$NON-NLS-1$ //$NON-NLS-2$
list.add(r);
}
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
try {
rs.close();
stmt.close();
} catch (Exception e) {
}
}
AS400ResultSet tableResultSet = new AS400ResultSet();
tableResultSet.setMetadata(TABLE_META);
tableResultSet.setData(list);
return tableResultSet;
// return super.getTables(catalog, schemaPattern, tableNamePattern, types);
}
private String getTypeNameType(String typeName) {
String result = typeName;
if (T.equals(typeName)) {
result = TABLE;
} else if (V.equals(typeName)) {
result = VIEW;
} else if (S.equals(typeName)) {
result = SYNONYM;
} else if (A.equals(typeName)) {
result = ALIAS;
}
return result;
}
return super.getTables(catalog, schemaPattern, tableNamePattern, types);
private String addTypesToSql(String sql, String[] types, String and) {
String result = sql;
if (types != null && types.length > 0) {
String typeClause = " type in("; //$NON-NLS-1$
int len = types.length;
for (int i = 0; i < len; ++i) {
String comma = ""; //$NON-NLS-1$
if (i > 0) {
comma = " , "; //$NON-NLS-1$
}
typeClause = typeClause + comma + "'" + getTypeName(types[i]) + "'";//$NON-NLS-1$ //$NON-NLS-2$
}
typeClause = typeClause + ")"; //$NON-NLS-1$
result = sql + and + typeClause;
}
return result;
}
private String getTypeName(String typeName) {
String result = typeName;
if (TABLE.equals(typeName)) {
result = T;
} else if (VIEW.equals(typeName)) {
result = V;
} else if (SYNONYM.equals(typeName)) {
result = S;
} else if (ALIAS.equals(typeName)) {
result = A;
}
return result;
}
/*

View File

@@ -0,0 +1,128 @@
package org.talend.commons.utils.database;
import java.sql.SQLException;
import java.util.List;
import org.talend.commons.i18n.internal.Messages;
import org.talend.commons.utils.TalendDBUtils;
import org.talend.fakejdbc.FakeResultSet;
/**
* DOC zwzhao class global comment. Detailled comment
*/
public class AS400ResultSet extends FakeResultSet {
private String[] tableMeta = null;
private List<String[]> data;
int index = -1;
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#next()
*/
@Override
public boolean next() throws SQLException {
if (data == null || data.size() == 0 || index >= data.size() - 1) {
return false;
}
index++;
return true;
}
public static int indexOf(String string, String[] search) {
for (int i = 0; i < search.length; i++) {
if (search[i].equals(string)) {
return i;
}
}
return -1;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getString(java.lang.String)
*/
@Override
public String getString(String columnLabel) throws SQLException {
int columnIndex = indexOf(columnLabel, tableMeta);
if (columnIndex == -1) {
throw new SQLException(Messages.getString("AS400ResultSet.unknowCloumn") + columnLabel); //$NON-NLS-1$
}
return getString(columnIndex + 1);
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getInt(java.lang.String)
*/
@Override
public int getInt(String columnLabel) throws SQLException {
String str = getString(columnLabel);
if (columnLabel.equals("TYPE_NAME")) {
int index = TalendDBUtils.convertToJDBCType(str);
return index;
} else if (columnLabel.equals("IS_NULLABLE")) {
if (str.equals("N")) {
return 1;
} else {
return 0;
}
} else {
return Integer.parseInt(str);
}
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getBoolean(java.lang.String)
*/
@Override
public boolean getBoolean(String columnLabel) throws SQLException {
String str = getString(columnLabel);
return Boolean.parseBoolean(str);
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getString(int)
*/
@Override
public String getString(int columnIndex) throws SQLException {
String[] row = data.get(index);
columnIndex--;
if (columnIndex < 0 || columnIndex > row.length) {
throw new SQLException(
Messages.getString("AS400ResultSet.parameterIndex") + columnIndex + Messages.getString("AS400ResultSet.outofRange")); //$NON-NLS-1$ //$NON-NLS-2$
}
return row[columnIndex];
}
/**
* DOC bqian Comment method "setMetadata".
*
* @param table_meta
*/
public void setMetadata(String[] tableMeta) {
this.tableMeta = tableMeta;
}
/**
* DOC bqian Comment method "setData".
*
* @param tables
*/
public void setData(List<String[]> data) {
this.data = data;
}
}

View File

@@ -222,26 +222,16 @@ public class TableViewerCreator<B> extends TableViewerCreatorNotModifiable<B> im
if (previousValue == null) {
if (value == null) {
needChange = false;
} else {
if (value instanceof Integer) {
Integer intValue = (Integer) value;
if (intValue == 0) {
needChange = false;
}
}
}
} else {
if (previousValue instanceof Integer) {
Integer integer = (Integer) previousValue;
if (integer == 0) {
if (value == null) {
needChange = false;
} else {
if (value instanceof Integer) {
Integer intValue = (Integer) value;
if (intValue == 0) {
needChange = false;
}
if (value != null && value instanceof Integer) {
Integer intValue = (Integer) value;
if (intValue == 0) {
needChange = false;
}
}
} else {
@@ -293,10 +283,12 @@ public class TableViewerCreator<B> extends TableViewerCreatorNotModifiable<B> im
return (B) AccessorUtils.get(currentRowObject, column);
}
@Override
public void addModifiedBeanListener(IModifiedBeanListener<B> modifiedBeanListener) {
this.modifiedBeanListeners.add(modifiedBeanListener);
}
@Override
public void removeModifiedBeanListener(IModifiedBeanListener<B> modifiedBeanListener) {
this.modifiedBeanListeners.remove(modifiedBeanListener);
}

View File

@@ -866,13 +866,18 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
if (label.equals("bin") || label.startsWith(".")) { //$NON-NLS-1$ //$NON-NLS-2$
continue;
}
// currently, only process the docs for job, joblet and route.
if (type.equals(ERepositoryObjectType.JOB_DOC) || type.equals(ERepositoryObjectType.JOBLET_DOC)
|| type.equals(ERepositoryObjectType.JOBS) || type.equals(ERepositoryObjectType.JOBLETS)
|| type.equals(ERepositoryObjectType.valueOf("ROUTE_DOCS"))//$NON-NLS-1$
|| type.equals(ERepositoryObjectType.valueOf("ROUTE_DOC"))) {//$NON-NLS-1$
boolean isJobDocRootFolder = ((label.indexOf("_") != -1) && (label.indexOf(".") != -1)); //$NON-NLS-1$ //$NON-NLS-2$
boolean isPicFolderName = label.equals(IHTMLDocConstants.PIC_FOLDER_NAME);
boolean isJobDocRootFolder = ((label.indexOf("_") != -1) && (label.indexOf(".") != -1)); //$NON-NLS-1$ //$NON-NLS-2$
boolean isPicFolderName = label.equals(IHTMLDocConstants.PIC_FOLDER_NAME);
// Do not show job documentation root folder and Foder "pictures" on the repository view.
if (isJobDocRootFolder || isPicFolderName) {
continue;
// Do not show job documentation root folder and Foder "pictures" on the repository view.
if (isJobDocRootFolder || isPicFolderName) {
continue;
}
}
// for system folder
if (RepositoryConstants.SYSTEM_DIRECTORY.equals(label)) {

View File

@@ -112,7 +112,7 @@ public enum EDatabaseConnTemplate {
"jdbc:exa:<host>:<port>;schema=<sid>", "8563")), //$NON-NLS-1$ //$NON-NLS-2$
AS400(new DbConnStr(EDatabaseTypeName.AS400, //
"jdbc:as400://<host>/<sid>;libraries=<sid>;<property>", //$NON-NLS-1$
"jdbc:as400://<host>/<sid>;<property>", //$NON-NLS-1$
null, //
"prompt=false")), //$NON-NLS-1$

View File

@@ -522,20 +522,19 @@ public class MetadataColumn implements IMetadataColumn, Cloneable {
}
}
/**
* if <0 (mostly, -1) is same as null. Because for the length, originalLength and precision of
* ColumnTypeImpl(ColumnType) and MetadataColumnImpl(MetadataColumn) in EMF model, the type is int(long), not
* Integer(Long). Can be set null for this class(MetadataColumn), but for EMF, must set -1.
*/
private boolean sameIntegerValue(Integer value1, Integer value2) {
if (value1 == null) {
if (value2 == null) {
return true;
} else {
return value2 <= 0;
}
} else {
if (value1 <= 0 && value2 == null) {
return true;
} else {
return (value1 <= 0 && value2 <= 0) || value1.equals(value2);
}
value1 = -1; // unify to -1 for null
}
if (value2 == null) {
value2 = -1; // unify to -1 for null
}
return (value1 < 0 && value2 < 0) || value1.equals(value2);
}
private boolean largeValue(Integer value1, Integer value2) {

View File

@@ -206,6 +206,7 @@ public class MetadataSchema {
final Node defaultValue = nodeMap.getNamedItem("default"); //$NON-NLS-1$
final Node comment = nodeMap.getNamedItem("comment"); //$NON-NLS-1$
final Node pattern = nodeMap.getNamedItem("pattern"); //$NON-NLS-1$
final Node originalLength = nodeMap.getNamedItem("originalLength");//$NON-NLS-1$
// see feature 4456
String nodeValue = MetadataToolHelper.validateColumnName(label.getNodeValue(), 0);
@@ -222,6 +223,17 @@ public class MetadataSchema {
} else {
metadataColumn.setOriginalDbColumnName(nodeValue);
}
if (originalLength != null && originalLength.getNodeValue() != null) {
try {
metadataColumn.setOriginalLength(Integer.parseInt(originalLength.getNodeValue()));
} catch (final NumberFormatException e) {
metadataColumn.setOriginalLength(null);
}
} else {
metadataColumn.setOriginalLength(null);
}
if (length.getNodeValue() != null) {
try {
metadataColumn.setLength(Integer.parseInt(length.getNodeValue()));
@@ -360,19 +372,19 @@ public class MetadataSchema {
try {
metadataColumn.setLength(Integer.parseInt(length.getNodeValue()));
} catch (final NumberFormatException e) {
metadataColumn.setLength(0);
metadataColumn.setLength(-1);
}
} else {
metadataColumn.setLength(0);
metadataColumn.setLength(-1);
}
if (precision.getNodeValue() != null) {
try {
metadataColumn.setPrecision(Integer.parseInt(precision.getNodeValue()));
} catch (final NumberFormatException e) {
metadataColumn.setPrecision(0);
metadataColumn.setPrecision(-1);
}
} else {
metadataColumn.setPrecision(0);
metadataColumn.setPrecision(-1);
}
metadataColumn.setNullable(Boolean.parseBoolean(nullable.getNodeValue()));
metadataColumn.setDefaultValue(defaultValue.getNodeValue());
@@ -381,9 +393,11 @@ public class MetadataSchema {
try {
metadataColumn.setOriginalLength(Integer.parseInt(originalLength.getNodeValue()));
} catch (final NumberFormatException e) {
metadataColumn.setOriginalLength(0);
metadataColumn.setOriginalLength(-1);
}
} else {
metadataColumn.setOriginalLength(-1);
}
if (pattern.getNodeValue() != null) {
metadataColumn.setPattern(pattern.getNodeValue());
@@ -776,6 +790,14 @@ public class MetadataSchema {
column.setAttributeNode(sourceType);
}
Attr originalLength = document.createAttribute("originalLength"); //$NON-NLS-1$
if (metadataColumn.getOriginalLength() == null) {
originalLength.setNodeValue("-1"); //$NON-NLS-1$
} else {
originalLength.setNodeValue(String.valueOf(metadataColumn.getOriginalLength()));
}
column.setAttributeNode(originalLength);
Attr length = document.createAttribute("length"); //$NON-NLS-1$
if (metadataColumn.getLength() == null) {
length.setNodeValue("-1"); //$NON-NLS-1$

View File

@@ -13,6 +13,8 @@
package org.talend.core.model.metadata;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -342,32 +344,26 @@ public class MetadataTable implements IMetadataTable, Cloneable {
@Override
public void sortCustomColumns() {
List<IMetadataColumn> customColumns = new ArrayList<IMetadataColumn>();
List<IMetadataColumn> tempCustomColumns = new ArrayList<IMetadataColumn>();
List<IMetadataColumn> noCustomColumns = new ArrayList<IMetadataColumn>();
for (int i = 0; i < listColumns.size(); i++) {
IMetadataColumn column = listColumns.get(i);
if (column.isCustom()) {
tempCustomColumns.add(column);
customColumns.add(column);
}
}
listColumns.removeAll(tempCustomColumns);
listColumns.removeAll(customColumns);
noCustomColumns.addAll(listColumns);
int nbDone = 0;
while (nbDone < tempCustomColumns.size()) {
boolean found = false;
for (int i = 0; i < tempCustomColumns.size() && !found; i++) {
IMetadataColumn column = tempCustomColumns.get(i);
if (column.getCustomId() == nbDone) {
customColumns.add(column);
found = true;
}
Collections.sort(customColumns, new Comparator<IMetadataColumn>() {
@Override
public int compare(IMetadataColumn col1, IMetadataColumn col2) {
return col1.getCustomId() - col2.getCustomId();
}
nbDone++;
}
});
listColumns.clear();
if (this.readOnlyColumnPosition != null && this.readOnlyColumnPosition.equals(EReadOnlyComlumnPosition.TOP.getName())) {

View File

@@ -1047,14 +1047,14 @@ public final class MetadataToolHelper {
createColumnType.setDefaultValue(column.getDefault());
createColumnType.setKey(column.isKey());
if (column.getLength() == null) {
// colType.setLength(-1);
createColumnType.unsetLength();
createColumnType.setLength(-1);
// createColumnType.unsetLength();
} else {
createColumnType.setLength(column.getLength());
}
if (column.getPrecision() == null) {
// colType.setPrecision(-1);
createColumnType.unsetPrecision();
createColumnType.setPrecision(-1);
// createColumnType.unsetPrecision();
} else {
createColumnType.setPrecision(column.getPrecision());
}
@@ -1286,6 +1286,10 @@ public final class MetadataToolHelper {
for (Entry<String, String> entry : oldProperties) {
newProperties.put(entry.getKey(), entry.getValue());
}
for (TaggedValue tv : old.getTaggedValue()) {
String additionalTag = tv.getTag();
result.getAdditionalProperties().put(additionalTag, tv.getValue());
}
return result;
}

View File

@@ -403,6 +403,10 @@ public final class ConvertionHelper {
for (Entry<String, String> entry : oldProperties) {
newProperties.put(entry.getKey(), entry.getValue());
}
for (TaggedValue tv : old.getTaggedValue()) {
String additionalTag = tv.getTag();
result.getAdditionalProperties().put(additionalTag, tv.getValue());
}
return result;
}
@@ -428,13 +432,13 @@ public final class ConvertionHelper {
newColumn.setLabel(column.getLabel());
newColumn.setPattern(column.getPattern());
if (column.getLength() == null || column.getLength() < 0) {
newColumn.setLength(0);
newColumn.setLength(-1);
} else {
newColumn.setLength(column.getLength());
}
newColumn.setNullable(column.isNullable());
if (column.getPrecision() == null || column.getPrecision() < 0) {
newColumn.setPrecision(0);
newColumn.setPrecision(-1);
} else {
newColumn.setPrecision(column.getPrecision());
}
@@ -501,13 +505,13 @@ public final class ConvertionHelper {
newColumn.setLabel(column.getLabel());
newColumn.setPattern(column.getPattern());
if (column.getLength() == null || column.getLength() < 0) {
newColumn.setLength(0);
newColumn.setLength(-1);
} else {
newColumn.setLength(column.getLength());
}
newColumn.setNullable(column.isNullable());
if (column.getPrecision() == null || column.getPrecision() < 0) {
newColumn.setPrecision(0);
newColumn.setPrecision(-1);
} else {
newColumn.setPrecision(column.getPrecision());
}

View File

@@ -112,6 +112,8 @@ public class RepositoryViewObject implements IRepositoryViewObject {
private static final String TIP = "same name item with other project";
private boolean avoidGuiInfos;
public RepositoryViewObject(Property property, boolean avoidGuiInfos) {
this.id = property.getId();
this.author = property.getAuthor();
@@ -137,6 +139,7 @@ public class RepositoryViewObject implements IRepositoryViewObject {
informationStatus = factory.getStatus(informationLevel);
modified = factory.isModified(property);
}
this.avoidGuiInfos = avoidGuiInfos;
if (!avoidGuiInfos) {
if (type == ERepositoryObjectType.JOBLET) {
JobletProcessItem item = (JobletProcessItem) property.getItem();
@@ -307,39 +310,41 @@ public class RepositoryViewObject implements IRepositoryViewObject {
repositoryStatus = factory.getStatus(property.getItem());
InformationLevel informationLevel = property.getMaxInformationLevel();
informationStatus = factory.getStatus(informationLevel);
if (type == ERepositoryObjectType.JOBLET) {
JobletProcessItem item = (JobletProcessItem) property.getItem();
if (item.getIcon() != null && item.getIcon().getInnerContent() != null
&& item.getIcon().getInnerContent().length != 0) {
customImage = getJobletCustomIcon(property);
customImage = ImageUtils.propertyLabelScale(property.getId(), customImage, ICON_SIZE.ICON_16);
}
IComponentsService service = (IComponentsService) GlobalServiceRegister.getDefault().getService(
IComponentsService.class);
IJobletProviderService jobletservice = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
IJobletProviderService.class);
if (service != null && jobletservice != null) {
IComponentsFactory factorySingleton = service.getComponentsFactory();
IComponent component = factorySingleton.get(property.getLabel(), DI);
if (component != null) {
try {
Property tProperty = jobletservice.getJobletComponentItem(component);
if (!tProperty.getId().equals(this.id)) {
informationStatus = ERepositoryStatus.WARN;
property.setDescription(TIP);
if (!this.avoidGuiInfos) {
if (type == ERepositoryObjectType.JOBLET) {
JobletProcessItem item = (JobletProcessItem) property.getItem();
if (item.getIcon() != null && item.getIcon().getInnerContent() != null
&& item.getIcon().getInnerContent().length != 0) {
customImage = getJobletCustomIcon(property);
customImage = ImageUtils.propertyLabelScale(property.getId(), customImage, ICON_SIZE.ICON_16);
}
IComponentsService service = (IComponentsService) GlobalServiceRegister.getDefault().getService(
IComponentsService.class);
IJobletProviderService jobletservice = (IJobletProviderService) GlobalServiceRegister.getDefault()
.getService(IJobletProviderService.class);
if (service != null && jobletservice != null) {
IComponentsFactory factorySingleton = service.getComponentsFactory();
IComponent component = factorySingleton.get(property.getLabel(), DI);
if (component != null) {
try {
Property tProperty = jobletservice.getJobletComponentItem(component);
if (!tProperty.getId().equals(this.id)) {
informationStatus = ERepositoryStatus.WARN;
property.setDescription(TIP);
}
} catch (Exception e) {
// tProperty is null
}
} catch (Exception e) {
// tProperty is null
}
}
}
} else if (type == ERepositoryObjectType.DOCUMENTATION) {
this.customImage = ImageProvider.getImage(RepositoryImageProvider.getIcon(type));
Item item = property.getItem();
if (item instanceof DocumentationItem) {
customImage = coreSerivce.getImageWithDocExt(((DocumentationItem) item).getExtension());
} else if (item instanceof LinkDocumentationItem) {
customImage = coreSerivce.getImageWithSpecial(customImage).createImage();
} else if (type == ERepositoryObjectType.DOCUMENTATION) {
this.customImage = ImageProvider.getImage(RepositoryImageProvider.getIcon(type));
Item item = property.getItem();
if (item instanceof DocumentationItem) {
customImage = coreSerivce.getImageWithDocExt(((DocumentationItem) item).getExtension());
} else if (item instanceof LinkDocumentationItem) {
customImage = coreSerivce.getImageWithSpecial(customImage).createImage();
}
}
}
return property;

View File

@@ -160,7 +160,12 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
@Override
public void syncRoutine(RoutineItem routineItem, boolean copyToTemp) throws SystemException {
if (!isRoutineUptodate(routineItem) || !getFile(routineItem).exists()) {
syncRoutine(routineItem, copyToTemp, false);
}
public void syncRoutine(RoutineItem routineItem, boolean copyToTemp, boolean forceUpdate) throws SystemException {
if (routineItem != null && (forceUpdate || !isRoutineUptodate(routineItem) || !getFile(routineItem).exists())) {
doSyncRoutine(routineItem, copyToTemp);
setRoutineAsUptodate(routineItem);
}
@@ -175,7 +180,11 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
@Override
public void syncBean(Item beanItem, boolean copyToTemp) throws SystemException {
if (!isBeanUptodate(beanItem) || !getFile(beanItem).exists()) {
syncBean(beanItem, copyToTemp, false);
}
public void syncBean(Item beanItem, boolean copyToTemp, boolean forceUpdate) throws SystemException {
if (beanItem != null && (forceUpdate || !isBeanUptodate(beanItem) || !getFile(beanItem).exists())) {
doSyncBean(beanItem, copyToTemp);
setBeanAsUptodate(beanItem);
}
@@ -315,4 +324,16 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
// TODO Auto-generated method stub
}
@Override
public void syncAllRoutinesForLogOn() throws SystemException {
}
@Override
public void syncAllBeansForLogOn() throws SystemException {
}
@Override
public void syncAllPigudfForLogOn() throws SystemException {
}
}

View File

@@ -38,10 +38,16 @@ public interface ITalendSynchronizer {
public void syncAllRoutines() throws SystemException;
public void syncAllRoutinesForLogOn() throws SystemException;
public void syncAllPigudf() throws SystemException;
public void syncAllPigudfForLogOn() throws SystemException;
public void syncAllBeans() throws SystemException;
public void syncAllBeansForLogOn() throws SystemException;
public void syncRoutine(RoutineItem routineItem, boolean copyToTemp) throws SystemException;
public void syncBean(Item beanItem, boolean copyToTemp) throws SystemException;

View File

@@ -13,10 +13,10 @@
package org.talend.repository.model;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.ui.IActionFilter;
import org.talend.commons.ui.runtime.image.IImage;
@@ -49,7 +49,7 @@ public class RepositoryNode implements IRepositoryNode, IActionFilter {
protected ENodeType type;
private Map<EProperties, Object> properties = new Hashtable<EProperties, Object>();
private Map<EProperties, Object> properties = new ConcurrentHashMap<EProperties, Object>();
private IProjectRepositoryNode root;

View File

@@ -165,6 +165,7 @@ MetadataTableEditorView.DefaultTitle=Default
MetadataTableEditorView.KeyTitle=Key
MetadataTableEditorView.LengthTitle=Length
MetadataTableEditorView.NullableTitle=Nullable
MetadataTableEditorView.OriginalLengthTitle=OriginalLength
MetadataTableEditorView.PatternTitle=Date Pattern (Ctrl+Space available)
MetadataTableEditorView.PrecisionTitle=Precision
MetadataTableEditorView.TypleTitle=Type

View File

@@ -364,7 +364,7 @@ public abstract class AbstractMetadataTableEditorView<B> extends AbstractDataTab
column.setMinimumWidth(10);
TextCellEditor textCellEditor = new TextCellEditor(tableViewerCreator.getTable());
textCellEditor.addListener(new InegerCellEditorListener(textCellEditor, column));
column.setCellEditor(textCellEditor, CellEditorValueAdapterFactory.getPositiveIntAdapter(true));
column.setCellEditor(textCellEditor, CellEditorValueAdapterFactory.getPositiveIntAdapter());
}
/**
@@ -476,7 +476,7 @@ public abstract class AbstractMetadataTableEditorView<B> extends AbstractDataTab
column.setMinimumWidth(10);
TextCellEditor textCellEditor = new TextCellEditor(tableViewerCreator.getTable());
textCellEditor.addListener(new InegerCellEditorListener(textCellEditor, column));
column.setCellEditor(textCellEditor, CellEditorValueAdapterFactory.getPositiveIntAdapter(true));
column.setCellEditor(textCellEditor, CellEditorValueAdapterFactory.getPositiveIntAdapter(false));
}
/**

View File

@@ -156,6 +156,8 @@ public class MetadataEmfTableEditorView extends AbstractMetadataTableEditorView<
public void set(MetadataColumn bean, Integer value) {
if (value != null) {
bean.setOriginalLength(value);
} else {
bean.setOriginalLength(-1);
}
}
@@ -206,7 +208,7 @@ public class MetadataEmfTableEditorView extends AbstractMetadataTableEditorView<
if (value != null) {
bean.setPrecision(value);
} else {
bean.setPrecision(0);
bean.setPrecision(-1);
}
}
@@ -240,11 +242,12 @@ public class MetadataEmfTableEditorView extends AbstractMetadataTableEditorView<
public void set(MetadataColumn bean, Integer value) {
if (value != null) {
bean.setLength(value);
if (Long.valueOf(bean.getOriginalLength()) == 0) {
// if not set Original Length
if (Long.valueOf(bean.getOriginalLength()) == -1) {
bean.setOriginalLength(value);
}
} else {
bean.setLength(0);
bean.setLength(-1);
}
}
@@ -330,6 +333,7 @@ public class MetadataEmfTableEditorView extends AbstractMetadataTableEditorView<
String oldTalendType = bean.getTalendType();
bean.setTalendType(value);
if (!oldTalendType.equals(value)) {
bean.setLength(-1);
String typeLength = getCurrentTypeLength(value);
if (typeLength != null && !typeLength.equals("")) { //$NON-NLS-1$
bean.setLength(Integer.parseInt(typeLength));

View File

@@ -22,7 +22,6 @@ import org.talend.core.language.LanguageManager;
import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.core.model.metadata.editor.MetadataTableEditor;
import org.talend.core.model.metadata.types.TypesManager;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.ui.proposal.JavaSimpleDateFormatProposalProvider;
@@ -202,9 +201,7 @@ public class MetadataTableEditorView extends AbstractMetadataTableEditorView<IMe
}
public void set(IMetadataColumn bean, Integer value) {
if (value != null) {
bean.setOriginalLength(value);
}
bean.setOriginalLength(value);
}
};
}
@@ -316,6 +313,7 @@ public class MetadataTableEditorView extends AbstractMetadataTableEditorView<IMe
public void set(IMetadataColumn bean, Integer value) {
bean.setLength(value);
// if not set Original Length
if (bean.getOriginalLength() == null) {
bean.setOriginalLength(value);
}
@@ -492,6 +490,7 @@ public class MetadataTableEditorView extends AbstractMetadataTableEditorView<IMe
return CoreRuntimePlugin.getInstance().getCoreService().getPreferenceStore().getString(value.toUpperCase());
}
@Override
protected IBeanPropertyAccessors<IMetadataColumn, String> getRelatedEntityAccessor() {
return new IBeanPropertyAccessors<IMetadataColumn, String>() {
@@ -506,6 +505,7 @@ public class MetadataTableEditorView extends AbstractMetadataTableEditorView<IMe
};
}
@Override
protected IBeanPropertyAccessors<IMetadataColumn, String> getRelationshipTypeAccessor() {
return new IBeanPropertyAccessors<IMetadataColumn, String>() {

View File

@@ -146,12 +146,12 @@ public class SaveAsGenericSchemaCommand extends Command {
createMetadataColumn.setKey(column.isKey());
Integer length = column.getLength();
if (length == null) {
length = 0;
length = -1;
}
createMetadataColumn.setLength(length);
Integer precision = column.getPrecision();
if (precision == null) {
precision = 0;
precision = -1;
}
createMetadataColumn.setPrecision(precision);
createMetadataColumn.setPattern(column.getPattern());

View File

@@ -285,8 +285,8 @@ public class CoreService implements ICoreService {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICodeGeneratorService.class)) {
ICodeGeneratorService codeGenService = (ICodeGeneratorService) GlobalServiceRegister.getDefault().getService(
ICodeGeneratorService.class);
codeGenService.createRoutineSynchronizer().syncAllRoutines();
codeGenService.createRoutineSynchronizer().syncAllPigudf();
codeGenService.createRoutineSynchronizer().syncAllRoutinesForLogOn();
codeGenService.createRoutineSynchronizer().syncAllPigudfForLogOn();
}
}
@@ -298,7 +298,7 @@ public class CoreService implements ICoreService {
ICodeGeneratorService.class);
ITalendSynchronizer talendSynchronizer = codeGenService.createCamelBeanSynchronizer();
if (talendSynchronizer != null) {
talendSynchronizer.syncAllBeans();
talendSynchronizer.syncAllBeansForLogOn();
}
}

View File

@@ -18,6 +18,7 @@ import org.eclipse.emf.common.util.URI;
import org.osgi.service.prefs.BackingStoreException;
import org.talend.commons.exception.LoginException;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.exception.SystemException;
import org.talend.core.IService;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.User;
@@ -37,7 +38,7 @@ public interface ICoreTisService extends IService {
public List<IUpdateSiteBean> getPatchesInstalled() throws BackingStoreException;
public List<IUpdateSiteBean> getUpdateSitesToBeInstall(String username, String password, String archivaServicesURL,
List<String> repositories) throws BackingStoreException;
List<String> repositories) throws BackingStoreException, SystemException;
public void downLoadAndInstallUpdateSites(String archivaServerURL, String username, String password,
List<IUpdateSiteBean> toBeInstalled, List<String> repositories) throws Exception;

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -5,18 +5,21 @@ Bundle-SymbolicName: org.talend.libraries.apache.cxf;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
lib/cxf-api-2.7.5.jar,
lib/cxf-rt-bindings-xml-2.7.5.jar,
lib/cxf-rt-core-2.7.5.jar,
lib/cxf-rt-frontend-jaxrs-2.7.5.jar,
lib/cxf-rt-transports-http-2.7.5.jar,
lib/javax.ws.rs-api-2.0-m10.jar,
lib/neethi-3.0.1.jar
Export-Package: javax.ws.rs,
javax.ws.rs.client,
javax.ws.rs.container,
javax.ws.rs.core,
javax.ws.rs.ext,
lib/neethi-3.0.1.jar,
lib/cxf-api-2.7.7.jar,
lib/cxf-rt-bindings-xml-2.7.7.jar,
lib/cxf-rt-core-2.7.7.jar,
lib/cxf-rt-frontend-jaxrs-2.7.7.jar,
lib/cxf-rt-transports-http-2.7.7.jar,
lib/stax-api-1.0.1.jar,
lib/stax2-api-3.1.1.jar,
lib/woodstox-core-asl-4.2.0.jar
Export-Package: javax.ws.rs;version="2.0.0.m10",
javax.ws.rs.client;version="2.0.0.m10",
javax.ws.rs.container;version="2.0.0.m10",
javax.ws.rs.core;version="2.0.0.m10",
javax.ws.rs.ext;version="2.0.0.m10",
org.apache.cxf;uses:="org.apache.cxf.common.i18n,org.apache.cxf.interceptor",
org.apache.cxf.annotations,
org.apache.cxf.attachment;
@@ -702,4 +705,165 @@ Export-Package: javax.ws.rs,
javax.wsdl.xml,
javax.wsdl.extensions,
org.apache.cxf.common.i18n"
Import-Package: bsh;resolution:=optional,com.ibm.wsdl.util.xml;resolut
ion:=optional,com.jamonapi;resolution:=optional,com.sun.msv.grammar;r
esolution:=optional,com.sun.msv.grammar.trex;resolution:=optional,com
.sun.msv.grammar.xmlschema;resolution:=optional,com.sun.msv.reader;re
solution:=optional,com.sun.msv.reader.trex.ng;resolution:=optional,co
m.sun.msv.reader.util;resolution:=optional,com.sun.msv.reader.xmlsche
ma;resolution:=optional,com.sun.msv.util;resolution:=optional,com.sun
.msv.verifier;resolution:=optional,com.sun.msv.verifier.regexp;resolu
tion:=optional,com.sun.msv.verifier.regexp.xmlschema;resolution:=opti
onal,com.sun.net.httpserver;resolution:=optional,com.sun.tools.xjc.re
ader.internalizer;resolution:=optional,com.sun.xml.fastinfoset.sax;re
solution:=optional,com.sun.xml.fastinfoset.stax;resolution:=optional,
edu.emory.mathcs.backport.java.util.concurrent;resolution:=optional,g
roovy.lang;resolution:=optional,javax.activation;resolution:=optional
,javax.annotation;resolution:=optional,javax.crypto;resolution:=optio
nal,javax.crypto.spec;resolution:=optional,javax.ejb;resolution:=opti
onal,javax.el;resolution:=optional,javax.imageio;resolution:=optional
,javax.imageio.stream;resolution:=optional,javax.inject;resolution:=o
ptional,javax.interceptor;resolution:=optional,javax.jms;resolution:=
optional,javax.jws;resolution:=optional,javax.jws.soap;resolution:=op
tional,javax.management;resolution:=optional,javax.management.modelmb
ean;resolution:=optional,javax.management.openmbean;resolution:=optio
nal,javax.management.remote;resolution:=optional,javax.naming;resolut
ion:=optional,javax.net;resolution:=optional,javax.net.ssl;resolution
:=optional,javax.persistence.spi;resolution:=optional,javax.rmi;resol
ution:=optional,javax.security.auth;resolution:=optional,javax.securi
ty.auth.callback;resolution:=optional,javax.security.auth.kerberos;re
solution:=optional,javax.security.auth.login;resolution:=optional,jav
ax.security.auth.x500;resolution:=optional,javax.security.cert;resolu
tion:=optional,javax.sql;resolution:=optional,javax.tools;resolution:
=optional,javax.transaction;resolution:=optional,javax.transaction.xa
;resolution:=optional,javax.validation;resolution:=optional,javax.val
idation.bootstrap;resolution:=optional,javax.validation.metadata;reso
lution:=optional,javax.validation.spi;resolution:=optional,javax.wsdl
;resolution:=optional,javax.wsdl.extensions;resolution:=optional,java
x.wsdl.extensions.http;resolution:=optional,javax.wsdl.extensions.mim
e;resolution:=optional,javax.wsdl.extensions.schema;resolution:=optio
nal,javax.wsdl.extensions.soap;resolution:=optional,javax.wsdl.extens
ions.soap12;resolution:=optional,javax.wsdl.factory;resolution:=optio
nal,javax.wsdl.xml;resolution:=optional,javax.xml.bind;resolution:=op
tional,javax.xml.bind.annotation;resolution:=optional,javax.xml.bind.
annotation.adapters;resolution:=optional,javax.xml.bind.attachment;re
solution:=optional,javax.xml.bind.helpers;resolution:=optional,javax.
xml.bind.util;resolution:=optional,javax.xml.datatype;resolution:=opt
ional,javax.xml.namespace;resolution:=optional,javax.xml.parsers;reso
lution:=optional,javax.xml.soap;resolution:=optional,javax.xml.stream
;resolution:=optional,javax.xml.stream.events;resolution:=optional,ja
vax.xml.stream.util;resolution:=optional,javax.xml.transform;resoluti
on:=optional,javax.xml.transform.dom;resolution:=optional,javax.xml.t
ransform.sax;resolution:=optional,javax.xml.transform.stax;resolution
:=optional,javax.xml.transform.stream;resolution:=optional,javax.xml.
validation;resolution:=optional,javax.xml.ws;resolution:=optional,jav
ax.xml.ws.handler;resolution:=optional,javax.xml.ws.handler.soap;reso
lution:=optional,javax.xml.ws.http;resolution:=optional,javax.xml.ws.
soap;resolution:=optional,javax.xml.ws.spi;resolution:=optional,javax
.xml.ws.spi.http;resolution:=optional,javax.xml.ws.wsaddressing;resol
ution:=optional,javax.xml.xpath;resolution:=optional,jline;resolution
:=optional,junit.framework;resolution:=optional,net.jcip.annotations;
resolution:=optional,net.sf.cglib.asm;resolution:=optional,net.sf.cgl
ib.core;resolution:=optional,net.sf.cglib.proxy;resolution:=optional,
net.sf.cglib.transform.impl;resolution:=optional,org.apache.abdera;re
solution:=optional,org.apache.abdera.factory;resolution:=optional,org
.apache.abdera.model;resolution:=optional,org.apache.abdera.parser;re
solution:=optional,org.apache.abdera.writer;resolution:=optional,org.
apache.aries.blueprint;resolution:=optional,org.apache.aries.blueprin
t.mutable;resolution:=optional,org.apache.axiom.om;resolution:=option
al,org.apache.commons.httpclient;resolution:=optional,org.apache.comm
ons.httpclient.auth;resolution:=optional,org.apache.commons.httpclien
t.methods;resolution:=optional,org.apache.commons.httpclient.params;r
esolution:=optional,org.apache.commons.httpclient.protocol;resolution
:=optional,org.apache.commons.httpclient.util;resolution:=optional,or
g.apache.commons.jxpath;resolution:=optional,org.apache.commons.lang;
resolution:=optional;version="[2.6,3)",org.apache.commons.lang.builde
r;resolution:=optional;version="[2.6,3)",org.apache.commons.logging;r
esolution:=optional,org.apache.commons.pool;resolution:=optional,org.
apache.commons.pool.impl;resolution:=optional,org.apache.commons.ssl;
resolution:=optional,org.apache.cxf;resolution:=optional;version="[2.
7,3)",org.apache.cxf.aegis;resolution:=optional,org.apache.cxf.aegis.
type;resolution:=optional,org.apache.cxf.binding;resolution:=optional
;version="[2.7,3)",org.apache.cxf.binding.soap.model;resolution:=opti
onal;version="[2.7,3)",org.apache.cxf.buslifecycle;resolution:=option
al;version="[2.7,3)",org.apache.cxf.clustering;resolution:=optional;v
ersion="[2.7,3)",org.apache.cxf.configuration.security;resolution:=op
tional;version="[2.7,3)",org.apache.cxf.endpoint;resolution:=optional
;version="[2.7,3)",org.apache.cxf.extension;resolution:=optional;vers
ion="[2.7,3)",org.apache.cxf.feature;resolution:=optional;version="[2
.7,3)",org.apache.cxf.headers;resolution:=optional;version="[2.7,3)",
org.apache.cxf.helpers;resolution:=optional;version="[2.7,3)",org.apa
che.cxf.io;resolution:=optional;version="[2.7,3)",org.apache.cxf.jaxr
s.client;resolution:=optional;version="[2.7,3)",org.apache.cxf.messag
e;resolution:=optional;version="[2.7,3)",org.apache.cxf.phase;resolut
ion:=optional;version="[2.7,3)",org.apache.cxf.security;resolution:=o
ptional;version="[2.7,3)",org.apache.cxf.service;resolution:=optional
;version="[2.7,3)",org.apache.cxf.tools.common;resolution:=optional,o
rg.apache.cxf.tools.validator;resolution:=optional,org.apache.cxf.tra
nsport;resolution:=optional;version="[2.7,3)",org.apache.cxf.ws.addre
ssing;resolution:=optional;version="[2.7,3)",org.apache.cxf.ws.addres
sing.impl;resolution:=optional;version="[2.7,3)",org.apache.cxf.ws.ad
dressing.soap;resolution:=optional;version="[2.7,3)",org.apache.cxf.w
s.mex;resolution:=optional,org.apache.cxf.ws.mex.model._2004_09;resol
ution:=optional,org.apache.geronimo.osgi.registry.api;resolution:=opt
ional,org.apache.log4j;resolution:=optional;version="[1.2,2)",org.apa
che.log4j.jmx;resolution:=optional;version="[1.2,2)",org.apache.log4j
.spi;resolution:=optional;version="[1.2,2)",org.apache.log4j.xml;reso
lution:=optional;version="[1.2,2)",org.apache.mina.core.buffer;resolu
tion:=optional,org.apache.mina.core.filterchain;resolution:=optional,
org.apache.mina.core.future;resolution:=optional,org.apache.mina.core
.service;resolution:=optional,org.apache.mina.core.session;resolution
:=optional,org.apache.mina.filter.codec;resolution:=optional,org.apac
he.mina.filter.logging;resolution:=optional,org.apache.mina.transport
.socket.nio;resolution:=optional,org.apache.velocity;resolution:=opti
onal,org.apache.velocity.app;resolution:=optional,org.apache.velocity
.context;resolution:=optional,org.apache.xml.dtm;resolution:=optional
,org.apache.xml.resolver;resolution:=optional,org.apache.xml.resolver
.helpers;resolution:=optional,org.apache.xml.resolver.tools;resolutio
n:=optional,org.apache.xml.utils;resolution:=optional,org.apache.xmlb
eans;resolution:=optional,org.apache.xpath;resolution:=optional,org.a
pache.xpath.compiler;resolution:=optional,org.apache.xpath.functions;
resolution:=optional,org.apache.xpath.objects;resolution:=optional,or
g.aspectj.bridge;resolution:=optional,org.aspectj.lang;resolution:=op
tional,org.aspectj.lang.annotation;resolution:=optional,org.aspectj.l
ang.reflect;resolution:=optional,org.aspectj.runtime.internal;resolut
ion:=optional,org.aspectj.util;resolution:=optional,org.aspectj.weave
r;resolution:=optional,org.aspectj.weaver.ast;resolution:=optional,or
g.aspectj.weaver.bcel;resolution:=optional,org.aspectj.weaver.interna
l.tools;resolution:=optional,org.aspectj.weaver.loadtime;resolution:=
optional,org.aspectj.weaver.patterns;resolution:=optional,org.aspectj
.weaver.reflect;resolution:=optional,org.aspectj.weaver.tools;resolut
ion:=optional,org.bouncycastle.asn1;resolution:=optional,org.bouncyca
stle.asn1.x509;resolution:=optional,org.bouncycastle.util.encoders;re
solution:=optional,org.bouncycastle.x509.extension;resolution:=option
al,org.codehaus.groovy.control;resolution:=optional,org.dom4j;resolut
ion:=optional,org.dom4j.io;resolution:=optional,org.eclipse.jetty.jmx
;resolution:=optional,org.hibernate;resolution:=optional,org.hibernat
e.cache;resolution:=optional,org.hibernate.cache.access;resolution:=o
ptional,org.hibernate.cfg;resolution:=optional,org.hibernate.impl;res
olution:=optional,org.hibernate.stat;resolution:=optional,org.hiberna
te.transaction;resolution:=optional,org.hibernate.validator.messagein
terpolation;resolution:=optional,org.hibernate.validator.resourceload
ing;resolution:=optional,org.ietf.jgss;resolution:=optional,org.jruby
;resolution:=optional,org.jruby.ast;resolution:=optional,org.jruby.ex
ceptions;resolution:=optional,org.jruby.javasupport;resolution:=optio
nal,org.jruby.runtime;resolution:=optional,org.jruby.runtime.builtin;
resolution:=optional,org.junit;resolution:=optional,org.jvnet.fastinf
oset;resolution:=optional,org.jvnet.staxex;resolution:=optional,org.m
ortbay.log;resolution:=optional,org.mortbay.util.ajax;resolution:=opt
ional,org.omg.CORBA;resolution:=optional,org.osgi.framework;resolutio
n:=optional,org.osgi.service.blueprint.container;resolution:=optional
,org.osgi.service.blueprint.reflect;resolution:=optional,org.osgi.ser
vice.cm;resolution:=optional,org.osgi.service.log;resolution:=optiona
l,org.osgi.util.tracker;resolution:=optional,org.owasp.esapi;resoluti
on:=optional,org.relaxng.datatype;resolution:=optional,org.springfram
ework.instrument;resolution:=optional,org.springframework.web.context
;resolution:=optional,org.springframework.web.context.support;resolut
ion:=optional,org.springframework.web.servlet;resolution:=optional,or
g.springframework.web.servlet.handler;resolution:=optional,org.spring
framework.web.servlet.mvc;resolution:=optional,org.w3c.dom;resolution
:=optional,org.w3c.dom.bootstrap;resolution:=optional,org.w3c.dom.ls;
resolution:=optional,org.xml.sax;resolution:=optional,org.xml.sax.ext
;resolution:=optional,org.xml.sax.helpers;resolution:=optional,sun.mi
sc;resolution:=optional
Require-Bundle: javax.wsdl;bundle-version="1.6.2"

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/main/java/
output.. = class/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = class/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -3,4 +3,3 @@ bin.includes = META-INF/,\
.,\
licenses/,\
plugin.xml
source.. = src/

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = main/java/src/
output.. = class/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -815,15 +815,17 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl {
}
try {
// common
boolean flag = true;
boolean isOracle8i = true;
boolean isOracle = false;
boolean isOracleJdbc = false;
String tableComment = null;
List<String> tablesToFilter = new ArrayList<String>();
if (pack != null) {
Connection c = ConnectionHelper.getConnection(pack);
flag = MetadataConnectionUtils.isOracle8i(c);
boolean isOracle = MetadataConnectionUtils.isOracle(c);
boolean isOracleJdbc = MetadataConnectionUtils.isOracleJDBC(c);
if ((isOracleJdbc || isOracle) && !flag) {// oracle and not oracle8
isOracle8i = MetadataConnectionUtils.isOracle8i(c);
isOracle = MetadataConnectionUtils.isOracle(c);
isOracleJdbc = MetadataConnectionUtils.isOracleJDBC(c);
if ((isOracleJdbc || isOracle) && !isOracle8i) {// oracle and not oracle8
Statement stmt;
try {
// MOD qiongli TDQ-4732 use the common method to create statement both DI and DQ,avoid Exception
@@ -881,21 +883,25 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl {
if (!isCreateElement(tableFilter, tableName)) {
continue;
}
if (tableName == null || tablesToFilter.contains(tableName) || tableName.startsWith("/")) { //$NON-NLS-1$
if (tableName == null || tablesToFilter.contains(tableName)) { //$NON-NLS-1$
continue;
}
String tableOwner = null;
if (!isHive && MetadataConnectionUtils.isSybase(dbJDBCMetadata)) {
tableOwner = tableSchema;
}
if (!flag) {
tableComment = tables.getString(GetTable.REMARKS.name());
if (StringUtils.isBlank(tableComment)) {
String selectRemarkOnTable = MetadataConnectionUtils.getCommonQueryStr(productName, tableName);
if (selectRemarkOnTable != null) {
tableComment = executeGetCommentStatement(selectRemarkOnTable, dbJDBCMetadata.getConnection());
if (!isOracle8i) {
try {
tableComment = tables.getString(GetTable.REMARKS.name());
if (StringUtils.isBlank(tableComment)) {
String selectRemarkOnTable = MetadataConnectionUtils.getCommonQueryStr(productName, tableName);
if (selectRemarkOnTable != null) {
tableComment = executeGetCommentStatement(selectRemarkOnTable, dbJDBCMetadata.getConnection());
}
}
} catch (SQLException e) {
}
}
MetadataTable metadatatable = null;
if (TableType.VIEW.toString().equals(temptableType) || ETableTypes.VIRTUAL_VIEW.getName().equals(temptableType)) {
@@ -924,6 +930,20 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl {
metadatatable.setComment(tableComment);
ColumnSetHelper.setComment(tableComment, metadatatable);
}
try {
if (tables.getString("SYSTEM_TABLE_NAME") != null && tables.getString("SYSTEM_TABLE_SCHEMA") != null
&& tables.getString("TABLE_SCHEMA") != null) {
TaggedValueHelper.setTaggedValue(metadatatable, TaggedValueHelper.SYSTEMTABLENAME,
tables.getString("SYSTEM_TABLE_NAME").trim());
TaggedValueHelper.setTaggedValue(metadatatable, TaggedValueHelper.SYSTEMTABLESCHEMA,
tables.getString("SYSTEM_TABLE_SCHEMA").trim());
TaggedValueHelper.setTaggedValue(metadatatable, TaggedValueHelper.TABLESCHEMA,
tables.getString("TABLE_SCHEMA").trim());
}
} catch (SQLException e) {
// don't catch anything if the system table name or schema doesn't exist
// this part is needed only for as400
}
list.add(metadatatable);
}
if (dbJDBCMetadata.getDatabaseProductName() != null
@@ -956,7 +976,7 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl {
}
}
} else if (dbJDBCMetadata.getDatabaseProductName() != null
&& dbJDBCMetadata.getDatabaseProductName().startsWith("DB2/NT")) { //$NON-NLS-1$
&& dbJDBCMetadata.getDatabaseProductName().startsWith("DB2/")) { //$NON-NLS-1$
for (String element : tableType) {
if (element.equals("SYNONYM")) { //$NON-NLS-1$
Statement stmt = extractMeta.getConn().createStatement();
@@ -1208,6 +1228,11 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl {
schemaPattern = ColumnSetHelper.getTableOwner(colSet);
}
// --- add columns to table
// TDI-28578 Metadata wizard doesn't display tables starting with '/'
boolean isOracle = MetadataConnectionUtils.isOracle(dbJDBCMetadata);
if (isOracle && tablePattern.contains("/")) {//$NON-NLS-1$
tablePattern = tablePattern.replaceAll("/", "//");//$NON-NLS-1$
}
ResultSet columns = dbJDBCMetadata.getColumns(catalogName, schemaPattern, tablePattern, columnPattern);
if (MetadataConnectionUtils.isMysql(dbJDBCMetadata)) {
boolean check = !Pattern.matches("^\\w+$", tablePattern);//$NON-NLS-1$
@@ -1364,6 +1389,10 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl {
schemaPattern = ColumnSetHelper.getTableOwner(colSet);
}
// --- add columns to table
boolean isOracle = MetadataConnectionUtils.isOracle(dbJDBCMetadata);
if (isOracle && tablePattern.contains("/")) {//$NON-NLS-1$
tablePattern = tablePattern.replaceAll("/", "//");//$NON-NLS-1$
}
ResultSet columns = dbJDBCMetadata.getColumns(catalogName, schemaPattern, tablePattern, columnPattern);
// MOD qiongli 2012-8-15 TDQ-5898,Odbc Terdata don't support some API.
boolean isOdbcTeradata = ConnectionUtils.isOdbcTeradata(dbJDBCMetadata);

View File

@@ -268,7 +268,7 @@ public class ExtractManager {
tableName = extractMeta.getStringMetaDataInfo(rsTables, ExtractManager.SYNONYM_NAME, null);
isSynonym = true;
}
if (tableName == null || tablesToFilter.contains(tableName) || tableName.startsWith("/")) {
if (tableName == null || tablesToFilter.contains(tableName)) {
continue;
}
@@ -377,10 +377,6 @@ public class ExtractManager {
}
fillSynonyms(metadataConnection, metadataColumns, table, tableName, dbMetaData);
} else {
if (tableLabel.contains("/")) {
tableLabel = tableLabel.replace("/", "");
}
newNode.setValue(tableLabel);
metadataColumns = MetadataFillFactory.getDBInstance().fillColumns(table, metadataConnection, dbMetaData, null);
}
@@ -835,6 +831,9 @@ public class ExtractManager {
throws SQLException {
ResultSet columns = null;
if (dbMetaData != null) {
if (tableName.contains("/")) {//$NON-NLS-1$
tableName = tableName.replaceAll("/", "//");//$NON-NLS-1$ //$NON-NLS-2$
}
columns = dbMetaData.getColumns(catalogName, schemaName, tableName, null);
}
return columns;

View File

@@ -40,7 +40,7 @@ import orgomg.cwm.resource.relational.NamedColumnSet;
*/
public class IBMDB2ExtractManager extends ExtractManager {
public static final String DATABASE_PRODUCT_NAME = "DB2/NT"; //$NON-NLS-1$
public static final String DATABASE_PRODUCT_NAME = "DB2/"; //$NON-NLS-1$
private static Logger log = Logger.getLogger(IBMDB2ExtractManager.class);

View File

@@ -466,10 +466,23 @@ public class MetadataConnectionUtils {
}
return false;
}
public static boolean isOracle(DatabaseMetaData metadata) {
if (metadata != null) {
try {
String name = metadata.getDatabaseProductName().toUpperCase();
if (name != null && name.equals(EDatabaseTypeName.ORACLEFORSID.getProduct().toUpperCase())) {
return true;
}
} catch (SQLException e) {
ExceptionHandler.process(e);
}
}
return false;
}
public static boolean isMssql(DatabaseMetaData connectionMetadata) throws SQLException {
if (connectionMetadata.getDriverName() != null && connectionMetadata.getDatabaseProductName() != null) {
if (EDataBaseType.Microsoft_SQL_Server.getProductName().equals(connectionMetadata.getDatabaseProductName().trim())) {
if (connectionMetadata.getDriverName() != null && connectionMetadata.getDatabaseProductName() != null) {
if (EDataBaseType.Microsoft_SQL_Server.getProductName().equals(connectionMetadata.getDatabaseProductName().trim())) {
return true;

View File

@@ -309,8 +309,8 @@ public abstract class FileItemImpl extends ItemImpl implements FileItem {
URIConverter theURIConverter = resourceSet.getURIConverter();
URI normalizedURI = theURIConverter.normalize(resourceUri);
if ("platform".equals(proxyUri.scheme()) && proxyUri.segmentCount() > 1 && "resource".equals(proxyUri.segment(0))) { //$NON-NLS-1$ //$NON-NLS-2$
// TUP-1814:because the routine proxyUri is File type,need handle with it.
if ((proxyUri.isPlatform() && proxyUri.segmentCount() > 1 && "resource".equals(proxyUri.segment(0))) || proxyUri.isFile()) { //$NON-NLS-1$
List<Resource> resources = resourceSet.getResources();
synchronized (resources) {
for (Resource resource : resources) {

View File

@@ -70,6 +70,12 @@ public final class TaggedValueHelper {
public static final String TABLE_OWNER = "Table Owner"; //$NON-NLS-1$
public static final String SYSTEMTABLENAME = "SYSTEM_TABLE_NAME"; //$NON-NLS-1$
public static final String SYSTEMTABLESCHEMA = "SYSTEM_TABLE_SCHEMA"; //$NON-NLS-1$
public static final String TABLESCHEMA = "TABLE_SCHEMA"; //$NON-NLS-1$
// ~~~~~~~~~~~~~~~~~~~~~~~~~
// data connection tagged values

View File

@@ -127,7 +127,7 @@ public class ColumnTypeImpl extends EObjectImpl implements ColumnType {
* @generated
* @ordered
*/
protected static final int LENGTH_EDEFAULT = 0;
protected static final int LENGTH_EDEFAULT = -1;
/**
* The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
@@ -243,7 +243,7 @@ public class ColumnTypeImpl extends EObjectImpl implements ColumnType {
* @generated
* @ordered
*/
protected static final int PRECISION_EDEFAULT = 0;
protected static final int PRECISION_EDEFAULT = -1;
/**
* The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute.

View File

@@ -1387,3 +1387,4 @@ ConfirmReloadConnectionDialog.title=Confirm Reload Connection
ConfirmReloadConnectionDialog.desc=Connection properties changed, the analyzed elements of this connection \non which the analyses depend might be removed if reload it, \ndo you want continue?
ConfirmReloadConnectionDialog.reload=reload
ConfirmReloadConnectionDialog.unreload=don\'t reload
SeletorModuleForm.connectFromCustomModuleName.errorTitle=Error

View File

@@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SearchPattern;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.exception.ExceptionMessageDialog;
import org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea;
import org.talend.commons.ui.swt.formtools.Form;
import org.talend.commons.ui.swt.formtools.UtilsButton;
@@ -329,7 +330,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
// Button Create Table
String displayStr = Messages.getString("SelectorTableForm.selectAllTables"); //$NON-NLS-1$
Point buttonSize = gc.stringExtent(displayStr);
selectAllTablesButton = new UtilsButton(compositeRetreiveSchemaButton, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL); //$NON-NLS-1$
selectAllTablesButton = new UtilsButton(compositeRetreiveSchemaButton, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
displayStr = Messages.getString("SelectorTableForm.selectNoneTables"); //$NON-NLS-1$
buttonSize = gc.stringExtent(displayStr);
@@ -416,6 +417,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
private final Comparator strComparator = new Comparator() {
@Override
public int compare(Object arg0, Object arg1) {
TableItem t1 = (TableItem) arg0;
@@ -513,8 +515,8 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
updateStatus(IStatus.ERROR, null);
TableItem[] tableItems = table.getItems();
int size = tableItems.length;
for (int i = 0; i < tableItems.length; i++) {
TableItem tableItem = tableItems[i];
for (TableItem tableItem2 : tableItems) {
TableItem tableItem = tableItem2;
if (!tableItem.getChecked()) {
tableItem.setText(3, Messages.getString("SelectorTableForm.Pending")); //$NON-NLS-1$
countPending++;
@@ -539,8 +541,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
countSuccess = 0;
countPending = 0;
TableItem[] tableItems = table.getItems();
for (int i = 0; i < tableItems.length; i++) {
TableItem tableItem = tableItems[i];
for (TableItem tableItem : tableItems) {
if (tableItem.getChecked()) {
clearTableItem(tableItem);
tableItem.setChecked(false);
@@ -611,6 +612,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
}
parentWizardPage.getWizard().getContainer().run(true, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(Messages.getString("CreateTableAction.action.createTitle"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
@@ -619,24 +621,36 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
String proxy = null;
oldTemConnection = getOriginalValueConnection();
if (oldTemConnection.isUseProxy()) {
proxy = SalesforceModuleParseAPI.USE_SOCKS_PROXY;//$NON-NLS-1$
proxy = SalesforceModuleParseAPI.USE_SOCKS_PROXY;
} else if (oldTemConnection.isUseHttpProxy()) {
proxy = SalesforceModuleParseAPI.USE_HTTP_PROXY;//$NON-NLS-1$
proxy = SalesforceModuleParseAPI.USE_HTTP_PROXY;
}
try {
itemTableName = connectFromCustomModuleName(proxy);
itemTableName = connectFromCustomModuleName(proxy);
if (itemTableName.size() <= 0) {
// connection is done but any table exist
if (displayMessageBox) {
openInfoDialogInUIThread(getShell(),
Messages.getString("DatabaseTableForm.checkConnection"), Messages //$NON-NLS-1$
.getString("DatabaseTableForm.tableNoExist"), true);//$NON-NLS-1$
if (itemTableName.size() <= 0) {
// connection is done but any table exist
if (displayMessageBox) {
openInfoDialogInUIThread(getShell(),
Messages.getString("DatabaseTableForm.checkConnection"), Messages //$NON-NLS-1$
.getString("DatabaseTableForm.tableNoExist"), true);//$NON-NLS-1$
}
} else {
createAllItems(displayMessageBox, null);
}
} else {
createAllItems(displayMessageBox, null);
} catch (final Exception ex) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
ExceptionMessageDialog.openError(
getShell(),
Messages.getString("SeletorModuleForm.connectFromCustomModuleName.errorTitle"), ex.getMessage(), ex); //$NON-NLS-1$
}
});
} finally {
monitor.done();
}
monitor.done();
}
});
} catch (Exception e) {
@@ -654,6 +668,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
private void createAllItems(final boolean displayMessageBox, final List<String> newList) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
List<String> list = new ArrayList<String>();
if (newList != null) {
@@ -693,16 +708,21 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
});
}
public static void openInfoDialogInUIThread(final Shell shell, final String title, final String msg, boolean ifUseRunnable) {
public static void openInfoDialogInUIThread(Shell shell, final String title, final String msg, boolean ifUseRunnable) {
if (ifUseRunnable) {
shell.getDisplay().asyncExec(new Runnable() {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openInformation(shell, title, msg);
MessageDialog.openInformation(new Shell(), title, msg);
}
});
} else {
MessageDialog.openInformation(shell, title, msg);
Shell iShell = shell;
if (iShell == null) {
iShell = new Shell();
}
MessageDialog.openInformation(iShell, title, msg);
}
}
@@ -873,8 +893,8 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
if (runnable != null) {
return runnable;
}
for (Iterator iter = getQueue().iterator(); iter.hasNext();) {
RetrieveColumnRunnable element = (RetrieveColumnRunnable) iter.next();
for (Object element2 : getQueue()) {
RetrieveColumnRunnable element = (RetrieveColumnRunnable) element2;
if (element.getTableItem() == key) {
return element;
}
@@ -938,6 +958,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
getConnection().setModuleName(tableString);
}
@Override
public void run() {
if (isCanceled()) {
return;
@@ -1042,6 +1063,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
//
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
if (isCanceled()) {
return;
@@ -1162,7 +1184,11 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
protected void addFieldsListeners() {
nameFilter.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
if (itemTableName == null) {
return;
}
List<String> newList = new ArrayList<String>();
String pattern = nameFilter.getText();
@@ -1318,6 +1344,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
}
}
@Override
protected SalesforceSchemaConnection getConnection() {
if (oldTemConnection != null) {
return oldTemConnection;
@@ -1393,7 +1420,7 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
return this.itemTableName;
}
public List<String> connectFromCustomModuleName(String proxy) {
public List<String> connectFromCustomModuleName(String proxy) throws Exception {
preparModuleInit();
SalesforceModuleParseAPI salesforceAPI = new SalesforceModuleParseAPI();
String[] types = null;
@@ -1412,90 +1439,83 @@ public class SelectorModulesForm extends AbstractSalesforceStepForm {
httpProxy = true;
}
}
try {
if (loginType.equals(BASIC)) {
salesforceAPI.resetAllProxy();
salesforceAPI.setProxy(proxyHost, proxyPort, proxyUsername, proxyPassword, httpProxy, socksProxy, httpsProxy);
salesforceAPI.login(endPoint, username, pwd, timeOut);
ISalesforceModuleParser currentAPI = salesforceAPI.getCurrentAPI();
if (currentAPI instanceof SalesforceModuleParseEnterprise) {
describeGlobalResult = describeGlobal();
if (describeGlobalResult != null) {
types = describeGlobalResult.getTypes();
}
} else {
// for bug 17280 use new jar axis2 for salesforce component and wizard.
if (currentAPI instanceof SalesforceModuleParserPartner) {
SalesforceModuleParserPartner partner = (SalesforceModuleParserPartner) currentAPI;
SforceManagementImpl sforceManagement = partner.getSforceManagement();
SessionHeader sessionHeader = sforceManagement.getSessionHeader();
DescribeGlobal dg = new DescribeGlobal();
com.salesforce.soap.partner.DescribeGlobalResult dgr = sforceManagement.getStub()
.describeGlobal(dg, sessionHeader, null, null).getResult();
dgsrs = dgr.getSobjects();
}
if (loginType.equals(BASIC)) {
salesforceAPI.resetAllProxy();
salesforceAPI.setProxy(proxyHost, proxyPort, proxyUsername, proxyPassword, httpProxy, socksProxy, httpsProxy);
salesforceAPI.login(endPoint, username, pwd, timeOut);
ISalesforceModuleParser currentAPI = salesforceAPI.getCurrentAPI();
if (currentAPI instanceof SalesforceModuleParseEnterprise) {
describeGlobalResult = describeGlobal();
if (describeGlobalResult != null) {
types = describeGlobalResult.getTypes();
}
} else {
salesforceAPI.resetAllProxy();
salesforceAPI.setProxy(proxyHost, proxyPort, proxyUsername, proxyPassword, httpProxy, socksProxy, httpsProxy);
Token token = salesforceAPI.login(endPointForAuth, consumerKey, consumeSecret, callbackHost, callbackPort,
salesforceVersion, tokenProperties, timeOut);
if (token != null) {
org.talend.salesforce.SforceManagement sfMgr = new org.talend.salesforce.SforceManagementImpl();
OAuthClient client = new OAuthClient();
client.setBaseOAuthURL(endPointForAuth);
client.setCallbackHost(callbackHost);
client.setCallbackPort(Integer.parseInt(callbackPort));
client.setClientID(consumerKey);
client.setClientSecret(consumeSecret);
String endpoint = client.getSOAPEndpoint(token, salesforceVersion);
boolean result = sfMgr.login(token.getAccess_token(), endpoint, Integer.parseInt(timeOut), false);
SessionHeader sessionHeader = sfMgr.getSessionHeader();
// for bug 17280 use new jar axis2 for salesforce component and wizard.
if (currentAPI instanceof SalesforceModuleParserPartner) {
SalesforceModuleParserPartner partner = (SalesforceModuleParserPartner) currentAPI;
SforceManagementImpl sforceManagement = partner.getSforceManagement();
SessionHeader sessionHeader = sforceManagement.getSessionHeader();
DescribeGlobal dg = new DescribeGlobal();
com.salesforce.soap.partner.DescribeGlobalResult dgr = sfMgr.getStub()
com.salesforce.soap.partner.DescribeGlobalResult dgr = sforceManagement.getStub()
.describeGlobal(dg, sessionHeader, null, null).getResult();
dgsrs = dgr.getSobjects();
}
}
} else {
salesforceAPI.resetAllProxy();
INode node = getSalesforceNode();
List list = new ArrayList();
IElementParameter modulesNameParam = node.getElementParameter("MODULENAME"); //$NON-NLS-1$
Object[] modulename = modulesNameParam.getListItemsValue();
if (modulename != null && modulename.length > 1) {
for (int i = 0; i < modulename.length - 1; i++) {
list.add(i, modulename[i]);
}
salesforceAPI.setProxy(proxyHost, proxyPort, proxyUsername, proxyPassword, httpProxy, socksProxy, httpsProxy);
Token token = salesforceAPI.login(endPointForAuth, consumerKey, consumeSecret, callbackHost, callbackPort,
salesforceVersion, tokenProperties, timeOut);
if (token != null) {
org.talend.salesforce.SforceManagement sfMgr = new org.talend.salesforce.SforceManagementImpl();
OAuthClient client = new OAuthClient();
client.setBaseOAuthURL(endPointForAuth);
client.setCallbackHost(callbackHost);
client.setCallbackPort(Integer.parseInt(callbackPort));
client.setClientID(consumerKey);
client.setClientSecret(consumeSecret);
String endpoint = client.getSOAPEndpoint(token, salesforceVersion);
boolean result = sfMgr.login(token.getAccess_token(), endpoint, Integer.parseInt(timeOut), false);
SessionHeader sessionHeader = sfMgr.getSessionHeader();
DescribeGlobal dg = new DescribeGlobal();
com.salesforce.soap.partner.DescribeGlobalResult dgr = sfMgr.getStub()
.describeGlobal(dg, sessionHeader, null, null).getResult();
dgsrs = dgr.getSobjects();
}
if (types != null && types.length > 0) {
for (int j = 0; j < types.length; j++) {
if (!list.contains(types[j])) {
list.add(types[j]);
}
}
}
if (dgsrs != null && dgsrs.length > 0) {
for (int k = 0; k < dgsrs.length; k++) {
DescribeGlobalSObjectResult dsResult = dgsrs[k];
String name = dsResult.getName();
if (!list.contains(name)) {
list.add(name);
}
}
}
// createAllItems(false, list);
return list;
} catch (Exception ex) {
ExceptionHandler.process(ex);
return null;
}
salesforceAPI.resetAllProxy();
INode node = getSalesforceNode();
List list = new ArrayList();
IElementParameter modulesNameParam = node.getElementParameter("MODULENAME"); //$NON-NLS-1$
Object[] modulename = modulesNameParam.getListItemsValue();
if (modulename != null && modulename.length > 1) {
for (int i = 0; i < modulename.length - 1; i++) {
list.add(i, modulename[i]);
}
}
if (types != null && types.length > 0) {
for (int j = 0; j < types.length; j++) {
if (!list.contains(types[j])) {
list.add(types[j]);
}
}
}
if (dgsrs != null && dgsrs.length > 0) {
for (DescribeGlobalSObjectResult dsResult : dgsrs) {
String name = dsResult.getName();
if (!list.contains(name)) {
list.add(name);
}
}
}
// createAllItems(false, list);
return list;
}
private void preparModuleInit() {

View File

@@ -1428,6 +1428,7 @@ public class SelectorTableForm extends AbstractForm {
// ~20828
dbtable.setComment(comment);
TableHelper.setComment(comment, dbtable);
dbtable.getTaggedValue().addAll(table.getTaggedValue());
dbtable.setTableType(type);
String lableName = MetadataToolHelper.validateTableName(table.getName());
dbtable.setLabel(lableName);