Compare commits

...

9 Commits

Author SHA1 Message Date
Sebastien Gandon
e00e41f316 TDM-4411 : generate a timestamp at every export for TDM generation 2014-12-04 17:46:52 +01:00
wchen-talend
254895372b TDI-31369:The context value can't be removed 2014-12-02 10:09:21 +08:00
ldong-talend
7f8caad2f4 TDI-31373:There is always popup error log when change setting of
tSAPInput.
2014-11-28 21:23:33 +08:00
hcyi
f2126a53e2 TUP-2457:don't modify, just click "Finish", all the table and view lost
from Postgresql connection.
2014-11-28 21:10:47 +08:00
cmeng-talend
4cde6cfcb0 TBD-1110 fix bug: Export Dependencies:The sub job can't be checked When
I export a MR job that use tRunJob
https://jira.talendforge.org/browse/TBD-1110
2014-11-28 20:20:32 +08:00
wchen-talend
a0f5761bb9 TDI-31369:The context value can't be removed 2014-11-28 20:15:23 +08:00
hwang
c61fe42ef8 TDI-31361:Issues about URL for json wizard 2014-11-28 20:13:55 +08:00
ycbai
e078a0e6b5 TBD-1018: add missing data type mappings. 2014-11-28 19:31:27 +08:00
ycbai
b3e6fcda1d TBD-1018: fix the problem of cassandra datatype mapping. 2014-11-28 19:30:51 +08:00
10 changed files with 183 additions and 50 deletions

View File

@@ -24,9 +24,11 @@
<dbType type="BIGINT" ignorePre="true" />
<dbType type="BLOB" ignorePre="true" />
<dbType type="BOOLEAN" ignorePre="true" />
<dbType type="TEXT" ignorePre="true" />
<dbType type="UUID" ignorePre="true" />
<dbType type="TIMEUUID" ignorePre="true" />
<dbType type="VARINT" ignorePre="true" />
<dbType type="INT" ignorePre="true" />
<dbType type="FLOAT" defaultLength="20" defaultPrecision="10" />
<dbType type="DOUBLE" defaultLength="20" defaultPrecision="10" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
@@ -60,7 +62,9 @@
</talendType>
<talendType type="id_Integer">
<dbType type="Int32Type" default="true" />
<dbType type="IntegerType"/>
<dbType type="VARINT" />
<dbType type="INT" />
</talendType>
<talendType type="id_Long">
<dbType type="LongType" default="true" />
@@ -70,7 +74,6 @@
</talendType>
<talendType type="id_Object">
<dbType type="ObjectType" default="true" />
<dbType type="IntegerType" />
<dbType type="BLOB" />
</talendType>
<talendType type="id_Short" />
@@ -80,6 +83,7 @@
<dbType type="UUIDType" />
<dbType type="TimeUUIDType" />
<dbType type="ASCII" />
<dbType type="TEXT" />
<dbType type="UUID" />
<dbType type="TIMEUUID" />
</talendType>
@@ -91,11 +95,14 @@
<dbType type="AsciiType">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="TEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="UTF8Type">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="IntegerType">
<talendType type="id_Object" default="true" />
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="Int32Type">
<talendType type="id_Integer" default="true" />
@@ -152,6 +159,9 @@
<dbType type="VARINT">
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="INT">
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="FLOAT">
<talendType type="id_Float" default="true" />
</dbType>

View File

@@ -300,9 +300,14 @@ public class RepositoryNodeUtilities {
for (IRepositoryNode childNode : children) {
RepositoryNode node = (RepositoryNode) childNode;
if (isRepositoryFolder(node) || node.getType() == ENodeType.REFERENCED_PROJECT
|| (hadoopClusterService != null && hadoopClusterService.isHadoopClusterNode(node))) {
if (isRepositoryFolder(node) || node.getType() == ENodeType.REFERENCED_PROJECT) {
folderChild.add(node);
} else if (hadoopClusterService != null && hadoopClusterService.isHadoopClusterNode(node)) {
if (node.getId().equals(curNode.getId()) && node.getObjectType() == curNode.getRepositoryObjectType()) {
return node;
} else {
folderChild.add(node);
}
} else if (node.getId().equals(curNode.getId()) && node.getObjectType() == curNode.getRepositoryObjectType()) {
return node;
}

View File

@@ -60,10 +60,10 @@ public class ContextValuesNatText extends Composite {
private NatTableCellEditorFactory cellFactory;
/**
* Flag to determine whether the text is on focus or lost.
*/
private boolean focusLostActive = false;
// /**
// * Flag to determine whether the text is on focus or lost.
// */
// private boolean focusLostActive = false;
private List<FocusListener> focusListener = new ArrayList<FocusListener>();
@@ -203,24 +203,24 @@ public class ContextValuesNatText extends Composite {
*
* @see org.eclipse.swt.widgets.Control#removeFocusListener(org.eclipse.swt.events.FocusListener)
*/
@Override
public void removeFocusListener(final FocusListener listener) {
if (focusLostActive) {
try {
new Thread() {
@Override
public void run() {
focusListener.remove(listener);
};
}.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
focusListener.remove(listener);
}
}
// @Override
// public void removeFocusListener(final FocusListener listener) {
// if (focusLostActive) {
// try {
// new Thread() {
//
// @Override
// public void run() {
// focusListener.remove(listener);
// };
// }.join();
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// } else {
// focusListener.remove(listener);
// }
// }
/**
* Transforms the subDialog's result.
@@ -248,4 +248,22 @@ public class ContextValuesNatText extends Composite {
result = getTransformedSelection(focusOnText);
return result;
}
/**
* Getter for text.
*
* @return the text
*/
public Text getText() {
return this.text;
}
/**
* Getter for button.
*
* @return the button
*/
public Button getButton() {
return this.button;
}
}

View File

@@ -17,14 +17,11 @@ import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.MoveDirectio
import org.eclipse.nebula.widgets.nattable.style.IStyle;
import org.eclipse.nebula.widgets.nattable.widget.EditModeEnum;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
import org.talend.commons.utils.PasswordEncryptUtil;
import org.talend.core.model.process.IContextParameter;
@@ -78,8 +75,6 @@ public class CustomTextCellEditor extends AbstractCellEditor {
}
final ContextValuesNatText text = new ContextValuesNatText(parentComp, cellStyle, realPara, style);
text.setCursor(new Cursor(Display.getDefault(), SWT.CURSOR_IBEAM));
addTextListener(text);
return text;
@@ -114,13 +109,13 @@ public class CustomTextCellEditor extends AbstractCellEditor {
});
text.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
commit(MoveDirectionEnum.NONE, editMode == EditModeEnum.INLINE);
}
});
// text.addFocusListener(new FocusAdapter() {
//
// @Override
// public void focusLost(FocusEvent e) {
// commit(MoveDirectionEnum.NONE, editMode == EditModeEnum.INLINE);
// }
// });
}
/*
@@ -172,6 +167,12 @@ public class CustomTextCellEditor extends AbstractCellEditor {
// use the real value.
setCanonicalValue(this.recordOriginalCanonicalValue);
Text text = buttonText.getText();
if (buttonText.getButton() == null) {
text.forceFocus();
}
text.setSelection(0, text.getText().length());
return this.buttonText;
}

View File

@@ -347,7 +347,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
param.setPromptNeeded((Boolean) newValue);
modified = true;
} else if (property.equals(ContextTableConstants.COLUMN_PROMPT_PROPERTY)) {
if (param.getPrompt().equals(newValue)) {
if (param.getPrompt() != null && param.getPrompt().equals(newValue)) {
return;
}
oldValue = param.getPrompt();
@@ -358,10 +358,10 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
return;
}
oldValue = param.getValue();
if (newValue != null) {
param.setValue((String) newValue);
modified = true;
}
// if (newValue != null) {
param.setValue(newValue == null ? "" : (String) newValue);
modified = true;
// }
}
if (modified) {
updateRelation();

View File

@@ -23,6 +23,7 @@ import org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor;
import org.eclipse.nebula.widgets.nattable.edit.editor.ICellEditor;
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.MoveDirectionEnum;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.talend.core.model.process.IContextManager;
@@ -144,4 +145,19 @@ public class ProxyDynamicCellEditor extends AbstractCellEditor {
return null;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor#commit(org.eclipse.nebula.widgets.nattable
* .selection.SelectionLayer.MoveDirectionEnum, boolean, boolean)
*/
@Override
public boolean commit(MoveDirectionEnum direction, boolean closeAfterCommit, boolean skipValidation) {
if (dynamicEditor != null) {
return dynamicEditor.commit(direction, closeAfterCommit, skipValidation);
}
return super.commit(direction, closeAfterCommit, skipValidation);
}
}

View File

@@ -506,8 +506,9 @@ public class SchemaCellEditor extends DialogCellEditor {
if (tableToEdit != null) {
if (isHL7OutputNode(node) && node.getIncomingConnections().size() > 0) {
copyHL7OutputMetadata(node, tableToEdit);
} else if (isSAPNode(node) && type.toString().equals(TABLE) && node.getIncomingConnections().size() > 0
&& hasParentRow && (parent_row != null && !parent_row.equals("") && !(parent_row instanceof Integer))) {
} else if (isSAPNode(node) && type != null && type.toString().equals(TABLE)
&& node.getIncomingConnections().size() > 0 && hasParentRow
&& (parent_row != null && !parent_row.equals("") && !(parent_row instanceof Integer))) {
copySAPOutputMetadata(node, tableToEdit);
} else {
MetadataDialog dialog = new MetadataDialog(cellEditorWindow.getShell(), tableToEdit.clone(), node, null);

View File

@@ -106,6 +106,8 @@ public class ProcessorUtilities {
private static Map<String, Integer> lastGeneratedWithStatsOrTrace = new HashMap<String, Integer>();
private static Date exportTimeStamp;// time stamp create when exporting a job and reset when export ends.
private static final int GENERATED_WITH_STATS = 1;
private static final int GENERATED_WITH_TRACES = 2;
@@ -145,6 +147,11 @@ public class ProcessorUtilities {
codeLocation = exportCodeLocation;
libraryPath = exportLibraryPath;
exportConfig = true;
exportTimeStamp = new Date();
}
public static Date getExportTimestamp() {
return exportTimeStamp;
}
public static boolean isExportConfig() {
@@ -156,6 +163,7 @@ public class ProcessorUtilities {
codeLocation = null;
libraryPath = null;
exportConfig = false;
exportTimeStamp = null;
}
public static String getInterpreter() {

View File

@@ -440,7 +440,7 @@ public class TreeUtil {
public static List<FOXTreeNode> getFoxTreeNodes(String filePath) {
List<FOXTreeNode> list = new ArrayList<FOXTreeNode>();
if (filePath == null) {
if (filePath == null || filePath.length() <= 0) {
return list;
}

View File

@@ -631,8 +631,8 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
filterList.addAll(postFillCatalog(metaConnection, catalogList, filterList,
TalendCWMService.getReadableName(dbConn, catalogName), dbConn));
List<Catalog> newCatalogList = new ArrayList<Catalog>();
List<Schema> schemaList = new ArrayList<Schema>();
for (Catalog catalog : catalogList) {
List<Schema> schemaList = new ArrayList<Schema>();
try {
schemaList = fillSchemaToCatalog(dbConn, dbJDBCMetadata, catalog, filterList);
if (!schemaList.isEmpty() && schemaList.size() > 0) {
@@ -642,9 +642,83 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl<DatabaseConnectio
log.info(e);
}
newCatalogList.add(catalog);
// ConnectionHelper.addCatalog(catalog, dbConn);
}
ConnectionHelper.addCatalogs(newCatalogList, dbConn);
Set<MetadataTable> tableSet = ConnectionHelper.getTables(dbConn);
// replaceCatalogs is use for record tables when click finish, then set to current connection.
List<Catalog> replaceCatalogs = new ArrayList<Catalog>();
List<String> catalogNames = new ArrayList<String>();
for (MetadataTable table : tableSet) {
EObject eContainer = table.eContainer();
if (eContainer != null) {
if (eContainer instanceof Catalog) {
Catalog c = (Catalog) eContainer;
String name = c.getName();
if (!catalogNames.contains(name)) {
replaceCatalogs.add(c);
catalogNames.add(name);
}
} else if (eContainer instanceof Schema) {
EObject parent = eContainer.eContainer();
if (parent != null && parent instanceof Catalog) {
Catalog c = (Catalog) parent;
String name = c.getName();
if (!catalogNames.contains(name)) {
List<Schema> filterSchemas = new ArrayList<Schema>();
List<String> schemaName = new ArrayList<String>();
List<Schema> schemas = CatalogHelper.getSchemas(c);
for (Schema schema : schemas) {
if (filterList != null) {
if (filterList.contains(schema.getName())) {
filterSchemas.add(schema);
schemaName.add(schema.getName());
} else if (schema.getOwnedElement() != null && !schema.getOwnedElement().isEmpty()) {
filterSchemas.add(schema);
schemaName.add(schema.getName());
}
}
}
// get schema in current connection
for (Catalog catalog : catalogList) {
if (catalog.getName().equals(name)) {
boolean added = false;
for (Schema schema : CatalogHelper.getSchemas(catalog)) {
if (!schemaName.contains(schema.getName())) {
filterSchemas.add(schema);
added = true;
}
}
if (added) {
break;
}
}
}
c.getOwnedElement().clear();
CatalogHelper.addSchemas(filterSchemas, c);
replaceCatalogs.add(c);
catalogNames.add(name);
}
}
}
}
}
if (this.isLinked() && !catalogList.isEmpty()) {
ConnectionHelper.addCatalogs(catalogList, dbConn);
}
// if have same schema in current connection,need to fill tables.
for (Catalog catalog : replaceCatalogs) {
List<Catalog> list = new ArrayList<Catalog>();
String name = catalog.getName();
Catalog c = (Catalog) ConnectionHelper.getPackage(name, dbConn, Catalog.class);
if (c != null) {
list.add(c);
ConnectionHelper.removeCatalogs(list, dbConn);
ConnectionHelper.addCatalog(catalog, dbConn);
} else {
ConnectionHelper.addCatalog(catalog, dbConn);
}
}
}
return catalogList;
}