Compare commits
235 Commits
release/5.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30f730dc12 | ||
|
|
ec12e1b8f3 | ||
|
|
ca6ec37047 | ||
|
|
16bef143ef | ||
|
|
e004b50344 | ||
|
|
23c3dd6f1a | ||
|
|
d7760a1e65 | ||
|
|
7f35e06529 | ||
|
|
f6261c0b31 | ||
|
|
4315904b8f | ||
|
|
c3d6f66d7f | ||
|
|
889ae405cb | ||
|
|
e5b713a617 | ||
|
|
0d144c69fd | ||
|
|
450bd19224 | ||
|
|
c5fd628e2c | ||
|
|
0c4507aeed | ||
|
|
76837c24fc | ||
|
|
19639c740e | ||
|
|
7e522b3de5 | ||
|
|
aa69617dd6 | ||
|
|
14665bc5ff | ||
|
|
a67205fdca | ||
|
|
96d5c4e89e | ||
|
|
19a261cf49 | ||
|
|
288f223e76 | ||
|
|
e92168add6 | ||
|
|
22d767875b | ||
|
|
6c7553f6a7 | ||
|
|
3211737135 | ||
|
|
2e283fdbb0 | ||
|
|
76d36599b4 | ||
|
|
bfc1249eaf | ||
|
|
6f74f6115d | ||
|
|
bd09ae6534 | ||
|
|
e46cb7a80c | ||
|
|
95ea1029b1 | ||
|
|
e19a768f99 | ||
|
|
dc4d6e5571 | ||
|
|
a008296c50 | ||
|
|
16274341d9 | ||
|
|
9161a76733 | ||
|
|
779532aea4 | ||
|
|
e3e5208f33 | ||
|
|
f73b758804 | ||
|
|
7e1464b2c7 | ||
|
|
fd5baa5bef | ||
|
|
beca41bd89 | ||
|
|
033b425139 | ||
|
|
90ee4e7540 | ||
|
|
9564006ec2 | ||
|
|
4e59bdb673 | ||
|
|
28c7241060 | ||
|
|
71e4faa1c9 | ||
|
|
59db3706e8 | ||
|
|
6d6223ee3e | ||
|
|
30b5520f90 | ||
|
|
5eaab053a7 | ||
|
|
c1d4923344 | ||
|
|
ff04dc3bcc | ||
|
|
77935db447 | ||
|
|
c415a095b4 | ||
|
|
c09724abe7 | ||
|
|
988fb6da6c | ||
|
|
4300c4d41c | ||
|
|
5a6c6072c1 | ||
|
|
7bcdd11a95 | ||
|
|
d9190e286d | ||
|
|
5357cae659 | ||
|
|
c393b30499 | ||
|
|
d49c30d86d | ||
|
|
5c4eb11138 | ||
|
|
2063a0c1e5 | ||
|
|
a485cf01f4 | ||
|
|
7733eb3d66 | ||
|
|
09e33f6369 | ||
|
|
156c4a37d6 | ||
|
|
a25bcc87c9 | ||
|
|
24cbfb8de7 | ||
|
|
9ec2203619 | ||
|
|
7e34a9ca47 | ||
|
|
477e5ba4af | ||
|
|
500408acd6 | ||
|
|
a8a97c1305 | ||
|
|
bbba2c55d4 | ||
|
|
61fa77fc0f | ||
|
|
84efb1f2ca | ||
|
|
fca502a4d5 | ||
|
|
a8edfc3b17 | ||
|
|
54c71d17cb | ||
|
|
4b3e413cec | ||
|
|
81cd899ca6 | ||
|
|
40414c1ba0 | ||
|
|
e84482734e | ||
|
|
0ff78a3881 | ||
|
|
68a66dfb80 | ||
|
|
14c04b7b9a | ||
|
|
fc8fd2da58 | ||
|
|
ec713509ab | ||
|
|
09221be330 | ||
|
|
6e57f92420 | ||
|
|
777b350d90 | ||
|
|
01b93131ad | ||
|
|
89ea83eb2e | ||
|
|
1ce533dab9 | ||
|
|
dbe9777fdc | ||
|
|
e20dc3c79b | ||
|
|
78a485a285 | ||
|
|
c7943bd6ad | ||
|
|
97984897d8 | ||
|
|
4672a95715 | ||
|
|
14e8fa0f43 | ||
|
|
f4d0ad33db | ||
|
|
68eb193517 | ||
|
|
4cd1f5829f | ||
|
|
fe9b7789e6 | ||
|
|
eb749086e7 | ||
|
|
b43486faaf | ||
|
|
270561e557 | ||
|
|
bca8b423c3 | ||
|
|
94a835d56f | ||
|
|
c9ac76a205 | ||
|
|
dd821715b1 | ||
|
|
96387b653b | ||
|
|
6ec88eb7e6 | ||
|
|
3b60d2c709 | ||
|
|
437de8cae5 | ||
|
|
2f1d299600 | ||
|
|
fd3457c9b2 | ||
|
|
165b19a355 | ||
|
|
8a87a4732a | ||
|
|
f2d4e3047e | ||
|
|
25fedcb75c | ||
|
|
bd58d821dd | ||
|
|
1c4e716de8 | ||
|
|
51bf3acc75 | ||
|
|
ba3d68e090 | ||
|
|
aa35063c76 | ||
|
|
a83562a5b0 | ||
|
|
212d0126c3 | ||
|
|
24a7e10f62 | ||
|
|
975b6349f5 | ||
|
|
392d60591b | ||
|
|
af15c95f8f | ||
|
|
3f2a82fc21 | ||
|
|
ccdc296b8d | ||
|
|
340e197ff6 | ||
|
|
1438f7d6c5 | ||
|
|
82a200b384 | ||
|
|
ca0adfff8e | ||
|
|
c49b073479 | ||
|
|
53ceb690e7 | ||
|
|
e3b6894a64 | ||
|
|
b2929b4824 | ||
|
|
2212ea1021 | ||
|
|
db34be3de5 | ||
|
|
bba322e979 | ||
|
|
b5d76de144 | ||
|
|
1459a58f45 | ||
|
|
db2b9dc1d5 | ||
|
|
9d6895cddb | ||
|
|
efcc63d493 | ||
|
|
8eb04e6087 | ||
|
|
494ebd3f51 | ||
|
|
0e21f83fde | ||
|
|
f16723a7e3 | ||
|
|
ac7d4e23c4 | ||
|
|
78318f3a0d | ||
|
|
c09ad426e6 | ||
|
|
95f48cfe8e | ||
|
|
2c188a7a6c | ||
|
|
59b931f17d | ||
|
|
3108ff8744 | ||
|
|
041c21e403 | ||
|
|
8b4a2c662a | ||
|
|
7ef8c0d6e7 | ||
|
|
4d8b6cb445 | ||
|
|
ceeb51b2c4 | ||
|
|
7c7c42269a | ||
|
|
cf7022fd9f | ||
|
|
513e7673ef | ||
|
|
dd4487935e | ||
|
|
af3327e591 | ||
|
|
56f14cb4c3 | ||
|
|
1db27fee9c | ||
|
|
87f8fed993 | ||
|
|
c1dcd70826 | ||
|
|
b8b7544c5a | ||
|
|
5561025a1d | ||
|
|
a2cacc6819 | ||
|
|
7fc5523701 | ||
|
|
c43f3de71e | ||
|
|
e8e00ed307 | ||
|
|
af0deba9b0 | ||
|
|
321899411d | ||
|
|
9e5c89b7c9 | ||
|
|
e340ab9d99 | ||
|
|
403c2f8644 | ||
|
|
1ac31be0da | ||
|
|
4b89fa78e8 | ||
|
|
06da92ae35 | ||
|
|
aea0ab0080 | ||
|
|
f2828ffd83 | ||
|
|
d99e4d5d80 | ||
|
|
94141bdd8c | ||
|
|
f29930364b | ||
|
|
0632fc5435 | ||
|
|
5cdb723a1e | ||
|
|
11fae62f21 | ||
|
|
97144881de | ||
|
|
1e32a80420 | ||
|
|
15650f400d | ||
|
|
d36b9f2373 | ||
|
|
cd721a7aeb | ||
|
|
a5158d37a3 | ||
|
|
0e4c36d687 | ||
|
|
02584d8f98 | ||
|
|
a54b8e7b69 | ||
|
|
8ee6be3ded | ||
|
|
49fb57f772 | ||
|
|
1b5b9adeea | ||
|
|
ae4d977060 | ||
|
|
5a94e1c547 | ||
|
|
360269d91c | ||
|
|
d1a13a1237 | ||
|
|
eb131d292e | ||
|
|
498e78f282 | ||
|
|
d73f7993b3 | ||
|
|
6565a23962 | ||
|
|
e2f12f3f18 | ||
|
|
4b22423501 | ||
|
|
ac7d51f672 | ||
|
|
2bccdc3013 | ||
|
|
6d217d9136 | ||
|
|
45d4a673ea |
@@ -10,6 +10,7 @@ ColorStyledText.SelectAllItem.Text=Alle ausw
|
||||
ContentProposalAdapterExtended.close=Schließen
|
||||
ControlUtils.Unsupported1=Dieses Steuerelement ({0}) wird nicht unterstützt, bei Bedarf "Feature Request" eröffnen...
|
||||
CopyPushButton.CopyButton.Tip=Ausgewählte Elemente kopieren
|
||||
DateDialog.textContent=Wähle Datum und Zeit
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=ERROR
|
||||
ErrorDialogWidthDetailArea.ErrorMessage.Text=Fehlermeldung
|
||||
EventUtil.activate=Aktivieren
|
||||
|
||||
@@ -104,13 +104,13 @@ TableViewerCreator.CellModifier.ExError=\u73FE\u5728\u306E CellModifier \u306F\u
|
||||
TableViewerCreator.columnNoIBeanProperty=\u30AB\u30E9\u30E0 '{0}' ('{1}') \u306F CellEditor \u30BB\u30C3\u30C8\u3092\u6301\u3061\u307E\u3059\u304C\u3001 IBeanPropertyAccessors\u3092\u6301\u3061\u307E\u305B\u3093\u3002
|
||||
TableViewerCreator.columnNullId=\u30AB\u30E9\u30E0 '{0}' \u306FNULL\u5024\u306Eid\u3092\u6301\u3063\u3066\u3044\u307E\u3059\u3002
|
||||
TableViewerCreator.IdProperty.AssertMsg=\u30AB\u30E9\u30E0\u306EidProperty\u306E\u5909\u66F4\u304C\u5FC5\u8981\u3067\u3059\u3001idProperty\u306F\uFF11\u3064\u306E\u30C6\u30FC\u30D6\u30EB\u3067\u30E6\u30CB\u30FC\u30AF\u3067\u306A\u304F\u3066\u306F\u306A\u308A\u307E\u305B\u3093\u3002
|
||||
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u5024\u3067\u3059
|
||||
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304Cnull\u3067\u3059
|
||||
TableViewerCreator.TableColumn.AssertMsg=idProperty'{0}'\u304C\u3042\u308BTableEditorColumn\u306ETableColumn\u306F\u3001\u6B63\u3057\u3044\u89AATable\u3092\u6301\u3063\u3066\u3044\u307E\u305B\u3093\u3002
|
||||
TreeToTablesLinker.Type.Unsupported=\u3053\u306E\u30BF\u30A4\u30D7\u306EcurrentControl\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
|
||||
exception.errorOccured=\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\uFF08{0}\uFF09\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
ModelSelectionDialog.Message=\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\uFF11\u3064\u9078\u629E\u3059\u308B\u304B\u3001\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3
|
||||
ModelSelectionDialog.BuiltIn=\u7D44\u307F\u8FBC\u307F\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u5909\u66F4
|
||||
ModelSelectionDialog.BuiltIn=\u7D44\u8FBC\u307F\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u5909\u66F4
|
||||
ModelSelectionDialog.ViewSchema=\u30B9\u30AD\u30FC\u30DE\u306E\u8868\u793A\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09\u3002
|
||||
ModelSelectionDialog.ViewQuery=\u30AF\u30A8\u30EA\u306E\u8868\u793A\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09\u3002
|
||||
ModelSelectionDialog.Update=\u30EA\u30DD\u30B8\u30C8\u30EA\u63A5\u7D9A\u306E\u66F4\u65B0\u3002
|
||||
|
||||
@@ -1 +1,9 @@
|
||||
AddPushButton.AddButton.Tip=Toevoegen
|
||||
DateDialog.textContent=Selecteer datum & tijd
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=Fout
|
||||
EventUtil.modify=Wijzigen
|
||||
EventUtil.move=Verplaatsen
|
||||
EventUtil.show=Toon
|
||||
LabelledFileField.BrowseButton.Text=Blader...
|
||||
commons.error=Fout
|
||||
ExceptionMessageDialog.Yes=Ja
|
||||
|
||||
@@ -25,6 +25,7 @@ DefaultCellModifier.tableItemDispose=TableItem disposed
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=Error
|
||||
ErrorDialogWidthDetailArea.ErrorMessage.Text=Error Message
|
||||
ErrorDialogWidthDetailArea.ErrorMessage.ColumnText=Column can not be empty
|
||||
ErrorDialogWidthDetailArea.ErrorMessage.ColumnText.NotValid=The input '{0}' is not valid, will use the original value '{1}' instead of it.
|
||||
ErrorDialogWithContinue.setParameter=Set parameters and continue
|
||||
EventUtil.activate=activate
|
||||
EventUtil.arm=arm
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ImageUtils {
|
||||
* RAP.
|
||||
*/
|
||||
public static Image scale(Image image, int percent) {
|
||||
float scale = (float) percent / 100f;
|
||||
float scale = percent / 100f;
|
||||
int newWidth = (int) (scale * image.getImageData().width);
|
||||
int newHeight = (int) (scale * image.getImageData().height);
|
||||
ImageData imageData = image.getImageData().scaledTo(newWidth, newHeight);
|
||||
@@ -118,7 +118,7 @@ public class ImageUtils {
|
||||
return image;
|
||||
}
|
||||
|
||||
private static Map<String, Image> propertyImgCachedImages = new HashMap<String, Image>();
|
||||
public static Map<String, Image> propertyImgCachedImages = new HashMap<String, Image>();
|
||||
|
||||
public static Image propertyLabelScale(String id, Image image, ICON_SIZE size) {
|
||||
if (image != null && size != null) {
|
||||
@@ -201,8 +201,9 @@ public class ImageUtils {
|
||||
if (baos != null) {
|
||||
try {
|
||||
baos.close();
|
||||
if (img != null && !img.isDisposed())
|
||||
if (img != null && !img.isDisposed()) {
|
||||
img.dispose();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -283,11 +284,11 @@ public class ImageUtils {
|
||||
// if width is mort than height.
|
||||
if (w > h) {
|
||||
newSize.x = requiredSize.x;
|
||||
newSize.y = (int) (w >= 1 ? Math.round(originalSize.y / w) : Math.round(originalSize.y * w));
|
||||
newSize.y = (w >= 1 ? Math.round(originalSize.y / w) : Math.round(originalSize.y * w));
|
||||
}
|
||||
// if width is less than height.
|
||||
else if (w < h) {
|
||||
newSize.x = (int) (h >= 1 ? Math.round(originalSize.x / h) : Math.round(originalSize.x * h));
|
||||
newSize.x = (h >= 1 ? Math.round(originalSize.x / h) : Math.round(originalSize.x * h));
|
||||
newSize.y = requiredSize.y;
|
||||
}
|
||||
// if equal
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.eclipse.jface.viewers.ColumnWeightData;
|
||||
import org.eclipse.jface.viewers.IBaseLabelProvider;
|
||||
import org.eclipse.jface.viewers.ICellModifier;
|
||||
import org.eclipse.jface.viewers.IContentProvider;
|
||||
import org.eclipse.jface.viewers.ILazyContentProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.ITableLabelProvider;
|
||||
import org.eclipse.jface.viewers.TableLayout;
|
||||
@@ -61,7 +60,6 @@ import org.talend.commons.ui.runtime.ws.WindowSystem;
|
||||
import org.talend.commons.ui.swt.tableviewer.behavior.DefaultHeaderColumnSelectionListener;
|
||||
import org.talend.commons.ui.swt.tableviewer.behavior.DefaultStructuredContentProvider;
|
||||
import org.talend.commons.ui.swt.tableviewer.behavior.DefaultTableLabelProvider;
|
||||
import org.talend.commons.ui.swt.tableviewer.behavior.LazyContentProvider;
|
||||
import org.talend.commons.ui.swt.tableviewer.behavior.TableViewerCreatorLayout;
|
||||
import org.talend.commons.ui.swt.tableviewer.data.AccessorUtils;
|
||||
import org.talend.commons.ui.swt.tableviewer.data.ModifiedObjectInfo;
|
||||
@@ -215,15 +213,11 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
|
||||
private boolean columnsSortableByDefault;
|
||||
|
||||
private boolean lazyLoad;
|
||||
|
||||
private ICellModifier cellModifier;
|
||||
|
||||
private ITableLabelProvider labelProvider;
|
||||
|
||||
private IStructuredContentProvider contentProviderold;
|
||||
|
||||
private IContentProvider contentProvider;
|
||||
private IStructuredContentProvider contentProvider;
|
||||
|
||||
private ControlListener tableParentResizedListener;
|
||||
|
||||
@@ -283,6 +277,8 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
|
||||
private ListenableList<B> listenableList;
|
||||
|
||||
private boolean lazyLoad;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@@ -361,7 +357,7 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
tableEditorManager.init(this.listenableList);
|
||||
}
|
||||
|
||||
if (hasChanged && !(contentProvider instanceof ILazyContentProvider)) {
|
||||
if (hasChanged && !isLazyLoad()) {
|
||||
refreshTableEditorControls();
|
||||
}
|
||||
|
||||
@@ -431,7 +427,7 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
@Override
|
||||
public void insert(Object element, int position) {
|
||||
super.insert(element, position);
|
||||
refreshTableEditorControls();
|
||||
// tableEditorManager.redrawControls();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -455,10 +451,7 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
@Override
|
||||
public void replace(Object element, int index) {
|
||||
super.replace(element, index);
|
||||
refreshTableEditorColumn(index);
|
||||
if (!(contentProvider instanceof ILazyContentProvider)) {
|
||||
refreshTableEditorControls();
|
||||
}
|
||||
refreshTableEditorControls();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -546,25 +539,38 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.AbstractTableViewer#inputChanged(java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
// @Override
|
||||
// protected void internalRefresh(Object element, boolean updateLabels) {
|
||||
// int oldCount = tableViewer.getTable().getItemCount();
|
||||
// if (getInputList() != null && oldCount != getInputList().size()) {
|
||||
// setItemCount(getInputList().size());
|
||||
// }
|
||||
// super.internalRefresh(element, updateLabels);
|
||||
// };
|
||||
|
||||
@Override
|
||||
protected void inputChanged(Object input, Object oldInput) {
|
||||
if (input instanceof List && contentProvider instanceof ILazyContentProvider) {
|
||||
int newSize = ((List) input).size();
|
||||
int oldSize = 0;
|
||||
if (oldInput instanceof List) {
|
||||
oldSize = ((List) oldInput).size();
|
||||
protected void hookControl(Control control) {
|
||||
super.hookControl(control);
|
||||
table.addListener(SWT.SetData, new Listener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
TableItem item = (TableItem) event.item;
|
||||
int index = table.indexOf(item);
|
||||
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
B element = getInputList().get(index);
|
||||
// if (element != item.getData()) {
|
||||
associate(element, item);
|
||||
updateItem(item, element);
|
||||
refreshTableEditorColumn(index);
|
||||
// }
|
||||
}
|
||||
if (newSize != oldSize) {
|
||||
tableViewer.setItemCount(newSize);
|
||||
}
|
||||
}
|
||||
super.inputChanged(input, oldInput);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
setTablePreferences();
|
||||
@@ -666,7 +672,7 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
if (verticalScroll) {
|
||||
style |= SWT.V_SCROLL;
|
||||
}
|
||||
if (lazyLoad) {
|
||||
if (isLazyLoad()) {
|
||||
style |= SWT.VIRTUAL;
|
||||
}
|
||||
return style;
|
||||
@@ -731,7 +737,9 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
getTable().forceFocus();
|
||||
if (!getTable().isDisposed()) {
|
||||
getTable().forceFocus();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
@@ -1141,7 +1149,6 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
if (this.contentProvider == null) {
|
||||
this.contentProvider = new DefaultStructuredContentProvider(this);
|
||||
}
|
||||
|
||||
tableViewer.setContentProvider(this.contentProvider);
|
||||
}
|
||||
|
||||
@@ -1618,7 +1625,7 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
return contentProvider;
|
||||
}
|
||||
|
||||
public void setContentProvider(IContentProvider contentProvider) {
|
||||
public void setContentProvider(IStructuredContentProvider contentProvider) {
|
||||
if (tableViewer != null && tableViewer.getContentProvider() != contentProvider) {
|
||||
tableViewer.setContentProvider(contentProvider);
|
||||
}
|
||||
@@ -1791,9 +1798,8 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
}
|
||||
|
||||
public void refreshTableEditorColumn(int index) {
|
||||
if (tableEditorManager != null && contentProvider instanceof ILazyContentProvider) {
|
||||
if (tableEditorManager != null && isLazyLoad()) {
|
||||
tableEditorManager.refreshColumn(index);
|
||||
// tableEditorManager.redrawControls();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2159,7 +2165,6 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
|
||||
public void setLazyLoad(boolean lazyLoad) {
|
||||
this.lazyLoad = lazyLoad;
|
||||
setContentProvider(new LazyContentProvider(this));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.set.MapBackedSet;
|
||||
import org.eclipse.jface.viewers.ILazyContentProvider;
|
||||
import org.eclipse.swt.custom.TableEditor;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
@@ -223,44 +222,40 @@ public class TableEditorManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(tableViewerCreator.getContentProvider() instanceof ILazyContentProvider)) {
|
||||
TableItem[] items = tableViewerCreator.getTable().getItems();
|
||||
TableItem[] items = tableViewerCreator.getTable().getItems();
|
||||
|
||||
List<TableEditor> addedTableEditor = new ArrayList<TableEditor>();
|
||||
List<TableEditor> addedTableEditor = new ArrayList<TableEditor>();
|
||||
|
||||
for (TableItem item : items) {
|
||||
TableItem tableItem = item;
|
||||
if (previousItemsHash == null || !previousItemsHash.contains(tableItem)) {
|
||||
for (TableItem item : items) {
|
||||
TableItem tableItem = item;
|
||||
if (previousItemsHash == null || !previousItemsHash.contains(tableItem)) {
|
||||
|
||||
for (int iEditorCol = 0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
|
||||
TableViewerCreatorColumnNotModifiable column = columnsWithEditorContent.get(iEditorCol);
|
||||
for (int iEditorCol = 0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
|
||||
TableViewerCreatorColumnNotModifiable column = columnsWithEditorContent.get(iEditorCol);
|
||||
|
||||
TableEditorContentNotModifiable tableEditorContent = column.getTableEditorContent();
|
||||
TableEditorContentNotModifiable tableEditorContent = column.getTableEditorContent();
|
||||
|
||||
String idProperty = column.getId();
|
||||
|
||||
TableEditor tableEditor = addTableEditor(column, tableEditorContent, idProperty, tableItem);
|
||||
if (tableEditor != null) {
|
||||
addedTableEditor.add(tableEditor);
|
||||
}
|
||||
String idProperty = column.getId();
|
||||
|
||||
TableEditor tableEditor = addTableEditor(column, tableEditorContent, idProperty, tableItem);
|
||||
if (tableEditor != null) {
|
||||
addedTableEditor.add(tableEditor);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = indexStart; i < items.length; i++) {
|
||||
TableItem tableItem = items[i];
|
||||
Object data = tableItem.getData();
|
||||
Collection<TableEditor> tableEditorCollection = dataToMultipleDataEditor.getCollection(data);
|
||||
for (TableEditor tableEditor : tableEditorCollection) {
|
||||
tableEditor.setItem(tableItem);
|
||||
}
|
||||
}
|
||||
|
||||
previousItemsHash = new HashSet<TableItem>(Arrays.asList(items));
|
||||
} else {
|
||||
refreshColumn(indexStart);
|
||||
}
|
||||
|
||||
for (int i = indexStart; i < items.length; i++) {
|
||||
TableItem tableItem = items[i];
|
||||
Object data = tableItem.getData();
|
||||
Collection<TableEditor> tableEditorCollection = dataToMultipleDataEditor.getCollection(data);
|
||||
for (TableEditor tableEditor : tableEditorCollection) {
|
||||
tableEditor.setItem(tableItem);
|
||||
}
|
||||
}
|
||||
|
||||
previousItemsHash = new HashSet<TableItem>(Arrays.asList(items));
|
||||
}
|
||||
|
||||
private void handleRemovedEvent(final ListenableListEvent event) {
|
||||
@@ -358,7 +353,7 @@ public class TableEditorManager {
|
||||
|
||||
public void refreshColumn(int index) {
|
||||
Table table = tableViewerCreator.getTable();
|
||||
if (table.isDisposed()) {
|
||||
if (table.isDisposed() || index >= table.getItems().length) {
|
||||
return;
|
||||
}
|
||||
for (int iEditorCol = 0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
|
||||
@@ -405,8 +400,12 @@ public class TableEditorManager {
|
||||
dataToMultipleDataEditor.put(tableItem.getData(), tableEditor);
|
||||
|
||||
Object currentRowObject = tableItem.getData();
|
||||
// Object value = tableViewerCreator.getCellModifier().getValue(currentRowObject, idProperty);
|
||||
Object value = column.getBeanPropertyAccessors().get(tableItem.getData());
|
||||
Object value = null;
|
||||
if (column.getBeanPropertyAccessors() != null) {
|
||||
value = column.getBeanPropertyAccessors().get(tableItem.getData());
|
||||
} else {
|
||||
value = tableViewerCreator.getCellModifier().getValue(currentRowObject, idProperty);
|
||||
}
|
||||
Control control = tableEditorContent.initialize(tableItem.getParent(), tableEditor, column, currentRowObject, value);
|
||||
|
||||
// control.addDisposeListener(new DisposeListener() {
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
ReusableMultiKey.Keys.BeNull=\u4E3B\u952E\u6570\u7EC4\u4E0D\u80FD\u4E3A\u7A7A
|
||||
utils.workbench.extensions.noExtension=\u6269\u5C55\u70B9ID\u4E3A"{0}"\u7684Plug-in\u4E0D\u5B58\u5728
|
||||
resources.file.notGet=\u8981\u6C42\u7684\u6587\u4EF6"{0}"\u6CA1\u6709\u5728\u6587\u4EF6\u5939"{1}"\u4E2D
|
||||
ListenableList.IndexSameLength.Error=\u539F\u59CB\u7D22\u5F15\u548C\u76EE\u6807\u7D22\u5F15\u5FC5\u987B\u4E3A\u76F8\u540C\u7684\u957F\u5EA6
|
||||
resources.folder.notGet=\u8981\u6C42\u7684\u6587\u4EF6\u5939"{0}"\u6CA1\u6709\u5728\u5DE5\u7A0B"{1}"\u4E2D
|
||||
resources.resource.notMoved=\u8D44\u6E90"{0}"\u4E0D\u80FD\u79FB\u52A8\u5230"{1}"
|
||||
resources.file.notDeleted=\u6587\u4EF6"{0}"\u4E0D\u80FD\u88AB\u5220\u9664
|
||||
resources.folder.notDeleted=\u6587\u4EF6\u5939"{0}"\u4E0D\u80FD\u88AB\u5220\u9664
|
||||
resources.folder.notEmptied=\u6587\u4EF6\u5939"{0}"\u4E0D\u80FD\u4E3A\u7A7A
|
||||
utils.workbench.extensions.badNumberOfExtension=\u65E0\u6548\u7684\u6269\u5C55\u6570\u5B57\u88AB\u53D1\u73B0\u5728{0}\u4E2D\uFF0C\u5F53\u67E5\u627E{3}\u51FA\u73B0\u5728{1}\u548C{2}\u4E4B\u95F4
|
||||
ExtensionImplementationProviders.ExtensionPointError=\u6269\u5C55\u70B9\u5FC5\u987B\u4F7F\u7528\u5355\u5B9E\u4F8B\u6A21\u5F0F
|
||||
ExceptionHandler.Parameter.BeNull=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u5F02\u5E38
|
||||
resources.file.notCreated=\u6587\u4EF6"{0}"\u4E0D\u80FD\u88AB\u521B\u5EFA({1})
|
||||
resources.project.notGet=\u8981\u6C42\u7684\u5DE5\u7A0B"{0}"\u4E0D\u5B58\u5728
|
||||
resources.fileContent.notGet=\u6587\u4EF6"{0}"\u7684\u5185\u5BB9\u65E0\u6CD5\u8BFB\u53D6\u3002
|
||||
VersionUtils.Version.Error2=\u7578\u5F62\u5B57\u7B26\u4E32{0}(\u51FA\u73B0M{1}m)
|
||||
resources.members.notGet=\u5BB9\u5668\u7684\u6210\u5458\u4E0D\u80FD\u88AB\u8BFB\u53D6\u3002
|
||||
ReflectionPropertyException.Access.ErrorMsg3=\u5F53\u5F15\u7528\u7C7B{2}\u7684\u5C5E\u6027{1}\u503C{0}\u662F\u51FA\u9519
|
||||
resources.folder.notCreated=\u6587\u4EF6\u5939"{0}"\u4E0D\u80FD\u88AB\u521B\u5EFA
|
||||
utils.data.container=Id{0}\u5DF2\u7ECF\u88AB\u4F7F\u7528\u5728\u5BB9\u5668\u4E2D
|
||||
DB2ForZosResultSet.outofRange=\u8D8A\u754C
|
||||
DB2ForZosResultSet.parameterIndex=\u65E0\u6548\u7684\u53C2\u6570\uFF1A\u53C2\u6570\u6307\u6807
|
||||
DB2ForZosResultSet.unknowCloumn=\u65E0\u6548\u7684\u53C2\u6570\uFF1A\u672A\u77E5\u7684\u5217\u540D
|
||||
Locker.beanNull=Bean\u4E0D\u80FD\u4E3A\u7A7A
|
||||
Locker.keyContext=\u952E
|
||||
Locker.keyNull=\u952E\u503C\u4E0D\u80FD\u4E3A\u7A7A
|
||||
ResourceUtils.canMove1=\u53EF\u79FB\u52A8
|
||||
ResourceUtils.streamNull=\u6D41\u4E3A\u7A7A
|
||||
FilesUtils.operationCanceled=\u590D\u5236\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u65F6\u64CD\u4F5C\u5DF2\u53D6\u6D88\u3002
|
||||
XmlNodeRetriever.countResult=\u8BA1\u6570\u7ED3\u679C\uFF1A
|
||||
XmlNodeRetriever.field2Node=field2\u8282\u70B9
|
||||
XmlNodeRetriever.filed1Node=field1\u8282\u70B9
|
||||
XmlNodeRetriever.mainExpression=\u4E3B\u8868\u8FBE\u5F0F
|
||||
XmlNodeRetriever.mainNode=\u4E3B\u8282\u70B9
|
||||
XmlNodeRetriever.singleQuotes=.
|
||||
XmlNodeRetriever.xPathExpression=xPath\u8868\u8FBE\u5F0F
|
||||
@@ -15,6 +15,7 @@ Export-Package: org.talend.commons,
|
||||
org.talend.commons.utils,
|
||||
org.talend.commons.utils.data.bean,
|
||||
org.talend.commons.utils.data.container,
|
||||
org.talend.commons.utils.data.extractor,
|
||||
org.talend.commons.utils.data.list,
|
||||
org.talend.commons.utils.data.map,
|
||||
org.talend.commons.utils.data.reflection,
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
DB2ForZosResultSet.outofRange=\ is out of range.
|
||||
DB2ForZosResultSet.parameterIndex=Invalid argument: parameter index
|
||||
DB2ForZosResultSet.unknowCloumn=Invalid argument: unknown column name
|
||||
SybaseResultSet.outofRange=\ is out of range.
|
||||
SybaseResultSet.parameterIndex=Invalid argument\: parameter index
|
||||
SybaseResultSet.unknowCloumn=Invalid argument\: unknown column name
|
||||
EntryLocation.returnTableName={tableName={0}, columnName={1}}
|
||||
ExceptionHandler.Parameter.BeNull=ex param cannot be null
|
||||
ExtensionImplementationProviders.ExtensionPointError=Extension point must authoriez a single instance
|
||||
|
||||
@@ -63,8 +63,8 @@ public class EmfHelper {
|
||||
}
|
||||
visitedObjects.add(object.eClass().getName() + ";" + object.getClass().getPackage().getName());
|
||||
List<EObject> toVisit = new ArrayList<EObject>();
|
||||
for (Iterator iterator = object.eClass().getEAllReferences().iterator(); iterator.hasNext();) {
|
||||
EReference reference = (EReference) iterator.next();
|
||||
for (Object element : object.eClass().getEAllReferences()) {
|
||||
EReference reference = (EReference) element;
|
||||
if (reference.isMany()) {
|
||||
List list = (List) object.eGet(reference);
|
||||
for (Iterator iterator2 = list.iterator(); iterator2.hasNext();) {
|
||||
|
||||
@@ -54,6 +54,10 @@ public final class CommonExceptionHandler {
|
||||
log.log(Level.INFO, message);
|
||||
}
|
||||
|
||||
public static void warn(String message) {
|
||||
log.log(Level.WARN, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return priority corresponding to the exception implementation.
|
||||
*
|
||||
|
||||
@@ -107,6 +107,8 @@ public class StringUtils {
|
||||
input = input.replaceAll(">", "gt"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("'", "apos"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("\"", "quot"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("\\(", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
input = input.replaceAll("\\)", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return input;
|
||||
}
|
||||
|
||||
@@ -354,5 +356,4 @@ public class StringUtils {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.data.extractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* DOC marvin class global comment. Detailled comment <br/>
|
||||
*
|
||||
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
|
||||
*
|
||||
*/
|
||||
public class ModuleNameExtractor {
|
||||
|
||||
/**
|
||||
* Extracts all file names from the given collection. This method is suitable the case that collection includes not
|
||||
* only file names but also paths. And you just need a set only including file names. So this method cuts the
|
||||
* directory of a file only the file name remaining. Added by Marvin Wang on Nov 8, 2012.
|
||||
*
|
||||
* @param collection must not be <code>null<code>, otherwise, it will throw NPE.
|
||||
* @return a set that only includes file name.
|
||||
*/
|
||||
public static Set<String> extractFileName(Collection<String> collection) {
|
||||
Set<String> moduleNameSet = new HashSet<String>();
|
||||
if (!collection.isEmpty()) {
|
||||
for (String module : collection) {
|
||||
if (module != null) {
|
||||
File moduleFile = new File(module);
|
||||
moduleNameSet.add(moduleFile.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return moduleNameSet;
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#add(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean add(T o) {
|
||||
int index = this.list.size();
|
||||
fireAddedEvent(index, o, true);
|
||||
@@ -84,6 +85,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#add(int, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void add(int index, T element) {
|
||||
fireAddedEvent(index, element, true);
|
||||
this.list.add(index, element);
|
||||
@@ -95,11 +97,18 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#addAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean addAll(Collection<? extends T> c) {
|
||||
fireAddedEvent(this.list.size(), (Collection<T>) c, null, true);
|
||||
return addAll(c, true, true);
|
||||
}
|
||||
|
||||
public boolean addAll(Collection<? extends T> c, boolean fireBefore, boolean fireAfter) {
|
||||
if (fireBefore) {
|
||||
fireAddedEvent(this.list.size(), (Collection<T>) c, null, true);
|
||||
}
|
||||
boolean returnValue = this.list.addAll(c);
|
||||
if (returnValue) {
|
||||
if (returnValue && fireAfter) {
|
||||
fireAddedEvent(this.list.size() - c.size(), (Collection<T>) c, null, false);
|
||||
}
|
||||
return returnValue;
|
||||
@@ -110,11 +119,18 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#addAll(int, java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean addAll(int index, Collection<? extends T> c) {
|
||||
fireAddedEvent(index, (Collection<T>) c, null, true);
|
||||
return addAll(index, c, true, true);
|
||||
}
|
||||
|
||||
public boolean addAll(int index, Collection<? extends T> c, boolean fireBefore, boolean fireAfter) {
|
||||
if (fireBefore) {
|
||||
fireAddedEvent(index, (Collection<T>) c, null, true);
|
||||
}
|
||||
boolean returnValue = this.list.addAll(index, c);
|
||||
if (returnValue) {
|
||||
if (returnValue && fireAfter) {
|
||||
fireAddedEvent(index, (Collection<T>) c, null, false);
|
||||
}
|
||||
return returnValue;
|
||||
@@ -124,6 +140,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addAll(List<Integer> indices, Collection<? extends T> c) {
|
||||
|
||||
@@ -149,6 +166,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#clear()
|
||||
*/
|
||||
@Override
|
||||
public void clear() {
|
||||
fireClearedEvent(true);
|
||||
this.list.clear();
|
||||
@@ -172,6 +190,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
* @return whether the list contains the object.
|
||||
* @see #useEquals
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(Object object) {
|
||||
|
||||
int size = list.size();
|
||||
@@ -205,6 +224,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
* @param object the object in question.
|
||||
* @return the position of the first occurrence of the object in the list.
|
||||
*/
|
||||
@Override
|
||||
public int indexOf(Object object) {
|
||||
int size = list.size();
|
||||
if (useEquals && object != null) {
|
||||
@@ -228,6 +248,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#containsAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return this.list.containsAll(c);
|
||||
}
|
||||
@@ -237,6 +258,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#get(int)
|
||||
*/
|
||||
@Override
|
||||
public T get(int index) {
|
||||
return this.list.get(index);
|
||||
}
|
||||
@@ -246,6 +268,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#isEmpty()
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return this.list.isEmpty();
|
||||
}
|
||||
@@ -255,6 +278,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
return new Iterator<T>() {
|
||||
|
||||
@@ -262,15 +286,18 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
|
||||
private T current = null;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return internalIterator.hasNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T next() {
|
||||
current = internalIterator.next();
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
Integer indexBeforeRemove = indexOf(current);
|
||||
fireBeforeRemovedEvent(indexBeforeRemove);
|
||||
@@ -286,6 +313,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#lastIndexOf(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int lastIndexOf(Object o) {
|
||||
return this.list.lastIndexOf(o);
|
||||
}
|
||||
@@ -295,6 +323,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#listIterator()
|
||||
*/
|
||||
@Override
|
||||
public ListIterator<T> listIterator() {
|
||||
return new ListIterator<T>() {
|
||||
|
||||
@@ -302,43 +331,52 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
|
||||
private T current = null;
|
||||
|
||||
@Override
|
||||
public void add(T o) {
|
||||
internalListIterator.add(o);
|
||||
fireAddedEvent(internalListIterator.previousIndex(), o, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPrevious() {
|
||||
return internalListIterator.hasPrevious();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int nextIndex() {
|
||||
return internalListIterator.nextIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T previous() {
|
||||
current = internalListIterator.previous();
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int previousIndex() {
|
||||
return internalListIterator.previousIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(T o) {
|
||||
fireReplacedEvent(internalListIterator.previousIndex() + 1, current, o, true);
|
||||
internalListIterator.set(o);
|
||||
fireReplacedEvent(internalListIterator.previousIndex() + 1, current, o, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return internalListIterator.hasNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T next() {
|
||||
current = internalListIterator.next();
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
Integer indexBeforeRemove = internalListIterator.previousIndex() + 1;
|
||||
fireBeforeRemovedEvent(indexBeforeRemove);
|
||||
@@ -354,6 +392,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#listIterator(int)
|
||||
*/
|
||||
@Override
|
||||
public ListIterator<T> listIterator(int index) {
|
||||
return this.list.listIterator(index);
|
||||
}
|
||||
@@ -363,6 +402,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#remove(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean remove(Object o) {
|
||||
int index = indexOf(o);
|
||||
@@ -378,6 +418,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#remove(int)
|
||||
*/
|
||||
@Override
|
||||
public T remove(int index) {
|
||||
fireBeforeRemovedEvent(index);
|
||||
T removedObject = this.list.remove(index);
|
||||
@@ -394,7 +435,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
private void fireRemovedEvent(int index, T removedObject) {
|
||||
if (afterListeners.size() != 0) {
|
||||
List<T> currentList = new ArrayList<T>(1);
|
||||
currentList.add((T) removedObject);
|
||||
currentList.add(removedObject);
|
||||
fireRemovedEvent(index, currentList, null, false);
|
||||
}
|
||||
}
|
||||
@@ -403,7 +444,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
if (beforeListeners.size() != 0) {
|
||||
T removingObject = this.list.get(index);
|
||||
List<T> currentList = new ArrayList<T>(1);
|
||||
currentList.add((T) removingObject);
|
||||
currentList.add(removingObject);
|
||||
fireRemovedEvent(index, currentList, null, true);
|
||||
}
|
||||
}
|
||||
@@ -415,12 +456,19 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
* @param collection the collection of objects to be removed.
|
||||
* @return whether any object was actually contained by the list.
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean removeAll(Collection<?> collection) {
|
||||
return removeAll(collection, true, true);
|
||||
}
|
||||
|
||||
public boolean removeAll(Collection<?> collection, boolean fireBefore, boolean fireAfter) {
|
||||
|
||||
List<Integer> indices = getIndices(collection);
|
||||
|
||||
fireRemovedEvent(null, new ArrayList(collection), indices, true);
|
||||
if (fireBefore) {
|
||||
fireRemovedEvent(null, new ArrayList(collection), indices, true);
|
||||
}
|
||||
if (this.list == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -429,7 +477,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
this.list.remove((int) indices.get(i));
|
||||
modified = true;
|
||||
}
|
||||
if (modified) {
|
||||
if (modified && fireAfter) {
|
||||
fireRemovedEvent(null, new ArrayList(collection), indices, false);
|
||||
}
|
||||
return modified;
|
||||
@@ -458,6 +506,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#retainAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> c) {
|
||||
List<T> all = new ArrayList<T>();
|
||||
all.addAll(this.list);
|
||||
@@ -481,6 +530,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#set(int, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public T set(int index, T element) {
|
||||
fireReplacedEvent(index, null, element, true);
|
||||
T replacedObject = this.list.set(index, element);
|
||||
@@ -493,6 +543,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#size()
|
||||
*/
|
||||
@Override
|
||||
public int size() {
|
||||
if (this.list != null) {
|
||||
return this.list.size();
|
||||
@@ -507,6 +558,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#subList(int, int)
|
||||
*/
|
||||
@Override
|
||||
public List<T> subList(int fromIndex, int toIndex) {
|
||||
if (this.list != null) {
|
||||
return this.list.subList(fromIndex, toIndex);
|
||||
@@ -520,6 +572,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#toArray()
|
||||
*/
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
if (this.list != null) {
|
||||
return this.list.toArray();
|
||||
@@ -533,6 +586,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @see java.util.List#toArray(T[])
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("hiding")
|
||||
public <T> T[] toArray(T[] a) {
|
||||
if (this.list != null) {
|
||||
@@ -542,6 +596,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swap(int index1, int index2) {
|
||||
|
||||
ArrayList<Integer> indexList1 = new ArrayList<Integer>(1);
|
||||
@@ -579,6 +634,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swapElements(List<Integer> indicesOrigin, List<Integer> indicesTarget) {
|
||||
if (indicesOrigin.size() != indicesTarget.size()) {
|
||||
throw new IllegalArgumentException(Messages.getString("ListenableList.IndexSameLength.Error")); //$NON-NLS-1$
|
||||
@@ -596,6 +652,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
fireSwapedEvent(indicesOrigin, indicesTarget, swapedObjects.toArray(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swapElement(T object1, T object2) {
|
||||
swap(indexOf(object1), indexOf(object2));
|
||||
}
|
||||
@@ -825,6 +882,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @return the useEquals
|
||||
*/
|
||||
@Override
|
||||
public boolean isUseEquals() {
|
||||
return this.useEquals;
|
||||
}
|
||||
@@ -834,6 +892,7 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
*
|
||||
* @param useEquals the useEquals to set
|
||||
*/
|
||||
@Override
|
||||
public void setUseEquals(boolean useEquals) {
|
||||
this.useEquals = useEquals;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,141 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.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;
|
||||
|
||||
/**
|
||||
* created by xqliu on Oct 26, 2012 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class SybaseResultSet 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("SybaseResultSet.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 {
|
||||
int value = 0;
|
||||
String str = getString(columnLabel);
|
||||
if (columnLabel.equals("TYPE_NAME")) { //$NON-NLS-1$
|
||||
value = TalendDBUtils.convertToJDBCType(str);
|
||||
} else if (columnLabel.equals("IS_NULLABLE")) { //$NON-NLS-1$
|
||||
if (str.equals("N")) { //$NON-NLS-1$
|
||||
value = 1;
|
||||
} else {
|
||||
value = 0;
|
||||
}
|
||||
} else {
|
||||
value = Integer.parseInt(str);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (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("SybaseResultSet.parameterIndex") + columnIndex + Messages.getString("SybaseResultSet.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;
|
||||
}
|
||||
}
|
||||
@@ -54,8 +54,8 @@ public class CharsetToolkit {
|
||||
/**
|
||||
* Defines the default <code>Charset</code> used in case the buffer represents an 8-bit <code>Charset</code>.
|
||||
*
|
||||
* @param defaultCharset the default <code>Charset</code> to be returned by <code>guessEncoding()</code> if an
|
||||
* 8-bit <code>Charset</code> is encountered.
|
||||
* @param defaultCharset the default <code>Charset</code> to be returned by <code>guessEncoding()</code> if an 8-bit
|
||||
* <code>Charset</code> is encountered.
|
||||
*/
|
||||
public void setDefaultCharset(Charset defaultCharset) {
|
||||
if (defaultCharset != null) {
|
||||
@@ -299,6 +299,17 @@ public class CharsetToolkit {
|
||||
return Charset.forName(System.getProperty("file.encoding")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC ycbai Comment method "getInternalSystemCharset".
|
||||
*
|
||||
* Retrieve the system charset from "sun.jnu.encoding" property.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Charset getInternalSystemCharset() {
|
||||
return Charset.forName(System.getProperty("sun.jnu.encoding")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* Has a Byte Order Marker for UTF-8 (Used by Microsoft's Notepad and other editors).
|
||||
*
|
||||
|
||||
@@ -73,5 +73,4 @@ public final class PluginChecker {
|
||||
public static boolean isOnlyTopLoaded() {
|
||||
return isPluginLoaded(TOP_BRANDING) && !isTDCPLoaded() && !isTDQLoaded();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ ImportPushButton.ImportButton.Tip=\u3059\u3079\u3066\u306e\u884c\u3092xml\u30d5\
|
||||
LabelledFileField.FileDialog.Text=\u9078\u629E
|
||||
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3
|
||||
ModelSelectionDialog.Update=\u30EA\u30DD\u30B8\u30C8\u30EA\u63A5\u7D9A\u306E\u66F4\u65B0\u3002
|
||||
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u5024\u3067\u3059
|
||||
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304Cnull\u3067\u3059
|
||||
ModelSelectionDialog.Title=\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u3066\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u7DE8\u96C6
|
||||
AddAllPushButton.AddAllButton.Tip=\u3059\u3079\u3066\u8ffd\u52a0
|
||||
ExtendedTableRemoveCommand.Romve.Label=\u30C6\u30FC\u30D6\u30EB\u30A8\u30F3\u30C8\u30EA\u306E\u524A\u9664
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
commons.error=Fout
|
||||
AddPushButton.AddButton.Tip=Toevoegen
|
||||
LabelledFileField.BrowseButton.Text=Blader...
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=Fout
|
||||
DateDialog.textContent=Selecteer datum & tijd
|
||||
EventUtil.modify=Wijzigen
|
||||
EventUtil.move=Verplaatsen
|
||||
EventUtil.show=Toon
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.eclipse.gef.commands.Command;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.commons.ui.utils.SimpleClipboard;
|
||||
import org.talend.commons.utils.data.list.UniqueStringGenerator;
|
||||
|
||||
/**
|
||||
* DOC amaumont class global comment. Detailled comment <br/>
|
||||
@@ -55,7 +56,7 @@ public abstract class ExtendedTablePasteCommand extends Command implements IExte
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
@@ -80,4 +81,17 @@ public abstract class ExtendedTablePasteCommand extends Command implements IExte
|
||||
return true;
|
||||
}
|
||||
|
||||
public String validateColumnName(final String columnName, List<String> labels) {
|
||||
String name = columnName;
|
||||
UniqueStringGenerator<String> uniqueStringGenerator = new UniqueStringGenerator<String>(name, labels) {
|
||||
|
||||
@Override
|
||||
protected String getBeanString(String bean) {
|
||||
return bean;
|
||||
}
|
||||
|
||||
};
|
||||
return uniqueStringGenerator.getUniqueString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,17 +47,20 @@ public class ErrorDialogWidthDetailArea {
|
||||
* @param detailMessage (\n an \t are interpreted ; \r are deleted)
|
||||
*/
|
||||
public ErrorDialogWidthDetailArea(Shell shell, String pid, String mainMessage, String detailMessage) {
|
||||
this(shell, pid, mainMessage, detailMessage, IStatus.INFO);
|
||||
}
|
||||
|
||||
public ErrorDialogWidthDetailArea(Shell shell, String pid, String mainMessage, String detailMessage, int status) {
|
||||
MultiStatus info = new MultiStatus(pid, 1, mainMessage, null);
|
||||
if (detailMessage != null) {
|
||||
String[] lines = detailMessage.split("\n"); //$NON-NLS-1$
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
info
|
||||
.add(new Status(IStatus.INFO, pid, 1, lines[i].replaceAll("\t", " ").replaceAll("\r", ""), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
null));
|
||||
for (String line : lines) {
|
||||
info.add(new Status(status, pid, 1, line.replaceAll("\t", " ").replaceAll("\r", ""), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
null));
|
||||
}
|
||||
}
|
||||
codeOfButton = ErrorDialog.openError(shell, Messages.getString("ErrorDialogWidthDetailArea.ErrorMessage.Text"), //$NON-NLS-1$
|
||||
null, info); //$NON-NLS-1$
|
||||
null, info);
|
||||
}
|
||||
|
||||
public int getCodeOfButton() {
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.eclipse.gef.commands.CommandStack;
|
||||
import org.eclipse.jface.viewers.ILazyContentProvider;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
@@ -374,41 +373,36 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
|
||||
}).start();
|
||||
} else {
|
||||
|
||||
if (event.type == TYPE.ADDED) {
|
||||
if (tableViewer.getContentProvider() instanceof ILazyContentProvider) {
|
||||
tableViewer.setItemCount(event.source.size());
|
||||
}
|
||||
if (tableViewerCreator.isLazyLoad()) {
|
||||
tableViewer.refresh();
|
||||
|
||||
} else if (event.type == TYPE.SWAPED) {
|
||||
|
||||
// tableViewer.refresh();
|
||||
|
||||
Object[] swapedObjects = event.swapedObjects;
|
||||
|
||||
for (Object data : swapedObjects) {
|
||||
tableViewer.refresh(data, true, true);
|
||||
}
|
||||
|
||||
} else if (event.type == TYPE.REMOVED) {
|
||||
|
||||
// if(event.index != null) {
|
||||
// tableViewerCreator.getSelectionHelper().select(event.index);
|
||||
// } else if(event.indicesOrigin != null) {
|
||||
// Integer startIndex = event.indicesOrigin.get(0);
|
||||
// tableViewerCreator.getSelectionHelper().select(startIndex);
|
||||
// }
|
||||
|
||||
// Collection<B> addedObjects = event.addedObjects;
|
||||
// for (B bean : addedObjects) {
|
||||
// tableViewer.refresh(bean);
|
||||
// }
|
||||
} else {
|
||||
if (tableViewer.getContentProvider() instanceof ILazyContentProvider) {
|
||||
tableViewer.setItemCount(event.source.size());
|
||||
if (event.type == TYPE.ADDED) {
|
||||
} else if (event.type == TYPE.SWAPED) {
|
||||
|
||||
// tableViewer.refresh();
|
||||
|
||||
Object[] swapedObjects = event.swapedObjects;
|
||||
|
||||
for (Object data : swapedObjects) {
|
||||
tableViewer.refresh(data, true, true);
|
||||
}
|
||||
|
||||
} else if (event.type == TYPE.REMOVED) {
|
||||
|
||||
// if(event.index != null) {
|
||||
// tableViewerCreator.getSelectionHelper().select(event.index);
|
||||
// } else if(event.indicesOrigin != null) {
|
||||
// Integer startIndex = event.indicesOrigin.get(0);
|
||||
// tableViewerCreator.getSelectionHelper().select(startIndex);
|
||||
// }
|
||||
|
||||
// Collection<B> addedObjects = event.addedObjects;
|
||||
// for (B bean : addedObjects) {
|
||||
// tableViewer.refresh(bean);
|
||||
// }
|
||||
} else {
|
||||
tableViewer.refresh();
|
||||
}
|
||||
tableViewer.refresh();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -115,11 +115,15 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
* @param index can be null
|
||||
*/
|
||||
public void addAll(final Integer index, List<B> beans) {
|
||||
addAll(index, beans, true, true);
|
||||
}
|
||||
|
||||
public void addAll(final Integer index, List<B> beans, boolean fireBefore, boolean fireAfter) {
|
||||
if (index == null || index < 0 || index > this.beansList.size() - 1) {
|
||||
if (tableViewer != null && !tableViewer.getTable().isDisposed()) {
|
||||
tableViewer.add(beans.toArray(new Object[beans.size()]));
|
||||
}
|
||||
this.beansList.addAll(beans);
|
||||
this.beansList.addAll(beans, fireBefore, fireAfter);
|
||||
} else {
|
||||
if (tableViewer != null && !tableViewer.getTable().isDisposed()) {
|
||||
int localIndex = index;
|
||||
@@ -128,7 +132,7 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
tableViewer.insert(beans.get(i), localIndex++);
|
||||
}
|
||||
}
|
||||
this.beansList.addAll(index, beans);
|
||||
this.beansList.addAll(index, beans, fireBefore, fireAfter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +156,10 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
addAll((Integer) null, beans);
|
||||
}
|
||||
|
||||
public void addAll(List<B> beans, boolean fireBefore, boolean fireAfter) {
|
||||
addAll((Integer) null, beans, fireBefore, fireAfter);
|
||||
}
|
||||
|
||||
public void registerDataList(List<B> list) {
|
||||
this.beansList.registerList(list);
|
||||
}
|
||||
@@ -162,8 +170,9 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
|
||||
public void addBeans(B b) {
|
||||
if (this.beansList.contains(b)) {
|
||||
} else
|
||||
} else {
|
||||
this.beansList.add(b);
|
||||
}
|
||||
}
|
||||
|
||||
public void setUseEquals(boolean useEquals) {
|
||||
@@ -200,10 +209,14 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
* @see org.talend.commons.utils.data.list.ListenableList#removeAll(java.util.Collection)
|
||||
*/
|
||||
public boolean removeAll(Collection<B> c) {
|
||||
return removeAll(c, true, true);
|
||||
}
|
||||
|
||||
public boolean removeAll(Collection<B> c, boolean fireBefor, boolean fireAfter) {
|
||||
if (tableViewer != null && !tableViewer.getTable().isDisposed()) {
|
||||
tableViewer.remove(c.toArray(new Object[c.size()]));
|
||||
}
|
||||
return this.beansList.removeAll(c);
|
||||
return this.beansList.removeAll(c, fireBefor, fireAfter);
|
||||
}
|
||||
|
||||
public void removeAll() {
|
||||
@@ -277,8 +290,8 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
*/
|
||||
public List<B> remove(int[] indexArray) {
|
||||
ArrayList<B> objectsToRemove = new ArrayList<B>(indexArray.length);
|
||||
for (int i = 0; i < indexArray.length; i++) {
|
||||
objectsToRemove.add(beansList.get(indexArray[i]));
|
||||
for (int element : indexArray) {
|
||||
objectsToRemove.add(beansList.get(element));
|
||||
}
|
||||
removeAll(objectsToRemove);
|
||||
return objectsToRemove;
|
||||
@@ -344,6 +357,7 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
this.modifiedBeanListenable = modifiedBeanListenable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDataRegistered() {
|
||||
return beansList.isListRegistered();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
@@ -99,7 +100,7 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
LinkableTree linkableTree = new LinkableTree(this, backgroundRefresher, targetTree, this, false);
|
||||
targetTree.removeSelectionListener(linkableTree.getSelectionListener());
|
||||
|
||||
new LinkableTable(this, backgroundRefresher, sourceTable, (BgDrawableComposite) this, true);
|
||||
new LinkableTable(this, backgroundRefresher, sourceTable, this, true);
|
||||
this.target = targetTree;
|
||||
this.source = sourceTable;
|
||||
|
||||
@@ -227,7 +228,7 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
IExtremityLink<Tree, D2> extremity2 = link.getExtremity2();
|
||||
// see bug 7360
|
||||
dataToTableItemCache.clear();
|
||||
TableItem tableItem = dataToTableItemCache.getTableItem((Object) extremity1.getDataItem());
|
||||
TableItem tableItem = dataToTableItemCache.getTableItem(extremity1.getDataItem());
|
||||
TableItem firstExpandedAscTableItem = tableItem;
|
||||
|
||||
Rectangle tableItemBounds = firstExpandedAscTableItem.getBounds();
|
||||
@@ -302,6 +303,12 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
pointEndCentralCurve.x += offset.x - 6;
|
||||
pointEndCentralCurve.y += offset.y;
|
||||
|
||||
// Added by Marvin Wang on Nov. 28, 2012 for bug TDI-23378. This is not the best way to fix this issue,
|
||||
// but till now I have not found the root cause.
|
||||
if (Platform.OS_LINUX.equals(Platform.getOS())) {
|
||||
pointEndCentralCurve.y = pointEndCentralCurve.y - tableItem.getBounds().height;
|
||||
}
|
||||
|
||||
drawableLink.setPoint1(pointEndStraight);
|
||||
drawableLink.setPoint2(pointEndCentralCurve);
|
||||
|
||||
@@ -326,8 +333,8 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
* @return
|
||||
*/
|
||||
private int findXRightStartBezierLink(TableItem[] items, int maxWidth) {
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
TableItem item = items[i];
|
||||
for (TableItem item2 : items) {
|
||||
TableItem item = item2;
|
||||
if (!item.isDisposed()) {
|
||||
Rectangle bounds = item.getBounds();
|
||||
maxWidth = Math.max(maxWidth, bounds.x + bounds.width);
|
||||
@@ -353,8 +360,7 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
getTarget().deselectAll();
|
||||
|
||||
TreeItem[] selection = getTarget().getSelection();
|
||||
for (int i = 0; i < selection.length; i++) {
|
||||
TreeItem tableItem = selection[i];
|
||||
for (TreeItem tableItem : selection) {
|
||||
selectedItems.add(tableItem.getData());
|
||||
}
|
||||
|
||||
@@ -362,8 +368,7 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
getSource().deselectAll();
|
||||
|
||||
TableItem[] selection = getSource().getSelection();
|
||||
for (int i = 0; i < selection.length; i++) {
|
||||
TableItem treeItem = selection[i];
|
||||
for (TableItem treeItem : selection) {
|
||||
selectedItems.add(treeItem.getData());
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public abstract class DialogErrorForCellEditorListener implements ICellEditorLis
|
||||
CELL_EDITOR_STATE state) {
|
||||
final Text text = (Text) cellEditor.getControl();
|
||||
final ModifiedObjectInfo modifiedObjectInfo = tableViewerCreator.getModifiedObjectInfo();
|
||||
Object originalValue = modifiedObjectInfo.getOriginalPropertyBeanValue();
|
||||
final Object originalValue = modifiedObjectInfo.getOriginalPropertyBeanValue();
|
||||
lastValidValue = lastValidValue != null && state == CELL_EDITOR_STATE.EDITING ? lastValidValue : originalValue;
|
||||
|
||||
int beanPosition = tableViewerCreator.getInputList().indexOf(currentModifiedBean);
|
||||
@@ -101,19 +101,22 @@ public abstract class DialogErrorForCellEditorListener implements ICellEditorLis
|
||||
|
||||
public void run() {
|
||||
if (errorMessage.equals("")) {
|
||||
MessageDialog.openError(
|
||||
text.getShell(),
|
||||
Messages.getString("DialogErrorForCellEditorListener.Error.MsgDialogTitle"), Messages.getString("ErrorDialogWidthDetailArea.ErrorMessage.ColumnText")); //$NON-NLS-1$
|
||||
MessageDialog.openError(text.getShell(),
|
||||
Messages.getString("DialogErrorForCellEditorListener.Error.MsgDialogTitle"), //$NON-NLS-1$
|
||||
Messages.getString("ErrorDialogWidthDetailArea.ErrorMessage.ColumnText.NotValid", //$NON-NLS-1$
|
||||
newValue, originalValue == null ? "" : originalValue.toString())); //$NON-NLS-1$
|
||||
final int columnPosition = tableViewerCreator.getColumns().indexOf(column);
|
||||
tableViewerCreator.getTableViewer().editElement(currentModifiedBean, columnPosition);
|
||||
text.setText(newValue);
|
||||
// Added by Marvin Wang on Dec. 12, 2012 for bug TDI-24174 and it also replaces the bug
|
||||
// TDI-23253.
|
||||
text.setText(originalValue == null ? "" : originalValue.toString()); //$NON-NLS-1$
|
||||
text.setSelection(selection.x, selection.y);
|
||||
} else {
|
||||
MessageDialog.openError(text.getShell(),
|
||||
Messages.getString("DialogErrorForCellEditorListener.Error.MsgDialogTitle"), errorMessage); //$NON-NLS-1$
|
||||
final int columnPosition = tableViewerCreator.getColumns().indexOf(column);
|
||||
tableViewerCreator.getTableViewer().editElement(currentModifiedBean, columnPosition);
|
||||
text.setText(newValue);
|
||||
text.setText("");
|
||||
text.setSelection(selection.x, selection.y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ public class FilesUtils {
|
||||
public static boolean isSVNFolder(String name) {
|
||||
if (name != null) {
|
||||
name = name.toLowerCase();
|
||||
for (int i = 0; i < SVN_FOLDER_NAMES.length; i++) {
|
||||
if (SVN_FOLDER_NAMES[i].equals(name) || name.endsWith(SVN_FOLDER_NAMES[i])) {
|
||||
for (String element : SVN_FOLDER_NAMES) {
|
||||
if (element.equals(name) || name.endsWith(element)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -377,8 +377,9 @@ public class FilesUtils {
|
||||
|| (excludedFile != null && excludedFile.equals(file.getName()))) {
|
||||
canAdd = false;
|
||||
}
|
||||
if (canAdd)
|
||||
if (canAdd) {
|
||||
results.add(file);
|
||||
}
|
||||
} else if (file.isDirectory() && nested) {
|
||||
if (excludedFolder != null && excludedFolder.equals(file.getName())) {
|
||||
return results;
|
||||
@@ -467,11 +468,15 @@ public class FilesUtils {
|
||||
return getFilesFromFolderByName(file, fileName, new String[] { ".jar", ".zip", ".bar" }, null, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
|
||||
public static List<File> getDllFilesFromFolder(File file, String fileName) throws MalformedURLException {
|
||||
return getFilesFromFolderByName(file, fileName, new String[] { ".dll" }, null, true); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static FileFilter getExcludeSystemFilesFilter() {
|
||||
FileFilter filter = new FileFilter() {
|
||||
|
||||
public boolean accept(File pathname) {
|
||||
return !isSVNFolder(pathname) && !pathname.toString().endsWith(".dummy"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return !isSVNFolder(pathname) && !pathname.toString().endsWith(".dummy"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
};
|
||||
@@ -794,7 +799,7 @@ public class FilesUtils {
|
||||
for (File sample : fileList) {
|
||||
boolean isDeleted = sample.delete();
|
||||
log.info(sample.getAbsolutePath() + (isDeleted ? " is deleted." : " failed to delete."));
|
||||
boolean isrenamed = new File(sample.getAbsolutePath() + MIGRATION_FILE_EXT).renameTo(sample); //$NON-NLS-1$
|
||||
boolean isrenamed = new File(sample.getAbsolutePath() + MIGRATION_FILE_EXT).renameTo(sample);
|
||||
log.info(sample.getAbsolutePath() + MIGRATION_FILE_EXT + (isrenamed ? " is renamed." : " failed to rename."));
|
||||
}
|
||||
}
|
||||
@@ -890,8 +895,38 @@ public class FilesUtils {
|
||||
if (source.isDirectory()) {
|
||||
tarpath.mkdir();
|
||||
File[] dir = source.listFiles();
|
||||
for (int i = 0; i < dir.length; i++) {
|
||||
copyDirectory(dir[i], tarpath);
|
||||
for (File element : dir) {
|
||||
copyDirectory(element, tarpath);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
InputStream is = new FileInputStream(source);
|
||||
OutputStream os = new FileOutputStream(tarpath);
|
||||
byte[] buf = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = is.read(buf)) != -1) {
|
||||
os.write(buf, 0, len);
|
||||
}
|
||||
is.close();
|
||||
os.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyDirectoryWithoutSvnFolder(File source, File target) {
|
||||
File tarpath = new File(target, source.getName());
|
||||
if (source.isDirectory()) {
|
||||
tarpath.mkdir();
|
||||
File[] dir = source.listFiles();
|
||||
for (File element : dir) {
|
||||
if (element.getName().equals(".svn")) { //$NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
copyDirectoryWithoutSvnFolder(element, tarpath);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
@@ -918,8 +953,8 @@ public class FilesUtils {
|
||||
file.delete();
|
||||
} else if (file.isDirectory()) {
|
||||
File files[] = file.listFiles();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
deleteFile(files[i], true);
|
||||
for (File file2 : files) {
|
||||
deleteFile(file2, true);
|
||||
}
|
||||
}
|
||||
if (delete) {
|
||||
|
||||
1
org.talend.core.nl/plugin_nl.properties
Normal file
1
org.talend.core.nl/plugin_nl.properties
Normal file
@@ -0,0 +1 @@
|
||||
prefsName=Talend
|
||||
@@ -7,7 +7,7 @@ ColorsCodeViewerPreferencePage.keyword2Color=\u30AD\u30FC\u30EF\u30FC\u30C92\u82
|
||||
MetadataDialog.Message=\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u306E\u3059\u3079\u3066\u306E\u30AB\u30E9\u30E0\u304C\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u79FB\u884C\u3055\u308C\u307E\u3059
|
||||
MetadataDialog.TransferMessage=\u51FA\u30B9\u30AD\u30FC\u30DE\u306E\u3059\u3079\u3066\u306E\u30AB\u30E9\u30E0\u304C\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u79FB\u884C\u3055\u308C\u307E\u3059
|
||||
EMetadataEncoding.Cyrillic=\u30AD\u30EA\u30EB\u8A9E
|
||||
EUpdateResult.BuiltIn=\u30D3\u30EB\u30C9\u30A4\u30F3\u30E2\u30FC\u30C9\u3078\u5909\u66F4
|
||||
EUpdateResult.BuiltIn=\u7D44\u8FBC\u307F\u30E2\u30FC\u30C9\u3078\u5909\u66F4
|
||||
EUpdateResult.Rename=\u540D\u524D\u3092\u5909\u66F4
|
||||
MetadataTypeLengthConstants.DOUBLE_LENGTH=Double
|
||||
ContextProcessSection.ParameterNameIsNotValid=\u5F15\u6570\u540D\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002
|
||||
@@ -185,7 +185,9 @@ PaletteContentDialog.lable=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30E9\u30D9\u30E
|
||||
MetadataDialog.CopySelectionToInput.toolTipText=\u9078\u629E\u3055\u308C\u305F\u30AB\u30E9\u30E0\u3092\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u304B\u3089\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u30B3\u30D4\u30FC
|
||||
MetadataDialog.CopyToOutput=\u3059\u3079\u3066\u306E\u30AB\u30E9\u30E0\u3092\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u304B\u3089\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u30B3\u30D4\u30FC
|
||||
MetadataDialog.CopySelectionToOutput=\u9078\u629E\u3055\u308C\u305F\u30AB\u30E9\u30E0\u3092\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u304B\u3089\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u30B3\u30D4\u30FC
|
||||
MetadataTalendType.dbIdNotFound=DBMS Id : {0} \u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093!
|
||||
PaletteContentDialog.connection=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u63A5\u7D9A\u30C7\u30D5\u30A9\u30EB\u30C8\uFF1A
|
||||
PaletteContentDialog.hint=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30D2\u30F3\u30C8\u30C7\u30D5\u30A9\u30EB\u30C8\uFF1A
|
||||
PaletteContentDialog.lable=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30E9\u30D9\u30EB\u30C7\u30D5\u30A9\u30EB\u30C8:
|
||||
ProcessorUtilities.finalizeBuild=\u30D3\u30EB\u30C9\u3092\u7D42\u4E86\u4E2D...
|
||||
ProcessorUtilities.generatingJob=\u30B8\u30E7\u30D6\u751F\u6210\u4E2D...
|
||||
@@ -241,6 +243,8 @@ MetadataTool.schemaNull=\u30B9\u30AD\u30FC\u30DE\u540D\u304CNULL\u3067\u3059\u30
|
||||
MetadataTool.invalidChar=\u7121\u52B9\u306A\u6587\u5B57
|
||||
MetadataTool.nameNull=\u30B9\u30AD\u30FC\u30DE\u540D\u3092\u6307\u5B9A\u3057\u3066\u4E0B\u3055\u3044\u3002
|
||||
MetadataTool.nullValue=Null\u5024
|
||||
MetadataTool.schemaExist=\u30B9\u30AD\u30FC\u30DE\u540D\u306F\u5B58\u5728\u3057\u307E\u3059\u3002
|
||||
MetadataTool.schemaIn=\u30B9\u30AD\u30FC\u30DE\u540D\u304C\u4E0D\u6B63\u3067\u3059\u3002
|
||||
MetadataTool.schemaInvalid=\u30B9\u30AD\u30FC\u30DE\u540D\u304C\u4E0D\u6B63\u3067\u3059\u3002
|
||||
MetadataTool.schemaNull=\u30B9\u30AD\u30FC\u30DE\u540D\u304CNULL\u3067\u3059\u3002
|
||||
RepositoryUpdateManager.NotFoundTitle=\u898B\u3064\u304B\u308A\u307E\u305B\u3093
|
||||
|
||||
@@ -1,5 +1,44 @@
|
||||
ContextProcessSection.errorTitle=Fout
|
||||
ContextProcessSection.7=Naam voor nieuwe Context
|
||||
ContextProcessSection.6=Nieuwe Context
|
||||
RoutinesFunctionProposal.User=Gebruiker
|
||||
ContextProcessSection.49=Standaard Context
|
||||
ContextProcessSection.29=Fout
|
||||
EUpdateItemType.Name=Naam
|
||||
ContextParameterProposal.ContextVariable=Context variabele
|
||||
ComponentsFormatPreferencePage.add=Toevoegen
|
||||
ComponentToRepositoryProperty.error=Fout
|
||||
ContextSetConfigurationDialog.nameNotValid=Ongeldige naam
|
||||
ProcessorUtilities.finalizeBuild=Bouwen afronden...
|
||||
ProcessorUtilities.generatingJob=Job genereren...
|
||||
ProcessorUtilities.loadingJob=Job laden...
|
||||
VariableItemEditor.name=Naam
|
||||
VariableItemEditor.new=Nieuw
|
||||
ApplicationActionBarAdvisor.menuFileLabel=&Bestand
|
||||
ApplicationActionBarAdvisor.navigateLabel=&Navigeer
|
||||
ApplicationActionBarAdvisor.gotoLabel=&Ga naar
|
||||
ApplicationActionBarAdvisor.projectLabel=&Project
|
||||
ApplicationActionBarAdvisor.menuWindowLabel=&Venster
|
||||
ApplicationActionBarAdvisor.menuHelpLabel=&Help
|
||||
BusinessAppearanceComposite.textAlignmentGroup=Tekst uitlijning
|
||||
BusinessAppearanceComposite.textAlignment.horizontal=Horizontaal
|
||||
BusinessAppearanceComposite.textAlignment.vertical=Verticaal
|
||||
BusinessAppearanceComposite.textAlignment.horizontal.centre=Centreer
|
||||
BusinessAppearanceComposite.textAlignment.vertical.centre=Centreer
|
||||
ComponentsFormatPreferencePage.ErrorTitle=Fout
|
||||
ConextTableValuesComposite.nameLabel=Naam
|
||||
ContextTemplateComposite.CommentLabel=Opmerking
|
||||
ContextTemplateComposite.nameLabel=Naam
|
||||
ContextTemplateComposite.sourceLabel=Bron
|
||||
EComponentCategory_assignment=Toewijzing
|
||||
EComponentCategory_properties=Eigenschappen
|
||||
EComponentCategory_sqlTemplate=SQL Template
|
||||
HTMLDocGenerator.comment=Opmerking
|
||||
HTMLDocGenerator.context=Context:
|
||||
HTMLDocGenerator.name=Naam
|
||||
HTMLDocGenerator.project_description=Project omschrijving
|
||||
HTMLDocGenerator.project_name=Project Naam
|
||||
HTMLDocGenerator.properties=Eigenschappen
|
||||
HTMLDocGenerator.source=Bron
|
||||
ConnectionParameterName.UserLabel=Gebruiker
|
||||
ConnectionParameterName.PasswordLabel=Wachtwoord
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
CreateRuleDialog.nameLabel=Naam
|
||||
@@ -60,3 +60,17 @@ JobletReferenceDialog.DeletedInfor=M
|
||||
JobletReferenceDialog.project=Projekt
|
||||
ContextReferenceDialog.Recycle=Mülleimer
|
||||
ContextReferenceDialog.Types=Typ
|
||||
ProjectRepositoryNode.code=Code
|
||||
ProjectRepositoryNode.columns=Spalten
|
||||
ProjectRepositoryNode.validationRules=Validierungsregeln
|
||||
ProjectRepositoryNode.genericSchema=Generische Schemata
|
||||
ProjectRepositoryNode.queries=Abfragen
|
||||
ProjectRepositoryNode.synonymSchemas=Synonym-Schemas
|
||||
ProjectRepositoryNode.tableSchemas=Tabellen-Schemas
|
||||
ProjectRepositoryNode.viewSchemas=Ansicht-Schemas
|
||||
ProjectRepositoryNode.sapFunctions=SAP Funktionen
|
||||
ProjectRepositoryNode.sapIDocs=SAP iDocs
|
||||
RepositoryDropAdapter_moveTitle=Verschieben
|
||||
ItemReferenceDialog.item=Element
|
||||
ItemReferenceDialog.project=Projekt
|
||||
ItemReferenceDialog.deletedInfor=Mülleimer
|
||||
|
||||
@@ -144,3 +144,11 @@ RepositoryDropAdapter_moveTitle=Move
|
||||
RepositoryDropAdapter_movingItems=Moving items...
|
||||
RepositoryDropAdapter.checkingLockStatus=Checking lock status of
|
||||
RepositoryDropAdapter.moving=Moving
|
||||
ItemReferenceDialog.title=Items which cannot be deleted
|
||||
ItemReferenceDialog.item=Item
|
||||
ItemReferenceDialog.referenceItem=Reference Item
|
||||
ItemReferenceDialog.nodeTotals=Totals
|
||||
ItemReferenceDialog.nodeTotalsTip=The totals of node reference
|
||||
ItemReferenceDialog.project=Project
|
||||
ItemReferenceDialog.deletedInfor=In Recycle Bin
|
||||
ItemReferenceDialog.messages=Some items cannot be deleted because they are referenced from other items.
|
||||
|
||||
@@ -103,9 +103,18 @@ ProjectRepositoryNode.rulesManagement=Gestion des r
|
||||
ProjectRepositoryNode.itemInvalid=Elément invalide : [{0}] {1}
|
||||
ProjectRepositoryNode.invalidItem=Elément invalide
|
||||
ProjectRepositoryNode.validationRules=Règles de validation
|
||||
ProjectRepositoryNode.cdcFoundation=Fondation CDC
|
||||
ProjectRepositoryNode.genericSchema=Schémas génériques
|
||||
ProjectRepositoryNode.queries=Requêtes
|
||||
ProjectRepositoryNode.synonymSchemas=Schémas synonymes
|
||||
ProjectRepositoryNode.tableSchemas=Schémas des tables
|
||||
ProjectRepositoryNode.viewSchemas=Voir les schémas
|
||||
ProjectRepositoryNode.sapFunctions=Fonctions SAP
|
||||
ProjectRepositoryNode.sapIDocs=SAP iDocs
|
||||
ItemReferenceDialog.title=Eléments ne pouvant être supprimés
|
||||
ItemReferenceDialog.item=Elément
|
||||
ItemReferenceDialog.referenceItem=Elément de référence
|
||||
ItemReferenceDialog.nodeTotals=Totaux
|
||||
ItemReferenceDialog.project=Projet
|
||||
ItemReferenceDialog.deletedInfor=Dans la Corbeille
|
||||
ItemReferenceDialog.messages=Des éléments ne peuvent être supprimés car ils sont référencés par d'autres.
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
CreateSandboxProjectDialog.userFirstname=Voornaam
|
||||
CreateSandboxProjectDialog.userLastname=Achternaam
|
||||
CreateSandboxProjectDialog.Password=Wachtwoord
|
||||
PropertiesWizardPage.Name=Naam
|
||||
JobletReferenceDialog.project=PROJECT
|
||||
ProjectRepositoryNode.invalidItem=Ongeldig item
|
||||
RepositoryDropAdapter_moveTitle=Verplaatsen
|
||||
ItemReferenceDialog.project=PROJECT
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
ProxyRepositoryFactory.Label=Labela
|
||||
CreateSandboxProjectDialog.ProjectLabel=Labela
|
||||
PropertiesWizardPage.Select=SELECT
|
||||
DeleteAction.action.logicalTitle=DELETE
|
||||
|
||||
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
|
||||
org.talend.commons.ui,
|
||||
org.apache.log4j,
|
||||
org.talend.libraries.apache,
|
||||
org.eclipse.osgi.services
|
||||
org.eclipse.osgi.services,
|
||||
org.eclipse.ui.ide
|
||||
Export-Package: org.talend.core.ldap,
|
||||
org.talend.core.model.genhtml,
|
||||
org.talend.core.model.metadata,
|
||||
@@ -25,6 +26,7 @@ Export-Package: org.talend.core.ldap,
|
||||
org.talend.core.repository.model.repositoryObject,
|
||||
org.talend.core.repository.ui.actions.metadata,
|
||||
org.talend.core.repository.utils,
|
||||
org.talend.repository.editor,
|
||||
org.talend.repository.model,
|
||||
org.talend.repository.model.actions,
|
||||
org.talend.repository.preview,
|
||||
@@ -32,6 +34,7 @@ Export-Package: org.talend.core.ldap,
|
||||
org.talend.repository.ui.dialog,
|
||||
org.talend.repository.ui.utils,
|
||||
org.talend.repository.ui.views,
|
||||
org.talend.repository.ui.wizards.folder,
|
||||
org.talend.repository.utils
|
||||
Bundle-Activator: org.talend.core.repository.CoreRepositoryPlugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
||||
@@ -586,6 +586,10 @@
|
||||
class="org.talend.core.repository.model.CheckJobletDeleteReference"
|
||||
priority="high">
|
||||
</check>
|
||||
<check
|
||||
class="org.talend.core.repository.model.CheckJobDeleteReference"
|
||||
priority="high">
|
||||
</check>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -21,6 +21,7 @@ ProxyRepositoryFactory.log.physicalDeletion=Physical deletion [{0}] by {1}.
|
||||
ProxyRepositoryFactory.log.tempFolderEmptied=Temp folder emptied ({0} files deleted in {1} ms)
|
||||
ProxyRepositoryFactory.log.unlock=Unlock [{0}] by "{1}".
|
||||
ProxyRepositoryFactory.logonInProgress=Log on in progress...
|
||||
ProxyRepositoryFactory.projectIsNotCompatible=The project {0} had been opend by a more recent studio so cannot open it.
|
||||
ProxyRepositoryFactory.ReplaceJob=is already in use,do you want to replace it?
|
||||
ProxyRepositoryFactory.synch.repo.items=Synchronize repository items
|
||||
ProxyRepositoryFactory.synchronizeLibraries=Synchronize libraries...
|
||||
@@ -92,6 +93,8 @@ DeleteAction.dialog.messageAllElements=All the elements will be deleted forever
|
||||
DeleteAction.dialog.title=Delete forever
|
||||
DeleteAction.error.lockedOrOpenedObject.newMessage=The {0} is locked, so you can't delete it.\n If this object is opened ,you must close it before deletion.
|
||||
DeleteAction.error.title=Deletion forbidden
|
||||
DeleteAction.warning.message1=can not delete the folder because at least one item contained in this folder is currently open. Close any open item and try again.
|
||||
DeleteAction.warning.title=Warning
|
||||
DuplicateAction.cannotGenerateItem=Cannot generate pasted item label.
|
||||
DuplicateAction.dialog.message=Give name to new job
|
||||
DuplicateAction.dialog.title=Please input job name
|
||||
@@ -115,12 +118,14 @@ JobletReferenceDialog.NodeTotalsTip=The totals of node reference
|
||||
JobletReferenceDialog.project=Project
|
||||
JobletReferenceDialog.ReferenceJob=Reference Job
|
||||
JobletReferenceDialog.Title=Delete the joblet failure
|
||||
ContextReferenceDialog.Title=Delete the context failure
|
||||
ContextReferenceDialog.Title=Delete Context Group
|
||||
ContextReferenceDialog.Recycle=in Recycle Bin
|
||||
ContextReferenceDialog.ReferenceJob=Reference Objects
|
||||
ContextReferenceDialog.Types=Type
|
||||
ContextReferenceDialog.NodeTypeTip=The type of node reference
|
||||
ContextReferenceDialog.Messages=Context({0} {1}) is referenced from\:\n
|
||||
ContextReferenceDialog.kindMessages=The context group of {0} {1} is referred by the following list, if you really want to delete it, the context group is used in job will be changed to built-in when job is opened again. Would you still like to delete it?
|
||||
ContextReferenceDialog.kindMessages1=The context group of {0} {1} is referred by the following list, Would you still like to delete it?
|
||||
CopyToGenericSchemaHelper.cannotGenarateItem=Cannot generate pasted item label.
|
||||
ProxyRepositoryFactory.ReplaceJobHazardDescription=\nDependence on the original connection may be lost\!
|
||||
|
||||
@@ -154,4 +159,24 @@ RepositoryDropAdapter_lockedByYou=This item is locked by you, it can not be move
|
||||
RepositoryDropAdapter_moveTitle=Move
|
||||
RepositoryDropAdapter_movingItems=Moving items...
|
||||
RepositoryDropAdapter.checkingLockStatus=Checking lock status of
|
||||
RepositoryDropAdapter.moving=Moving
|
||||
RepositoryDropAdapter.moving=Moving
|
||||
|
||||
NewFolderWizard.description=Create a new folder in repository
|
||||
NewFolderWizard.failureText=An error occurs. Folder cannot be created. See log for more details.
|
||||
NewFolderWizard.failureTitle=Error
|
||||
NewFolderWizard.label=Label
|
||||
NewFolderWizard.nameEmpty=Label is required
|
||||
NewFolderWizard.nameIncorrect=Label contains incorrect characters.
|
||||
NewFolderWizard.nameInvalid=Label {0} is forbidden
|
||||
NewFolderWizard.title=Folder
|
||||
NewFolderWizard.windowTitle=New folder
|
||||
|
||||
CreateFolderAction.action.title=Create folder
|
||||
CreateFolderAction.action.toolTipText=Create folder
|
||||
|
||||
RenameFolderAction.action.title=Rename folder
|
||||
RenameFolderAction.action.toolTipText=Rename folder
|
||||
RenameFolderAction.warning.editorOpen.message=Cannot rename "{1}" folder because an item ({0}) contained in this folder is currently open.\nClose it and retry.
|
||||
RenameFolderAction.warning.editorOpen.title=Action not available
|
||||
RenameFolderAction.warning.cannotFind.message=Cannot rename folder, it may have been moved or deleted. Click refresh button to update the repository.
|
||||
RenameFolderAction.warning.cannotFind.title=Action not available
|
||||
@@ -43,4 +43,12 @@ public class FileConstants {
|
||||
|
||||
// MOD klliu 2010-11-26
|
||||
public static final String JRXML_EXTENSION = "jrxml"; //$NON-NLS-1$
|
||||
|
||||
public static final String ZIP_FILE_SUFFIX = ".zip"; //$NON-NLS-1$
|
||||
|
||||
public static final String TAR_FILE_SUFFIX = ".tar"; //$NON-NLS-1$
|
||||
|
||||
public static final String TAR_GZ_FILE_SUFFIX = ".tar.gz"; //$NON-NLS-1$
|
||||
|
||||
public static final String PROPERTIES_FILE_SUFFIX = '.' + PROPERTIES_EXTENSION;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.core.repository.model;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -41,6 +40,7 @@ import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ICoreService;
|
||||
import org.talend.core.IStatusPreferenceInitService;
|
||||
import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.general.LibraryInfo;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
@@ -99,6 +99,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return EcoreUtil.generateUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RootContainer<String, IRepositoryViewObject> getMetadata(Project project, ERepositoryObjectType type,
|
||||
boolean... options) throws PersistenceException {
|
||||
return getObjectFromFolder(project, type, true, options);
|
||||
@@ -138,6 +139,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
*
|
||||
* @see org.talend.repository.model.IRepositoryFactory#getRecycleBinItems()
|
||||
*/
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getRecycleBinItems(Project project, boolean... options) throws PersistenceException {
|
||||
ERepositoryObjectType types[] = { ERepositoryObjectType.DOCUMENTATION, ERepositoryObjectType.METADATA_CONNECTIONS,
|
||||
ERepositoryObjectType.METADATA_SAPCONNECTIONS, ERepositoryObjectType.SQLPATTERNS,
|
||||
@@ -155,8 +157,8 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
ERepositoryObjectType.JOB_SCRIPT };
|
||||
|
||||
List<IRepositoryViewObject> deletedItems = new ArrayList<IRepositoryViewObject>();
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
RootContainer<String, IRepositoryViewObject> container = getObjectFromFolder(project, types[i], true, options);
|
||||
for (ERepositoryObjectType type : types) {
|
||||
RootContainer<String, IRepositoryViewObject> container = getObjectFromFolder(project, type, true, options);
|
||||
List<IRepositoryViewObject> repositoryObjects = container.getAbsoluteMembers().objects();
|
||||
for (IRepositoryViewObject object : repositoryObjects) {
|
||||
if (object.isDeleted()) {
|
||||
@@ -237,6 +239,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
|
||||
protected abstract Object getFolder(Project project, ERepositoryObjectType repositoryObjectType) throws PersistenceException;
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getAllVersion(Project project, String id, boolean avoidSaveProject)
|
||||
throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
@@ -244,6 +247,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return convert(serializableAllVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getAllVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
@@ -261,6 +265,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return serializableAllVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNameAvailable(Project project, Item item, String name, List<IRepositoryViewObject>... givenList)
|
||||
throws PersistenceException {
|
||||
if (name == null) {
|
||||
@@ -395,7 +400,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
}
|
||||
|
||||
List<IRepositoryViewObject> repositoryObjects = getAll(project, ERepositoryObjectType.ROUTINES, false, false);
|
||||
Map<String, List<URI>> routineAndJars = coreSerivce.getRoutineAndJars();
|
||||
Map<String, List<LibraryInfo>> routineAndJars = coreSerivce.getRoutineAndJars();
|
||||
for (URL url : routines) {
|
||||
String[] fragments = url.toString().split("/"); //$NON-NLS-1$
|
||||
String label = fragments[fragments.length - 1];
|
||||
@@ -503,7 +508,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
* @param url
|
||||
* @throws PersistenceException
|
||||
*/
|
||||
private void createRoutine(URL url, IPath path, String label, List<URI> neededJars) throws PersistenceException {
|
||||
private void createRoutine(URL url, IPath path, String label, List<LibraryInfo> neededJars) throws PersistenceException {
|
||||
if (url == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
@@ -527,13 +532,13 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
routineItem.setContent(byteArray);
|
||||
routineItem.setBuiltIn(true);
|
||||
if (neededJars != null) {
|
||||
for (URI jar : neededJars) {
|
||||
for (LibraryInfo jar : neededJars) {
|
||||
IMPORTType type = ComponentFactory.eINSTANCE.createIMPORTType();
|
||||
type.setMESSAGE("");
|
||||
type.setNAME(label);
|
||||
type.setREQUIRED(true);
|
||||
type.setMODULE(new Path(jar.getPath()).lastSegment());
|
||||
type.setUrlPath(jar.getPath());
|
||||
type.setMODULE(jar.getLibName());
|
||||
type.setBundleID(jar.getBundleId());
|
||||
routineItem.getImports().add(type);
|
||||
}
|
||||
}
|
||||
@@ -651,6 +656,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logOnProject(Project project) throws LoginException, PersistenceException {
|
||||
setLoggedOnProject(false);
|
||||
|
||||
@@ -678,6 +684,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
setLoggedOnProject(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModuleNeeded> getModulesNeededForJobs() throws PersistenceException {
|
||||
List<ModuleNeeded> importNeedsList = new ArrayList<ModuleNeeded>();
|
||||
IProxyRepositoryFactory repositoryFactory = CoreRuntimePlugin.getInstance().getRepositoryService()
|
||||
@@ -710,6 +717,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return importNeedsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RootContainer<String, IRepositoryViewObject> getRoutineFromProject(Project project) throws PersistenceException {
|
||||
RootContainer<String, IRepositoryViewObject> toReturn = new RootContainer<String, IRepositoryViewObject>();
|
||||
ERepositoryObjectType type = ERepositoryObjectType.ROUTINES;
|
||||
@@ -724,6 +732,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(Project project, String id) throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
serializableAllVersion = getSerializable(project, id, false, false);
|
||||
@@ -761,6 +770,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
@@ -803,7 +813,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
}
|
||||
Object fullFolder;
|
||||
if (folder instanceof IFolder) {
|
||||
fullFolder = (IFolder) getFolder(project, itemType);
|
||||
fullFolder = getFolder(project, itemType);
|
||||
if (path != null && !"".equals(path)) { //$NON-NLS-1$
|
||||
fullFolder = ((IFolder) fullFolder).getFolder(new Path(path));
|
||||
}
|
||||
@@ -824,6 +834,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return fullFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getUptodateProperty(Project project, Property property) throws PersistenceException {
|
||||
|
||||
List<IRepositoryViewObject> allVersion = new ArrayList<IRepositoryViewObject>();
|
||||
@@ -855,8 +866,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
String parentBranch = getRepositoryContext().getFields().get(
|
||||
IProxyRepositoryFactory.BRANCH_SELECTION + "_" + project.getTechnicalLabel());
|
||||
|
||||
for (ProjectReference refProject : (List<ProjectReference>) (List<ProjectReference>) project.getEmfProject()
|
||||
.getReferencedProjects()) {
|
||||
for (ProjectReference refProject : (List<ProjectReference>) project.getEmfProject().getReferencedProjects()) {
|
||||
if (refProject.getBranch() != null && !parentBranch.equals(refProject.getBranch())) {
|
||||
continue;
|
||||
}
|
||||
@@ -874,6 +884,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public FolderItem getFolderItem(Project project, ERepositoryObjectType itemType, IPath path) {
|
||||
return getFolderHelper(project.getEmfProject()).getFolder(
|
||||
ERepositoryObjectType.getFolderName(itemType) + IPath.SEPARATOR + path);
|
||||
@@ -884,6 +895,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
*
|
||||
* @see org.talend.repository.model.IRepositoryFactory#reloadProject(org.talend.core.model.general.Project)
|
||||
*/
|
||||
@Override
|
||||
public void reloadProject(Project project) throws PersistenceException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -898,25 +910,30 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
* @return all of object under path.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getMetadataByFolder(Project project, ERepositoryObjectType itemType, IPath path) {
|
||||
return getMetadatasByFolder(project, itemType, path);
|
||||
}
|
||||
|
||||
protected abstract <K, T> List<T> getMetadatasByFolder(Project project, ERepositoryObjectType type, IPath path);
|
||||
|
||||
@Override
|
||||
public RootContainer<String, IRepositoryViewObject> getTdqRepositoryViewObjects(Project project, ERepositoryObjectType type,
|
||||
String folderName, boolean[] options) throws PersistenceException {
|
||||
return getObjectFromFolder(project, type, folderName, true, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canLock(Item item) throws PersistenceException {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUnlock(Item item) throws PersistenceException {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RootContainer<String, IRepositoryViewObject> getRootContainerFromType(Project project, ERepositoryObjectType type) {
|
||||
if (project == null || type == null) {
|
||||
return null;
|
||||
@@ -929,6 +946,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LockInfo getLockInfo(Item item) {
|
||||
if (item.getState().isLocked()) {
|
||||
return new LockInfo(item.getState().getLocker().getLogin(), "studio", item.getState().getLockDate());//$NON-NLS-1$
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.repository.model;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.map.MultiKeyMap;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.ICheckDeleteItemReference;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC hcyi class global comment. Detailled comment
|
||||
*/
|
||||
public class CheckJobDeleteReference extends AbstractCheckDeleteItemReference implements ICheckDeleteItemReference {
|
||||
|
||||
private static final String PROCESS_TYPE_PROCESS = "PROCESS_TYPE_PROCESS"; //$NON-NLS-1$
|
||||
|
||||
// almost move from the method checkRepositoryNodeFromProcess of DeleteAction class.
|
||||
public Set<ItemReferenceBean> checkItemReferenceBeans(IProxyRepositoryFactory factory, DeleteActionCache deleteActionCache,
|
||||
IRepositoryNode currentJobNode) {
|
||||
IRepositoryViewObject object = currentJobNode.getObject();
|
||||
Item nodeItem = object.getProperty().getItem();
|
||||
boolean needCheckJobIfUsedInProcess = false;
|
||||
if (nodeItem instanceof ProcessItem) {
|
||||
needCheckJobIfUsedInProcess = true;
|
||||
}
|
||||
Set<ItemReferenceBean> list = new HashSet<ItemReferenceBean>();
|
||||
if (object != null && needCheckJobIfUsedInProcess) {
|
||||
Property property = object.getProperty();
|
||||
if (property != null) {
|
||||
String label = property.getLabel();
|
||||
String version = property.getVersion();
|
||||
ERepositoryObjectType type = object.getRepositoryObjectType();
|
||||
boolean isItemDeleted = factory.getStatus(object) == ERepositoryStatus.DELETED;
|
||||
Item item = property.getItem();
|
||||
if (!(item instanceof ProcessItem)) {
|
||||
return list;
|
||||
}
|
||||
EList nodesList = null;
|
||||
// fix bug 10050
|
||||
Set<Project> refParentProjects = new HashSet<Project>();
|
||||
try {
|
||||
refParentProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
|
||||
for (Project refP : refParentProjects) {
|
||||
List<IRepositoryViewObject> processes = factory.getAll(refP, ERepositoryObjectType.PROCESS, true);
|
||||
deleteActionCache.setProcessList(processes);
|
||||
for (IRepositoryViewObject process : deleteActionCache.getProcessList()) {
|
||||
Property property2 = process.getProperty();
|
||||
boolean isDelete = factory.getStatus(process) == ERepositoryStatus.DELETED;
|
||||
Item item2 = property2.getItem();
|
||||
if (item == item2) {
|
||||
continue;
|
||||
}
|
||||
if (!isOpenedItem(item2, deleteActionCache.getOpenProcessMap())) {
|
||||
if (item2 instanceof ProcessItem) {
|
||||
nodesList = ((ProcessItem) item2).getProcess().getNode();
|
||||
}
|
||||
}
|
||||
if (nodesList != null) {
|
||||
for (Object object2 : nodesList) {
|
||||
if (object2 instanceof NodeType) {
|
||||
NodeType nodeType = (NodeType) object2;
|
||||
boolean equals = false;
|
||||
// only detect the tRunJob component releationship between father job and child job //$NON-NLS-1$
|
||||
if ("tRunJob".equals(nodeType.getComponentName())) {
|
||||
for (Object obj : nodeType.getElementParameter()) {
|
||||
if (obj != null && obj instanceof ElementParameterType) {
|
||||
ElementParameterType param = (ElementParameterType) obj;
|
||||
if ("PROCESS:PROCESS_TYPE_PROCESS".equals(param.getName())) { //$NON-NLS-1$
|
||||
if (property.getId().equals(param.getValue())) {
|
||||
equals = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (equals) {
|
||||
String path = item2.getState().getPath();
|
||||
boolean found = false;
|
||||
ItemReferenceBean bean = new ItemReferenceBean();
|
||||
bean.setItemName(label);
|
||||
bean.setItemVersion(version);
|
||||
bean.setItemType(type);
|
||||
bean.setItemDeleted(isItemDeleted);
|
||||
bean.setReferenceItemName(property2.getLabel());
|
||||
bean.setReferenceItemVersion(property2.getVersion());
|
||||
bean.setReferenceItemType(process.getRepositoryObjectType());
|
||||
bean.setReferenceItemPath(path);
|
||||
bean.setReferenceProjectName(refP.getLabel());
|
||||
bean.setReferenceItemDeleted(isDelete);
|
||||
for (ItemReferenceBean b : list) {
|
||||
if (b.equals(bean)) {
|
||||
found = true;
|
||||
b.addNodeNum();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
list.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (IProcess2 openedProcess : deleteActionCache.getOpenedProcessList()) {
|
||||
for (INode node : openedProcess.getGraphicalNodes()) {
|
||||
boolean equals = false;
|
||||
IElementParameter processTypeParam = node.getElementParameter(PROCESS_TYPE_PROCESS);
|
||||
if (processTypeParam != null && property.getId().equals(processTypeParam.getValue())) {
|
||||
equals = true;
|
||||
}
|
||||
boolean isDelete = factory.getStatus(openedProcess) == ERepositoryStatus.DELETED;
|
||||
Property property2 = openedProcess.getProperty();
|
||||
Item item2 = property2.getItem();
|
||||
String path = item2.getState().getPath();
|
||||
if (equals) {
|
||||
boolean found = false;
|
||||
ItemReferenceBean bean = new ItemReferenceBean();
|
||||
bean.setItemName(label);
|
||||
bean.setItemVersion(version);
|
||||
bean.setItemType(type);
|
||||
bean.setItemDeleted(isItemDeleted);
|
||||
bean.setReferenceItemName(property2.getLabel());
|
||||
bean.setReferenceItemVersion(property2.getVersion());
|
||||
bean.setReferenceItemType(ERepositoryObjectType.getItemType(item2));
|
||||
bean.setReferenceItemPath(path);
|
||||
bean.setReferenceProjectName(refP.getLabel());
|
||||
bean.setReferenceItemDeleted(isDelete);
|
||||
for (ItemReferenceBean b : list) {
|
||||
if (b.equals(bean)) {
|
||||
found = true;
|
||||
b.addNodeNum();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
list.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If the reference job or joblet is in the recycle bin but the joblet is not then no need to check; If both the
|
||||
* joblet and the reference job or joblet are all in the recycle bin and they are all in the delete list then no
|
||||
* need to check them; If both the joblet and the reference job or joblet are all not in the recycle bin and
|
||||
* they are all in the delete list then no need to check them too.
|
||||
*/
|
||||
Iterator<ItemReferenceBean> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
ItemReferenceBean bean = it.next();
|
||||
if ((!bean.isItemDeleted() && bean.isReferenceItemDeleted())
|
||||
|| (bean.isItemDeleted() && bean.isReferenceItemDeleted() && isItemInDeleteList(bean, true))
|
||||
|| (!bean.isItemDeleted() && !bean.isReferenceItemDeleted() && isItemInDeleteList(bean, true))) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static boolean isOpenedItem(Item openedItem, MultiKeyMap openProcessMap) {
|
||||
if (openedItem == null) {
|
||||
return false;
|
||||
}
|
||||
Property property = openedItem.getProperty();
|
||||
return (openProcessMap.get(property.getId(), property.getLabel(), property.getVersion()) != null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -123,12 +123,12 @@ public class CopyToGenericSchemaHelper {
|
||||
listColumns = (ConnectionHelper.getTables(dbConnection).toArray(new MetadataTable[0])[0]).getColumns();
|
||||
}
|
||||
|
||||
boolean isConnectionTableSchema = checkIsConnectionTableSchema(tableToMove);
|
||||
if (isConnectionTableSchema) {
|
||||
metadataTable.setLabel(DEFAULT_TABLE_NAME);
|
||||
} else {
|
||||
metadataTable.setLabel(tableToMove.getLabel() == null ? DEFAULT_TABLE_NAME : tableToMove.getLabel());
|
||||
}
|
||||
// boolean isConnectionTableSchema = checkIsConnectionTableSchema(tableToMove);
|
||||
// if (isConnectionTableSchema) {
|
||||
// metadataTable.setLabel(DEFAULT_TABLE_NAME);
|
||||
// } else {
|
||||
metadataTable.setLabel(tableToMove.getLabel() == null ? DEFAULT_TABLE_NAME : tableToMove.getLabel());
|
||||
// }
|
||||
for (Object temp : listColumns) {
|
||||
MetadataColumn column = (MetadataColumnImpl) temp;
|
||||
MetadataColumn metadataColumn = ConnectionFactory.eINSTANCE.createMetadataColumn();
|
||||
@@ -162,8 +162,7 @@ public class CopyToGenericSchemaHelper {
|
||||
connectionProperty.setLabel(connectionLabel);
|
||||
metadataTable.setId(factory.getNextId());
|
||||
|
||||
GenericPackage g = (GenericPackage) ConnectionHelper.getPackage(connection.getName(), (Connection) connection,
|
||||
GenericPackage.class);
|
||||
GenericPackage g = (GenericPackage) ConnectionHelper.getPackage(connection.getName(), connection, GenericPackage.class);
|
||||
if (g != null) { // hywang
|
||||
g.getOwnedElement().add(metadataTable);
|
||||
} else {
|
||||
@@ -176,7 +175,7 @@ public class CopyToGenericSchemaHelper {
|
||||
connectionProperty.setItem(connectionItem);
|
||||
connectionProperty.setId(factory.getNextId());
|
||||
|
||||
if (!repositoryFactory.isNameAvailable(connectionItem, connectionLabel))// name is existing in generic
|
||||
if (!repositoryFactory.isNameAvailable(connectionItem, connectionLabel)) {
|
||||
// schema.
|
||||
try {
|
||||
setPropNewName(connectionProperty);
|
||||
@@ -184,6 +183,7 @@ public class CopyToGenericSchemaHelper {
|
||||
// e.printStackTrace();
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
repositoryFactory.create(connectionItem, targetPath);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.repository.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
@@ -20,7 +23,8 @@ import org.talend.core.IService;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import orgomg.cwm.objectmodel.core.ModelElement;
|
||||
import org.talend.core.model.properties.TDQItem;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
|
||||
/**
|
||||
* DOC mzhao Abstract unload resource service which can be extended by client.
|
||||
@@ -30,11 +34,6 @@ public class AbstractResourceChangesService implements IService {
|
||||
public void handleUnload(Resource toBeUnloadedResource) {
|
||||
}
|
||||
|
||||
// Add new elements to resource, remove elements from resource, delete resource
|
||||
public boolean handleResourceChange(ModelElement modelElement) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void handleLogicalDelete(Property prop) {
|
||||
}
|
||||
|
||||
@@ -75,8 +74,26 @@ public class AbstractResourceChangesService implements IService {
|
||||
* @throws PersistenceException
|
||||
*/
|
||||
public void saveResourceByEMFShared(Resource toSave) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* if move TDQReportItem, need to move the generated doc of it also.
|
||||
*
|
||||
* @param tdqItem
|
||||
* @param tarFolder
|
||||
*/
|
||||
public void moveReportGeneratedDocFolder(TDQItem tdqItem, File tarFolder) {
|
||||
}
|
||||
|
||||
public List<IRepositoryNode> getDependentNodes(IRepositoryNode currentNode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<IRepositoryNode> getDependentConnNodesInRecycleBin(List<IRepositoryNode> children) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void openDependcesDialog(List<IRepositoryNode> nodes) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.repository.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.utils.RepositoryManagerHelper;
|
||||
import org.talend.repository.model.ContextReferenceBean;
|
||||
|
||||
/**
|
||||
* DOC Marvin class global comment. Detailled comment <br/>
|
||||
*
|
||||
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
|
||||
*
|
||||
*/
|
||||
public class RepositoryReferenceBeanUtils {
|
||||
|
||||
public static boolean hasReferenceBean(List<ContextReferenceBean> list, String beanName, String beanVersion) {
|
||||
boolean has = false;
|
||||
|
||||
if (list == null) {
|
||||
list = new ArrayList<ContextReferenceBean>();
|
||||
has = false;
|
||||
} else {
|
||||
for (ContextReferenceBean loopBean : list) {
|
||||
String loopBeanName = loopBean.getRelateName();
|
||||
String loopBeanVersion = loopBean.getRelateVersion();
|
||||
if (loopBeanName != null && !"".equals(loopBeanName) && loopBeanName.equals(beanName) && loopBeanVersion != null
|
||||
&& !"".equals(loopBeanVersion) && loopBeanVersion.equals(beanVersion)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return has;
|
||||
}
|
||||
|
||||
public static boolean isOpenedProcess(IProcess2 process) {
|
||||
List<IProcess2> openedProcesses = RepositoryManagerHelper.getOpenedProcess();
|
||||
boolean isOpenedProcess = false;
|
||||
if (openedProcesses != null && openedProcesses.size() > 0) {
|
||||
for (IProcess2 tempPro : openedProcesses) {
|
||||
if (process.getId().equals(tempPro.getId())) {
|
||||
isOpenedProcess = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isOpenedProcess;
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.repository.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -122,11 +122,12 @@ public class XmiResourceManager {
|
||||
|
||||
public void loadScreenshots(Property property, ProcessType processType) {
|
||||
Resource screenshotResource = getScreenshotResource(property.getItem());
|
||||
processType.getScreenshots().addAll(screenshotResource.getContents());
|
||||
|
||||
if (screenshotResource != null) { // if no screenshot, we will try to add later when save
|
||||
processType.getScreenshots().addAll(screenshotResource.getContents());
|
||||
}
|
||||
}
|
||||
|
||||
public Property loadProperty(IResource iResource) {
|
||||
public synchronized Property loadProperty(IResource iResource) {
|
||||
// force unload old version, or the UI won't be synchronized all the time to the current file.
|
||||
// this is only if a user update itself a .item or .properties, or for SVN repository.
|
||||
//
|
||||
@@ -192,8 +193,8 @@ public class XmiResourceManager {
|
||||
public Resource createTempProjectResource() {
|
||||
URI uri = null;
|
||||
try {
|
||||
uri = URI.createPlatformResourceURI(Platform.getInstallLocation().getURL().toURI().toString());
|
||||
} catch (URISyntaxException e) {
|
||||
uri = URI.createPlatformResourceURI(Platform.getInstallLocation().getURL().getFile(), true);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return resourceSet.createResource(uri);
|
||||
@@ -214,36 +215,41 @@ public class XmiResourceManager {
|
||||
return resourceSet.createResource(propertyResourceURI);
|
||||
}
|
||||
|
||||
public Resource getReferenceFileResource(Resource itemResource, String extension, boolean needLoad) {
|
||||
URI referenceFileURI = getReferenceFileURI(itemResource.getURI(), extension);
|
||||
public Resource getReferenceFileResource(Resource itemResource, ReferenceFileItem refFile, boolean needLoad) {
|
||||
URI referenceFileURI = getReferenceFileURI(itemResource.getURI(), refFile.getExtension());
|
||||
URIConverter converter = resourceSet.getURIConverter();
|
||||
Resource referenceResource = new ByteArrayResource(referenceFileURI);
|
||||
InputStream inputStream = null;
|
||||
|
||||
List<Resource> resources = new ArrayList<Resource>(resourceSet.getResources());
|
||||
for (Resource res : resources) {
|
||||
if (res != null && referenceFileURI.toString().equals(res.getURI().toString())) {
|
||||
res.unload();
|
||||
resourceSet.getResources().remove(res);
|
||||
// in case ESB load reference file from the physcial file,but DI need reference from the EMF,so add this flag
|
||||
if (refFile.isReloadFromFile()) {
|
||||
for (Resource res : resources) {
|
||||
if (res != null && referenceFileURI.toString().equals(res.getURI().toString())) {
|
||||
res.unload();
|
||||
resourceSet.getResources().remove(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resourceSet.getResources().add(referenceResource);
|
||||
try {
|
||||
if (needLoad) {
|
||||
inputStream = converter.createInputStream(referenceFileURI);
|
||||
referenceResource.load(inputStream, null);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
resourceSet.getResources().add(referenceResource);
|
||||
try {
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
if (needLoad) {
|
||||
inputStream = converter.createInputStream(referenceFileURI);
|
||||
referenceResource.load(inputStream, null);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
referenceResource = resourceSet.getResource(referenceFileURI, true);
|
||||
}
|
||||
return referenceResource;
|
||||
}
|
||||
@@ -335,17 +341,41 @@ public class XmiResourceManager {
|
||||
return itemResource;
|
||||
}
|
||||
|
||||
public Resource getScreenshotResource(Item item) {
|
||||
return getScreenshotResource(item, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a resource obj from Item resource file. if the resouce file does not exist ,will create it first.
|
||||
*/
|
||||
public Resource getScreenshotResource(Item item) {
|
||||
public Resource getScreenshotResource(Item item, boolean createIfNotExist) {
|
||||
URI itemResourceURI = null;
|
||||
itemResourceURI = getScreenshotResourceURI(getItemURI(item));
|
||||
Resource itemResource;
|
||||
try {
|
||||
// judge whether the physical file exists or not
|
||||
itemResource = resourceSet.getResource(itemResourceURI, true);
|
||||
} catch (Exception e) {
|
||||
boolean fileExist = false;
|
||||
if (itemResourceURI.isFile()) {
|
||||
fileExist = new File(itemResourceURI.toFileString()).exists();
|
||||
} else {
|
||||
IPath path = URIHelper.convert(itemResourceURI);
|
||||
if (path != null) {
|
||||
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
|
||||
if (file.exists()) {
|
||||
fileExist = true;
|
||||
}
|
||||
} else {
|
||||
fileExist = false;
|
||||
}
|
||||
}
|
||||
Resource itemResource = null;
|
||||
if (fileExist) {
|
||||
try {
|
||||
// judge whether the physical file exists or not
|
||||
itemResource = resourceSet.getResource(itemResourceURI, true);
|
||||
} catch (Exception e) {
|
||||
// do nothing, consider the file don't exist
|
||||
itemResource = null;
|
||||
}
|
||||
}
|
||||
if (itemResource == null && createIfNotExist) {
|
||||
itemResource = resourceSet.createResource(itemResourceURI);
|
||||
}
|
||||
return itemResource;
|
||||
|
||||
@@ -49,10 +49,12 @@ public class RepositoryEditorInput extends FileEditorInput implements IRepositor
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem() {
|
||||
return this.item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItem(Item item) {
|
||||
this.item = item;
|
||||
if (item != null) {
|
||||
@@ -62,14 +64,17 @@ public class RepositoryEditorInput extends FileEditorInput implements IRepositor
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return this.readOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadOnly(boolean readOnly) {
|
||||
this.readOnly = readOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
@@ -89,6 +94,7 @@ public class RepositoryEditorInput extends FileEditorInput implements IRepositor
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if (getItem() != null) {
|
||||
return super.hashCode() & getItem().hashCode();
|
||||
@@ -98,6 +104,7 @@ public class RepositoryEditorInput extends FileEditorInput implements IRepositor
|
||||
|
||||
protected RepositoryNode repositoryNode;
|
||||
|
||||
@Override
|
||||
public RepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
@@ -107,6 +114,7 @@ public class RepositoryEditorInput extends FileEditorInput implements IRepositor
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode repositoryNode) {
|
||||
if (repositoryNode != null) {
|
||||
this.repositoryNode = (RepositoryNode) repositoryNode;
|
||||
@@ -464,6 +464,8 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
refProject.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.REFERENCED_PROJECTS);
|
||||
nodes.add(refProject);
|
||||
}
|
||||
// delete the hidden nodes
|
||||
deleteHiddenNodes(nodes);
|
||||
// *init the repository node from extension
|
||||
initExtensionRepositoryNodes(curParentNode);
|
||||
|
||||
@@ -476,6 +478,31 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
collectRepositoryNodes(curParentNode);
|
||||
}
|
||||
|
||||
private void deleteHiddenNodes(List<IRepositoryNode> nodes) {
|
||||
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
|
||||
IBrandingService service = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
|
||||
List<IRepositoryNode> hiddens = service.getBrandingConfiguration().getHiddenRepositoryCategory(this, "DI");
|
||||
for (IRepositoryNode node : hiddens) {
|
||||
Iterator<IRepositoryNode> it = nodes.iterator();
|
||||
while (it.hasNext()) {
|
||||
IRepositoryNode curNode = it.next();
|
||||
if (curNode.getContentType() != null && curNode.getContentType().equals(ERepositoryObjectType.METADATA)) {
|
||||
for (IRepositoryNode curNode2 : curNode.getChildren()) {
|
||||
if (curNode2.equals(node)) {
|
||||
curNode.getChildren().remove(curNode2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (curNode.equals(node)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void collectRepositoryNodes(IRepositoryNode curParentNode) {
|
||||
if (repositoryNodeMap == null) {
|
||||
repositoryNodeMap = new HashMap<String, RepositoryNode>();
|
||||
@@ -1145,7 +1172,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
"ProjectRepositoryNode.itemInvalid", repositoryObject.getRepositoryObjectType(), //$NON-NLS-1$,
|
||||
repositoryObject.getLabel()));
|
||||
|
||||
if (repositoryObject.getProperty().getInformations().isEmpty()) {
|
||||
if (repositoryObject.getProperty() != null && repositoryObject.getProperty().getInformations().isEmpty()) {
|
||||
Information info = PropertiesFactory.eINSTANCE.createInformation();
|
||||
info.setLevel(InformationLevel.ERROR_LITERAL);
|
||||
info.setText(Messages.getString("ProjectRepositoryNode.invalidItem")); //$NON-NLS-1$
|
||||
@@ -1812,7 +1839,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
}
|
||||
|
||||
public boolean getMergeRefProject() {
|
||||
IPreferenceStore preferenceStore = RepositoryManager.getPreferenceStore();
|
||||
IPreferenceStore preferenceStore = RepositoryManager.getRepositoryPreferenceStore();
|
||||
return preferenceStore.getBoolean(IRepositoryPrefConstants.MERGE_REFERENCE_PROJECT);
|
||||
}
|
||||
|
||||
@@ -1900,5 +1927,4 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -267,35 +267,62 @@ public class CopyObjectAction {
|
||||
}
|
||||
|
||||
private void copySingleVersionItem(final Item item, final IPath path) {
|
||||
final RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("", this) {//$NON-NLS-1$
|
||||
final RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("", this) {//$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void run() throws LoginException, PersistenceException {
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
Item newItem = factory.copy(item, path, true);
|
||||
// qli modified to fix the bug 5400 and 6185.
|
||||
if (newItem instanceof RoutineItem) {
|
||||
synDuplicatedRoutine((RoutineItem) newItem);
|
||||
}
|
||||
ICamelDesignerCoreService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
|
||||
service = (ICamelDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
ICamelDesignerCoreService.class);
|
||||
}
|
||||
if (service != null && service.isInstanceofCamelBeans(item)) {
|
||||
// for camel
|
||||
synDuplicatedBean(newItem);
|
||||
}
|
||||
if (newItem instanceof ProcessItem || newItem instanceof JobletProcessItem) {
|
||||
RelationshipItemBuilder.getInstance().addOrUpdateItem(newItem);
|
||||
}
|
||||
if (newItem instanceof ConnectionItem) {
|
||||
ConnectionItem connectionItem = (ConnectionItem) newItem;
|
||||
connectionItem.getConnection().getSupplierDependency().clear();
|
||||
}
|
||||
factory.save(newItem);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
ISchedulingRule schedulingRule = workspace.getRoot();
|
||||
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
|
||||
} catch (CoreException e) {
|
||||
throw new InvocationTargetException(e);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
try {
|
||||
Item newItem = factory.copy(item, path, true);
|
||||
// qli modified to fix the bug 5400 and 6185.
|
||||
if (newItem instanceof RoutineItem) {
|
||||
synDuplicatedRoutine((RoutineItem) newItem);
|
||||
}
|
||||
ICamelDesignerCoreService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
|
||||
service = (ICamelDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
ICamelDesignerCoreService.class);
|
||||
}
|
||||
if (service != null && service.isInstanceofCamelBeans(item)) {
|
||||
// for camel
|
||||
synDuplicatedBean(newItem);
|
||||
}
|
||||
if (newItem instanceof ProcessItem || newItem instanceof JobletProcessItem) {
|
||||
RelationshipItemBuilder.getInstance().addOrUpdateItem(newItem);
|
||||
}
|
||||
if (newItem instanceof ConnectionItem) {
|
||||
ConnectionItem connectionItem = (ConnectionItem) newItem;
|
||||
connectionItem.getConnection().getSupplierDependency().clear();
|
||||
}
|
||||
factory.save(newItem);
|
||||
} catch (Exception e) {
|
||||
new ProgressMonitorDialog(null).run(true, true, iRunnableWithProgress);
|
||||
} catch (InvocationTargetException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (InterruptedException e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,8 +21,6 @@ import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.RepositoryManager;
|
||||
@@ -34,6 +32,7 @@ import org.talend.core.repository.utils.AbstractResourceChangesService;
|
||||
import org.talend.core.repository.utils.TDQServiceRegister;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.JobletReferenceBean;
|
||||
@@ -291,11 +290,10 @@ public class MoveObjectAction {
|
||||
|| repositoryObjectType == ERepositoryObjectType.METADATA_MDMCONNECTION) {
|
||||
AbstractResourceChangesService resourceChangeService = TDQServiceRegister.getInstance()
|
||||
.getResourceChangeService(AbstractResourceChangesService.class);
|
||||
Item item = objectToMove.getProperty() == null ? null : objectToMove.getProperty().getItem();
|
||||
if (null != resourceChangeService && null != item) {
|
||||
boolean handleResourceChange = resourceChangeService.handleResourceChange(((ConnectionItem) item)
|
||||
.getConnection());
|
||||
if (!handleResourceChange) {
|
||||
if (null != resourceChangeService) {
|
||||
List<IRepositoryNode> dependentNodes = resourceChangeService.getDependentNodes(sourceNode);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resourceChangeService.openDependcesDialog(dependentNodes);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +68,15 @@ public class CopyAction extends AContextualAction {
|
||||
|
||||
LocalSelectionTransfer.getTransfer().setSelection(selection);
|
||||
LocalSelectionTransfer.getTransfer().setSelectionSetTime(System.currentTimeMillis());
|
||||
// init paste action
|
||||
PasteAction pasteActionInstance = PasteAction.getInstance();
|
||||
if (pasteActionInstance != null) {
|
||||
pasteActionInstance.init(null, selection);
|
||||
}
|
||||
// refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(TreeViewer viewer, IStructuredSelection selection) {
|
||||
boolean canWork = true;
|
||||
RepositoryNode node = (RepositoryNode) selection.getFirstElement();
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IEditorReference;
|
||||
@@ -58,11 +59,13 @@ import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.SubscriberTable;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.FolderItem;
|
||||
import org.talend.core.model.properties.FolderType;
|
||||
import org.talend.core.model.properties.Item;
|
||||
@@ -70,17 +73,18 @@ import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.ProjectReference;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.TDQItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.Folder;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.RepositoryManager;
|
||||
import org.talend.core.model.utils.RepositoryManagerHelper;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.model.ISubRepositoryObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject;
|
||||
import org.talend.core.repository.utils.AbstractResourceChangesService;
|
||||
import org.talend.core.repository.utils.RepositoryNodeDeleteManager;
|
||||
import org.talend.core.repository.utils.RepositoryReferenceBeanUtils;
|
||||
import org.talend.core.repository.utils.TDQServiceRegister;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
@@ -154,6 +158,7 @@ public class DeleteAction extends AContextualAction {
|
||||
final List<RepositoryNode> deletedFolder = new ArrayList<RepositoryNode>();
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) {
|
||||
monitor.beginTask("Delete Running", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
|
||||
Object[] selections = ((IStructuredSelection) selection).toArray();
|
||||
@@ -190,6 +195,7 @@ public class DeleteAction extends AContextualAction {
|
||||
if (jobNames != null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String message = jobNames.toString()
|
||||
+ Messages.getString("DeleteAction.deleteJobAssignedToOneService"); //$NON-NLS-1$
|
||||
@@ -209,6 +215,20 @@ public class DeleteAction extends AContextualAction {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TDI-22550
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService coreService = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerCoreService.class);
|
||||
IRepositoryViewObject object = node.getObject();
|
||||
if (coreService != null && object != null && object.getProperty() != null) {
|
||||
Item item = object.getProperty().getItem();
|
||||
IProcess iProcess = coreService.getProcessFromItem(item);
|
||||
if (iProcess != null && iProcess instanceof IProcess2) {
|
||||
IProcess2 process = (IProcess2) iProcess;
|
||||
process.removeProblems4ProcessDeleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean needReturn = deleteElements(factory, deleteActionCache, node);
|
||||
if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET) {
|
||||
needToUpdataPalette = true;
|
||||
@@ -218,18 +238,6 @@ public class DeleteAction extends AContextualAction {
|
||||
}
|
||||
types.add(node.getObjectType());
|
||||
|
||||
// TDI-22550
|
||||
IDesignerCoreService coreService = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerCoreService.class);
|
||||
IRepositoryViewObject object = node.getObject();
|
||||
if (coreService != null && object != null && object.getProperty() != null) {
|
||||
Item item = object.getProperty().getItem();
|
||||
IProcess iProcess = coreService.getProcessFromItem(item);
|
||||
if (iProcess != null && iProcess instanceof IProcess2) {
|
||||
IProcess2 process = (IProcess2) iProcess;
|
||||
process.removeProblems4ProcessDeleted();
|
||||
}
|
||||
}
|
||||
} else if (node.getType() == ENodeType.SIMPLE_FOLDER) {
|
||||
FolderItem folderItem = (FolderItem) node.getObject().getProperty().getItem();
|
||||
if (node.getChildren().size() > 0 && !folderItem.getState().isDeleted()) {
|
||||
@@ -241,6 +249,7 @@ public class DeleteAction extends AContextualAction {
|
||||
if (jobNames != null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String message = null;
|
||||
if (jobNames.toString().contains(",")) { //$NON-NLS-1$
|
||||
@@ -301,6 +310,7 @@ public class DeleteAction extends AContextualAction {
|
||||
if (unDeleteItems.size() > 0) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ItemReferenceDialog dialog = new ItemReferenceDialog(PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell(), unDeleteItems);
|
||||
@@ -338,6 +348,7 @@ public class DeleteAction extends AContextualAction {
|
||||
|
||||
IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
@@ -362,6 +373,7 @@ public class DeleteAction extends AContextualAction {
|
||||
final boolean updatePalette = needToUpdataPalette;
|
||||
Display.getCurrent().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// MOD qiongli 2011-1-24,avoid to refresh repositoryView for top
|
||||
if (!org.talend.commons.utils.platform.PluginChecker.isOnlyTopLoaded()) {
|
||||
@@ -416,14 +428,21 @@ public class DeleteAction extends AContextualAction {
|
||||
ERepositoryObjectType objectType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
List<IRepositoryNode> repositoryList = node.getChildren();
|
||||
boolean success = true;
|
||||
Exception bex = null;
|
||||
for (IRepositoryNode repositoryNode : repositoryList) {
|
||||
try {
|
||||
deleteRepositoryNode(repositoryNode, factory);
|
||||
} catch (Exception e) {
|
||||
bex = e;
|
||||
ExceptionHandler.process(e);
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
if (bex != null) {
|
||||
final Shell shell = getShell();
|
||||
MessageDialog.openWarning(shell, Messages.getString("DeleteAction.warning.title"),
|
||||
Messages.getString("DeleteAction.warning.message1"));
|
||||
}
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
@@ -574,17 +593,20 @@ public class DeleteAction extends AContextualAction {
|
||||
} else {
|
||||
IRepositoryViewObject objToDelete = repositoryNode.getObject();
|
||||
// TDI-22550
|
||||
IDesignerCoreService coreService = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService.class);
|
||||
if (coreService != null && objToDelete != null && objToDelete.getProperty() != null) {
|
||||
Item item = objToDelete.getProperty().getItem();
|
||||
IProcess iProcess = coreService.getProcessFromItem(item);
|
||||
if (iProcess != null && iProcess instanceof IProcess2) {
|
||||
IProcess2 process = (IProcess2) iProcess;
|
||||
process.removeProblems4ProcessDeleted();
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService coreService = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService.class);
|
||||
if (coreService != null && objToDelete != null && objToDelete.getProperty() != null) {
|
||||
Item item = objToDelete.getProperty().getItem();
|
||||
IProcess iProcess = coreService.getProcessFromItem(item);
|
||||
if (iProcess != null && iProcess instanceof IProcess2) {
|
||||
IProcess2 process = (IProcess2) iProcess;
|
||||
process.removeProblems4ProcessDeleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
factory.deleteObjectLogical(objToDelete);
|
||||
removeConnFromSQLExplorer(repositoryNode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,6 +622,7 @@ public class DeleteAction extends AContextualAction {
|
||||
final List<IEditorReference> list = new ArrayList<IEditorReference>();
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IEditorReference[] reference = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
|
||||
.getEditorReferences();
|
||||
@@ -700,10 +723,20 @@ public class DeleteAction extends AContextualAction {
|
||||
for (Project refP : refParentProjects) {
|
||||
List<IRepositoryViewObject> objList = new ArrayList<IRepositoryViewObject>();
|
||||
List<IRepositoryViewObject> processes = factory.getAll(refP, ERepositoryObjectType.PROCESS);
|
||||
List<IRepositoryViewObject> allJobVersions = new ArrayList<IRepositoryViewObject>();
|
||||
// Added by Marvin Wang on Sep.14, 2012 for bug TDI-21878. It assumes that for a job the low
|
||||
// version maybe use the Context Group, but the latest version does not use it. So it has to to
|
||||
// check all job versions.
|
||||
if (processes != null && processes.size() > 0) {
|
||||
for (IRepositoryViewObject process : processes) {
|
||||
allJobVersions.addAll(factory.getAllVersion(process.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
List<IRepositoryViewObject> jobletes = factory.getAll(refP, ERepositoryObjectType.JOBLET);
|
||||
processes.addAll(jobletes);
|
||||
deleteActionCache.setProcessList(processes);
|
||||
objList.addAll(processes);
|
||||
allJobVersions.addAll(jobletes);
|
||||
deleteActionCache.setProcessList(allJobVersions);
|
||||
objList.addAll(allJobVersions);
|
||||
|
||||
List<IRepositoryViewObject> connectionc = factory
|
||||
.getAll(refP, ERepositoryObjectType.METADATA_CONNECTIONS);
|
||||
@@ -751,34 +784,67 @@ public class DeleteAction extends AContextualAction {
|
||||
}
|
||||
List<IContext> contextList = null;
|
||||
String contextID = null;
|
||||
if (!isOpenedItem(item2, deleteActionCache.getOpenProcessMap())) {
|
||||
IDesignerCoreService service = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerCoreService.class);
|
||||
// if (!isOpenedItem(item2, deleteActionCache.getOpenProcessMap())) {
|
||||
// The following logic is added by Marvin Wang on Sep. 14, 2012 for bug TDI-21878.
|
||||
// The reason to check if the above "process" is opened is the give "process" may be
|
||||
// changed, that means user may do some operation on the process and not save. So I need to
|
||||
// get the changed process in order to get the correct context list.
|
||||
List<IProcess2> openedProcesses = RepositoryManagerHelper.getOpenedProcess();
|
||||
boolean isOpenedProcess = false;
|
||||
if (openedProcesses != null && openedProcesses.size() > 0) {
|
||||
for (IProcess2 tempPro : openedProcesses) {
|
||||
if (process.getId().equals(tempPro.getId())) {
|
||||
isOpenedProcess = true;
|
||||
contextList = tempPro.getContextManager().getListContext();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
IDesignerCoreService service = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService.class);
|
||||
// Commented by Marvin Wang on Sep.14, 2012.
|
||||
// If the given "process" is not opened, it indicates there are no changes(no dirty) on job.
|
||||
// So we can use IDesignerCoreService.getProcessFromProcessItem(Item) to get IProcess by
|
||||
// loading file. That is why it can not use the method to get IProcess directly without
|
||||
// checking if "process" is opened.
|
||||
if (!isOpenedProcess) {
|
||||
if (item2 instanceof ProcessItem) {
|
||||
contextList = service.getProcessFromProcessItem((ProcessItem) item2).getContextManager()
|
||||
.getListContext();
|
||||
} else if (item2 instanceof JobletProcessItem) {
|
||||
contextList = service.getProcessFromJobletProcessItem((JobletProcessItem) item2)
|
||||
.getContextManager().getListContext();
|
||||
} else if (item2 instanceof ConnectionItem) {
|
||||
contextID = ((ConnectionItem) item2).getConnection().getContextId();
|
||||
}
|
||||
}
|
||||
if (item2 instanceof JobletProcessItem) {
|
||||
contextList = service.getProcessFromJobletProcessItem((JobletProcessItem) item2)
|
||||
.getContextManager().getListContext();
|
||||
} else if (item2 instanceof ConnectionItem) {
|
||||
contextID = ((ConnectionItem) item2).getConnection().getContextId();
|
||||
}
|
||||
|
||||
if (contextList != null) {
|
||||
// isExtensionComponent(node);
|
||||
for (IContext context : contextList) {
|
||||
if (context.getContextParameterList().size() <= 0) {
|
||||
continue;
|
||||
}
|
||||
String source = context.getContextParameterList().get(0).getSource();
|
||||
if (source.equals(item.getProperty().getId())) {
|
||||
String path = item2.getState().getPath();
|
||||
String type = process.getRepositoryObjectType().getType();
|
||||
ContextReferenceBean bean = new ContextReferenceBean(property2.getLabel(), type,
|
||||
property2.getVersion(), path, refP.getLabel());
|
||||
bean.setJobFlag(isJob, isDelete);
|
||||
list.add(bean);
|
||||
break;
|
||||
// Added by Marvin Wang on Sep.14, 2012 for bug TDI-21878. It just needs to check the
|
||||
// first IContext, normally it is named "default". In order to add the different version
|
||||
// jobs to ContextReferenceBean, below uses
|
||||
// "RepositoryReferenceBeanUtils.hasReferenceBean" to filter the repeat object.
|
||||
List<IContextParameter> contextParams = contextList.get(0).getContextParameterList();
|
||||
if (contextParams != null && contextParams.size() > 0) {
|
||||
for (IContextParameter contextParameter : contextParams) {
|
||||
if (contextParameter.isBuiltIn()) {
|
||||
continue;
|
||||
}
|
||||
String contextId = item.getProperty().getId();
|
||||
String sourceId = contextParameter.getSource();
|
||||
if (contextId != null && contextId.equals(sourceId)) {
|
||||
String processName = process.getLabel();
|
||||
String processVersion = process.getVersion();
|
||||
if (!RepositoryReferenceBeanUtils.hasReferenceBean(list, processName, processVersion)) {
|
||||
String path = item2.getState().getPath();
|
||||
String type = process.getRepositoryObjectType().getType();
|
||||
ContextReferenceBean bean = new ContextReferenceBean(property2.getLabel(), type,
|
||||
property2.getVersion(), path, refP.getLabel());
|
||||
bean.setJobFlag(isJob, isDelete);
|
||||
list.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (contextID != null) {
|
||||
@@ -807,11 +873,18 @@ public class DeleteAction extends AContextualAction {
|
||||
Item item2 = property2.getItem();
|
||||
String path = item2.getState().getPath();
|
||||
|
||||
ContextReferenceBean bean = new ContextReferenceBean(property2.getLabel(), openedProcess
|
||||
.getRepositoryObjectType().getType(), property2.getVersion(), path, refP.getLabel());
|
||||
bean.setJobFlag(isJob, isDelete);
|
||||
list.add(bean);
|
||||
break;
|
||||
String processName = openedProcess.getLabel();
|
||||
String processVersion = openedProcess.getVersion();
|
||||
// Added by Marvin Wang on Sep. 24, 2012 for bug TDI-21878 to filter the bean that
|
||||
// has been added in the list.
|
||||
if (!RepositoryReferenceBeanUtils.hasReferenceBean(list, processName, processVersion)) {
|
||||
ContextReferenceBean bean = new ContextReferenceBean(property2.getLabel(), openedProcess
|
||||
.getRepositoryObjectType().getType(), property2.getVersion(), path,
|
||||
refP.getLabel());
|
||||
bean.setJobFlag(isJob, isDelete);
|
||||
list.add(bean);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -984,13 +1057,14 @@ public class DeleteAction extends AContextualAction {
|
||||
&& nodeObject.getProperty().getItem() != null
|
||||
&& (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER
|
||||
|| nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER || RepositoryManager
|
||||
.isOpenedItemInEditor(nodeObject)) && !(DELETE_FOREVER_TITLE.equals(getText()))) {
|
||||
.isOpenedItemInEditor(nodeObject)) && !(DELETE_FOREVER_TITLE.equals(getText()))) {
|
||||
|
||||
final String title = Messages.getString("DeleteAction.error.title"); //$NON-NLS-1$
|
||||
String nodeName = ERepositoryObjectType.getDeleteFolderName(nodeObject.getRepositoryObjectType());
|
||||
final String message = Messages.getString("DeleteAction.error.lockedOrOpenedObject.newMessage", nodeName);//$NON-NLS-1$
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog dialog = new MessageDialog(new Shell(), title, null, message, MessageDialog.ERROR,
|
||||
new String[] { IDialogConstants.OK_LABEL }, 0);
|
||||
@@ -1048,38 +1122,43 @@ public class DeleteAction extends AContextualAction {
|
||||
private boolean deleteElements(IProxyRepositoryFactory factory, DeleteActionCache deleteActionCache,
|
||||
final RepositoryNode currentJobNode, Boolean confirm) throws PersistenceException, BusinessException {
|
||||
boolean needReturn = false;
|
||||
final boolean[] enableDeleting = new boolean[1];
|
||||
enableDeleting[0] = true;
|
||||
final IRepositoryViewObject objToDelete = currentJobNode.getObject();
|
||||
|
||||
final List<ContextReferenceBean> checkContext = checkContextFromProcess(factory, deleteActionCache, currentJobNode);
|
||||
if (checkContext.size() > 0) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ContextReferenceDialog dialog = new ContextReferenceDialog(PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell(), objToDelete, checkContext);
|
||||
dialog.open();
|
||||
int returnCode = dialog.open();
|
||||
switch (returnCode) {
|
||||
case Window.OK:
|
||||
enableDeleting[0] = true;
|
||||
break;
|
||||
case Window.CANCEL:
|
||||
enableDeleting[0] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!enableDeleting[0]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Item item = null;
|
||||
if (objToDelete != null && objToDelete.getProperty() != null) {
|
||||
item = objToDelete.getProperty().getItem();
|
||||
}
|
||||
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance().getResourceChangeService(
|
||||
AbstractResourceChangesService.class);
|
||||
if (resChangeService != null && item != null && item instanceof ConnectionItem && item.getState().isDeleted()) {
|
||||
if (!resChangeService.handleResourceChange(((ConnectionItem) item).getConnection())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// To manage case of we have a subitem. This is possible using 'DEL' shortcut:
|
||||
ERepositoryObjectType nodeType = (ERepositoryObjectType) currentJobNode.getProperties(EProperties.CONTENT_TYPE);
|
||||
if (nodeType != null && nodeType.isSubItem()) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final DeleteTableAction deleteTableAction = new DeleteTableAction();
|
||||
deleteTableAction.setWorkbenchPart(getWorkbenchPart());
|
||||
@@ -1089,9 +1168,17 @@ public class DeleteAction extends AContextualAction {
|
||||
needReturn = true;
|
||||
} else {
|
||||
if (factory.getStatus(objToDelete) == ERepositoryStatus.DELETED) {
|
||||
if (resChangeService != null) {
|
||||
List<IRepositoryNode> dependentNodes = resChangeService.getDependentNodes(currentJobNode);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resChangeService.openDependcesDialog(dependentNodes);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (confirm == null) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String title = Messages.getString("DeleteAction.dialog.title"); //$NON-NLS-1$
|
||||
|
||||
@@ -1139,15 +1226,11 @@ public class DeleteAction extends AContextualAction {
|
||||
} else {
|
||||
// MOD qiongli 2011-5-10,bug 21189.should remove dependency after showing the question dialog of
|
||||
// physical delete.
|
||||
if (resChangeService != null && (item instanceof TDQItem || item instanceof ConnectionItem)) {
|
||||
resChangeService.removeAllDependecies(item);
|
||||
}
|
||||
// MOD qiongli 2012-3-30 remove SQL Explore only when it is confirmed to delete.
|
||||
if (item instanceof ConnectionItem
|
||||
&& GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepService = (ITDQRepositoryService) GlobalServiceRegister.getDefault()
|
||||
.getService(ITDQRepositoryService.class);
|
||||
tdqRepService.removeAliasInSQLExplorer(currentJobNode);
|
||||
if (resChangeService != null && objToDelete != null && objToDelete.getProperty() != null) {
|
||||
Item item = objToDelete.getProperty().getItem();
|
||||
if (item != null) {
|
||||
resChangeService.removeAllDependecies(item);
|
||||
}
|
||||
}
|
||||
factory.deleteObjectPhysical(objToDelete);
|
||||
ExpressionPersistance.getInstance().jobDeleted(objToDelete.getLabel());
|
||||
@@ -1155,18 +1238,65 @@ public class DeleteAction extends AContextualAction {
|
||||
}
|
||||
} else {
|
||||
factory.deleteObjectLogical(objToDelete);
|
||||
updateRelatedViews();
|
||||
removeConnFromSQLExplorer(currentJobNode);
|
||||
}
|
||||
}
|
||||
|
||||
return needReturn;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Added by Marvin Wang on Sep 14, 2012.
|
||||
*/
|
||||
private void updateRelatedViews() {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IDesignerCoreService designerCoreService = CoreRuntimePlugin.getInstance().getDesignerCoreService();
|
||||
if (designerCoreService != null) {
|
||||
designerCoreService.switchToCurContextsView();
|
||||
// for tRunJob component
|
||||
designerCoreService.switchToCurComponentSettingsView();
|
||||
// for 2608
|
||||
designerCoreService.switchToCurJobSettingsView();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* *
|
||||
* Remove the dbconnection in sql explorer after logical delete.
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
private void removeConnFromSQLExplorer(IRepositoryNode node) {
|
||||
IRepositoryViewObject object = node.getObject();
|
||||
Property prop = null;
|
||||
if (object != null) {
|
||||
prop = object.getProperty();
|
||||
}
|
||||
if (prop == null || prop.getItem() == null || !(prop.getItem() instanceof DatabaseConnectionItem)) {
|
||||
return;
|
||||
}
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
|
||||
ITDQRepositoryService.class);
|
||||
if (tdqRepService != null) {
|
||||
tdqRepService.removeAliasInSQLExplorer(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
|
||||
* org.eclipse.jface.viewers.IStructuredSelection)
|
||||
*/
|
||||
@Override
|
||||
public void init(TreeViewer viewer, IStructuredSelection selection) {
|
||||
visible = !selection.isEmpty();
|
||||
if (selection.isEmpty()) {
|
||||
@@ -1254,6 +1384,12 @@ public class DeleteAction extends AContextualAction {
|
||||
break;
|
||||
}
|
||||
|
||||
if (contentType == ERepositoryObjectType.METADATA_CON_TABLE) {
|
||||
enabled = false;
|
||||
visible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
IRepositoryViewObject repObj = node.getObject();
|
||||
|
||||
ERepositoryStatus status = repObj.getRepositoryStatus();
|
||||
@@ -1267,11 +1403,6 @@ public class DeleteAction extends AContextualAction {
|
||||
}
|
||||
|
||||
if (isDeleted) {
|
||||
if (ERepositoryObjectType.METADATA_CON_TABLE.equals(nodeType)) {
|
||||
visible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ERepositoryObjectType.METADATA_CON_COLUMN.equals(nodeType)) {
|
||||
visible = false;
|
||||
break;
|
||||
|
||||
@@ -52,6 +52,7 @@ import org.talend.core.repository.utils.TDQServiceRegister;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
@@ -128,7 +129,11 @@ public class DeleteTableAction extends AContextualAction {
|
||||
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance()
|
||||
.getResourceChangeService(AbstractResourceChangesService.class);
|
||||
if (resChangeService != null) {
|
||||
isSave = resChangeService.handleResourceChange(((ConnectionItem) item).getConnection());
|
||||
List<IRepositoryNode> dependentNodes = resChangeService.getDependentNodes(node);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resChangeService.openDependcesDialog(dependentNodes);
|
||||
isSave = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isSave) {
|
||||
@@ -180,6 +185,7 @@ public class DeleteTableAction extends AContextualAction {
|
||||
}
|
||||
Display.getCurrent().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
RepositoryManager.refreshDeletedNode(types);
|
||||
}
|
||||
@@ -205,6 +211,7 @@ public class DeleteTableAction extends AContextualAction {
|
||||
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
|
||||
* org.eclipse.jface.viewers.IStructuredSelection)
|
||||
*/
|
||||
@Override
|
||||
public void init(TreeViewer viewer, IStructuredSelection selection) {
|
||||
boolean canWork = false;
|
||||
setText(null);
|
||||
|
||||
@@ -49,8 +49,11 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ITDQRepositoryService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
@@ -453,7 +456,18 @@ public class DuplicateAction extends AContextualAction {
|
||||
if (copy instanceof ProcessItem) {
|
||||
RelationshipItemBuilder.getInstance().addOrUpdateItem(copy);
|
||||
}
|
||||
// MOD qiongli 2012-10-16 TDQ-6166 notify sqlExplore when duplicate a new
|
||||
// connection
|
||||
if (copy instanceof DatabaseConnectionItem) {
|
||||
Connection connection = ((DatabaseConnectionItem) copy).getConnection();
|
||||
if (connection != null) {
|
||||
connection.getSupplierDependency().clear();
|
||||
connection.setLabel(newJobName);
|
||||
connection.setName(newJobName);
|
||||
}
|
||||
}
|
||||
factory.save(copy);
|
||||
notifySQLExplorer(copy);
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, "org.talend.core.repository", "", e));
|
||||
@@ -524,10 +538,16 @@ public class DuplicateAction extends AContextualAction {
|
||||
}
|
||||
|
||||
if (newItem instanceof ConnectionItem) {
|
||||
ConnectionItem connectionItem = (ConnectionItem) newItem;
|
||||
connectionItem.getConnection().getSupplierDependency().clear();
|
||||
Connection connection = ((ConnectionItem) newItem).getConnection();
|
||||
if (connection != null) {
|
||||
connection.setLabel(newName);
|
||||
connection.setName(newName);
|
||||
connection.getSupplierDependency().clear();
|
||||
}
|
||||
}
|
||||
factory.save(newItem);
|
||||
// MOD qiongli 2012-10-16 TDQ-6166 notify sqlExplore when duplicate a new connection
|
||||
notifySQLExplorer(newItem);
|
||||
} catch (PersistenceException e) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, "org.talend.core.repository", "", e));
|
||||
} catch (BusinessException e) {
|
||||
@@ -618,4 +638,15 @@ public class DuplicateAction extends AContextualAction {
|
||||
protected boolean resetProcessVersion() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void notifySQLExplorer(Item item) {
|
||||
if (item instanceof DatabaseConnectionItem
|
||||
&& GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
|
||||
ITDQRepositoryService.class);
|
||||
if (tdqRepService != null) {
|
||||
tdqRepService.notifySQLExplorer(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,9 @@ import org.talend.core.model.repository.RepositoryManager;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.model.ISubRepositoryObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.AbstractResourceChangesService;
|
||||
import org.talend.core.repository.utils.RepositoryNodeDeleteManager;
|
||||
import org.talend.core.repository.utils.TDQServiceRegister;
|
||||
import org.talend.designer.business.diagram.custom.IDiagramModelService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
@@ -86,9 +88,21 @@ public class EmptyRecycleBinAction extends AContextualAction {
|
||||
// TDI-20542
|
||||
List<IRepositoryNode> originalChildren = node.getChildren();
|
||||
final List<IRepositoryNode> children = new ArrayList<IRepositoryNode>(originalChildren);
|
||||
// MOD qiongli 2012-12-12 TUP-273 if a connection in recycle bin which depended by DQ analysis,should give a
|
||||
// warning then return.
|
||||
if (children.size() == 0) {
|
||||
return;
|
||||
} else if (children.size() > 1) {
|
||||
}
|
||||
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance().getResourceChangeService(
|
||||
AbstractResourceChangesService.class);
|
||||
if (resChangeService != null) {
|
||||
List<IRepositoryNode> dependentNodes = resChangeService.getDependentConnNodesInRecycleBin(children);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resChangeService.openDependcesDialog(dependentNodes);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (children.size() > 1) {
|
||||
message = Messages.getString("DeleteAction.dialog.messageAllElements") + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
|
||||
Messages.getString("DeleteAction.dialog.message2"); //$NON-NLS-1$;
|
||||
} else {
|
||||
|
||||
@@ -94,12 +94,13 @@ public class PasteAction extends AContextualAction {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(TreeViewer viewer, IStructuredSelection selection) {
|
||||
boolean enabled = true;
|
||||
if (selection.size() != 1) { // only one current node selected
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
// if (selection.size() != 1) { // only one current node selected
|
||||
// setEnabled(false);
|
||||
// return;
|
||||
// }
|
||||
|
||||
Object targetObject = selection.getFirstElement();
|
||||
if (!(targetObject instanceof RepositoryNode)) {
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 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.ui.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.wizard.WizardDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
import org.eclipse.ui.IEditorReference;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.editor.RepositoryEditorInput;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.model.RepositoryNodeUtilities;
|
||||
import org.talend.repository.ui.actions.AContextualAction;
|
||||
import org.talend.repository.ui.wizards.folder.FolderWizard;
|
||||
|
||||
/**
|
||||
* Action used to create a new folder in repository.<br/>
|
||||
*
|
||||
* $Id: CreateFolderAction.java 1100 2006-12-19 14:27:01Z amaumont $
|
||||
*
|
||||
*/
|
||||
public class RenameFolderAction extends AContextualAction {
|
||||
|
||||
public RenameFolderAction() {
|
||||
super();
|
||||
this.setText(Messages.getString("RenameFolderAction.action.title")); //$NON-NLS-1$
|
||||
this.setToolTipText(Messages.getString("RenameFolderAction.action.toolTipText")); //$NON-NLS-1$
|
||||
this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.FOLDER_CLOSE_ICON));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||
*/
|
||||
@Override
|
||||
protected void doRun() {
|
||||
ISelection selection = getSelection();
|
||||
Object obj = ((IStructuredSelection) selection).getFirstElement();
|
||||
if (obj == null) {
|
||||
MessageDialog.openWarning(new Shell(), Messages.getString("RenameFolderAction.warning.cannotFind.title"), Messages //$NON-NLS-1$
|
||||
.getString("RenameFolderAction.warning.cannotFind.message")); //$NON-NLS-1$
|
||||
return;
|
||||
}
|
||||
|
||||
RepositoryNode node = (RepositoryNode) obj;
|
||||
|
||||
// Check if some jobs in the folder are currently opened:
|
||||
String firstChildOpen = getFirstOpenedChild(node);
|
||||
if (firstChildOpen != null) {
|
||||
MessageDialog.openWarning(new Shell(), Messages.getString("RenameFolderAction.warning.editorOpen.title"), Messages //$NON-NLS-1$
|
||||
.getString("RenameFolderAction.warning.editorOpen.message", firstChildOpen, node //$NON-NLS-1$
|
||||
.getProperties(EProperties.LABEL)));
|
||||
return;
|
||||
}
|
||||
|
||||
ERepositoryObjectType objectType = null;
|
||||
IPath path = null;
|
||||
|
||||
path = RepositoryNodeUtilities.getPath(node);
|
||||
objectType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
|
||||
openFolderWizard(node, objectType, path);
|
||||
}
|
||||
|
||||
protected void openFolderWizard(RepositoryNode node, ERepositoryObjectType objectType, IPath path) {
|
||||
if (objectType != null) {
|
||||
FolderWizard processWizard = new FolderWizard(path, objectType, node.getObject().getLabel());
|
||||
Shell activeShell = Display.getCurrent().getActiveShell();
|
||||
WizardDialog dialog = new WizardDialog(activeShell, processWizard);
|
||||
dialog.setPageSize(400, 60);
|
||||
dialog.create();
|
||||
dialog.open();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
|
||||
* org.eclipse.jface.viewers.IStructuredSelection)
|
||||
*/
|
||||
@Override
|
||||
public void init(TreeViewer viewer, IStructuredSelection selection) {
|
||||
boolean canWork = !selection.isEmpty() && selection.size() == 1;
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
if (factory.isUserReadOnlyOnCurrentProject()) {
|
||||
canWork = false;
|
||||
}
|
||||
if (canWork) {
|
||||
Object o = selection.getFirstElement();
|
||||
RepositoryNode node = (RepositoryNode) o;
|
||||
Object obj = node.getProperties(EProperties.LABEL);
|
||||
switch (node.getType()) {
|
||||
case SIMPLE_FOLDER:
|
||||
String label = null;
|
||||
if (obj instanceof String) {
|
||||
label = (String) obj;
|
||||
}
|
||||
if (node.getContentType() == ERepositoryObjectType.JOB_DOC
|
||||
|| node.getContentType() == ERepositoryObjectType.JOBLET_DOC
|
||||
|| (node.getContentType() == ERepositoryObjectType.SQLPATTERNS && !isUnderUserDefined(node))
|
||||
|| RepositoryConstants.USER_DEFINED.equals(label)) {
|
||||
canWork = false;
|
||||
}
|
||||
if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
|
||||
canWork = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
canWork = false;
|
||||
}
|
||||
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
|
||||
canWork = false;
|
||||
}
|
||||
}
|
||||
setEnabled(canWork);
|
||||
}
|
||||
|
||||
protected String getFirstOpenedChild(IRepositoryNode node) {
|
||||
if (node.hasChildren()) {
|
||||
IWorkbenchPage page = getActivePage();
|
||||
IEditorReference[] editorReferences = page.getEditorReferences();
|
||||
List<String> openEditor = new ArrayList<String>();
|
||||
for (IEditorReference tmp : editorReferences) {
|
||||
try {
|
||||
IEditorInput editorInput = tmp.getEditorInput();
|
||||
if (editorInput instanceof RepositoryEditorInput) {
|
||||
RepositoryEditorInput rei = (RepositoryEditorInput) editorInput;
|
||||
openEditor.add(rei.getItem().getProperty().getId());
|
||||
}
|
||||
} catch (PartInitException e) {
|
||||
ExceptionHandler.process(e, Level.WARN);
|
||||
}
|
||||
}
|
||||
|
||||
List<IRepositoryNode> children = node.getChildren();
|
||||
for (IRepositoryNode currentNode : children) {
|
||||
if (currentNode.getType() == ENodeType.REPOSITORY_ELEMENT) {
|
||||
if (openEditor.contains(currentNode.getObject().getId())) {
|
||||
return currentNode.getObject().getLabel();
|
||||
}
|
||||
} else if (currentNode.getType() == ENodeType.SIMPLE_FOLDER) {
|
||||
String childOpen = getFirstOpenedChild(currentNode);
|
||||
if (childOpen != null) {
|
||||
return childOpen;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -38,8 +38,10 @@ import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ICoreService;
|
||||
import org.talend.core.ITDQRepositoryService;
|
||||
import org.talend.core.model.metadata.builder.connection.AbstractMetadataObject;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.FolderItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
@@ -106,11 +108,22 @@ public class RestoreAction extends AContextualAction {
|
||||
// IPath path = restoreFolder.restoreFolderIfNotExists(nodeType, node);
|
||||
String oldPath = node.getObject().getProperty().getItem().getState().getPath();
|
||||
IPath path = new Path(oldPath);
|
||||
if (node.getObject().getProperty().getItem() instanceof FolderItem) {
|
||||
node.getObject().getProperty().getItem().getState().setDeleted(false);
|
||||
} else {
|
||||
Item item = node.getObject().getProperty().getItem();
|
||||
if (item instanceof FolderItem) {
|
||||
item.getState().setDeleted(false);
|
||||
} else {
|
||||
RestoreObjectAction restoreObjectAction = RestoreObjectAction.getInstance();
|
||||
restoreObjectAction.execute(node, null, path);
|
||||
// MOD qiongli 2012-10-16 TDQ-6166 notify sql exploere when restore a connection.
|
||||
if (item instanceof DatabaseConnectionItem) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepService = (ITDQRepositoryService) GlobalServiceRegister.getDefault()
|
||||
.getService(ITDQRepositoryService.class);
|
||||
if (tdqRepService != null) {
|
||||
tdqRepService.notifySQLExplorer(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
|
||||
@@ -51,6 +51,7 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
*/
|
||||
class ContextsProvide extends LabelProvider implements ITableLabelProvider {
|
||||
|
||||
@Override
|
||||
public Image getColumnImage(Object element, int columnIndex) {
|
||||
if (columnIndex == 0) {
|
||||
if (element instanceof ContextReferenceBean) {
|
||||
@@ -82,6 +83,7 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColumnText(Object element, int columnIndex) {
|
||||
ContextReferenceBean bean = (ContextReferenceBean) element;
|
||||
switch (columnIndex) {
|
||||
@@ -121,7 +123,7 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
Item item = objToDelete.getProperty().getItem();
|
||||
if (item != null) {
|
||||
setMessage(Messages.getString(
|
||||
"ContextReferenceDialog.Messages", item.getProperty().getLabel(), item.getProperty().getVersion())); //$NON-NLS-1$
|
||||
"ContextReferenceDialog.kindMessages1", item.getProperty().getLabel(), item.getProperty().getVersion())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
setHelpAvailable(false);
|
||||
@@ -136,10 +138,11 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = (Composite) super.createDialogArea(parent);
|
||||
@@ -153,16 +156,19 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
viewer.setLabelProvider(new ContextsProvide());
|
||||
viewer.setContentProvider(new IStructuredContentProvider() {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
if (inputElement != null) {
|
||||
return ((List) inputElement).toArray();
|
||||
|
||||
@@ -38,7 +38,6 @@ import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.business.BusinessType;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
@@ -96,8 +95,9 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
case DND.DROP_COPY:
|
||||
RunnableWithReturnValue runnable = new CopyRunnable(
|
||||
Messages.getString("RepositoryDropAdapter_copyingItems"), data, targetNode); //$NON-NLS-1$
|
||||
runInProgressDialog(runnable);
|
||||
toReturn = (Boolean) runnable.getReturnValue();
|
||||
// runInProgressDialog(runnable);
|
||||
// toReturn = (Boolean) runnable.getReturnValue();
|
||||
runCopy(data, targetNode);
|
||||
break;
|
||||
case DND.DROP_MOVE:
|
||||
runnable = new MoveRunnable(Messages.getString("RepositoryDropAdapter_movingItems"), data, targetNode); //$NON-NLS-1$
|
||||
@@ -149,10 +149,10 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
// iRepositoryNode.getObject().getProperty().getItem().eResource().unload();
|
||||
Item item = repositoryNode.getObject() == null ? null : repositoryNode.getObject().getProperty().getItem();
|
||||
if (resourceChangeService != null && null != item) {
|
||||
boolean handleResourceChange = resourceChangeService.handleResourceChange(((ConnectionItem) item)
|
||||
.getConnection());
|
||||
if (!handleResourceChange) {
|
||||
return handleResourceChange;
|
||||
List<IRepositoryNode> dependentNodes = resourceChangeService.getDependentNodes(repositoryNode);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resourceChangeService.openDependcesDialog(dependentNodes);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,8 +167,9 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
*/
|
||||
@Override
|
||||
public boolean validateDrop(Object target, int operation, TransferData transferType) {
|
||||
if (target == null)
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
super.validateDrop(target, operation, transferType);
|
||||
boolean isValid = true;
|
||||
for (Object obj : ((StructuredSelection) getViewer().getSelection()).toArray()) {
|
||||
@@ -229,9 +230,29 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
private void runCopy(final Object data, final RepositoryNode targetNode) {
|
||||
String copyName = "User action : Copy Object"; //$NON-NLS-1$
|
||||
RepositoryWorkUnit<Object> repositoryWorkUnit = new RepositoryWorkUnit<Object>(copyName, CopyObjectAction.getInstance()) {
|
||||
|
||||
@Override
|
||||
protected void run() throws LoginException, PersistenceException {
|
||||
try {
|
||||
for (Object obj : ((StructuredSelection) data).toArray()) {
|
||||
final RepositoryNode sourceNode = (RepositoryNode) obj;
|
||||
CopyObjectAction.getInstance().execute(sourceNode, targetNode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new PersistenceException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
|
||||
}
|
||||
|
||||
private void runInProgressDialog(final IWorkspaceRunnable op) {
|
||||
final IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
@@ -279,6 +300,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
this.targetNode = targetNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
monitor.beginTask(getTaskName(), IProgressMonitor.UNKNOWN);
|
||||
String copyName = "User action : Copy Object"; //$NON-NLS-1$
|
||||
@@ -319,6 +341,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
this.targetNode = targetNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final IProgressMonitor monitor) throws CoreException {
|
||||
monitor.beginTask(getTaskName(), IProgressMonitor.UNKNOWN);
|
||||
// MOD gdbu 2011-10-9 TDQ-3545
|
||||
@@ -340,7 +363,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
}
|
||||
MessageDialog.openInformation(getViewer().getControl().getShell(),
|
||||
Messages.getString("RepositoryDropAdapter_moveTitle"), //$NON-NLS-1$
|
||||
errorMsg); //$NON-NLS-1$
|
||||
errorMsg);
|
||||
setReturnValue(false);
|
||||
return;
|
||||
}
|
||||
@@ -371,6 +394,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
|
||||
protected void run() throws LoginException, PersistenceException {
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
for (Object obj : ((StructuredSelection) data).toArray()) {
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 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.ui.wizards.folder;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.wizard.Wizard;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
* Wizard for the creation of a new project. <br/>
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
public class FolderWizard extends Wizard {
|
||||
|
||||
/** Main page. */
|
||||
private FolderWizardPage mainPage;
|
||||
|
||||
private IPath path;
|
||||
|
||||
private ERepositoryObjectType type;
|
||||
|
||||
private final String defaultLabel;
|
||||
|
||||
/**
|
||||
* Constructs a new NewProjectWizard.
|
||||
*
|
||||
* @param author Project author.
|
||||
* @param server
|
||||
* @param password
|
||||
*/
|
||||
public FolderWizard(IPath path, ERepositoryObjectType type, String defaultLabel) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.type = type;
|
||||
this.defaultLabel = defaultLabel;
|
||||
setDefaultPageImageDescriptor(ImageProvider.getImageDesc(ECoreImage.FOLDER_WIZ));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.wizard.Wizard#addPages()
|
||||
*/
|
||||
@Override
|
||||
public void addPages() {
|
||||
mainPage = new FolderWizardPage(defaultLabel);
|
||||
addPage(mainPage);
|
||||
if (defaultLabel != null) {
|
||||
setWindowTitle(Messages.getString("RenameFolderAction.action.title")); //$NON-NLS-1$
|
||||
} else {
|
||||
setWindowTitle(Messages.getString("NewFolderWizard.windowTitle")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.wizard.Wizard#performFinish()
|
||||
*/
|
||||
@Override
|
||||
public boolean performFinish() {
|
||||
|
||||
final String folderName = mainPage.getName();
|
||||
final IProxyRepositoryFactory repositoryFactory = ProxyRepositoryFactory.getInstance();
|
||||
|
||||
if (defaultLabel == null) {
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
repositoryFactory.createFolder(type, path, folderName);
|
||||
} catch (PersistenceException e) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass())
|
||||
.getSymbolicName(), "Error", e));
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
ISchedulingRule schedulingRule = workspace.getRoot();
|
||||
// the update the project files need to be done in the workspace runnable to avoid all
|
||||
// notification
|
||||
// of changes before the end of the modifications.
|
||||
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
|
||||
} catch (CoreException e) {
|
||||
throw new InvocationTargetException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
new ProgressMonitorDialog(getShell()).run(true, true, iRunnableWithProgress);
|
||||
return true;
|
||||
} catch (InvocationTargetException e1) {
|
||||
Throwable targetException = e1.getTargetException();
|
||||
MessageDialog.openError(getShell(), Messages.getString("NewFolderWizard.failureTitle"), Messages //$NON-NLS-1$
|
||||
.getString("NewFolderWizard.failureText")); //$NON-NLS-1$
|
||||
ExceptionHandler.process(targetException);
|
||||
} catch (InterruptedException e1) {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
repositoryFactory.renameFolder(type, path, folderName);
|
||||
return true;
|
||||
} catch (PersistenceException e) {
|
||||
MessageDialog.openError(getShell(), Messages.getString("NewFolderWizard.failureTitle"), Messages //$NON-NLS-1$
|
||||
.getString("NewFolderWizard.failureText")); //$NON-NLS-1$
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isValid(String folderName) {
|
||||
IProxyRepositoryFactory repositoryFactory = ProxyRepositoryFactory.getInstance();
|
||||
try {
|
||||
if (defaultLabel == null) {
|
||||
return repositoryFactory.isPathValid(type, path, folderName);
|
||||
} else {
|
||||
return repositoryFactory.isPathValid(type, path.removeLastSegments(1), folderName);
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFinish() {
|
||||
return super.canFinish() && !mainPage.getName().equals(defaultLabel);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 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.ui.wizards.folder;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.wizard.WizardPage;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.core.repository.CoreRepositoryPlugin;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
/**
|
||||
* Page for new project details. <br/>
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
public class FolderWizardPage extends WizardPage {
|
||||
|
||||
private static final String DESC = Messages.getString("NewFolderWizard.description"); //$NON-NLS-1$
|
||||
|
||||
private Text nameText;
|
||||
|
||||
private IStatus nameStatus;
|
||||
|
||||
private final String defaultLabel;
|
||||
|
||||
/**
|
||||
* Constructs a new NewProjectWizardPage.
|
||||
*
|
||||
*/
|
||||
public FolderWizardPage(String defaultLabel) {
|
||||
super("WizardPage"); //$NON-NLS-1$
|
||||
this.defaultLabel = defaultLabel;
|
||||
|
||||
setTitle(Messages.getString("NewFolderWizard.title")); //$NON-NLS-1$
|
||||
if (defaultLabel == null) {
|
||||
setDescription(DESC);
|
||||
} else {
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
nameStatus = createOkStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
Composite container = new Composite(parent, SWT.NONE);
|
||||
|
||||
GridLayout layout = new GridLayout(2, false);
|
||||
container.setLayout(layout);
|
||||
|
||||
// Name
|
||||
Label nameLab = new Label(container, SWT.NONE);
|
||||
nameLab.setText(Messages.getString("NewFolderWizard.label")); //$NON-NLS-1$
|
||||
|
||||
nameText = new Text(container, SWT.BORDER);
|
||||
nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
setControl(container);
|
||||
addListeners();
|
||||
setPageComplete(false);
|
||||
setDefaultValues();
|
||||
}
|
||||
|
||||
private void setDefaultValues() {
|
||||
if (defaultLabel != null) {
|
||||
setName(defaultLabel);
|
||||
}
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
nameText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
checkFieldsValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC ocarbone Comment method "checkField".
|
||||
*/
|
||||
protected void checkFieldsValue() {
|
||||
// Field Name
|
||||
if (nameText.getText().length() == 0) {
|
||||
nameStatus = new Status(IStatus.ERROR, CoreRepositoryPlugin.PLUGIN_ID, IStatus.OK,
|
||||
Messages.getString("NewFolderWizard.nameEmpty"), null); //$NON-NLS-1$
|
||||
} else if (!Pattern.matches(RepositoryConstants.FOLDER_PATTERN, nameText.getText())) {
|
||||
nameStatus = new Status(IStatus.ERROR, CoreRepositoryPlugin.PLUGIN_ID, IStatus.OK,
|
||||
Messages.getString("NewFolderWizard.nameIncorrect"), null); //$NON-NLS-1$
|
||||
} else if ((defaultLabel == null || !defaultLabel.equals(nameText.getText()))
|
||||
&& !((FolderWizard) getWizard()).isValid(nameText.getText())) {
|
||||
nameStatus = new Status(IStatus.ERROR, CoreRepositoryPlugin.PLUGIN_ID, IStatus.OK, Messages.getString(
|
||||
"NewFolderWizard.nameInvalid", nameText.getText()), null); //$NON-NLS-1$
|
||||
} else {
|
||||
nameStatus = createOkStatus();
|
||||
}
|
||||
updatePageStatus();
|
||||
}
|
||||
|
||||
private void updatePageStatus() {
|
||||
setMessage(findMostSevere());
|
||||
setPageComplete(findMostSevere().getSeverity() != IStatus.ERROR);
|
||||
}
|
||||
|
||||
private IStatus findMostSevere() {
|
||||
return nameStatus;
|
||||
}
|
||||
|
||||
private void setMessage(IStatus status) {
|
||||
String message2 = status.getMessage();
|
||||
if (IStatus.ERROR == status.getSeverity()) {
|
||||
setErrorMessage(message2);
|
||||
setMessage(""); //$NON-NLS-1$
|
||||
} else {
|
||||
if (message2.length() == 0 && defaultLabel == null) {
|
||||
message2 = DESC;
|
||||
}
|
||||
setMessage(message2);
|
||||
setErrorMessage(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return nameText.getText();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
nameText.setText(name);
|
||||
}
|
||||
|
||||
private static IStatus createOkStatus() {
|
||||
return new Status(IStatus.OK, CoreRepositoryPlugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
Metadata=Meta-Daten
|
||||
TalendDataCollectorPreview=Vorschau
|
||||
prefs=Talend
|
||||
|
||||
1
org.talend.core.runtime.nl/plugin_nl.properties
Normal file
1
org.talend.core.runtime.nl/plugin_nl.properties
Normal file
@@ -0,0 +1 @@
|
||||
prefs=Talend
|
||||
@@ -283,7 +283,10 @@ OpenXSDFileDialog.confirm=Best
|
||||
repository.column=Spalte
|
||||
repository.recyclebin=Papierkorb
|
||||
repository.metadataColumn=Metadata Spalte
|
||||
EComponentCategory.validationRules=Validierungsregeln
|
||||
repository.metadataValidationRules=Validierungsregeln
|
||||
RepositoryContentProvider.repositoryLabel.sapFunction=SAP Funktionen
|
||||
repository.code=Code
|
||||
TalendDataCollectorPreviewPreferencePage_Key=Schlüsselwert
|
||||
repository.servicesPort=Port
|
||||
BinRepositoryNode.label=Papierkorb
|
||||
|
||||
@@ -526,3 +526,4 @@ RepositoryUpdateManager.MessagesForTDQ=Do you want to propagate the modification
|
||||
EComponentCategory.executeJob=Execute Job
|
||||
EComponentCategory.monitoring=Monitoring
|
||||
BinRepositoryNode.label=Recycle bin
|
||||
EMetadataEncoding.Latin9=Latin9
|
||||
|
||||
@@ -453,3 +453,4 @@ RepositoryUpdateManager.MessagesForTDQ=Voulez-vous propager les modifications
|
||||
EComponentCategory.executeJob=Exécuter le Job
|
||||
EComponentCategory.monitoring=Monitoring
|
||||
BinRepositoryNode.label=Corbeille
|
||||
EMetadataEncoding.Latin9=Latin9
|
||||
|
||||
@@ -482,3 +482,5 @@ TalendDataCollectorUploadingPreferencePage_UploadPeriod=\u30A2\u30C3\u30D7\u30ED
|
||||
TalendDataCollectorUploadingPreferencePage_Days=\u65E5
|
||||
repository.servicesOperation=\u64CD\u4F5C
|
||||
repository.servicesPort=\u30DD\u30FC\u30C8
|
||||
BinRepositoryNode.label=\u3054\u307F\u7BB1
|
||||
EMetadataEncoding.Latin9=Latin9
|
||||
|
||||
@@ -1,5 +1,39 @@
|
||||
ComponentsFormatPreferencePage.add=Toevoegen
|
||||
ComponentsFormatPreferencePage.ErrorTitle=Fout
|
||||
ComponentToRepositoryProperty.error=Fout
|
||||
ContextProcessSection.29=Fout
|
||||
ContextProcessSection.49=Standaard Context
|
||||
ContextProcessSection.6=Nieuwe Context
|
||||
ContextProcessSection.7=Naam voor nieuwe Context
|
||||
ContextProcessSection.errorTitle=Fout
|
||||
ConextTableValuesComposite.nameLabel=Naam
|
||||
ContextSetConfigurationDialog.nameNotValid=Ongeldige naam
|
||||
ContextTemplateComposite.CommentLabel=Opmerking
|
||||
ContextTemplateComposite.nameLabel=Naam
|
||||
ContextTemplateComposite.sourceLabel=Bron
|
||||
EComponentCategory_assignment=Toewijzing
|
||||
EComponentCategory_properties=Eigenschappen
|
||||
EComponentCategory_sqlTemplate=SQL Template
|
||||
MetadataTableEditorView.CommentTitle=Opmerking
|
||||
ProcessorUtilities.finalizeBuild=Bouwen afronden...
|
||||
ProcessorUtilities.generatingJob=Job genereren
|
||||
ProcessorUtilities.loadingJob=Job laden...
|
||||
PropertiesWizardPage.Name=Naam
|
||||
RoutinesFunctionProposal.User=Gebruiker
|
||||
VariableItemEditor.name=Naam
|
||||
VariableItemEditor.new=Nieuw
|
||||
repository.concept=Concept
|
||||
EUpdateItemType.Name=Naam
|
||||
ApplicationActionBarAdvisor.menuFileLabel=&Bestand
|
||||
ApplicationActionBarAdvisor.navigateLabel=&Navigeer
|
||||
ApplicationActionBarAdvisor.gotoLabel=&Ga naar
|
||||
ApplicationActionBarAdvisor.projectLabel=&Project
|
||||
ApplicationActionBarAdvisor.menuWindowLabel=&Venster
|
||||
ApplicationActionBarAdvisor.menuHelpLabel=&Help
|
||||
BusinessAppearanceComposite.textAlignmentGroup=Tekst uitlijning
|
||||
BusinessAppearanceComposite.textAlignment.horizontal=Horizontaal
|
||||
BusinessAppearanceComposite.textAlignment.vertical=Verticaal
|
||||
BusinessAppearanceComposite.textAlignment.horizontal.centre=Centreer
|
||||
BusinessAppearanceComposite.textAlignment.vertical.centre=Centreer
|
||||
ConnectionBean.Local=Lokaal
|
||||
ConnectionBean.DefaultConnection=Standaard verbinding
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<dbType type="BINARY_DOUBLE" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TIMESTAMP" defaultPrecision="6" ignoreLen="true" ignorePre="false"/>
|
||||
<dbType type="TIMESTAMP WITH TIME ZONE" defaultLength="6" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="BLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BFILE" ignoreLen="true" ignorePre="true"/>
|
||||
@@ -53,6 +54,7 @@
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" default="true"/>
|
||||
<dbType type="TIMESTAMP"/>
|
||||
<dbType type="TIMESTAMP WITH TIME ZONE"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DEC" default="true"/>
|
||||
@@ -163,6 +165,9 @@
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP WITH TIME ZONE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BLOB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
<dbType type="BYTEINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BYTE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHAR" defaultLength="50" ignorePre="true"/>
|
||||
<dbType type="CHARACTER" defaultLength="50" ignorePre="true"/>
|
||||
<dbType type="CLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DEC" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="FLOAT" ignorePre="true" />
|
||||
<dbType type="I" ignoreLen="true" ignorePre="true" />
|
||||
@@ -29,6 +31,10 @@
|
||||
<dbType type="I2" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TS" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TZ" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONG VARCHAR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="NUMERIC" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="REAL" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
|
||||
@@ -61,39 +67,47 @@
|
||||
<dbType type="VARBYTE"/>
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="BYTE" />
|
||||
<dbType type="CHAR" default="true"/>
|
||||
<dbType type="CHARACTER"/>
|
||||
<dbType type="VARCHAR"/>
|
||||
<dbType type="NCHAR"/>
|
||||
<dbType type="VARCHAR"/>
|
||||
<dbType type="CV"/>
|
||||
<dbType type="LONG VARCHAR"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" default="true" />
|
||||
<dbType type="DA"/>
|
||||
<dbType type="TIMESTAMP"/>
|
||||
<dbType type="TIME"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="FLOAT" />
|
||||
<dbType type="D"/>
|
||||
<dbType type="DEC"/>
|
||||
<dbType type="NUMERIC"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="FLOAT" />
|
||||
<dbType type="DECIMAL"/>
|
||||
<dbType type="FLOAT" default="true"/>
|
||||
<dbType type="REAL"/>
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="DECIMAL"/>
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="DEC"/>
|
||||
<dbType type="NUMERIC"/>
|
||||
<dbType type="F" />
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INTEGER" default="true" />
|
||||
<dbType type="I" default="true" />
|
||||
<dbType type="I" />
|
||||
<dbType type="SMALLINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="INTEGER" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="INTEGER"/>
|
||||
<dbType type="BIGINT" default="true"/>
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="BLOB" default="true"/>
|
||||
@@ -118,14 +132,16 @@
|
||||
<dbType type="GV"/>
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="INTEGER" default="true" />
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INTEGER"/>
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="VARCHAR" default="true" />
|
||||
<dbType type="NCHAR" />
|
||||
<dbType type="VARCHAR"/>
|
||||
<dbType type="LONG VARCHAR"/>
|
||||
<dbType type="CHAR" />
|
||||
<dbType type="CF" />
|
||||
<dbType type="CHARACTER"/>
|
||||
<dbType type="NCHAR" />
|
||||
<dbType type="CF" />
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes><!-- Adviced mappings -->
|
||||
@@ -136,14 +152,15 @@
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_Integer" default="true"/>
|
||||
<talendType type="id_Long" />
|
||||
<talendType type="id_Long" default="true"/>
|
||||
<talendType type="id_Integer"/>
|
||||
</dbType>
|
||||
<dbType type="BYTEINT">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BYTE">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
<talendType type="id_Character" default="true" />
|
||||
<talendType type="id_Byte" />
|
||||
</dbType>
|
||||
<dbType type="CLOB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
@@ -151,6 +168,9 @@
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
@@ -158,14 +178,29 @@
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="DEC">
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
</dbType>
|
||||
<dbType type="NUMERIC">
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="REAL">
|
||||
<talendType type="id_Double" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONG VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="CHARACTER">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="I">
|
||||
<talendType type="id_Long"/>
|
||||
|
||||
@@ -10,13 +10,12 @@
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.utils;
|
||||
package org.talend.core;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
|
||||
/**
|
||||
@@ -28,7 +27,7 @@ public class BrandingChecker {
|
||||
|
||||
private static boolean isBrandingChanged;
|
||||
|
||||
private static final String LAST_STARTED_PRODUCT = "last started product";
|
||||
private static final String LAST_STARTED_PRODUCT = "last_started_product";
|
||||
|
||||
public static boolean isBrandingChanged() {
|
||||
if (!initialized) {
|
||||
@@ -45,8 +44,9 @@ public class BrandingChecker {
|
||||
}
|
||||
display.syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IPreferenceStore preferenceStore = CorePlugin.getDefault().getPreferenceStore();
|
||||
IPreferenceStore preferenceStore = CoreRuntimePlugin.getInstance().getPreferenceStore();
|
||||
String oldBrandingName = preferenceStore.getString(LAST_STARTED_PRODUCT);
|
||||
if (oldBrandingName == null || oldBrandingName.equals("") || !oldBrandingName.equals(fullProductName)) {
|
||||
isBrandingChanged = true;
|
||||
@@ -34,9 +34,6 @@ public class GlobalServiceRegister {
|
||||
// The shared instance
|
||||
private static GlobalServiceRegister instance = new GlobalServiceRegister();
|
||||
|
||||
|
||||
|
||||
|
||||
public static GlobalServiceRegister getDefault() {
|
||||
return instance;
|
||||
}
|
||||
@@ -45,6 +42,8 @@ public class GlobalServiceRegister {
|
||||
|
||||
private Map<Class<?>, AbstractDQModelService> dqModelServices = new HashMap<Class<?>, AbstractDQModelService>();
|
||||
|
||||
private static IConfigurationElement[] configurationDQDriverElements = null;
|
||||
|
||||
private static IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
|
||||
private static IConfigurationElement[] configurationElements = registry == null ? null : registry
|
||||
@@ -76,6 +75,38 @@ public class GlobalServiceRegister {
|
||||
return true;
|
||||
}
|
||||
|
||||
private IConfigurationElement[] getConfigurationDQDriverElements() {
|
||||
if (configurationDQDriverElements == null) {
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
configurationDQDriverElements = (registry == null ? null : registry
|
||||
.getConfigurationElementsFor("org.talend.metadata.managment.DBDriver_extension")); //$NON-NLS-1$
|
||||
}
|
||||
return configurationDQDriverElements;
|
||||
}
|
||||
|
||||
public IService getDQDriverService(Class<?> klass) {
|
||||
IService dqModelserviceInst = services.get(klass);
|
||||
if (dqModelserviceInst == null) {
|
||||
dqModelserviceInst = findDQModelService(klass);
|
||||
if (dqModelserviceInst != null) {
|
||||
services.put(klass, dqModelserviceInst);
|
||||
}
|
||||
}
|
||||
return dqModelserviceInst;
|
||||
}
|
||||
|
||||
public boolean isDQDriverServiceRegistered(Class klass) {
|
||||
IService service = services.get(klass);
|
||||
if (service == null) {
|
||||
service = findDQDriverService(klass);
|
||||
if (service == null) {
|
||||
return false;
|
||||
}
|
||||
services.put(klass, service);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isServiceRegistered(Class klass) {
|
||||
IService service = services.get(klass);
|
||||
if (service == null) {
|
||||
@@ -100,7 +131,7 @@ public class GlobalServiceRegister {
|
||||
service = findService(klass);
|
||||
if (service == null) {
|
||||
|
||||
throw new RuntimeException(Messages.getString("GlobalServiceRegister.ServiceNotRegistered", klass.getName())); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
throw new RuntimeException(Messages.getString("GlobalServiceRegister.ServiceNotRegistered", klass.getName())); //$NON-NLS-1$
|
||||
}
|
||||
services.put(klass, service);
|
||||
}
|
||||
@@ -115,8 +146,7 @@ public class GlobalServiceRegister {
|
||||
*/
|
||||
private IService findService(Class klass) {
|
||||
String key = klass.getName();
|
||||
for (int i = 0; i < configurationElements.length; i++) {
|
||||
IConfigurationElement element = configurationElements[i];
|
||||
for (IConfigurationElement element : configurationElements) {
|
||||
if (element.isValid()) {
|
||||
String id = element.getAttribute("serviceId"); //$NON-NLS-1$
|
||||
if (!key.endsWith(id)) {
|
||||
@@ -144,8 +174,7 @@ public class GlobalServiceRegister {
|
||||
* @return IService
|
||||
*/
|
||||
public IProviderService findService(String key) {
|
||||
for (int i = 0; i < configurationElements.length; i++) {
|
||||
IConfigurationElement element = configurationElements[i];
|
||||
for (IConfigurationElement element : configurationElements) {
|
||||
if (element.isValid()) {
|
||||
String id = element.getAttribute("serviceId"); //$NON-NLS-1$
|
||||
if (!key.equals(id)) {
|
||||
@@ -165,8 +194,7 @@ public class GlobalServiceRegister {
|
||||
}
|
||||
|
||||
private AbstractDQModelService findDQModelService(Class<?> klass) {
|
||||
for (int i = 0; i < configurationDQModelElements.length; i++) {
|
||||
IConfigurationElement element = configurationDQModelElements[i];
|
||||
for (IConfigurationElement element : configurationDQModelElements) {
|
||||
try {
|
||||
Object service = element.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
if (klass.isInstance(service)) {
|
||||
@@ -178,4 +206,21 @@ public class GlobalServiceRegister {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private IService findDQDriverService(Class<?> klass) {
|
||||
IConfigurationElement[] configDQModelElements = getConfigurationDQDriverElements();
|
||||
if (configDQModelElements != null) {
|
||||
for (IConfigurationElement element : configDQModelElements) {
|
||||
try {
|
||||
Object service = element.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
if (klass.isInstance(service)) {
|
||||
return (IService) service;
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -28,6 +27,7 @@ import org.eclipse.swt.graphics.Image;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.ui.swt.actions.ITreeContextualAction;
|
||||
import org.talend.core.model.general.LibraryInfo;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.ColumnNameChanged;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
@@ -61,7 +61,7 @@ public interface ICoreService extends IService {
|
||||
|
||||
public boolean getContextFlagFromQueryUtils();
|
||||
|
||||
public Map<String, List<URI>> getRoutineAndJars();
|
||||
public Map<String, List<LibraryInfo>> getRoutineAndJars();
|
||||
|
||||
public String getTemplateString();
|
||||
|
||||
|
||||
@@ -69,6 +69,14 @@ public interface ILibraryManagerService extends IService {
|
||||
*/
|
||||
public Set<String> list(IProgressMonitor... monitorWrap);
|
||||
|
||||
/**
|
||||
*
|
||||
* List all .dll files
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<String> listAllDllFiles();
|
||||
|
||||
public boolean delete(String jarName);
|
||||
|
||||
public boolean contains(String jarName);
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 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.swtbot.helpers;
|
||||
|
||||
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
|
||||
import org.talend.swtbot.TalendSwtBotForTos;
|
||||
|
||||
/**
|
||||
* DOC fzhong class global comment. Detailled comment
|
||||
*/
|
||||
public interface Helper {
|
||||
|
||||
SWTGefBot GEFBOT = new SWTGefBot();
|
||||
|
||||
TalendSwtBotForTos UTIL = new TalendSwtBotForTos();
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 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;
|
||||
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.utils.sugars.ReturnCode;
|
||||
|
||||
/**
|
||||
* created by talend on Dec 19, 2012 Detailled comment
|
||||
*
|
||||
*/
|
||||
public interface ITDQCompareService extends IService {
|
||||
|
||||
// ADD zshen 2012-12-19 to reuse reloadAction
|
||||
public ReturnCode reloadDatabase(ConnectionItem connectionItem);
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import java.util.Map;
|
||||
import org.eclipse.jface.dialogs.InputDialog;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
@@ -42,7 +41,7 @@ public interface ITDQRepositoryService extends IService {
|
||||
|
||||
public IViewPart getTDQRespositoryView();
|
||||
|
||||
public void openEditor(Item item);
|
||||
public void openConnectionEditor(Item item);
|
||||
|
||||
public void notifySQLExplorer(Item... items);
|
||||
|
||||
@@ -56,17 +55,20 @@ public interface ITDQRepositoryService extends IService {
|
||||
public void initProxyRepository();
|
||||
|
||||
public void addPartListener();
|
||||
//MOD klliu 2011-04-28 bug 20204 removing connection is synced to the connection view of SQL explore
|
||||
|
||||
// MOD klliu 2011-04-28 bug 20204 removing connection is synced to the connection view of SQL explore
|
||||
public boolean removeAliasInSQLExplorer(IRepositoryNode children);
|
||||
|
||||
// MOD zshen 2012-09-19 bug TDQ-5850 change the action for create softWareSystemResource, so need to delete it when
|
||||
// connection just be deleted.
|
||||
public boolean removeSoftWareSystem(IRepositoryNode children);
|
||||
|
||||
public void createParserRuleItem(ArrayList<HashMap<String, Object>> values, String parserRuleName);
|
||||
|
||||
public List<Map<String, String>> getPaserRulesFromResources(Object[] rules);
|
||||
|
||||
public List<Map<String, String>> getPaserRulesFromRules(Object parser);
|
||||
|
||||
// ADD qiongli 2011-9-13 TDQ-3317
|
||||
public void reloadDatabase(ContextItem contextItem);
|
||||
|
||||
// ADD zshen 2012-1-6 TDQ-4384
|
||||
public ReturnCode reloadDatabase(ConnectionItem connectionItem);
|
||||
|
||||
@@ -96,4 +98,19 @@ public interface ITDQRepositoryService extends IService {
|
||||
|
||||
// ADD xqliu 2012-07-24 TDQ-5853
|
||||
public void checkUsernameBeforeSaveConnection(ConnectionItem connectionItem);
|
||||
|
||||
// ADD qiongli 2012-11-12 TDQ-6166
|
||||
public void initAllConnectionsToSQLExplorer();
|
||||
|
||||
// Add yyin 2012-11-15 TDQ-6395
|
||||
public void saveConnectionWithDependency(ConnectionItem connectionItem);
|
||||
|
||||
// Add xqliu 2012-12-11 TDQ-5750
|
||||
public void refreshCurrentAnalysisEditor();
|
||||
|
||||
// Add zshen 2013-01-05
|
||||
public void refreshCurrentAnalysisAndConnectionEditor();
|
||||
|
||||
public void refreshConnectionEditor(Item item);
|
||||
|
||||
}
|
||||
|
||||
@@ -65,8 +65,11 @@ public enum EDatabase4DriverClassName {
|
||||
SAS(EDatabaseTypeName.SAS, "com.sas.rio.MVADriver"), //$NON-NLS-1$
|
||||
SQLITE(EDatabaseTypeName.SQLITE, "org.sqlite.JDBC"), //$NON-NLS-1$
|
||||
|
||||
SYBASEASE(EDatabaseTypeName.SYBASEASE, "com.sybase.jdbc3.jdbc.SybDriver"), //$NON-NLS-1$
|
||||
SYBASEIQ(EDatabaseTypeName.SYBASEIQ, "com.sybase.jdbc3.jdbc.SybDriver"), //$NON-NLS-1$
|
||||
SYBASEASE(EDatabaseTypeName.SYBASEASE, new String[] {
|
||||
"com.sybase.jdbc3.jdbc.SybDriver", "com.sybase.jdbc3.jdbc.SybDataSource" }, new String[] {}), //$NON-NLS-1$
|
||||
SYBASEIQ(
|
||||
EDatabaseTypeName.SYBASEIQ,
|
||||
new String[] { "com.sybase.jdbc3.jdbc.SybDriver", "com.sybase.jdbc3.jdbc.SybDataSource" }, new String[] {}), //$NON-NLS-1$
|
||||
|
||||
EXASOLUTION(EDatabaseTypeName.EXASOL, "com.exasol.jdbc.EXADriver"), //$NON-NLS-1$
|
||||
// MOD klliu 2010-06-04 bug 12819: upgrade jdbc driver class used in sql explorer
|
||||
|
||||
@@ -19,8 +19,6 @@ import java.util.List;
|
||||
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
|
||||
/**
|
||||
* cli class global comment. Detailled comment
|
||||
@@ -257,37 +255,16 @@ public enum EDatabaseConnTemplate {
|
||||
databaseType.add(typeName);
|
||||
}
|
||||
}
|
||||
if (!all && LanguageManager.getCurrentLanguage() == ECodeLanguage.PERL) {
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.MSSQL, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.INGRES, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.INTERBASE, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.INFORMIX, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.FIREBIRD, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.ACCESS, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.TERADATA, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.AS400, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.JAVADB_DERBYCLIENT, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.JAVADB_EMBEDED, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.JAVADB_JCCJDBC, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HSQLDB_IN_PROGRESS, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HSQLDB_SERVER, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HSQLDB_WEBSERVER, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.VERTICA, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HIVE, display));
|
||||
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HBASE, display));
|
||||
}
|
||||
if (sort) {
|
||||
String[] sortedArray = databaseType.toArray(new String[0]);
|
||||
Arrays.sort(sortedArray, new Comparator() {
|
||||
Arrays.sort(sortedArray, new Comparator<String>() {
|
||||
|
||||
public int compare(Object o1, Object o2) {
|
||||
if (o1 instanceof String && o2 instanceof String) {
|
||||
return o1.toString().compareTo(o2.toString());
|
||||
}
|
||||
return 0;
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return o1.compareTo(o2);
|
||||
}
|
||||
});
|
||||
return Arrays.asList(sortedArray);
|
||||
return new ArrayList<String>(Arrays.asList(sortedArray));
|
||||
}
|
||||
return databaseType;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
|
||||
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// MYSQL, add for 9594
|
||||
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.0-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.22-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_4(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 4", "MYSQL_4", "mysql-connector-java-3.1.14-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// add for 9594
|
||||
MSSQL(new DbVersion4Drivers(EDatabaseTypeName.MSSQL, "jtds-1.2.5.jar")), //$NON-NLS-1$
|
||||
|
||||
@@ -94,14 +94,18 @@ public final class UpdateRunJobComponentContextHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
// bug 9424
|
||||
obj = valueMap.get(PARAM_VALUE_COLUMN);
|
||||
if (obj != null && obj instanceof String) {
|
||||
String oldValue = (String) obj;
|
||||
String newValue = checkAndUpdateValue(nameMap, oldValue);
|
||||
if (newValue != null) { // update
|
||||
valueMap.put(PARAM_VALUE_COLUMN, newValue);
|
||||
changed = true;
|
||||
// Change value only for the job which context variable is changed. Changed by Marvin Wang
|
||||
// on Dec. 28, 2012 for bug TDI-24255.
|
||||
if (process.getId().equals(refJobId)) {
|
||||
// bug 9424
|
||||
obj = valueMap.get(PARAM_VALUE_COLUMN);
|
||||
if (obj != null && obj instanceof String) {
|
||||
String oldValue = (String) obj;
|
||||
String newValue = checkAndUpdateValue(nameMap, oldValue);
|
||||
if (newValue != null) { // update
|
||||
valueMap.put(PARAM_VALUE_COLUMN, newValue);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +120,7 @@ public final class UpdateRunJobComponentContextHelper {
|
||||
}
|
||||
// update the job state
|
||||
if (changed && process instanceof IProcess2) {
|
||||
CommandStack commandStack = ((IProcess2) process).getCommandStack();
|
||||
CommandStack commandStack = process.getCommandStack();
|
||||
if (commandStack != null) {
|
||||
commandStack.execute(new Command() {
|
||||
});
|
||||
@@ -321,7 +325,7 @@ public final class UpdateRunJobComponentContextHelper {
|
||||
boolean exist = false;
|
||||
for (IContext con : listContext) {
|
||||
String name = con.getName();
|
||||
if (((String) value).equals(name)) {
|
||||
if (value.equals(name)) {
|
||||
exist = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,13 @@
|
||||
package org.talend.core.model.general;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.json.JSONException;
|
||||
import org.talend.json.JSONObject;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
/**
|
||||
@@ -31,22 +34,26 @@ public class ConnectionBean implements Cloneable {
|
||||
|
||||
private static final String FIELDS_SEPARATOR = "#"; //$NON-NLS-1$
|
||||
|
||||
private String repositoryId;
|
||||
private static final String ID = "id"; //$NON-NLS-1$
|
||||
|
||||
private String name;
|
||||
private static final String DESCRIPTION = "description"; //$NON-NLS-1$
|
||||
|
||||
private String description;
|
||||
private static final String NAME = "name"; //$NON-NLS-1$
|
||||
|
||||
private String user;
|
||||
private static final String PASSWORD = "password"; //$NON-NLS-1$
|
||||
|
||||
private String password;
|
||||
private static final String USER = "user"; //$NON-NLS-1$
|
||||
|
||||
private static final String WORKSPACE = "workSpace"; //$NON-NLS-1$
|
||||
|
||||
private static final String DYNAMICFIELDS = "dynamicFields"; //$NON-NLS-1$
|
||||
|
||||
private static final String COMPLETE = "complete"; //$NON-NLS-1$
|
||||
|
||||
private JSONObject conDetails = new JSONObject();
|
||||
|
||||
private Map<String, String> dynamicFields = new HashMap<String, String>();
|
||||
|
||||
private boolean complete;
|
||||
|
||||
private String workSpace;
|
||||
|
||||
/**
|
||||
* DOC smallet ConnectionBean constructor comment.
|
||||
*/
|
||||
@@ -73,12 +80,33 @@ public class ConnectionBean implements Cloneable {
|
||||
return newConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for ID.
|
||||
*
|
||||
* @return the ID
|
||||
*/
|
||||
public String getRepositoryId() {
|
||||
return this.repositoryId;
|
||||
try {
|
||||
if (conDetails.has(ID)) {
|
||||
return conDetails.getString(ID);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ID.
|
||||
*
|
||||
* @param id the id to set
|
||||
*/
|
||||
public void setRepositoryId(String repositoryId) {
|
||||
this.repositoryId = repositoryId;
|
||||
try {
|
||||
conDetails.put(ID, repositoryId);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +115,14 @@ public class ConnectionBean implements Cloneable {
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
try {
|
||||
if (conDetails.has(DESCRIPTION)) {
|
||||
return conDetails.getString(DESCRIPTION);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +131,11 @@ public class ConnectionBean implements Cloneable {
|
||||
* @param description the description to set
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
try {
|
||||
conDetails.put(DESCRIPTION, description);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +144,14 @@ public class ConnectionBean implements Cloneable {
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
try {
|
||||
if (conDetails.has(NAME)) {
|
||||
return conDetails.getString(NAME);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +160,11 @@ public class ConnectionBean implements Cloneable {
|
||||
* @param name the name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
try {
|
||||
conDetails.put(NAME, name);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,7 +173,14 @@ public class ConnectionBean implements Cloneable {
|
||||
* @return the password
|
||||
*/
|
||||
public String getPassword() {
|
||||
return this.password;
|
||||
try {
|
||||
if (conDetails.has(PASSWORD)) {
|
||||
return conDetails.getString(PASSWORD);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +189,11 @@ public class ConnectionBean implements Cloneable {
|
||||
* @param password the password to set
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
try {
|
||||
conDetails.put(PASSWORD, password);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +202,14 @@ public class ConnectionBean implements Cloneable {
|
||||
* @return the user
|
||||
*/
|
||||
public String getUser() {
|
||||
return this.user;
|
||||
try {
|
||||
if (conDetails.has(USER)) {
|
||||
return conDetails.getString(USER);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,7 +218,11 @@ public class ConnectionBean implements Cloneable {
|
||||
* @param user the user to set
|
||||
*/
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
try {
|
||||
conDetails.put(USER, user);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,10 +231,14 @@ public class ConnectionBean implements Cloneable {
|
||||
* @return the workSpace
|
||||
*/
|
||||
public String getWorkSpace() {
|
||||
if (this.workSpace == null) {
|
||||
return ""; //$NON-NLS-1$
|
||||
try {
|
||||
if (conDetails.has(WORKSPACE)) {
|
||||
return conDetails.getString(WORKSPACE);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return this.workSpace;
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,11 +247,15 @@ public class ConnectionBean implements Cloneable {
|
||||
* @param workSpace the workSpace to set
|
||||
*/
|
||||
public void setWorkSpace(String workSpace) {
|
||||
this.workSpace = workSpace;
|
||||
try {
|
||||
conDetails.put(WORKSPACE, workSpace);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> getDynamicFields() {
|
||||
return this.dynamicFields;
|
||||
return dynamicFields;
|
||||
}
|
||||
|
||||
public void setDynamicFields(Map<String, String> dynamicFields) {
|
||||
@@ -183,53 +263,32 @@ public class ConnectionBean implements Cloneable {
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
return this.complete;
|
||||
try {
|
||||
if (conDetails.has(COMPLETE)) {
|
||||
return (Boolean) conDetails.get(COMPLETE);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setComplete(boolean complete) {
|
||||
this.complete = complete;
|
||||
try {
|
||||
conDetails.put(COMPLETE, complete);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionBean clone() throws CloneNotSupportedException {
|
||||
ConnectionBean object = (ConnectionBean) super.clone();
|
||||
object.setDynamicFields(new HashMap<String, String>(this.dynamicFields));
|
||||
return object;
|
||||
return writeFromJSON(this.getConDetails());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer string = new StringBuffer("Repository:" + getRepositoryId() + ", Name:" + getName() //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ ", Desription:" + getDescription() + ", User:" + getUser() + ", Password:" + getPassword() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ ", WorkSpace:" + getWorkSpace() + ", Complete:" + isComplete()); //$NON-NLS-1$//$NON-NLS-1$ //$NON-NLS-2$
|
||||
string.append(", Dyn:").append(dynamicFields); //$NON-NLS-1$
|
||||
return string.toString();
|
||||
}
|
||||
|
||||
public String readToString() {
|
||||
StringBuffer fields = new StringBuffer(256);
|
||||
fields.append(assertValue(getRepositoryId()));
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(assertValue(getName()));
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(assertValue(getDescription()));
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(assertValue(getUser()));
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(assertValue(getPassword()));
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(assertValue(getWorkSpace()));
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(isComplete());
|
||||
|
||||
if (dynamicFields.size() > 0) {
|
||||
for (String current : dynamicFields.keySet()) {
|
||||
fields.append(FIELDS_SEPARATOR);
|
||||
fields.append(current + DYN_FIELDS_SEPARATOR + dynamicFields.get(current));
|
||||
}
|
||||
}
|
||||
|
||||
return fields.toString();
|
||||
return this.getConDetails().toString();
|
||||
}
|
||||
|
||||
public static ConnectionBean writeFromString(String s) {
|
||||
@@ -244,41 +303,28 @@ public class ConnectionBean implements Cloneable {
|
||||
toReturn.setPassword(st[i++]);
|
||||
toReturn.setWorkSpace(st[i++]);
|
||||
toReturn.setComplete(new Boolean(st[i++]));
|
||||
JSONObject dynamicJson = new JSONObject();
|
||||
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);
|
||||
while (i < st.length) {
|
||||
String[] st2 = st[i++].split(DYN_FIELDS_SEPARATOR, -1);
|
||||
toReturn.getDynamicFields().put(st2[0], st2[1]);
|
||||
dynamicJson.put(st2[0], st2[1]);
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
// e.printStackTrace();
|
||||
ExceptionHandler.process(e);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// ConnectionBean tt = new ConnectionBean();
|
||||
// tt.setName("tagada");
|
||||
// System.out.println(tt);
|
||||
// tt.setDescription("MyDesc");
|
||||
// tt.setUser("smallet@talend.com");
|
||||
// tt.setPassword("");
|
||||
// tt.getDynamicFields().put("DbLogin", "root");
|
||||
// tt.getDynamicFields().put("DbPassword", "toor");
|
||||
// String test2 = tt.readToString();
|
||||
// ConnectionBean bean2 = writeFromString(test2);
|
||||
// System.out.println(bean2 + " (" + test2 + ")");
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "assertValue".
|
||||
*/
|
||||
private String assertValue(final String value) {
|
||||
if (value == null) {
|
||||
return ""; //$NON-NLS-1$
|
||||
public static ConnectionBean writeFromJSON(JSONObject json) {
|
||||
ConnectionBean toReturn = new ConnectionBean();
|
||||
try {
|
||||
toReturn.setConDetails(new JSONObject(json.toString()));
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return value;
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -289,8 +335,43 @@ public class ConnectionBean implements Cloneable {
|
||||
if (!(obj instanceof ConnectionBean)) {
|
||||
return false;
|
||||
}
|
||||
ConnectionBean other = (ConnectionBean) obj;
|
||||
|
||||
return this.readToString().equals(((ConnectionBean) obj).readToString());
|
||||
return this.getConDetails().toString().equals(other.getConDetails().toString());
|
||||
}
|
||||
|
||||
public JSONObject getConDetails() {
|
||||
JSONObject dynamicJson = new JSONObject();
|
||||
try {
|
||||
for (String key : dynamicFields.keySet()) {
|
||||
dynamicJson.put(key, dynamicFields.get(key));
|
||||
}
|
||||
conDetails.put(DYNAMICFIELDS, dynamicJson);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return conDetails;
|
||||
}
|
||||
|
||||
public void setConDetails(JSONObject conDetails) {
|
||||
this.conDetails = conDetails;
|
||||
try {
|
||||
if (conDetails.has(DYNAMICFIELDS)) {
|
||||
Object object = conDetails.get(DYNAMICFIELDS);
|
||||
if (object instanceof JSONObject) {
|
||||
JSONObject dynamicJson = (JSONObject) object;
|
||||
Iterator sortedKeys = dynamicJson.sortedKeys();
|
||||
while (sortedKeys.hasNext()) {
|
||||
String key = (String) sortedKeys.next();
|
||||
String value = dynamicJson.getString(key);
|
||||
dynamicFields.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.general;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class LibraryInfo {
|
||||
|
||||
private String libName;
|
||||
|
||||
private String bundleId;
|
||||
|
||||
public String getLibName() {
|
||||
return this.libName;
|
||||
}
|
||||
|
||||
public void setLibName(String libName) {
|
||||
this.libName = libName;
|
||||
}
|
||||
|
||||
public String getBundleId() {
|
||||
return this.bundleId;
|
||||
}
|
||||
|
||||
public void setBundleId(String bundleId) {
|
||||
this.bundleId = bundleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((this.bundleId == null) ? 0 : this.bundleId.hashCode());
|
||||
result = prime * result + ((this.libName == null) ? 0 : this.libName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
LibraryInfo other = (LibraryInfo) obj;
|
||||
if (this.bundleId == null) {
|
||||
if (other.bundleId != null)
|
||||
return false;
|
||||
} else if (!this.bundleId.equals(other.bundleId))
|
||||
return false;
|
||||
if (this.libName == null) {
|
||||
if (other.libName != null)
|
||||
return false;
|
||||
} else if (!this.libName.equals(other.libName))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class MetadataManager {
|
||||
if (!components.isEmpty()) {
|
||||
itemResource.getContents().addAll(components);
|
||||
}
|
||||
if(!dependencies.isEmpty()){
|
||||
if (!dependencies.isEmpty()) {
|
||||
itemResource.getContents().addAll(dependencies);
|
||||
}
|
||||
}
|
||||
@@ -123,6 +123,11 @@ public class MetadataManager {
|
||||
for (int i = 0; i < item.getConnection().getDataPackage().size(); i++) {
|
||||
if (item.getConnection().getDataPackage().get(i) instanceof RecordFile) {
|
||||
RecordFile rf = (RecordFile) item.getConnection().getDataPackage().get(i);
|
||||
// add for TDI-22857
|
||||
item.getConnection().setName(item.getProperty().getDisplayName());
|
||||
if (rf != null) {
|
||||
rf.setName("default");
|
||||
}
|
||||
returnlist.add(rf);
|
||||
}
|
||||
}
|
||||
@@ -142,8 +147,8 @@ public class MetadataManager {
|
||||
}
|
||||
break;
|
||||
case Dependency:
|
||||
List<Dependency> dependencies = item.getConnection().getSupplierDependency();
|
||||
returnlist.addAll(dependencies);
|
||||
List<Dependency> dependencies = item.getConnection().getSupplierDependency();
|
||||
returnlist.addAll(dependencies);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -388,8 +388,12 @@ public class MetadataSchema {
|
||||
if (pattern.getNodeValue() != null) {
|
||||
metadataColumn.setPattern(pattern.getNodeValue());
|
||||
}
|
||||
metadataColumn.setOriginalField(metadataColumn.getLabel());
|
||||
|
||||
if (originalField.getNodeValue() != null) {
|
||||
String originalFieldValue = MetadataToolHelper.validateColumnName(originalField.getNodeValue(), 0);
|
||||
metadataColumn.setOriginalField(originalFieldValue);
|
||||
} else {
|
||||
metadataColumn.setOriginalField(metadataColumn.getLabel());
|
||||
}
|
||||
if (!columnsAlreadyAdded.contains(metadataColumn.getLabel())) {
|
||||
listColumns.add(metadataColumn);
|
||||
columnsAlreadyAdded.add(metadataColumn.getLabel());
|
||||
|
||||
@@ -225,7 +225,7 @@ public final class MetadataToolHelper {
|
||||
for (int i = 0; i < originalColumnName.length(); i++) {
|
||||
Character car = originalColumnName.charAt(i);
|
||||
// MOD yyin TDQ-4929 20120330
|
||||
if (car.toString().getBytes().length == 1 && !isAllowSpecific) {
|
||||
if (car.toString().getBytes().length == 1 || !isAllowSpecific) {
|
||||
// first character should have only a-z or A-Z or _
|
||||
// other characters should have only a-z or A-Z or _ or 0-9
|
||||
if (((car >= 'a') && (car <= 'z')) || ((car >= 'A') && (car <= 'Z')) || car == '_'
|
||||
|
||||
@@ -296,6 +296,11 @@ public class ComponentToRepositoryProperty {
|
||||
connection.setDatabaseType(EDatabaseTypeName.GENERAL_JDBC.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.GENERAL_JDBC.getProduct());
|
||||
}
|
||||
// vertica output component have no TYPE ElementParameter .
|
||||
if (para.getRepositoryValue().endsWith(EDatabaseTypeName.VERTICA.getProduct())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.VERTICA.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.VERTICA.getProduct());
|
||||
}
|
||||
return;
|
||||
}
|
||||
// mysql
|
||||
@@ -369,12 +374,10 @@ public class ComponentToRepositoryProperty {
|
||||
connection.setProductId(EDatabaseTypeName.AS400.getProduct());
|
||||
}
|
||||
// Vertica
|
||||
// not exist in "DB Type" in Database Connection page.
|
||||
// else if (EDatabaseTypeName.VERTICA.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
// connection.setDatabaseType(EDatabaseTypeName.VERTICA.getDisplayName());
|
||||
// connection.setProductId(EDatabaseTypeName.VERTICA.getProduct());
|
||||
// }
|
||||
|
||||
else if (EDatabaseTypeName.VERTICA.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.VERTICA.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.VERTICA.getProduct());
|
||||
}
|
||||
// MaxDB
|
||||
else if (EDatabaseTypeName.MAXDB.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.MAXDB.getDisplayName());
|
||||
@@ -566,6 +569,9 @@ public class ComponentToRepositoryProperty {
|
||||
if (connection.getDatabaseType().equals(EDatabaseTypeName.AS400.getDisplayName())) {
|
||||
setDatabaseValueForAs400(connection, node, repositoryValue);
|
||||
}
|
||||
if (connection.getDatabaseType().equals(EDatabaseTypeName.VERTICA.getDisplayName())) {
|
||||
setDatabaseValueForVertica(connection, node, repositoryValue);
|
||||
}
|
||||
if (connection.getDatabaseType().equals(EDatabaseTypeName.MSSQL.getDisplayName())) {
|
||||
setDatabaseValueForMSSql(connection, node, repositoryValue);
|
||||
}
|
||||
@@ -666,6 +672,16 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
|
||||
private static void setDatabaseValueForVertica(DatabaseConnection connection, INode node, String repositoryValue) {
|
||||
if ("DB_VERSION".equals(repositoryValue)) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, "DB_VERSION"); //$NON-NLS-1$
|
||||
String dbVersionName = EDatabaseVersion4Drivers.getDbVersionName(EDatabaseTypeName.VERTICA, value);
|
||||
if (value != null) {
|
||||
connection.setDbVersionString(dbVersionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void setDatabaseValueForMysql(DatabaseConnection connection, INode node, String repositoryValue) {
|
||||
if ("PROPERTIES_STRING".equals(repositoryValue)) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, "PROPERTIES"); //$NON-NLS-1$
|
||||
@@ -1141,6 +1157,13 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
|
||||
if ("TAC_WEBAPP".equals(repositoryValue)) {//$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, "TAC_WEBAPP"); //$NON-NLS-1$
|
||||
if (value != null) {
|
||||
connection.setTacWebappName(value);
|
||||
}
|
||||
}
|
||||
|
||||
if ("CLASS_NAME".equals(repositoryValue)) {//$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, "CLASS_NAME"); //$NON-NLS-1$
|
||||
if (value != null) {
|
||||
|
||||
@@ -910,7 +910,8 @@ public class RepositoryToComponentProperty {
|
||||
|
||||
if (value.equals("DB_VERSION")) { //$NON-NLS-1$
|
||||
String dbVersionString = connection.getDbVersionString();
|
||||
if (EDatabaseConnTemplate.ACCESS.getDBDisplayName().equals(databaseType)) {
|
||||
if (EDatabaseConnTemplate.ACCESS.getDBDisplayName().equals(databaseType)
|
||||
|| EDatabaseConnTemplate.MYSQL.getDBDisplayName().equals(databaseType)) {
|
||||
// @Deprecated: see bug 7262 this bug is Deprecated
|
||||
return dbVersionString;
|
||||
} else {
|
||||
@@ -966,6 +967,13 @@ public class RepositoryToComponentProperty {
|
||||
String h2Prefix = "jdbc:h2:"; //$NON-NLS-1$
|
||||
if (url.startsWith(h2Prefix)) {
|
||||
String path = url.substring(h2Prefix.length(), url.length());
|
||||
// TDI-23861: handle the server mode of H2 which url has more than one colon.
|
||||
if (path.split(":").length > 2) { //$NON-NLS-1$
|
||||
int startIndex = path.lastIndexOf(":") - 1; //$NON-NLS-1$
|
||||
String filePath = path.substring(startIndex);
|
||||
h2Prefix += path.substring(0, startIndex);
|
||||
path = filePath;
|
||||
}
|
||||
path = PathUtils.getPortablePath(path);
|
||||
url = h2Prefix + path;
|
||||
}
|
||||
@@ -1204,6 +1212,20 @@ public class RepositoryToComponentProperty {
|
||||
return TalendQuoteUtils.addQuotes(p.toPortableString());
|
||||
}
|
||||
}
|
||||
if ("CODE_PAGE".equals(value)) { //$NON-NLS-1$
|
||||
if (connection.getCodePage() == null) {
|
||||
return null;
|
||||
}
|
||||
if (isContextMode(connection, connection.getCodePage())) {
|
||||
return connection.getCodePage();
|
||||
} else {
|
||||
Path p = new Path(""); //$NON-NLS-1$
|
||||
if (connection.getCodePage() != null) {
|
||||
p = new Path(connection.getCodePage());
|
||||
}
|
||||
return TalendQuoteUtils.addQuotes(p.toPortableString());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2055,14 +2077,29 @@ public class RepositoryToComponentProperty {
|
||||
return connection.getXmlField();
|
||||
}
|
||||
if (value.equals("GUVNOR_URL")) {
|
||||
return connection.getUrlName();
|
||||
return addQuotesIfNecessary(connection, connection.getUrlName());
|
||||
}
|
||||
if (value.equals("TAC_WEBAPP")) {
|
||||
return addQuotesIfNecessary(connection, connection.getTacWebappName());
|
||||
}
|
||||
if (value.equals("CLASS_NAME")) {
|
||||
return connection.getClassName();
|
||||
return addQuotesIfNecessary(connection, connection.getClassName());
|
||||
}
|
||||
if (value.equals("GUVNOR_PACKAGE")) {
|
||||
return addQuotesIfNecessary(connection, connection.getPackage());
|
||||
}
|
||||
if (value.equals("MODULE_USED")) {
|
||||
return connection.getModuleUsed();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Object addQuotesIfNecessary(Connection connection, String value) {
|
||||
if (!isContextMode(connection, value)) {
|
||||
if (!value.startsWith(TalendQuoteUtils.QUOTATION_MARK) && !value.endsWith(TalendQuoteUtils.QUOTATION_MARK)) {
|
||||
return TalendQuoteUtils.addQuotes(value);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Java2STLangTypesHelper {
|
||||
|
||||
// Characters: char(Character)
|
||||
if (typeToGenerate.equals("char")) { //$NON-NLS-1$
|
||||
return "char"; //$NON-NLS-1$
|
||||
return "string"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// others treat as string
|
||||
|
||||
@@ -385,7 +385,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
|
||||
private String alias;
|
||||
|
||||
private String folder = ""; //$NON-NLS-N$
|
||||
private String folder = "";
|
||||
|
||||
private String[] products;
|
||||
|
||||
@@ -451,6 +451,18 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return toReturn.toArray(new ERepositoryObjectType[] {});
|
||||
|
||||
}
|
||||
// Bad code here to fix bug TDI-23178. If DQ repository type implemented by extention point like what MDM does
|
||||
// will avoid this bug.
|
||||
if (!PluginChecker.isPluginLoaded("org.talend.dataprofiler.core")) { //$NON-NLS-1$
|
||||
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
|
||||
for (ERepositoryObjectType currentType : values(ERepositoryObjectType.class)) {
|
||||
if (!(currentType.getProducts().length == 1 && ArrayUtils.contains(currentType.getProducts(), "DQ"))) { //$NON-NLS-1$
|
||||
toReturn.add(currentType);
|
||||
}
|
||||
}
|
||||
return toReturn.toArray(new ERepositoryObjectType[0]);
|
||||
}
|
||||
|
||||
return values(ERepositoryObjectType.class);
|
||||
}
|
||||
|
||||
@@ -460,25 +472,24 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
IConfigurationElement[] configurationElements = registry
|
||||
.getConfigurationElementsFor("org.talend.core.repository.repository_node_provider"); //$NON-NLS-1$
|
||||
try {
|
||||
for (int i = 0; i < configurationElements.length; i++) {
|
||||
IConfigurationElement element = configurationElements[i];
|
||||
Object extensionNode = element.createExecutableExtension("class");//$NON-NLS-N$
|
||||
for (IConfigurationElement element : configurationElements) {
|
||||
Object extensionNode = element.createExecutableExtension("class");
|
||||
if (extensionNode instanceof IExtendRepositoryNode) {
|
||||
IExtendRepositoryNode diyNode = (IExtendRepositoryNode) extensionNode;
|
||||
String label = element.getAttribute("label");//$NON-NLS-N$
|
||||
String type = element.getAttribute("type");//$NON-NLS-N$
|
||||
String folder = element.getAttribute("folder");//$NON-NLS-N$
|
||||
String label = element.getAttribute("label");
|
||||
String type = element.getAttribute("type");
|
||||
String folder = element.getAttribute("folder");
|
||||
if (folder == null) {
|
||||
folder = "";
|
||||
}
|
||||
String isResouce = element.getAttribute("isResouce");//$NON-NLS-N$
|
||||
String rightAttribute = element.getAttribute("user_right");//$NON-NLS-N$
|
||||
String isResouce = element.getAttribute("isResouce");
|
||||
String rightAttribute = element.getAttribute("user_right");
|
||||
if (rightAttribute == null) {
|
||||
rightAttribute = "";
|
||||
}
|
||||
String productsAttribute = element.getAttribute("products");//$NON-NLS-N$
|
||||
String[] products = productsAttribute.split("\\|");//$NON-NLS-N$
|
||||
String[] user_right = rightAttribute.split(";");//$NON-NLS-N$
|
||||
String productsAttribute = element.getAttribute("products");
|
||||
String[] products = productsAttribute.split("\\|");
|
||||
String[] user_right = rightAttribute.split(";");
|
||||
|
||||
boolean isResource = false;
|
||||
if (isResouce != null) {
|
||||
@@ -550,18 +561,18 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
|
||||
if (type == GENERATED || type == JOBS || type == JOB_DOC) {
|
||||
if ((PluginChecker.isDocumentationPluginLoaded())) {
|
||||
return type.getFolder(); //$NON-NLS-1$
|
||||
return type.getFolder();
|
||||
}
|
||||
}
|
||||
if (type == JOBLETS || type == JOBLET_DOC) {
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
return type.getFolder(); //$NON-NLS-1$
|
||||
return type.getFolder();
|
||||
}
|
||||
} else {
|
||||
|
||||
return type.getFolder();
|
||||
}
|
||||
throw new IllegalArgumentException(Messages.getString("ERepositoryObjectType.FolderNotFound", type)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
throw new IllegalArgumentException(Messages.getString("ERepositoryObjectType.FolderNotFound", type)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static String getDeleteFolderName(ERepositoryObjectType type) {
|
||||
@@ -751,6 +762,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return FOLDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseDocumentationItem(DocumentationItem object) {
|
||||
return DOCUMENTATION;
|
||||
}
|
||||
@@ -776,6 +788,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
* @seeorg.talend.core.model.properties.util.PropertiesSwitch# caseJobDocumentationItem
|
||||
* (org.talend.core.model.properties.JobDocumentationItem)
|
||||
*/
|
||||
@Override
|
||||
public Object caseJobDocumentationItem(JobDocumentationItem object) {
|
||||
return JOB_DOC;
|
||||
}
|
||||
@@ -786,10 +799,12 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
* @seeorg.talend.core.model.properties.util.PropertiesSwitch# caseJobletDocumentationItem
|
||||
* (org.talend.core.model.properties.JobletDocumentationItem)
|
||||
*/
|
||||
@Override
|
||||
public Object caseJobletDocumentationItem(JobletDocumentationItem object) {
|
||||
return JOBLET_DOC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseRoutineItem(RoutineItem object) {
|
||||
return ROUTINES;
|
||||
}
|
||||
@@ -798,6 +813,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
// return BEANS;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Object caseJobScriptItem(JobScriptItem object) {
|
||||
return JOB_SCRIPT;
|
||||
}
|
||||
@@ -813,6 +829,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return SQLPATTERNS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseProcessItem(ProcessItem object) {
|
||||
|
||||
return PROCESS;
|
||||
@@ -829,26 +846,32 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return JOBLET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseContextItem(ContextItem object) {
|
||||
return CONTEXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseSnippetItem(SnippetItem object) {
|
||||
return SNIPPETS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseSnippetVariable(SnippetVariable object) {
|
||||
return SNIPPETS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseBusinessProcessItem(BusinessProcessItem object) {
|
||||
return BUSINESS_PROCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseCSVFileConnectionItem(CSVFileConnectionItem object) {
|
||||
throw new IllegalStateException(Messages.getString("ERepositoryObjectType.NotImplemented")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseDatabaseConnectionItem(DatabaseConnectionItem object) {
|
||||
return METADATA_CONNECTIONS;
|
||||
}
|
||||
@@ -858,46 +881,57 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return METADATA_SAPCONNECTIONS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseDelimitedFileConnectionItem(DelimitedFileConnectionItem object) {
|
||||
return METADATA_FILE_DELIMITED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object casePositionalFileConnectionItem(PositionalFileConnectionItem object) {
|
||||
return METADATA_FILE_POSITIONAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseRegExFileConnectionItem(RegExFileConnectionItem object) {
|
||||
return METADATA_FILE_REGEXP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseXmlFileConnectionItem(XmlFileConnectionItem object) {
|
||||
return METADATA_FILE_XML;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseExcelFileConnectionItem(ExcelFileConnectionItem object) {
|
||||
return METADATA_FILE_EXCEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseLdifFileConnectionItem(LdifFileConnectionItem object) {
|
||||
return METADATA_FILE_LDIF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseLDAPSchemaConnectionItem(LDAPSchemaConnectionItem object) {
|
||||
return METADATA_LDAP_SCHEMA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseGenericSchemaConnectionItem(GenericSchemaConnectionItem object) {
|
||||
return METADATA_GENERIC_SCHEMA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseSalesforceSchemaConnectionItem(SalesforceSchemaConnectionItem object) {
|
||||
return METADATA_SALESFORCE_SCHEMA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseWSDLSchemaConnectionItem(WSDLSchemaConnectionItem object) {
|
||||
return METADATA_WSDL_SCHEMA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseEDIFACTConnectionItem(EDIFACTConnectionItem object) {
|
||||
return METADATA_EDIFACT;
|
||||
}
|
||||
@@ -907,10 +941,12 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return METADATA_FILE_EBCDIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseHL7ConnectionItem(HL7ConnectionItem object) {
|
||||
return METADATA_FILE_HL7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseFTPConnectionItem(FTPConnectionItem object) {
|
||||
return METADATA_FILE_FTP;
|
||||
}
|
||||
@@ -920,6 +956,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return METADATA_FILE_BRMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseMDMConnectionItem(MDMConnectionItem object) {
|
||||
return METADATA_MDMCONNECTION;
|
||||
}
|
||||
@@ -929,6 +966,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return SVG_BUSINESS_PROCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseHeaderFooterConnectionItem(HeaderFooterConnectionItem object) {
|
||||
return METADATA_HEADER_FOOTER;
|
||||
}
|
||||
@@ -939,10 +977,12 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return TDQ_ELEMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseValidationRulesConnectionItem(ValidationRulesConnectionItem object) {
|
||||
return METADATA_VALIDATION_RULES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object defaultCase(EObject object) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
@@ -985,7 +1025,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
* @return
|
||||
*/
|
||||
public boolean isDQItemType() {
|
||||
return Arrays.asList(this.getProducts()).contains("DQ"); //$NON-NLS-N$
|
||||
return Arrays.asList(this.getProducts()).contains("DQ");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -997,7 +1037,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
* @return
|
||||
*/
|
||||
public boolean isDIItemType() {
|
||||
return Arrays.asList(this.getProducts()).contains("DI"); //$NON-NLS-N$
|
||||
return Arrays.asList(this.getProducts()).contains("DI");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1017,6 +1057,7 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
*
|
||||
* @see org.talend.core.model.repository.DynaEnum#name()
|
||||
*/
|
||||
@Override
|
||||
public String name() {
|
||||
if (isStaticNode()) {
|
||||
Field[] allFields = ERepositoryObjectType.class.getDeclaredFields();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user