Compare commits
403 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 | ||
|
|
2afa0e0344 | ||
|
|
fbf3378db1 | ||
|
|
d1df2137e0 | ||
|
|
506ab841f7 | ||
|
|
3146730dbf | ||
|
|
10f94cd189 | ||
|
|
8df200d289 | ||
|
|
ea6ecbbc01 | ||
|
|
c5f1cdfb07 | ||
|
|
6d6685b2d7 | ||
|
|
31771e4962 | ||
|
|
5340af3267 | ||
|
|
5787e5cd24 | ||
|
|
7e89fe8401 | ||
|
|
7b6fc80cb4 | ||
|
|
d9b2fbf15f | ||
|
|
47ce108adb | ||
|
|
b6cd48c736 | ||
|
|
67aed7e2a6 | ||
|
|
79beddc636 | ||
|
|
32c1039d27 | ||
|
|
8b6a036f64 | ||
|
|
f7261c2bef | ||
|
|
d8ec005476 | ||
|
|
ccdd6b8ec9 | ||
|
|
b2e7cae844 | ||
|
|
129fbc1892 | ||
|
|
5a769ec51a | ||
|
|
e96f5e1235 | ||
|
|
615f9dadd1 | ||
|
|
dfdf08bef6 | ||
|
|
e96ded3ac5 | ||
|
|
a0f8225f6e | ||
|
|
586a340518 | ||
|
|
b1629b9720 | ||
|
|
df197e6433 | ||
|
|
037f218459 | ||
|
|
7b08106a47 | ||
|
|
e1cea9125a | ||
|
|
94304d8756 | ||
|
|
fed5addb5e | ||
|
|
4a0435f699 | ||
|
|
a4541ae55c | ||
|
|
7579f3e416 | ||
|
|
7dcc032b81 | ||
|
|
d546bdaae7 | ||
|
|
027163e58f | ||
|
|
d572f68919 | ||
|
|
c11f41bd13 | ||
|
|
9a556ea7aa | ||
|
|
3c93ce3236 | ||
|
|
abbb801232 | ||
|
|
4ca21e0240 | ||
|
|
b393d23bd5 | ||
|
|
ffad1c0d24 | ||
|
|
501ca24048 | ||
|
|
198dc0a9c9 | ||
|
|
2e3700fe1c | ||
|
|
068e836bf1 | ||
|
|
cd8bd1d00a | ||
|
|
be4d642c74 | ||
|
|
ad5e777f3b | ||
|
|
cf235a2e92 | ||
|
|
de4e67d41d | ||
|
|
0828f6e564 | ||
|
|
9a11a02f77 | ||
|
|
ebf9c85399 | ||
|
|
9be298640d | ||
|
|
c00db61cd5 | ||
|
|
34b612f7c9 | ||
|
|
777f4c6938 | ||
|
|
fe6751e140 | ||
|
|
07fd9e38f5 | ||
|
|
4ce6f5c3b4 | ||
|
|
66d5e750b3 | ||
|
|
b54d802c55 | ||
|
|
2c268d36f6 | ||
|
|
0aacd86dc4 | ||
|
|
39d521213c | ||
|
|
35359a1829 | ||
|
|
e7f73d768d | ||
|
|
4a70286a1f | ||
|
|
dfd3ffaf19 | ||
|
|
685e00024f | ||
|
|
bbc536d20b | ||
|
|
4c31bb473c | ||
|
|
845ec2d4aa | ||
|
|
4c1543c701 | ||
|
|
1005d9ef70 | ||
|
|
d3f1de8dfa | ||
|
|
8a5412e7bd | ||
|
|
759b6ce0d1 | ||
|
|
9b634206af | ||
|
|
8eb84b93b9 | ||
|
|
0d4bc055fe | ||
|
|
09c5da1a12 | ||
|
|
e5902875cc | ||
|
|
66a56f597c | ||
|
|
17de5c063a | ||
|
|
e208d3afbd | ||
|
|
f2334929c2 | ||
|
|
e5b8b1891a | ||
|
|
aa89b08d2d | ||
|
|
33dbb0e819 | ||
|
|
46a782d500 | ||
|
|
1ad958cb15 | ||
|
|
abe5464bb7 | ||
|
|
b96a2e92e8 | ||
|
|
e85c119849 | ||
|
|
fe6d6bc2b0 | ||
|
|
b60ef4289b | ||
|
|
8f85246efc | ||
|
|
6a36c03fdb | ||
|
|
1dd43b27f1 | ||
|
|
bab0c510ca | ||
|
|
ecc9a0727c | ||
|
|
78fbea7e81 | ||
|
|
50d604bcff | ||
|
|
3267b78adb | ||
|
|
25f3d2eca4 | ||
|
|
dbf3aefdf1 | ||
|
|
96fd269d81 | ||
|
|
80c6a471d2 | ||
|
|
d640d342dc | ||
|
|
38210f0f1e | ||
|
|
301319a164 | ||
|
|
9875bf9376 | ||
|
|
65a636d238 | ||
|
|
c6e01ce83b | ||
|
|
c3fc6dce4f | ||
|
|
eab20aba41 | ||
|
|
71515b9e25 | ||
|
|
1b6176032e | ||
|
|
7d982a270e | ||
|
|
679902633f | ||
|
|
ce915b858f | ||
|
|
ef6994d97f | ||
|
|
7c0903481d | ||
|
|
2758982bf4 | ||
|
|
36f183bf36 | ||
|
|
b7c3413f34 | ||
|
|
68e0292891 | ||
|
|
ca15ab80f0 | ||
|
|
3b00989b40 | ||
|
|
95f58c4cea | ||
|
|
f328a59944 | ||
|
|
f7ba5e4b09 | ||
|
|
a1b31112d1 | ||
|
|
7e7c602c6b | ||
|
|
7e4ce6d0e0 | ||
|
|
3354bdf435 | ||
|
|
8b54a419e8 | ||
|
|
018fa2d2fc | ||
|
|
240f060fa7 | ||
|
|
5dabcd9b6a | ||
|
|
a5413c81d0 | ||
|
|
c677b38293 | ||
|
|
62c4dd8434 | ||
|
|
64d27dccbd | ||
|
|
c23eecf940 | ||
|
|
0b7468f220 | ||
|
|
ea4e67ec05 | ||
|
|
1ae9aab21f | ||
|
|
9f21d1c750 | ||
|
|
dd3b8c7d96 | ||
|
|
eabbef55ee | ||
|
|
35537f2d19 | ||
|
|
dcc95787ed |
@@ -1,68 +0,0 @@
|
||||
AccessorUtils.Assert0=\u8FD9\u4E2A\u5217(\u6807\u9898\u4E3A\u2018{0}\u2019\uFF0CID\u4E3A\u2018{1}\u2019)\u7684\u2018BeanPropertyAccessors\u2019\u6CA1\u6709\u6B63\u786E\u914D\u7F6E\u3002\u2018{2}\u2019\u9700\u8981\u4E00\u4E2ABean<B>
|
||||
AccessorUtils.Assert1=\u8FD9\u4E2A\u5217(\u6807\u9898\u4E3A\u2018{0}\u2019\uFF0CID\u4E3A\u2018{1}\u2019)\u7684\u2018BeanPropertyAccessors\u2019\u6CA1\u6709\u6B63\u786E\u914D\u7F6E,\u6216\u8005\u503C\u8BBE\u7F6E\u4E3A\u4E0D\u6B63\u786E\u7684\u7C7B\u578B\u3002
|
||||
AddPushButton.AddButton.Tip=\u589E\u52A0
|
||||
AddAllPushButton.AddAllButton.Tip=\u6DFB\u52A0\u6240\u6709
|
||||
ColorStyledText.RedoItem.Text=\u91CD\u505A
|
||||
ColorStyledText.UndoItem.Text=\u590D\u539F
|
||||
ColorStyledText.CopyItem.Text=\u590D\u5236
|
||||
ColorStyledText.PasteItem.Text=\u7C98\u8D34
|
||||
ColorStyledText.SelectAllItem.Text=\u5168\u9009
|
||||
ContentProposalAdapterExtended.close=\u5173\u95ED
|
||||
ContentProposalAdapterExtended.closeFocusout=\u5173\u95EDfocusout
|
||||
ControlUtils.Unsupported1=\u8FD9\u4E2A\u9762\u677F({0})\u4E0D\u652F\u6301\u3002\u5982\u679C\u4F60\u60F3\u4F7F\u7528\uFF0C\u8BF7\u6DFB\u52A0\u4E8B\u4EF6\u3002
|
||||
CopyPushButton.CopyButton.Tip=\u590D\u5236\u88AB\u9009\u4E2D\u7684\u9879
|
||||
DateDialog.textContent=\u9009\u62E9\u65E5\u671F& \u65F6\u95F4
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=\u9519\u8BEF
|
||||
ErrorDialogWidthDetailArea.ErrorMessage.Text=\u9519\u8BEF\u4FE1\u606F
|
||||
ErrorDialogWithContinue.setParameter=\u8BBE\u7F6E\u53C2\u6570\u5E76\u7EE7\u7EED
|
||||
EventUtil.activate=\u542f\u52a8
|
||||
EventUtil.close=\u5173\u95ED
|
||||
EventUtil.deactivate=\u64a4\u6d88
|
||||
EventUtil.defaultSelection=\u9ED8\u8BA4\u9009\u62E9
|
||||
EventUtil.dragDetect=\u62D6\u66F3\u68C0\u6D4B
|
||||
EventUtil.expand=\u6269\u5F20
|
||||
EventUtil.help=\u5e2e\u52a9
|
||||
EventUtil.mouseDoubleClick=\u9F20\u6807\u53CC\u51FB
|
||||
EventUtil.mouseDown=\u9F20\u6807\u6309\u4E0B
|
||||
EventUtil.mouseEnter=\u9F20\u6807\u8F93\u5165
|
||||
EventUtil.mouseExit=\u9F20\u6807\u9000\u51FA
|
||||
EventUtil.mouseHover=\u9F20\u6807\u60AC\u505C
|
||||
EventUtil.mouseMove=\u9F20\u6807\u79FB\u52A8
|
||||
EventUtil.mouseUp=\u9F20\u6807\u5411\u4E0A
|
||||
EventUtil.move=\u79fb\u52a8
|
||||
EventUtil.paint=\u989C\u6599
|
||||
EventUtil.resize=\u8C03\u6574\u5927\u5C0F
|
||||
EventUtil.show=\u663E\u793A
|
||||
ExceptionHandler.Parameter.BeNull=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u5F02\u5E38
|
||||
ExceptionMessageDialog.log=\u65E5\u5FD7
|
||||
ExportPushButton.ExportButton.Tip=\u5BFC\u51FA\u6240\u6709\u884C\u5230XML\u6587\u4EF6
|
||||
ExtendedTableAddCommand.Add.Label=\u6DFB\u52A0\u4E00\u4E2A\u6216\u591A\u4E2A\u8868
|
||||
ExtendedTableCopyCommand.Copy.Label=\u590D\u5236\u4E00\u4E2A\u6216\u591A\u4E2A\u8868\u5728\u5916\u90E8\u526A\u8D34\u677F\u4E2D\u3002
|
||||
ExtendedTableModel.ModifiedObject.Error=ModifiedBeanListenable\u7684\u5BF9\u8C61\u5FC5\u987B\u5728\u4F7F\u7528\u8FD9\u4E2A\u65B9\u6CD5\u4E4B\u524D\u88AB\u5B9E\u73B0\u3002
|
||||
ExtendedTableMoveCommand.MoveLabel=\u5411\u4E0A\u6216\u5411\u4E0B\u79FB\u52A8\u4E00\u4E2A\u6216\u591A\u4E2A\u8868
|
||||
ExtendedTablePasteCommand.Paste.Label=\u4ECE\u5916\u90E8\u526A\u8D34\u677F\u7C98\u8D34\u6570\u636E
|
||||
ExtendedTableRemoveCommand.Romve.Label=\u5220\u9664\u8868
|
||||
ExtendedTableResetDBTypesCommand.ResetDBTypes.Label=\u91CD\u7F6E\u6240\u6709\u6570\u636E\u5E93\u7C7B\u578B\u4E3A\u9ED8\u8BA4\u503C
|
||||
ImportPushButton.ImportButton.Tip=\u5BFC\u5165XML\u6587\u4EF6\u66FF\u6362\u6240\u6709\u884C
|
||||
ImportPushButtonForExtendedTable.ErrorMsg.Text=\u51FA\u9519
|
||||
LabelledFileField.BrowseButton.Text=\u6D4F\u89C8...
|
||||
LabelledFileField.FileDialog.Text=\u9009\u62E9\u4E00\u4E2A
|
||||
ModeReader.IgnoreElement=\u5FFD\u7565\u672A\u77E5\u5143\u7D20
|
||||
ModifyBeanValueCommand.ModifyCell.Label=\u4FEE\u6539\u5355\u5143\u683C\u503C
|
||||
MoveDownPushButton.MoveDownTip=\u5411\u4E0B\u79FB\u52A8\u9009\u4E2D\u9879
|
||||
MoveUpPushButton.MoveUpButton.Tip=\u5411\u4E0A\u79FB\u52A8\u9009\u4E2D\u9879
|
||||
PastePushButton.PasteButton.Label=\u7C98\u8D34
|
||||
RemovePushButton.RemoveButton.Tip=\u5220\u9664\u6240\u9009\u9879
|
||||
ResetDBTypesButton.ResetDBTypesButton.Tip=\u91CD\u7F6E\u6240\u6709\u6570\u636E\u5E93\u7C7B\u578B
|
||||
SaveAsGenericSchemaPushButton.saveAsSchema=\u53e6\u5b58\u4e3a\u4e00\u822cschema
|
||||
SelectContextVariablesPushButton.Label=\u9009\u62E9\u4E0A\u4E0B\u6587\u53D8\u91CF
|
||||
TableViewerCreator.CallMethod.ErrorMsg=\u53EA\u6709\u4F60\u7684\u5DF2\u7ECF\u8C03\u7528\u4E86createTable()\u65B9\u6CD5\u540E\uFF0C\u624D\u80FD\u8C03\u7528\u6B64\u65B9\u6CD5\u3002
|
||||
TableViewerCreator.IdProperty.AssertMsg=\u4F60\u5FC5\u987B\u6539\u53D8\u5217ID\u5C5E\u6027\uFF0C\u4E00\u4E2A\u8868\u4E2D\u5217\u7684ID\u5C5E\u6027\u5FC5\u987B\u552F\u4E00\u3002
|
||||
TableViewerCreator.Table.BeNull=\u8868\u4E3A\u7A7A
|
||||
TableViewerCreator.TableColumn.AssertMsg=ID\u5C5E\u6027\u4E3A\u2019{0}\u2018\u7684TableEditorColumn\u7684TableColumn\u6CA1\u6709\u6B63\u786E\u7684Table\u3002
|
||||
TreeToTablesLinker.Type.Unsupported=\u4e0d\u652f\u6301\u5f53\u524d\u7684\u63a7\u4ef6
|
||||
commons.error=\u9519\u8BEF
|
||||
GlobalServiceRegister.ServiceNotRegistered=\u670D\u52A1{0}\u6CA1\u6709\u88AB\u6CE8\u518C
|
||||
ExceptionMessageDialog.Cancel=\u53D6\u6D88
|
||||
ExceptionMessageDialog.OK=\u786E\u5B9A
|
||||
ExceptionMessageDialog.Yes=\u662F
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 952 B |
Binary file not shown.
|
Before Width: | Height: | Size: 528 B |
@@ -169,7 +169,7 @@ public enum ECoreImage implements IImage {
|
||||
PROGRESSGRAYBAR("/icons1/gray.gif"), //$NON-NLS-1$
|
||||
PROGRESSGRAYGEBAR("/icons1/graygeBar.gif"), //$NON-NLS-1$
|
||||
TRIANGLE("/icons1/triangle.gif"), // triangle.gif //$NON-NLS-1$
|
||||
COMPARE("/icons1/compare.gif"), //$NON-NLS-N$
|
||||
COMPARE("/icons1/compare.gif"),
|
||||
EXCHNAGETAB("/icons/exchangeTab.jpg"), // $NON-NLS-1$
|
||||
EXCHNAGEIMAGEMISSING("/icons/component_missing.gif"); // $NON-NLS-1$
|
||||
|
||||
@@ -188,6 +188,7 @@ public enum ECoreImage implements IImage {
|
||||
*
|
||||
* @return the path
|
||||
*/
|
||||
@Override
|
||||
public String getPath() {
|
||||
return this.path;
|
||||
}
|
||||
@@ -197,6 +198,7 @@ public enum ECoreImage implements IImage {
|
||||
*
|
||||
* @return the clazz
|
||||
*/
|
||||
@Override
|
||||
public Class getLocation() {
|
||||
return ECoreImage.class;
|
||||
// return CorePlugin.class;
|
||||
|
||||
@@ -115,9 +115,6 @@ public enum EImage implements IImage {
|
||||
FONT_COLOR_ICON("/icons/font_color.gif"), //$NON-NLS-1$
|
||||
FILL_COLOR_ICON("/icons/fill_color.gif"), //$NON-NLS-1$
|
||||
|
||||
OPEN_IN_BROWSER("/icons/open.gif"), //$NON-NLS-1$
|
||||
DOWNLOAD_MODULE("/icons/download.gif"), //$NON-NLS-1$
|
||||
|
||||
COMPONENT_MISSING("/icons/component_missing.gif"), //$NON-NLS-1$
|
||||
|
||||
FILTER_DEACTIVED_ICON("/icons/filter_deactivated.png"), //$NON-NLS-1$
|
||||
@@ -138,7 +135,6 @@ public enum EImage implements IImage {
|
||||
*
|
||||
* @return the path
|
||||
*/
|
||||
@Override
|
||||
public String getPath() {
|
||||
return this.path;
|
||||
}
|
||||
@@ -148,7 +144,6 @@ public enum EImage implements IImage {
|
||||
*
|
||||
* @return the clazz
|
||||
*/
|
||||
@Override
|
||||
public Class getLocation() {
|
||||
return EImage.class;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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
|
||||
|
||||
@@ -38,6 +38,7 @@ public class DefaultTableLabelProvider implements ITableLabelProvider, ITableCol
|
||||
this.tableViewerCreator = tableViewerCreator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getColumnImage(Object element, int columnIndex) {
|
||||
TableViewerCreatorColumnNotModifiable column = (TableViewerCreatorColumnNotModifiable) this.tableViewerCreator
|
||||
.getColumns().get(columnIndex);
|
||||
@@ -47,6 +48,7 @@ public class DefaultTableLabelProvider implements ITableLabelProvider, ITableCol
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColumnText(Object element, int columnIndex) {
|
||||
String returnValue = null;
|
||||
TableViewerCreatorColumnNotModifiable column = (TableViewerCreatorColumnNotModifiable) this.tableViewerCreator
|
||||
@@ -93,16 +95,20 @@ public class DefaultTableLabelProvider implements ITableLabelProvider, ITableCol
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(ILabelProviderListener listener) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLabelProperty(Object element, String property) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(ILabelProviderListener lpl) {
|
||||
}
|
||||
|
||||
@@ -111,6 +117,7 @@ public class DefaultTableLabelProvider implements ITableLabelProvider, ITableCol
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.ITableColorProvider#getBackground(java.lang.Object, int)
|
||||
*/
|
||||
@Override
|
||||
public Color getBackground(Object element, int columnIndex) {
|
||||
TableViewerCreatorColumnNotModifiable column = (TableViewerCreatorColumnNotModifiable) this.tableViewerCreator
|
||||
.getColumns().get(columnIndex);
|
||||
@@ -125,6 +132,7 @@ public class DefaultTableLabelProvider implements ITableLabelProvider, ITableCol
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.ITableColorProvider#getForeground(java.lang.Object, int)
|
||||
*/
|
||||
@Override
|
||||
public Color getForeground(Object element, int columnIndex) {
|
||||
TableViewerCreatorColumnNotModifiable column = (TableViewerCreatorColumnNotModifiable) this.tableViewerCreator
|
||||
.getColumns().get(columnIndex);
|
||||
|
||||
@@ -406,7 +406,6 @@ public class TableEditorManager {
|
||||
} 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
|
||||
@@ -42,11 +42,3 @@ XmlNodeRetriever.proposal2Node=proposal2Nodes :
|
||||
XmlNodeRetriever.prposal1Node=proposal1Nodes :
|
||||
XmlNodeRetriever.singleQuotes='
|
||||
XmlNodeRetriever.xPathExpression=xPathExpression = '
|
||||
VersionUtils.readPropertyFileError=Error to read property in talend.properties file.
|
||||
DatabaseContentRetriever.PRODUCTNAME=Database Product Name:
|
||||
DatabaseContentRetriever.PRODUCTVERSION=Database Product Version:
|
||||
SybaseResultSet.outofRange=\ is out of range.
|
||||
SybaseResultSet.parameterIndex=Invalid argument\: parameter index
|
||||
SybaseResultSet.unknowCloumn=Invalid argument\: unknown column name
|
||||
AbstractFakeResultSet.unknowCloumn=Invalid argument\: {0} is unknown column name
|
||||
AbstractFakeResultSet.parameterIndexOutOfRange=Invalid argument\: parameter index {0} is out of range
|
||||
|
||||
@@ -37,6 +37,3 @@ XmlNodeRetriever.mainExpression=expression principale =
|
||||
XmlNodeRetriever.proposal2Node=proposal2Nodes :
|
||||
XmlNodeRetriever.prposal1Node=proposal1Nodes :
|
||||
XmlNodeRetriever.singleQuotes='
|
||||
VersionUtils.readPropertyFileError=Erreur de lecture de propriété dans le fichier talend.properties.
|
||||
DatabaseContentRetriever.PRODUCTNAME=Nom de produit de la base de données :
|
||||
DatabaseContentRetriever.PRODUCTVERSION=Version du produit de la base de données :
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
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
|
||||
ExceptionHandler.Parameter.BeNull=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u5F02\u5E38
|
||||
ExtensionImplementationProviders.ExtensionPointError=\u6269\u5C55\u70B9\u5FC5\u987B\u4F7F\u7528\u5355\u5B9E\u4F8B\u6A21\u5F0F
|
||||
ListenableList.IndexSameLength.Error=\u539F\u59CB\u7D22\u5F15\u548C\u76EE\u6807\u7D22\u5F15\u5FC5\u987B\u4E3A\u76F8\u540C\u7684\u957F\u5EA6
|
||||
ReflectionPropertyException.Access.ErrorMsg3=\u5F53\u5F15\u7528\u7C7B{2}\u7684\u5C5E\u6027{1}\u503C{0}\u662F\u51FA\u9519
|
||||
ResourceUtils.canMove1=\u53EF\u79FB\u52A8
|
||||
ResourceUtils.streamNull=\u6D41\u4E3A\u7A7A
|
||||
ReusableMultiKey.Keys.BeNull=\u4E3B\u952E\u6570\u7EC4\u4E0D\u80FD\u4E3A\u7A7A
|
||||
VersionUtils.Version.Error2=\u7578\u5F62\u5B57\u7B26\u4E32{0}(\u51FA\u73B0M{1}m)
|
||||
resources.file.notCreated=\u6587\u4EF6"{0}"\u4E0D\u80FD\u88AB\u521B\u5EFA({1})
|
||||
resources.file.notDeleted=\u6587\u4EF6"{0}"\u4E0D\u80FD\u88AB\u5220\u9664
|
||||
resources.file.notGet=\u8981\u6C42\u7684\u6587\u4EF6"{0}"\u6CA1\u6709\u5728\u6587\u4EF6\u5939"{1}"\u4E2D
|
||||
resources.folder.notCreated=\u6587\u4EF6\u5939"{0}"\u4E0D\u80FD\u88AB\u521B\u5EFA
|
||||
resources.folder.notDeleted=\u6587\u4EF6\u5939"{0}"\u4E0D\u80FD\u88AB\u5220\u9664
|
||||
resources.folder.notEmptied=\u6587\u4EF6\u5939"{0}"\u4E0D\u80FD\u4E3A\u7A7A
|
||||
resources.folder.notGet=\u8981\u6C42\u7684\u6587\u4EF6\u5939"{0}"\u6CA1\u6709\u5728\u5DE5\u7A0B"{1}"\u4E2D
|
||||
resources.project.notGet=\u8981\u6C42\u7684\u5DE5\u7A0B"{0}"\u4E0D\u5B58\u5728
|
||||
resources.resource.notMoved=\u8D44\u6E90"{0}"\u4E0D\u80FD\u79FB\u52A8\u5230"{1}"
|
||||
utils.data.container=Id{0}\u5DF2\u7ECF\u88AB\u4F7F\u7528\u5728\u5BB9\u5668\u4E2D
|
||||
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
|
||||
utils.workbench.extensions.noExtension=\u6269\u5C55\u70B9ID\u4E3A"{0}"\u7684Plug-in\u4E0D\u5B58\u5728
|
||||
XmlNodeRetriever.countResult=\u8BB0\u5F55\u7ED3\u679C\u6570
|
||||
XmlNodeRetriever.singleQuotes=.
|
||||
@@ -4,6 +4,5 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry exported="true" kind="lib" path="data" sourcepath="data"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -5,8 +5,6 @@ Bundle-SymbolicName: org.talend.commons.runtime.test
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Fragment-Host: org.talend.commons.runtime
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: org.junit,
|
||||
org.talend.utils,
|
||||
org.talend.testutils;bundle-version="1.0.0"
|
||||
Require-Bundle: org.junit
|
||||
Bundle-ClassPath: data/,
|
||||
.
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.utils.ProductVersion;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class VersionUtilsTest {
|
||||
|
||||
/**
|
||||
* Test method for {@link org.talend.commons.utils.VersionUtils#getTalendVersion()}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetTalendVersion() {
|
||||
ProductVersion talendVersion = ProductVersion.fromString(VersionUtils.getTalendVersion());
|
||||
ProductVersion studioVersion = ProductVersion.fromString(VersionUtils.getVersion());
|
||||
Assert.assertEquals(studioVersion, talendVersion);
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,8 @@ package org.talend.commons.utils.threading;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.talend.commons.utils.threading.Locker;
|
||||
import org.talend.commons.utils.threading.Locker.LockerValue;
|
||||
import org.talend.commons.utils.threading.locker.operators.AbstractLockerOperator;
|
||||
import org.talend.commons.utils.threading.locker.operators.LockOperator;
|
||||
@@ -355,7 +355,6 @@ public class LockerTest {
|
||||
}
|
||||
|
||||
@Test(timeout = 10000)
|
||||
@Ignore("Locker is not reliable, test fails at each time")
|
||||
public void testThreadSafetyWithWaitForLockThenUnlock_allowReentrantLockFromOtherThread() throws Exception {
|
||||
boolean allowReentrantLockFromOtherThread = true;
|
||||
final Locker locker = new Locker(allowReentrantLockFromOtherThread);
|
||||
@@ -365,7 +364,6 @@ public class LockerTest {
|
||||
}
|
||||
|
||||
@Test(timeout = 10000)
|
||||
@Ignore("Locker is not reliable, test fails at each time")
|
||||
public void testThreadSafetyWithWaitForLockThenUnlock_forbidReentrantLockFromOtherThread() throws Exception {
|
||||
boolean allowReentrantLockFromOtherThread = false;
|
||||
final Locker locker = new Locker(allowReentrantLockFromOtherThread);
|
||||
@@ -386,7 +384,6 @@ public class LockerTest {
|
||||
|
||||
@Test(timeout = 30000)
|
||||
// @Test
|
||||
@Ignore("Locker is not reliable, test fails at each time")
|
||||
public void testThreadSafetyWithWaitForLockThenUnlock() throws Exception {
|
||||
boolean allowReentrantLockFromOtherThread = true;
|
||||
final Locker locker = new Locker(allowReentrantLockFromOtherThread);
|
||||
|
||||
@@ -15,17 +15,18 @@ package org.talend.commons.utils.threading.lockerbykey;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.MethodRule;
|
||||
import org.junit.rules.Timeout;
|
||||
import org.talend.commons.utils.memory.MemoryMeasurer;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.AbstractLockerByKeyOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.CleanOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.LockThenUnlockOperator;
|
||||
@@ -34,12 +35,10 @@ import org.talend.commons.utils.threading.lockerbykey.operators.TryLockThenUnloc
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.TryLockWithTimeoutThenUnlockOperator;
|
||||
import org.talend.commons.utils.threading.threadsafetester.AbstractThreadSafetyTester;
|
||||
|
||||
import com.javamex.classmexer.MemoryUtil;
|
||||
|
||||
public class LockerByKeyTest {
|
||||
|
||||
// @Rule
|
||||
// public MethodRule globalTimeout = new Timeout(60000);
|
||||
@Rule
|
||||
public MethodRule globalTimeout = new Timeout(60000);
|
||||
|
||||
private static final int WAIT_THREAD_STARTED = 200;
|
||||
|
||||
@@ -47,10 +46,6 @@ public class LockerByKeyTest {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
// static {
|
||||
// MemoryUtilAgentLoader.loadAgent();
|
||||
// }
|
||||
|
||||
protected ILockerByKey createLockerInstance() {
|
||||
// default implementation when running this TestCase
|
||||
return new LockerByKey();
|
||||
@@ -635,7 +630,6 @@ public class LockerByKeyTest {
|
||||
assertThat(suspectLocks.size(), is(0));
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test(timeout = 20000)
|
||||
// @Test
|
||||
public void testThreadSafety_LockThenUnlock() throws Exception {
|
||||
@@ -643,13 +637,13 @@ public class LockerByKeyTest {
|
||||
final int nOperatorsByClassOperator = 30;
|
||||
final int nOperationsByOperator = 500;
|
||||
boolean assertEntriesLessThanCleanPeriod = true;
|
||||
boolean warmupRound = false;
|
||||
boolean shutdownAtEnd = true;
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test(timeout = 20000)
|
||||
// @Test
|
||||
public void testThreadSafety_LockThenUnlock_with_randomClean() throws Exception {
|
||||
@@ -657,9 +651,10 @@ public class LockerByKeyTest {
|
||||
final int nOperatorsByClassOperator = 30;
|
||||
final int nOperationsByOperator = 500;
|
||||
boolean assertEntriesLessThanCleanPeriod = true;
|
||||
boolean warmupRound = false;
|
||||
boolean shutdownAtEnd = true;
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class, CleanOperator.class);
|
||||
}
|
||||
|
||||
@@ -668,49 +663,68 @@ public class LockerByKeyTest {
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test(timeout = 30000)
|
||||
// @Test
|
||||
@Ignore("Ignored while JUnit buils is not modified to allow measure of memory")
|
||||
public void testMemory() throws Exception {
|
||||
ILockerByKey locker = createLockerInstance();
|
||||
|
||||
public void testMemory_iterations() throws Exception {
|
||||
ILockerByKey locker = new LockerByKeyUnrestricted();
|
||||
final int nOperatorsByClassOperator = 30;
|
||||
final int nOperationsByOperator = 50;
|
||||
boolean assertEntriesLessThanCleanPeriod = true;
|
||||
boolean warmupRound = true;
|
||||
boolean shutdownAtEnd = false;
|
||||
int warmupRounds = 3;
|
||||
int mesureRounds = 3;
|
||||
|
||||
long previousDeepMemoryUsageOfLocker = MemoryUtil.deepMemoryUsageOf(locker);
|
||||
System.out.println("deepMemoryUsageOfLocker=" + previousDeepMemoryUsageOfLocker);
|
||||
Set<Long> memoryResults = new HashSet<Long>();
|
||||
|
||||
int maxMesureRounds = 10;
|
||||
for (int i = 0; i < maxMesureRounds; i++) {
|
||||
MemoryMeasurer globalMemoryMeasurer = new MemoryMeasurer();
|
||||
globalMemoryMeasurer.begin();
|
||||
for (int i = 0; i < warmupRounds; i++) {
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class);
|
||||
locker.clean();
|
||||
System.gc();
|
||||
Thread.sleep(500); // memory seems more stable when waiting a bit
|
||||
long deepMemoryUsageOfLocker = MemoryUtil.deepMemoryUsageOf(locker);
|
||||
System.out.println("deepMemoryUsageOfLocker=" + deepMemoryUsageOfLocker);
|
||||
if (memoryResults.contains(deepMemoryUsageOfLocker)) {
|
||||
break;
|
||||
} else if (i == maxMesureRounds - 1) {
|
||||
fail("Used memory is unstable after " + maxMesureRounds + " rounds");
|
||||
}
|
||||
memoryResults.add(deepMemoryUsageOfLocker);
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure");
|
||||
}
|
||||
globalMemoryMeasurer.end();
|
||||
|
||||
warmupRound = false;
|
||||
|
||||
globalMemoryMeasurer = new MemoryMeasurer();
|
||||
globalMemoryMeasurer.begin();
|
||||
long usedMemory = 0;
|
||||
for (int i = 0; i < mesureRounds; i++) {
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class);
|
||||
boolean useGCBeforeMeasure = true;
|
||||
usedMemory = globalMemoryMeasurer.step(useGCBeforeMeasure);
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure");
|
||||
}
|
||||
|
||||
assertTrue("Used memory exceeds the expected", usedMemory < 200000);
|
||||
|
||||
locker.shutdown();
|
||||
|
||||
usedMemory = globalMemoryMeasurer.end();
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure after shutdown");
|
||||
|
||||
assertTrue("Used memory exceeds the expected", usedMemory < 20000);
|
||||
|
||||
locker = null;
|
||||
|
||||
usedMemory = globalMemoryMeasurer.end();
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure after set to null");
|
||||
assertTrue("Used memory exceeds the expected", usedMemory < 20000);
|
||||
|
||||
}
|
||||
|
||||
protected void launchThreadSafetyTest(final ILockerByKey locker, final int nOperatorsByClassOperator,
|
||||
final int nOperationsByOperator, boolean assertEntriesLessThanCleanPeriod, final boolean shutdownAtEnd,
|
||||
Class<? extends AbstractLockerByKeyOperator>... classOperators) throws Exception {
|
||||
private void launchThreadSafetyTest(final ILockerByKey locker, final int nOperatorsByClassOperator,
|
||||
final int nOperationsByOperator, boolean assertEntriesLessThanCleanPeriod, boolean warmupRound,
|
||||
final boolean shutdownAtEnd, Class<? extends AbstractLockerByKeyOperator>... classOperators) throws Exception {
|
||||
final ResultContainer resultContainer = new ResultContainer();
|
||||
|
||||
System.out.println("------------------------------------------------------------------------------------");
|
||||
System.out.println("####################################################################################");
|
||||
if (warmupRound) {
|
||||
System.out.println("!!! WARMUP ROUND !!! (don't take account the results of this round)");
|
||||
}
|
||||
|
||||
class LockerThreadSafetyTester extends AbstractThreadSafetyTester<AbstractLockerByKeyOperator> {
|
||||
|
||||
|
||||
@@ -15,29 +15,28 @@ package org.talend.commons.utils.threading.lockerbykey;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.MethodRule;
|
||||
import org.junit.rules.Timeout;
|
||||
import org.talend.commons.utils.memory.MemoryMeasurer;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.AbstractLockerByKeyOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.CleanOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.LockThenUnlockOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.LockThenUnlockUnrestrictedOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.ResultContainer;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.TryLockThenUnlockOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.TryLockThenUnlockUnrestrictedOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.TryLockWithTimeoutThenUnlockOperator;
|
||||
import org.talend.commons.utils.threading.lockerbykey.operators.TryLockWithTimeoutThenUnlockUnrestrictedOperator;
|
||||
|
||||
import com.javamex.classmexer.MemoryUtil;
|
||||
import org.talend.commons.utils.threading.threadsafetester.AbstractThreadSafetyTester;
|
||||
|
||||
public class LockerByKeyUnrestrictedTest extends LockerByKeyTest {
|
||||
|
||||
@@ -771,7 +770,7 @@ public class LockerByKeyUnrestrictedTest extends LockerByKeyTest {
|
||||
boolean shutdownAtEnd = true;
|
||||
boolean warmupRound = false;
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class);
|
||||
}
|
||||
|
||||
@@ -787,7 +786,7 @@ public class LockerByKeyUnrestrictedTest extends LockerByKeyTest {
|
||||
boolean shutdownAtEnd = true;
|
||||
boolean warmupRound = false;
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class, CleanOperator.class);
|
||||
}
|
||||
|
||||
@@ -803,7 +802,7 @@ public class LockerByKeyUnrestrictedTest extends LockerByKeyTest {
|
||||
boolean shutdownAtEnd = true;
|
||||
boolean warmupRound = false;
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, LockThenUnlockUnrestrictedOperator.class,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, LockThenUnlockUnrestrictedOperator.class,
|
||||
TryLockWithTimeoutThenUnlockOperator.class, TryLockWithTimeoutThenUnlockUnrestrictedOperator.class,
|
||||
TryLockThenUnlockOperator.class, TryLockThenUnlockUnrestrictedOperator.class, CleanOperator.class);
|
||||
}
|
||||
@@ -813,42 +812,150 @@ public class LockerByKeyUnrestrictedTest extends LockerByKeyTest {
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test(timeout = 30000)
|
||||
// @Test
|
||||
@Ignore("Ignored while JUnit buils is not modified to allow measure of memory")
|
||||
public void testMemory() throws Exception {
|
||||
ILockerByKey locker = createLockerInstance();
|
||||
|
||||
public void testUnrestricted_Memory() throws Exception {
|
||||
LockerByKeyUnrestricted locker = createLockerUnrestrictedInstance();
|
||||
final int nOperatorsByClassOperator = 30;
|
||||
final int nOperationsByOperator = 50;
|
||||
boolean assertEntriesLessThanCleanPeriod = true;
|
||||
boolean warmupRound = true;
|
||||
boolean shutdownAtEnd = false;
|
||||
int warmupRounds = 3;
|
||||
int mesureRounds = 3;
|
||||
|
||||
long previousDeepMemoryUsageOfLocker = MemoryUtil.deepMemoryUsageOf(locker);
|
||||
System.out.println("deepMemoryUsageOfLocker=" + previousDeepMemoryUsageOfLocker);
|
||||
Set<Long> memoryResults = new HashSet<Long>();
|
||||
|
||||
int maxMesureRounds = 10;
|
||||
for (int i = 0; i < maxMesureRounds; i++) {
|
||||
MemoryMeasurer globalMemoryMeasurer = new MemoryMeasurer();
|
||||
globalMemoryMeasurer.begin();
|
||||
for (int i = 0; i < warmupRounds; i++) {
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
shutdownAtEnd, LockThenUnlockOperator.class, LockThenUnlockUnrestrictedOperator.class,
|
||||
TryLockWithTimeoutThenUnlockOperator.class, TryLockWithTimeoutThenUnlockUnrestrictedOperator.class,
|
||||
TryLockThenUnlockOperator.class, TryLockThenUnlockUnrestrictedOperator.class);
|
||||
locker.clean();
|
||||
System.gc();
|
||||
Thread.sleep(500); // memory seems more stable when waiting a bit
|
||||
long deepMemoryUsageOfLocker = MemoryUtil.deepMemoryUsageOf(locker);
|
||||
System.out.println("deepMemoryUsageOfLocker=" + deepMemoryUsageOfLocker);
|
||||
if (memoryResults.contains(deepMemoryUsageOfLocker)) {
|
||||
break;
|
||||
} else if (i == maxMesureRounds - 1) {
|
||||
fail("Used memory exceeds the expected: deepMemoryUsageOfLocker > deepMemoryUsageOfLockerAtStart "
|
||||
+ deepMemoryUsageOfLocker + " > " + previousDeepMemoryUsageOfLocker);
|
||||
}
|
||||
memoryResults.add(deepMemoryUsageOfLocker);
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class);
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure");
|
||||
}
|
||||
globalMemoryMeasurer.end();
|
||||
|
||||
warmupRound = false;
|
||||
|
||||
globalMemoryMeasurer = new MemoryMeasurer();
|
||||
globalMemoryMeasurer.begin();
|
||||
long usedMemory = 0;
|
||||
for (int i = 0; i < mesureRounds; i++) {
|
||||
launchThreadSafetyTest(locker, nOperatorsByClassOperator, nOperationsByOperator, assertEntriesLessThanCleanPeriod,
|
||||
warmupRound, shutdownAtEnd, LockThenUnlockOperator.class, TryLockWithTimeoutThenUnlockOperator.class,
|
||||
TryLockThenUnlockOperator.class);
|
||||
boolean useGCBeforeMeasure = true;
|
||||
usedMemory = globalMemoryMeasurer.step(useGCBeforeMeasure);
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure");
|
||||
}
|
||||
|
||||
assertTrue("Used memory exceeds the expected", usedMemory < 300000);
|
||||
|
||||
locker.shutdown();
|
||||
|
||||
usedMemory = globalMemoryMeasurer.end();
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure after shutdown");
|
||||
|
||||
assertTrue("Used memory exceeds the expected", usedMemory < 50000);
|
||||
|
||||
locker = null;
|
||||
|
||||
usedMemory = globalMemoryMeasurer.end();
|
||||
globalMemoryMeasurer.printUsedMemory("Global used memory mesure after set to null");
|
||||
assertTrue("Used memory exceeds the expected", usedMemory < 50000);
|
||||
|
||||
}
|
||||
|
||||
private void launchThreadSafetyTest(final ILockerByKey locker, final int nOperatorsByClassOperator,
|
||||
final int nOperationsByOperator, boolean assertEntriesLessThanCleanPeriod, boolean warmupRound,
|
||||
final boolean shutdownAtEnd, Class<? extends AbstractLockerByKeyOperator>... classOperators) throws Exception {
|
||||
final ResultContainer resultContainer = new ResultContainer();
|
||||
|
||||
System.out.println("####################################################################################");
|
||||
if (warmupRound) {
|
||||
System.out.println("!!! WARMUP ROUND !!! (don't take account the results of this round)");
|
||||
}
|
||||
class LockerThreadSafetyTester extends AbstractThreadSafetyTester<AbstractLockerByKeyOperator> {
|
||||
|
||||
private boolean assertEntriesLessThanCleanPeriod;
|
||||
|
||||
public LockerThreadSafetyTester(int nOperatorsByClassOperator, boolean assertEntriesLessThanCleanPeriod,
|
||||
Class<? extends AbstractLockerByKeyOperator>... classOperators) {
|
||||
super(nOperatorsByClassOperator, classOperators);
|
||||
this.assertEntriesLessThanCleanPeriod = assertEntriesLessThanCleanPeriod;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.talend.commons.utils.threading.AbstractThreadSafetyTester#initInstance(org.talend.commons.utils.threading
|
||||
* .IThreadSafetyOperator)
|
||||
*/
|
||||
protected void initInstance(AbstractLockerByKeyOperator operatorInstance) {
|
||||
operatorInstance.setDebug(DEBUG);
|
||||
operatorInstance.setLocker(locker);
|
||||
operatorInstance.setnOperationsByOperator(nOperationsByOperator);
|
||||
operatorInstance.setResultContainer(resultContainer);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.threading.AbstractThreadSafetyTester#assertFinal()
|
||||
*/
|
||||
@Override
|
||||
protected void assertFinal() {
|
||||
int actualSumLockedAtEnd = 0;
|
||||
int actualSumLockersAtEnd = 0;
|
||||
for (int i = 0; i < nOperationsByOperator; i++) {
|
||||
LockerValue lockerValue = locker.getLockerValue(i);
|
||||
if (lockerValue != null) {
|
||||
int queueLength = lockerValue.getLock().getQueueLength();
|
||||
if (lockerValue != null) {
|
||||
actualSumLockedAtEnd += queueLength;
|
||||
}
|
||||
actualSumLockersAtEnd++;
|
||||
}
|
||||
}
|
||||
assertThat(actualSumLockedAtEnd, is(0));
|
||||
if (assertEntriesLessThanCleanPeriod) {
|
||||
assertTrue("actualSumLockersAtEnd > locker.getCleanPeriod() where actualSumLockersAtEnd="
|
||||
+ actualSumLockersAtEnd + " and locker.getCleanPeriod()=" + locker.getCleanPeriod(),
|
||||
actualSumLockersAtEnd < locker.getCleanPeriod());
|
||||
}
|
||||
|
||||
if (shutdownAtEnd) {
|
||||
locker.shutdown();
|
||||
} else {
|
||||
locker.clean();
|
||||
}
|
||||
actualSumLockedAtEnd = 0;
|
||||
actualSumLockersAtEnd = 0;
|
||||
for (int i = 0; i < nOperationsByOperator; i++) {
|
||||
LockerValue lockerValue = locker.getLockerValue(i);
|
||||
if (lockerValue != null) {
|
||||
int queueLength = lockerValue.getLock().getQueueLength();
|
||||
if (lockerValue != null) {
|
||||
actualSumLockedAtEnd += queueLength;
|
||||
}
|
||||
actualSumLockersAtEnd++;
|
||||
}
|
||||
}
|
||||
assertThat(actualSumLockedAtEnd, is(0));
|
||||
assertThat(actualSumLockersAtEnd, is(0));
|
||||
|
||||
assertThat(AbstractLockerByKeyOperator.getNotThreadSafeCounter(),
|
||||
is(resultContainer.sumThreadSafeOperations.get()));
|
||||
System.out.println("Total of operations done: " + resultContainer.sumThreadSafeOperations.get());
|
||||
System.out.println("Average duration: "
|
||||
+ ((double) getDuration() / (double) resultContainer.sumThreadSafeOperations.get()) + " ms by operation");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
LockerThreadSafetyTester lockerThreadSafetyTester = new LockerThreadSafetyTester(nOperatorsByClassOperator,
|
||||
assertEntriesLessThanCleanPeriod, classOperators);
|
||||
lockerThreadSafetyTester.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,9 @@ import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
*
|
||||
* class AbstractThreadSafetyTester.
|
||||
* DOC amaumont class global comment. Detailled comment
|
||||
*
|
||||
* Abstract class to launch test with multiple operators. You can set several operators (<code>classOperators</code>).
|
||||
* Each operator may be launched by a given number of threads (<code>nOperatorsByClassOperator</code>).
|
||||
*
|
||||
* @param T must implement the interface <code>IThreadSafetyOperator.class</code>
|
||||
* @param T
|
||||
*/
|
||||
public abstract class AbstractThreadSafetyTester<T extends IThreadSafetyOperator> {
|
||||
|
||||
@@ -41,20 +38,12 @@ public abstract class AbstractThreadSafetyTester<T extends IThreadSafetyOperator
|
||||
|
||||
private long duration;
|
||||
|
||||
/**
|
||||
*
|
||||
* AbstractThreadSafetyTester constructor.
|
||||
*
|
||||
* @param nOperatorsByClassOperator it means number of threads by operator
|
||||
* @param classOperators variable arguments of the operators
|
||||
*/
|
||||
public AbstractThreadSafetyTester(int nOperatorsByClassOperator, Class<? extends T>... classOperators) {
|
||||
this.nOperatorsByClassOperator = nOperatorsByClassOperator;
|
||||
this.classOperators = classOperators;
|
||||
this.barrier = new CyclicBarrier(nOperatorsByClassOperator * classOperators.length + 1);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void start() throws Exception {
|
||||
List<Future<Object>> operatorsHandlerList = new ArrayList<Future<Object>>();
|
||||
try {
|
||||
@@ -104,33 +93,10 @@ public abstract class AbstractThreadSafetyTester<T extends IThreadSafetyOperator
|
||||
return duration;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "initInstance".
|
||||
*
|
||||
* Used to initialize the useful variables of the operator.
|
||||
*
|
||||
* @param operatorInstance
|
||||
*/
|
||||
protected abstract void initInstance(T operatorInstance);
|
||||
|
||||
/**
|
||||
*
|
||||
* Method "assertFinal".
|
||||
*
|
||||
* Method executed when all operators have ended their operations. Add assertions into to verify that your class is
|
||||
* ThreadSafe.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected abstract void assertFinal() throws Exception;
|
||||
protected abstract void assertFinal();
|
||||
|
||||
/**
|
||||
*
|
||||
* ThreadSafetyOperatorHandler class.
|
||||
*
|
||||
* Wrapper for operator which will be submitted in the internal thread pool.
|
||||
*/
|
||||
public class ThreadSafetyOperatorHandler<A extends IThreadSafetyOperator> implements Callable<Object> {
|
||||
|
||||
private A operatorInstance;
|
||||
|
||||
@@ -15,16 +15,16 @@ package org.talend.commons.utils.tracer;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
/**
|
||||
* DOC amaumont class global comment. Detailled comment
|
||||
@@ -37,9 +37,6 @@ public class StatisticsTracerTest {
|
||||
|
||||
private static Logger log = Logger.getLogger(StatisticsTracerTest.class);
|
||||
|
||||
@Rule
|
||||
public TemporaryFolder testFolder = new TemporaryFolder();
|
||||
|
||||
@Test
|
||||
public void testStatisticTracer() throws InterruptedException {
|
||||
|
||||
@@ -99,28 +96,33 @@ public class StatisticsTracerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStatisticTracerAndTraceToFile() throws InterruptedException, IOException {
|
||||
public void testStatisticTracerAndTraceToFile() throws InterruptedException {
|
||||
|
||||
StatisticsTracer myTracerTest1 = StatisticsTracer.getTracer(MY_TRACER_TEST1);
|
||||
|
||||
testFolder.create();
|
||||
File newFile = testFolder.newFile("myTracerTest3");
|
||||
String pathFile = newFile.getPath();
|
||||
URL resource = StatisticsTracer.class.getResource(StatisticsTracer.class.getSimpleName() + ".class");
|
||||
File refClassFile = null;
|
||||
try {
|
||||
refClassFile = new File(new URI(resource.toString()));
|
||||
} catch (URISyntaxException e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
File folder = refClassFile.getParentFile();
|
||||
|
||||
String pathFile = folder.getAbsolutePath() + "/myTracerTest3";
|
||||
myTracerTest1.traceToFile(pathFile, false);
|
||||
|
||||
int sleepTime = 100;
|
||||
int executionsCount = 10;
|
||||
String firstRowStr = "";
|
||||
firstRowStr = myTracerTest1.toDataRow();
|
||||
for (int i = 0; i < executionsCount; i++) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
long id = myTracerTest1.start();
|
||||
firstRowStr = myTracerTest1.toDataRow();
|
||||
Thread.sleep(sleepTime);
|
||||
myTracerTest1.stop(id);
|
||||
myTracerTest1.print();
|
||||
}
|
||||
|
||||
long elapsedTimeSinceFirstStart = myTracerTest1.getElapsedTimeSinceFirstStart();
|
||||
|
||||
long averageWorkTime = myTracerTest1.getAverageWorkTime();
|
||||
long totalTime = myTracerTest1.getElapsedTime();
|
||||
// Changed by Marvin Wang on Feb.15 for TDI-19166, refer to the method from
|
||||
@@ -129,8 +131,8 @@ public class StatisticsTracerTest {
|
||||
// assertTrue(averageWorkTime >= sleepTime && averageWorkTime < sleepTime + 10);
|
||||
|
||||
int exepectedElapsedTimeSinceFirstStart = sleepTime * executionsCount;
|
||||
assertTrue("elapsedTimeSinceFirstStart=" + elapsedTimeSinceFirstStart + ", exepectedElapsedTimeSinceFirstStart="
|
||||
+ exepectedElapsedTimeSinceFirstStart, elapsedTimeSinceFirstStart >= exepectedElapsedTimeSinceFirstStart
|
||||
long elapsedTimeSinceFirstStart = myTracerTest1.getElapsedTimeSinceFirstStart();
|
||||
assertTrue(elapsedTimeSinceFirstStart >= exepectedElapsedTimeSinceFirstStart
|
||||
&& elapsedTimeSinceFirstStart < exepectedElapsedTimeSinceFirstStart + 50);
|
||||
|
||||
long countExecutions = myTracerTest1.getCountExecutions();
|
||||
@@ -143,7 +145,6 @@ public class StatisticsTracerTest {
|
||||
int fistRowByteLength = firstRowStr.getBytes().length;
|
||||
assertTrue(file.length() > (fistRowByteLength + 1) * executionsCount);
|
||||
file.delete();
|
||||
testFolder.delete();
|
||||
|
||||
StatisticsTracer.removeTracer(MY_TRACER_TEST1);
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: runtime (low dependencies) for Talend common classes
|
||||
Bundle-SymbolicName: org.talend.commons.runtime
|
||||
Bundle-Version: 2.2.0.qualifier
|
||||
Require-Bundle: org.talend.libraries.apache,
|
||||
org.eclipse.core.runtime,
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.emf.ecore.xmi
|
||||
Export-Package: org.talend.commons,
|
||||
org.talend.commons.debug,
|
||||
|
||||
@@ -4,5 +4,4 @@ bin.includes = META-INF/,\
|
||||
.,\
|
||||
fakejdbc_driver.jar,\
|
||||
modes/,\
|
||||
lib/talend_file_enhanced_20070724.jar,\
|
||||
talend.properties
|
||||
lib/talend_file_enhanced_20070724.jar
|
||||
|
||||
Binary file not shown.
@@ -113,9 +113,6 @@
|
||||
<KEYWORD1>try</KEYWORD1>
|
||||
<KEYWORD1>volatile</KEYWORD1>
|
||||
<KEYWORD1>while</KEYWORD1>
|
||||
<KEYWORD1>assert</KEYWORD1>
|
||||
<KEYWORD1>enum</KEYWORD1>
|
||||
<KEYWORD1>strictfp</KEYWORD1>
|
||||
|
||||
<KEYWORD2>package</KEYWORD2>
|
||||
<KEYWORD2>import</KEYWORD2>
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
#Created by JInto - www.guh-software.de
|
||||
#Thu Nov 22 16:33:05 CST 2007
|
||||
DatabaseContentRetriever.PRODUCTNAME=Database Product Name:
|
||||
DatabaseContentRetriever.PRODUCTVERSION=Database Product Version:
|
||||
DB2ForZosResultSet.outofRange=\ is out of range.
|
||||
DB2ForZosResultSet.parameterIndex=Invalid argument\: parameter index
|
||||
DB2ForZosResultSet.unknowCloumn=Invalid argument\: unknown column name
|
||||
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
|
||||
AbstractFakeResultSet.unknowCloumn=Invalid argument\: {0} is unknown column name
|
||||
AbstractFakeResultSet.parameterIndexOutOfRange=Invalid argument\: parameter index {0} is out of range
|
||||
EntryLocation.returnTableName={tableName={0}, columnName={1}}
|
||||
ExceptionHandler.Parameter.BeNull=ex param cannot be null
|
||||
ExtensionImplementationProviders.ExtensionPointError=Extension point must authoriez a single instance
|
||||
@@ -42,13 +38,12 @@ resources.resource.notMoved=Resource "{0}" cannot be moved to "{1}"
|
||||
utils.data.container=Id {0} already used in container
|
||||
utils.workbench.extensions.badNumberOfExtension=Bad number of extension found on {0}. Attending between {1} and {2} wile found {3}.
|
||||
utils.workbench.extensions.noExtension=No plug-in extending extension point ID "{0}" can be found.
|
||||
XmlNodeRetriever.countResult=Count result \:
|
||||
XmlNodeRetriever.countResult=Count result :
|
||||
XmlNodeRetriever.field2Node=field2Node=
|
||||
XmlNodeRetriever.filed1Node=field1Node=
|
||||
XmlNodeRetriever.mainExpression=main expression =
|
||||
XmlNodeRetriever.mainNode=mainNode=
|
||||
XmlNodeRetriever.proposal2Node=proposal2Nodes \:
|
||||
XmlNodeRetriever.prposal1Node=proposal1Nodes \:
|
||||
XmlNodeRetriever.proposal2Node=proposal2Nodes :
|
||||
XmlNodeRetriever.prposal1Node=proposal1Nodes :
|
||||
XmlNodeRetriever.singleQuotes='
|
||||
XmlNodeRetriever.xPathExpression=xPathExpression = '
|
||||
VersionUtils.readPropertyFileError=Error to read property in talend.properties file.
|
||||
|
||||
@@ -11,23 +11,17 @@
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils;
|
||||
|
||||
/**
|
||||
* This class store all the constant of SpecialValue.
|
||||
*
|
||||
*/
|
||||
public final class SpecialValueDisplay {
|
||||
public final class SpecialValueDisplay {
|
||||
|
||||
private SpecialValueDisplay() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public static final String NULL_FIELD = "Null field"; //$NON-NLS-1$
|
||||
private SpecialValueDisplay() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
public static final String NULL_FIELD = "Null field"; //$NON-NLS-1$
|
||||
|
||||
public static final String EMPTY_FIELD = "Empty field"; //$NON-NLS-1$
|
||||
|
||||
public static final String ZREO_FIELD = "0"; //$NON-NLS-1$
|
||||
|
||||
public static final String INVALID_FIELD = "invalid"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
||||
@@ -12,17 +12,8 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
|
||||
/**
|
||||
* Represents a version. Contents a major and a minor version.<br/>
|
||||
@@ -34,16 +25,6 @@ public class VersionUtils {
|
||||
|
||||
public static final String DEFAULT_VERSION = "0.1"; //$NON-NLS-1$
|
||||
|
||||
public static final String STUDIO_VERSION_PROP = "studio.version"; //$NON-NLS-1$
|
||||
|
||||
public static final String TALEND_VERSION_PROP = "talend.version"; //$NON-NLS-1$
|
||||
|
||||
private static final String COMMONS_PLUGIN_ID = "org.talend.commons.runtime"; //$NON-NLS-1$
|
||||
|
||||
private static final String TALEND_PROPERTIES_FILE = "/talend.properties"; //$NON-NLS-1$
|
||||
|
||||
private static Logger log = Logger.getLogger(VersionUtils.class);
|
||||
|
||||
public static int compareTo(String arg0, String arg1) {
|
||||
return new Version(arg0).compareTo(new Version(arg1));
|
||||
}
|
||||
@@ -60,61 +41,14 @@ public class VersionUtils {
|
||||
return toReturn.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC ycbai Comment method "getVersion".
|
||||
*
|
||||
* @return the studio version.
|
||||
*/
|
||||
public static String getVersion() {
|
||||
String version = System.getProperty(STUDIO_VERSION_PROP);
|
||||
String version = System.getProperty("talend.studio.version"); //$NON-NLS-1$
|
||||
if (version == null || "".equals(version.trim())) { //$NON-NLS-1$
|
||||
Bundle bundle = Platform.getBundle(COMMONS_PLUGIN_ID);
|
||||
Bundle bundle = Platform.getBundle("org.talend.commons.runtime"); //$NON-NLS-1$
|
||||
if (bundle != null) {
|
||||
version = (String) bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
|
||||
}
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC ycbai Comment method "getTalendVersion".
|
||||
*
|
||||
* return the internal version of the studio that may be different from the Studio version in OEM distribution. look
|
||||
* for version in org.talend.commons.runtime/talend.properties with the key talend.version if none found then return
|
||||
* the Studio version.
|
||||
*
|
||||
* @return the talend version or the Studio version or null if none found.
|
||||
*
|
||||
*/
|
||||
public static String getTalendVersion() {
|
||||
String version = null;
|
||||
|
||||
Bundle b = Platform.getBundle(COMMONS_PLUGIN_ID);
|
||||
if (b != null) {
|
||||
try {
|
||||
URL fileUrl = FileLocator.find(b, new Path(TALEND_PROPERTIES_FILE), null);
|
||||
if (fileUrl != null) {
|
||||
URL url = FileLocator.toFileURL(fileUrl);
|
||||
if (url != null) {
|
||||
FileInputStream in = new FileInputStream(url.getPath());
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
props.load(in);
|
||||
version = props.getProperty(TALEND_VERSION_PROP);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(Messages.getString("VersionUtils.readPropertyFileError"), e);
|
||||
}
|
||||
}
|
||||
if (version == null) {
|
||||
version = getVersion();
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,10 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Created by Marvin Wang on Nov 8, 2012.
|
||||
* DOC marvin class global comment. Detailled comment <br/>
|
||||
*
|
||||
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
|
||||
*
|
||||
*/
|
||||
public class ModuleNameExtractor {
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.talend.fakejdbc.FakeDatabaseMetaData;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment <br/>
|
||||
*
|
||||
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractFakeDatabaseMetaData extends FakeDatabaseMetaData {
|
||||
|
||||
protected static final String[] TABLE_META = { "ID", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
|
||||
protected static final String[] COLUMN_META = { "TABLE_NAME", "COLUMN_NAME", "TYPE_NAME", "COLUMN_SIZE", "DECIMAL_DIGITS", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
"NUM_PREC_RADIX", "IS_NULLABLE", "REMARKS", "COLUMN_DEF" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
private Connection connection;
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu AbstractFakeDatabaseMetaData constructor comment.
|
||||
*
|
||||
* @param connection
|
||||
*/
|
||||
public AbstractFakeDatabaseMetaData(Connection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeDatabaseMetaData#getConnection()
|
||||
*/
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
import org.talend.commons.utils.TalendDBUtils;
|
||||
import org.talend.fakejdbc.FakeResultSet;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment <br/>
|
||||
*
|
||||
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractFakeResultSet extends FakeResultSet {
|
||||
|
||||
private String[] tableMeta = new String[0];
|
||||
|
||||
private List<String[]> data = new ArrayList<String[]>();;
|
||||
|
||||
int index = -1;
|
||||
|
||||
public AbstractFakeResultSet() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void setMetadata(String[] tableMeta) {
|
||||
this.tableMeta = tableMeta;
|
||||
|
||||
}
|
||||
|
||||
public void setData(List<String[]> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/*
|
||||
* (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;
|
||||
}
|
||||
|
||||
protected 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("AbstractFakeResultSet.unknowCloumn", columnLabel)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return getString(columnIndex + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeResultSet#getInt(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public int getInt(String columnLabel) throws SQLException {
|
||||
String str = getString(columnLabel);
|
||||
if (columnLabel.equals("TYPE_NAME")) {
|
||||
int index = TalendDBUtils.convertToJDBCType(str);
|
||||
return index;
|
||||
} else if (columnLabel.equals("IS_NULLABLE")) {
|
||||
if (str.equals("N")) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return Integer.parseInt(str);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeResultSet#getBoolean(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public boolean getBoolean(String columnLabel) throws SQLException {
|
||||
String str = getString(columnLabel);
|
||||
return Boolean.parseBoolean(str);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeResultSet#getString(int)
|
||||
*/
|
||||
@Override
|
||||
public String getString(int columnIndex) throws SQLException {
|
||||
String[] row = data.get(index);
|
||||
columnIndex--;
|
||||
|
||||
if (columnIndex < 0 || columnIndex > row.length) {
|
||||
throw new SQLException(Messages.getString("AbstractFakeResultSet.parameterIndexOutOfRange", columnIndex)); //$NON-NLS-1$
|
||||
}
|
||||
return row[columnIndex];
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.sql.Types;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment <br/>
|
||||
*
|
||||
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
|
||||
*
|
||||
*/
|
||||
public class EmbeddedHiveResultSet extends AbstractFakeResultSet {
|
||||
|
||||
/**
|
||||
* DOC ggu EmbeddedHiveResultSet constructor comment.
|
||||
*/
|
||||
public EmbeddedHiveResultSet() {
|
||||
super();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.AbstractFakeResultSet#getInt(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public int getInt(String columnLabel) throws SQLException {
|
||||
if ("DATA_TYPE".equals(columnLabel)) {
|
||||
String sqlType = getString("TYPE_NAME");
|
||||
if (sqlType.trim().equalsIgnoreCase("TINYINT") || sqlType.trim().equalsIgnoreCase("SMALLINT")) { //$NON-NLS-1$
|
||||
return Types.SMALLINT;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("INT")) { //$NON-NLS-1$
|
||||
return Types.INTEGER;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("BIGINT")) { //$NON-NLS-1$
|
||||
return Types.BIGINT;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("BOOLEAN")) { //$NON-NLS-1$
|
||||
return Types.BOOLEAN;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("FLOAT")) { //$NON-NLS-1$
|
||||
return Types.FLOAT;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("DOUBLE")) { //$NON-NLS-1$
|
||||
return Types.DOUBLE;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("STRING")) { //$NON-NLS-1$
|
||||
return Types.VARCHAR;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("BINARY")) { //$NON-NLS-1$
|
||||
return Types.BINARY;
|
||||
} else if (sqlType.trim().equalsIgnoreCase("TIMESTAMP")) { //$NON-NLS-1$
|
||||
return Types.TIMESTAMP;
|
||||
}
|
||||
}
|
||||
// TODO Auto-generated method stub
|
||||
return super.getInt(columnLabel);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.talend.fakejdbc.FakeDatabaseMetaData;
|
||||
|
||||
/**
|
||||
*
|
||||
* Created by Marvin Wang on Nov 29, 2012.
|
||||
*/
|
||||
public class HiveDatabaseMetaData extends FakeDatabaseMetaData {
|
||||
|
||||
private Connection connection;
|
||||
|
||||
private DatabaseMetaData metaData;
|
||||
|
||||
public HiveDatabaseMetaData(Connection connection) throws SQLException {
|
||||
this.connection = connection;
|
||||
metaData = connection.getMetaData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
|
||||
return this.metaData.getTables(catalog, schemaPattern, tableNamePattern, types);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class MemoryMeasurer {
|
||||
* @return the difference between the used memory at beginning and at end of measure
|
||||
*/
|
||||
public long step() {
|
||||
boolean useGCBeforeMeasure = true;
|
||||
boolean useGCBeforeMeasure = false;
|
||||
return step(useGCBeforeMeasure);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class MemoryMeasurer {
|
||||
*
|
||||
*/
|
||||
public void printUsedMemory(String contextInfo) {
|
||||
callGC();
|
||||
callMultipleGC();
|
||||
String formated = String.format("%,d", getUsedMemoryFromBeginToCurrent(false));
|
||||
System.out.println((contextInfo != null ? contextInfo + " : " : "") + formated + " bytes");
|
||||
}
|
||||
@@ -146,9 +146,19 @@ public class MemoryMeasurer {
|
||||
return usedMemory - usedMemoryAtBeginning;
|
||||
}
|
||||
|
||||
private void callGC() {
|
||||
private void callMultipleGC() {
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
// runtime.gc();
|
||||
}
|
||||
|
||||
public void printInformations() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Talend Community Edition
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend 锟<EFBFBD>www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend <20> www.talend.com
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
@@ -41,8 +41,6 @@ public class EclipseCommandLine {
|
||||
static final String CMD_VMARGS = "-vmargs"; //$NON-NLS-1$
|
||||
|
||||
static final String NEW_LINE = "\n"; //$NON-NLS-1$
|
||||
|
||||
static public final String TALEND_NOSPLASH_COMMAND = "-nosplash";
|
||||
|
||||
/**
|
||||
* Use it to specify the type of project that will be use to configure the studio when relaunched
|
||||
@@ -68,9 +66,8 @@ public class EclipseCommandLine {
|
||||
* the command with value, except if value is null then the command shall be removed.
|
||||
*
|
||||
* @param command the command to add or update or remove (if value is null) (usually starts with a -)
|
||||
* @param value the value of the command,if the value is null,will only update the commmand
|
||||
* @param value the value of the command,if the value is null,will only update the commmanden
|
||||
* @param delete the flag used to trigger delete or insert/update the command
|
||||
* @param isOption this flag used to trigger for the option command without any arguments.
|
||||
*/
|
||||
static public void updateOrCreateExitDataPropertyWithCommand(String command, String value, boolean delete, boolean isOption) {
|
||||
boolean isValueNull = false;
|
||||
@@ -78,21 +75,19 @@ public class EclipseCommandLine {
|
||||
isValueNull = true;
|
||||
}
|
||||
StringBuffer result = new StringBuffer(512);
|
||||
|
||||
String currentProperty = System.getProperty(org.eclipse.equinox.app.IApplicationContext.EXIT_DATA_PROPERTY);
|
||||
String patternStr = "\\s+.+\\s"; //$NON-NLS-1$
|
||||
String patternStr = "\\s+.+\\s"; //$NON-NLS-1$
|
||||
// if the command is only one option. should only process the command without arguments.
|
||||
if (isOption) {
|
||||
patternStr = "\\s+"; //$NON-NLS-1$
|
||||
patternStr = "\\s+"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
String currentProperty = System.getProperty(org.eclipse.equinox.app.IApplicationContext.EXIT_DATA_PROPERTY);
|
||||
if (currentProperty != null) {// update the property
|
||||
Pattern commandPattern = Pattern.compile(command + patternStr);// -talendRestart\s+.+\s
|
||||
Matcher restartMatcher = commandPattern.matcher(currentProperty);
|
||||
|
||||
if (delete) {// if delete,no matter the value is null or not,remove the command directly
|
||||
if (restartMatcher.find()) {// match found so remove it
|
||||
currentProperty = restartMatcher.replaceAll(""); //$NON-NLS-1$
|
||||
currentProperty = restartMatcher.replaceAll("");//$NON-NLS-1$
|
||||
} // else no match so do nothing
|
||||
} else {// else add or update the command
|
||||
// try to find existing commands to update them
|
||||
@@ -103,7 +98,7 @@ public class EclipseCommandLine {
|
||||
// because no arguments, if have been existed, so ignore.
|
||||
} else {
|
||||
currentProperty = restartMatcher.replaceAll(command + EclipseCommandLine.NEW_LINE
|
||||
+ (isValueNull ? "" : value + EclipseCommandLine.NEW_LINE));
|
||||
+ (isValueNull ? "" : value + EclipseCommandLine.NEW_LINE));//$NON-NLS-1$
|
||||
}
|
||||
} else {// no match so insert it before the CMD_VMARGS
|
||||
int indexOfVmArgs = currentProperty.indexOf(CMD_VMARGS);
|
||||
|
||||
@@ -14,9 +14,7 @@ package org.talend.commons.utils.threading.lockerbykey;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -42,7 +40,7 @@ public class LockerByKey<KP> implements ILockerByKey<KP> {
|
||||
|
||||
private static Logger log = Logger.getLogger(LockerByKey.class);
|
||||
|
||||
private ConcurrentHashMap<InternalKeyLock<KP>, LockerValue<KP>> mapKeyLockToValueLock = new ConcurrentHashMap<InternalKeyLock<KP>, LockerValue<KP>>();
|
||||
ConcurrentHashMap<InternalKeyLock<KP>, LockerValue<KP>> mapKeyLockToValueLock = new ConcurrentHashMap<InternalKeyLock<KP>, LockerValue<KP>>();
|
||||
|
||||
private final Object lockAllOperations = new Object();
|
||||
|
||||
@@ -589,13 +587,4 @@ public class LockerByKey<KP> implements ILockerByKey<KP> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for mapKeyLockToValueLock.
|
||||
*
|
||||
* @return the mapKeyLockToValueLock
|
||||
*/
|
||||
Map<InternalKeyLock<KP>, LockerValue<KP>> getMapKeyLockToValueLock() {
|
||||
return new HashMap<InternalKeyLock<KP>, LockerValue<KP>>(mapKeyLockToValueLock);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ public class LockerByKeyUnrestricted<KP> implements ILockerByKey<KP> {
|
||||
blockAllOperations();
|
||||
boolean breakAtNext = false;
|
||||
while (true) {
|
||||
Collection<LockerValue<KP>> values = locker.getMapKeyLockToValueLock().values();
|
||||
Collection<LockerValue<KP>> values = locker.mapKeyLockToValueLock.values();
|
||||
int waitingThreads = 0;
|
||||
for (LockerValue<KP> lockerValue : values) {
|
||||
waitingThreads += lockerValue.getLock().getQueueLength();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TimeMeasure {
|
||||
|
||||
public static boolean isLogToFile = false;
|
||||
|
||||
public static boolean printMemoryUsed = false;
|
||||
public static boolean printMemoryUsed = true;
|
||||
|
||||
public static ITimeMeasureLogger logger;
|
||||
|
||||
@@ -107,18 +107,7 @@ public class TimeMeasure {
|
||||
}
|
||||
long totalElapsedTime = timeStack.getTotalElapsedTime();
|
||||
if (display) {
|
||||
if (printMemoryUsed) {
|
||||
// GC must be forced when check memory, or we can't mesure the difference
|
||||
Runtime.getRuntime().gc();
|
||||
long usedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
|
||||
System.out.println(indent(indent)
|
||||
+ "End '" + idTimer + "', total elapsed time: " + totalElapsedTime + " ms, " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ " current memory [" + usedMemory + "] bytes"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
System.out
|
||||
.println(indent(indent) + "End '" + idTimer + "', total elapsed time: " + totalElapsedTime + " ms "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
System.out.println(indent(indent) + "End '" + idTimer + "', total elapsed time: " + totalElapsedTime + " ms "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
indent--;
|
||||
if (isLogToFile && logger != null) {
|
||||
@@ -149,16 +138,7 @@ public class TimeMeasure {
|
||||
} else {
|
||||
long time = timers.get(idTimer).getTotalElapsedTime();
|
||||
if (display) {
|
||||
if (printMemoryUsed) {
|
||||
// GC must be forced when check memory, or we can't mesure the difference
|
||||
Runtime.getRuntime().gc();
|
||||
long usedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
|
||||
System.out.println(indent(indent) + "-> '" + idTimer + "', elapsed time since start: " + time + " ms," //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ " current memory [" + usedMemory + "] bytes"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
System.out.println(indent(indent) + "-> '" + idTimer + "', elapsed time since start: " + time + " ms "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
System.out.println(indent(indent) + "-> '" + idTimer + "', elapsed time since start: " + time + " ms "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
return time;
|
||||
}
|
||||
@@ -192,21 +172,9 @@ public class TimeMeasure {
|
||||
Date now = ca.getTime();
|
||||
long time = timeStack.getLastStepElapsedTime();
|
||||
if (display && displaySteps) {
|
||||
long usedMemory = 0;
|
||||
if (printMemoryUsed) {
|
||||
// GC must be forced when check memory, or we can't mesure the difference
|
||||
Runtime.getRuntime().gc();
|
||||
usedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
}
|
||||
String timerStepName = idTimer + "', step name '" + stepName; //$NON-NLS-1$
|
||||
if (printMemoryUsed) {
|
||||
System.out.println(indent(indent)
|
||||
+ "-> '" + timerStepName + "', elapsed time since previous step: " + time + " ms," + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
" current memory [" + usedMemory + "] bytes"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
System.out.println(indent(indent)
|
||||
+ "-> '" + timerStepName + "', elapsed time since previous step: " + time + " ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
String timerStepName = idTimer + "', step name '" + stepName;
|
||||
System.out.println(indent(indent)
|
||||
+ "-> '" + timerStepName + "', elapsed time since previous step: " + time + " ms "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (isLogToFile) {
|
||||
boolean foundTimerKey = false;
|
||||
for (String keyTimer : logValue.keySet()) {
|
||||
@@ -221,6 +189,9 @@ public class TimeMeasure {
|
||||
newRowValue.put(ELogFileColumnConstant.TIME_USED.locationY, time);
|
||||
// memory used
|
||||
if (printMemoryUsed) {
|
||||
// GC must be forced when check memory, or we can't mesure the difference
|
||||
Runtime.getRuntime().gc();
|
||||
long usedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
newRowValue.put(ELogFileColumnConstant.MEMO_USED.locationY, usedMemory);
|
||||
}
|
||||
// current time
|
||||
@@ -240,6 +211,9 @@ public class TimeMeasure {
|
||||
newRowValue.put(ELogFileColumnConstant.TIME_USED.locationY, time);
|
||||
// memory used
|
||||
if (printMemoryUsed) {
|
||||
// GC must be forced when check memory, or we can't mesure the difference
|
||||
Runtime.getRuntime().gc();
|
||||
long usedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
newRowValue.put(ELogFileColumnConstant.MEMO_USED.locationY, usedMemory);
|
||||
}
|
||||
// current time
|
||||
@@ -268,7 +242,6 @@ public class TimeMeasure {
|
||||
// long time = times.getElapsedTimeSinceLastRequest();
|
||||
time.pause();
|
||||
if (display) {
|
||||
// do nothing... yet
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -286,10 +259,9 @@ public class TimeMeasure {
|
||||
return;
|
||||
} else {
|
||||
TimeStack times = timers.get(idTimer);
|
||||
// long time = times.getLastStepElapsedTime();
|
||||
long time = times.getLastStepElapsedTime();
|
||||
times.resume();
|
||||
if (display) {
|
||||
// do nothing... yet
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,11 +286,11 @@ public class TimeMeasure {
|
||||
/* this enum define the attributes of columns in a log file */
|
||||
public enum ELogFileColumnConstant {
|
||||
|
||||
TITLE(0, 0, "Welcome to CommandLine performance test"), //$NON-NLS-1$
|
||||
STEP(0, 1, "Step"), //$NON-NLS-1$
|
||||
TIME_USED(1, 1, "TimeUsed(ms)"), //$NON-NLS-1$
|
||||
MEMO_USED(2, 1, "memoryUsed(bytes)"), //$NON-NLS-1$
|
||||
TIMETRACE(3, 1, "timeLine"); //$NON-NLS-1$
|
||||
TITLE(0, 0, "Welcome to CommandLine performance test"), //$NON-NLS-N$
|
||||
STEP(0, 1, "Step"), //$NON-NLS-N$
|
||||
TIME_USED(1, 1, "TimeUsed(ms)"), //$NON-NLS-N$
|
||||
MEMO_USED(2, 1, "memoryUsed(bytes)"), //$NON-NLS-N$
|
||||
TIMETRACE(3, 1, "timeLine");//$NON-NLS-N$
|
||||
|
||||
public int locationY;
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
talend.version=5.2.2
|
||||
@@ -1,79 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.help;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* DOC xqliu class global comment. Detailled comment
|
||||
*/
|
||||
public class UnitTestBuildCommonHelper {
|
||||
|
||||
/**
|
||||
* create a new file under the parent.
|
||||
*
|
||||
* @param parentPath parent path, if it is null create a new file under the default location
|
||||
* @param fileName file name with extension (don't include the path)
|
||||
* @param createIt create it if it is not exists
|
||||
* @return
|
||||
*/
|
||||
public static File createRealFile(String parentPath, String fileName, boolean createIt) {
|
||||
String path = parentPath == null ? System.getProperty("user.dir") : parentPath; //$NON-NLS-1$
|
||||
if (!path.endsWith(File.separator)) {
|
||||
path += File.separator;
|
||||
}
|
||||
File file = new File(path + fileName);
|
||||
if (createIt) {
|
||||
if (!file.exists()) {
|
||||
File folder = new File(path);
|
||||
if (folder.exists()) {
|
||||
if (!folder.isDirectory()) {
|
||||
folder.delete();
|
||||
folder.mkdirs();
|
||||
}
|
||||
} else {
|
||||
folder.mkdirs();
|
||||
}
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* create a new folder under the parent.
|
||||
*
|
||||
* @param parentPath parent path, if it is null create a new folder under the default location
|
||||
* @param folderName file name (don't include the path)
|
||||
* @param createIt create it if it is not exists
|
||||
* @return
|
||||
*/
|
||||
public static File createRealFolder(String parentPath, String folderName, boolean createIt) {
|
||||
String path = parentPath == null ? System.getProperty("user.dir") : parentPath; //$NON-NLS-1$
|
||||
if (!path.endsWith(File.separator)) {
|
||||
path += File.separator;
|
||||
}
|
||||
File file = new File(path + folderName);
|
||||
if (createIt) {
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.io;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.commons.utils.help.UnitTestBuildCommonHelper;
|
||||
|
||||
/**
|
||||
* DOC xqliu class global comment. Detailled comment
|
||||
*/
|
||||
public class FilesUtilsRealTest {
|
||||
|
||||
/**
|
||||
* Test method for {@link org.talend.commons.utils.io.FilesUtils#renameFolder(java.io.File, java.io.File)}
|
||||
*/
|
||||
@Test
|
||||
public void testRenameFolder() {
|
||||
String folderName1 = "test_folder_name"; //$NON-NLS-1$
|
||||
String folderName2 = "test_folder_name_rename"; //$NON-NLS-1$
|
||||
String fileName = "test_file_name.tdq"; //$NON-NLS-1$
|
||||
|
||||
File folder1 = UnitTestBuildCommonHelper.createRealFolder(null, folderName1, true);
|
||||
File file = UnitTestBuildCommonHelper.createRealFile(folder1.getAbsolutePath(), fileName, true);
|
||||
|
||||
File[] listFiles = folder1.listFiles();
|
||||
boolean b = false;
|
||||
for (File f : listFiles) {
|
||||
if (f.getAbsolutePath().equals(file.getAbsolutePath())) {
|
||||
b = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assertTrue(b);
|
||||
|
||||
String folder1Path = folder1.getAbsolutePath();
|
||||
int i = folder1Path.lastIndexOf(File.separator);
|
||||
File folder2 = new File(folder1Path.substring(0, i) + File.separator + folderName2);
|
||||
|
||||
FilesUtils.renameFolder(folder1, folder2);
|
||||
|
||||
assertFalse(folder1.exists());
|
||||
assertTrue(folder2.exists());
|
||||
|
||||
File[] listFiles2 = folder2.listFiles();
|
||||
boolean b2 = false;
|
||||
for (File f : listFiles2) {
|
||||
if (f.getName().equals(file.getName())) {
|
||||
b2 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assertTrue(b2);
|
||||
|
||||
FilesUtils.deleteFile(folder2, true);
|
||||
assertFalse(folder2.exists());
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
commons.error=\u9519\u8BEF
|
||||
TableViewerCreator.TableColumn.AssertMsg=ID\u5C5E\u6027\u4E3A\u2019{0}\u2018\u7684TableEditorColumn\u7684TableColumn\u6CA1\u6709\u6B63\u786E\u7684Table\u3002
|
||||
ColorStyledText.PasteItem.Text=\u7C98\u8D34
|
||||
EventUtil.UnknowDetail=\u672A\u77E5\u7684\u4E8B\u4EF6\u63CF\u8FF0\uFF1A
|
||||
ImportPushButtonForExtendedTable.ErrorMsg.Text=\u51FA\u9519
|
||||
ResetDBTypesButton.ResetDBTypesButton.Tip=\u91CD\u7F6E\u6240\u6709\u6570\u636E\u5E93\u7C7B\u578B
|
||||
ExportPushButtonForExtendedTable.ErrorMsg.Text=\u51FA\u9519!
|
||||
TableViewerCreator.IdProperty.AssertMsg=\u4F60\u5FC5\u987B\u6539\u53D8\u5217ID\u5C5E\u6027\uFF0C\u4E00\u4E2A\u8868\u4E2D\u5217\u7684ID\u5C5E\u6027\u5FC5\u987B\u552F\u4E00\u3002
|
||||
TableViewerCreator.CallMethod.ErrorMsg=\u53EA\u6709\u4F60\u7684\u5DF2\u7ECF\u8C03\u7528\u4E86createTable()\u65B9\u6CD5\u540E\uFF0C\u624D\u80FD\u8C03\u7528\u6B64\u65B9\u6CD5\u3002
|
||||
ExtendedTablePasteCommand.Paste.Label=\u4ECE\u5916\u90E8\u526A\u8D34\u677F\u7C98\u8D34\u6570\u636E
|
||||
SelectContextVariablesPushButton.Label=\u9009\u62E9\u4E0A\u4E0B\u6587\u53D8\u91CF
|
||||
ExtendedTableModel.ModifiedObject.Error=ModifiedBeanListenable\u7684\u5BF9\u8C61\u5FC5\u987B\u5728\u4F7F\u7528\u8FD9\u4E2A\u65B9\u6CD5\u4E4B\u524D\u88AB\u5B9E\u73B0\u3002
|
||||
ImportPushButton.ImportButton.Tip=\u5BFC\u5165XML\u6587\u4EF6\u66FF\u6362\u6240\u6709\u884C
|
||||
LabelledFileField.FileDialog.Text=\u9009\u62E9\u4E00\u4E2A
|
||||
TableViewerCreator.Table.BeNull=\u8868\u4E3A\u7A7A
|
||||
AddAllPushButton.AddAllButton.Tip=\u6DFB\u52A0\u6240\u6709
|
||||
ExtendedTableRemoveCommand.Romve.Label=\u5220\u9664\u8868
|
||||
AddPushButton.AddButton.Tip=\u6DFB\u52A0
|
||||
MoveDownPushButton.MoveDownTip=\u5411\u4E0B\u79FB\u52A8\u9009\u4E2D\u9879
|
||||
ExtendedTableCopyCommand.Copy.Label=\u590D\u5236\u4E00\u4E2A\u6216\u591A\u4E2A\u8868\u5728\u5916\u90E8\u526A\u8D34\u677F\u4E2D\u3002
|
||||
ProposalUtils.CtrlProposal.ErrorMsg=\u63A7\u952E\u7C7B\u578B\u63D0\u793A\u4E0D\u88AB\u652F\u6301\uFF1A
|
||||
AccessorUtils.isReq=\u9700\u8981\u4E00\u4E2ABean(<B>)
|
||||
EventUtil.UnknowType=\u672A\u77E5\u7684\u65F6\u95F4\u7C7B\u578B\uFF1A
|
||||
ProposalUtils.CellProposal.Error=CellEditor\u7C7B\u578B\u63D0\u793A\u4E0D\u88AB\u652F\u6301\uFF1A
|
||||
RemovePushButton.RemoveButton.Tip=\u5220\u9664\u6240\u9009\u9879
|
||||
FileStep2.previewFailure=\u9884\u89c8\u9519\u8bef\u3002\u987b\u6539\u53d8\u4e00\u4e9b\u8bbe\u7f6e\u3002 \n\u6ce8\u610f\uff1a\u9884\u89c8\u9519\u8bef\u53ef\u80fd\u662f\u56e0\u4e3a\u9519\u8bef\u7684\u7f16\u7801\u8bbe\u7f6e\u9020\u6210\u7684\u3002
|
||||
PastePushButton.PasteButton.Label=\u7C98\u8D34
|
||||
LabelledFileField.BrowseButton.Text=\u6D4F\u89C8...
|
||||
MoveUpPushButton.MoveUpButton.Tip=\u5411\u4E0A\u79FB\u52A8\u9009\u4E2D\u9879
|
||||
AccessorUtils.Assert1=\u8FD9\u4E2A\u5217(\u6807\u9898\u4E3A\u2018{0}\u2019\uFF0CID\u4E3A\u2018{1}\u2019)\u7684\u2018BeanPropertyAccessors\u2019\u6CA1\u6709\u6B63\u786E\u914D\u7F6E,\u6216\u8005\u503C\u8BBE\u7F6E\u4E3A\u4E0D\u6B63\u786E\u7684\u7C7B\u578B\u3002
|
||||
exception.errorOccured=\u4E00\u4E2A\u9519\u8BEF\u53D1\u751F({0}).\n \u8BE6\u7EC6\u63CF\u8FF0\u67E5\u770B\u65E5\u5FD7\u3002
|
||||
ColorStyledText.CopyItem.Text=\u590D\u5236
|
||||
AccessorUtils.Assert0=\u8FD9\u4E2A\u5217(\u6807\u9898\u4E3A\u2018{0}\u2019\uFF0CID\u4E3A\u2018{1}\u2019)\u7684\u2018BeanPropertyAccessors\u2019\u6CA1\u6709\u6B63\u786E\u914D\u7F6E\u3002\u2018{2}\u2019\u9700\u8981\u4E00\u4E2ABean<B>
|
||||
ExtendedTableMoveCommand.MoveLabel=\u5411\u4E0A\u6216\u5411\u4E0B\u79FB\u52A8\u4E00\u4E2A\u6216\u591A\u4E2A\u8868
|
||||
CopyPushButton.CopyButton.Tip=\u590D\u5236\u88AB\u9009\u4E2D\u7684\u9879
|
||||
ExtendedTableResetDBTypesCommand.ResetDBTypes.Label=\u91CD\u7F6E\u6240\u6709\u6570\u636E\u5E93\u7C7B\u578B\u4E3A\u9ED8\u8BA4\u503C
|
||||
ExtendedTableAddCommand.Add.Label=\u6DFB\u52A0\u4E00\u4E2A\u6216\u591A\u4E2A\u8868
|
||||
ControlUtils.Unsupported1=\u8FD9\u4E2A\u9762\u677F({0})\u4E0D\u652F\u6301\u3002\u5982\u679C\u4F60\u60F3\u4F7F\u7528\uFF0C\u8BF7\u6DFB\u52A0\u4E8B\u4EF6\u3002
|
||||
AccessorUtils.isReqValue=\u9700\u8981\u4E00\u4E2A\u503C(<V>),\u4F46\u662F\u8FD9\u4E2A\u503C\u662F\u7531\u2018CellEditorValueAdapter\u2019\u4EA7\u751F\u3002
|
||||
AccessorUtils.NoClassDef=\u7C7B\u672A\u5B9A\u4E49\u9519\u8BEF\uFF1A
|
||||
ErrorDialogWidthDetailArea.ErrorMessage.Text=\u9519\u8BEF\u4FE1\u606F
|
||||
ExceptionHandler.Parameter.BeNull=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u5F02\u5E38
|
||||
TreeToTablesLinker.Type.Unsupported=\u5F53\u524D\u63A7\u952E\u7C7B\u578B\u4E0D\u652F\u6301\u3002
|
||||
ModifyBeanValueCommand.ModifyCell.Label=\u4FEE\u6539\u5355\u5143\u683C\u503C
|
||||
ColorStyledText.SelectAllItem.Text=\u5168\u9009
|
||||
DialogErrorForCellEditorListener.Error.MsgDialogTitle=\u9519\u8BEF
|
||||
ExportPushButton.ExportButton.Tip=\u5BFC\u51FA\u6240\u6709\u884C\u5230XML\u6587\u4EF6
|
||||
TableViewerCreator.CellModifier.ExError=\u5F53\u524DCellModifier\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u3002\n \u4F7F\u7528\u2019{0}\u2018\u7C7B\u6216\u7EE7\u627F\u8FD9\u4E2A\u7C7B\u7684\u5B50\u7C7B
|
||||
Curve2D.MinNum.Be0=\u6BB5\u7684\u6700\u5C0F\u503C\u5FC5\u987B\u4E3A\u6B63\u6570\u62160\u3002
|
||||
ModeReader.IgnoreElement=\u5FFD\u7565\u672A\u77E5\u5143\u7D20
|
||||
Curve2D.MaxNum.Be0=\u6BB5\u7684\u6700\u5927\u503C\u5FC5\u987B\u4E3A\u6B63\u6570\u62160\u3002
|
||||
CellEditorValueAdapterFactory.valueNotStringType=Bean\u503C\u5FC5\u987B\u662F\u4E00\u4E2AString\u7C7B\u578B\uFF01
|
||||
ColorStyledText.RedoItem.Text=\u91CD\u505A
|
||||
ColorStyledText.UndoItem.Text=\u590D\u539F
|
||||
ContentProposalAdapterExtended.close=\u5173\u95ED
|
||||
ContentProposalAdapterExtended.closeFocusout=\u5173\u95EDfocusout
|
||||
DateDialog.textContent=\u9009\u62E9\u65E5\u671F& \u65F6\u95F4
|
||||
ErrorDialogWithContinue.setParameter=\u8BBE\u7F6E\u53C2\u6570\u5E76\u7EE7\u7EED
|
||||
EventUtil.activate=\u542f\u52a8
|
||||
EventUtil.close=\u5173\u95ED
|
||||
EventUtil.deactivate=\u64a4\u6d88
|
||||
EventUtil.defaultSelection=\u9ED8\u8BA4\u9009\u62E9
|
||||
EventUtil.dragDetect=\u62D6\u66F3\u68C0\u6D4B
|
||||
EventUtil.expand=\u6269\u5F20
|
||||
EventUtil.help=\u5e2e\u52a9
|
||||
EventUtil.modify=\u4FEE\u6539
|
||||
EventUtil.mouseDoubleClick=\u9F20\u6807\u53CC\u51FB
|
||||
EventUtil.mouseDown=\u9F20\u6807\u6309\u4E0B
|
||||
EventUtil.mouseEnter=\u9F20\u6807\u8F93\u5165
|
||||
EventUtil.mouseExit=\u9F20\u6807\u9000\u51FA
|
||||
EventUtil.mouseHover=\u9F20\u6807\u60AC\u505C
|
||||
EventUtil.mouseMove=\u9F20\u6807\u79FB\u52A8
|
||||
EventUtil.mouseUp=\u9F20\u6807\u5411\u4E0A
|
||||
EventUtil.move=\u79fb\u52a8
|
||||
EventUtil.paint=\u989C\u6599
|
||||
EventUtil.resize=\u8C03\u6574\u5927\u5C0F
|
||||
EventUtil.selectedEqual=\u9009\u5B9A\u7684
|
||||
EventUtil.selection=\u9009\u62E9
|
||||
EventUtil.show=\u663E\u793A
|
||||
EventUtil.verify=\u9A8C\u8BC1
|
||||
ExceptionMessageDialog.log=\u65E5\u5FD7
|
||||
SaveAsGenericSchemaPushButton.saveAsSchema=\u53e6\u5b58\u4e3a\u4e00\u822cschema
|
||||
@@ -56,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() {
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public abstract class ExtendedPushButton implements IExtendedPushButton {
|
||||
|
||||
public void handleEvent(ExtendedControlEvent event) {
|
||||
if (event.getType() == AbstractExtendedControlViewer.EVENT_TYPE.MODEL_CHANGED) {
|
||||
handleModelChange();
|
||||
button.setEnabled(getEnabledState());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,10 +95,6 @@ public abstract class ExtendedPushButton implements IExtendedPushButton {
|
||||
|
||||
}
|
||||
|
||||
protected void handleModelChange() {
|
||||
button.setEnabled(getEnabledState());
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for button.
|
||||
*
|
||||
|
||||
@@ -167,7 +167,7 @@ public class LabelledDirectoryField {
|
||||
gridLayout.marginWidth = 0;
|
||||
|
||||
compositeButton.setLayout(gridLayout);
|
||||
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
||||
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true));
|
||||
button = new Button(compositeButton, SWT.PUSH);
|
||||
GridDataFactory.swtDefaults().applyTo(button);
|
||||
button.setText(Messages.getString("LabelledFileField.BrowseButton.Text")); //$NON-NLS-1$
|
||||
|
||||
@@ -171,7 +171,7 @@ public class LabelledFileField {
|
||||
gridLayout.marginWidth = 0;
|
||||
|
||||
compositeButton.setLayout(gridLayout);
|
||||
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
||||
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true));
|
||||
button = new Button(compositeButton, SWT.PUSH);
|
||||
GridDataFactory.swtDefaults().applyTo(button);
|
||||
button.setText(Messages.getString("LabelledFileField.BrowseButton.Text")); //$NON-NLS-1$
|
||||
|
||||
@@ -349,10 +349,6 @@ public class LabelledText {
|
||||
return text.getEditable();
|
||||
}
|
||||
|
||||
public boolean getEnable() {
|
||||
return text.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* getCharCount to Text Object.
|
||||
*
|
||||
|
||||
@@ -303,8 +303,7 @@ public class TableToTreeLinker<D1, D2> extends BgDrawableComposite implements IB
|
||||
pointEndCentralCurve.x += offset.x - 6;
|
||||
pointEndCentralCurve.y += offset.y;
|
||||
|
||||
// Added by Marvin Wang on Dec. 17, 2012 for bug TDI-23378(see backport). This is not the best way to
|
||||
// fix this issue,
|
||||
// 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;
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class DialogErrorForCellEditorListener implements ICellEditorLis
|
||||
Messages.getString("DialogErrorForCellEditorListener.Error.MsgDialogTitle"), errorMessage); //$NON-NLS-1$
|
||||
final int columnPosition = tableViewerCreator.getColumns().indexOf(column);
|
||||
tableViewerCreator.getTableViewer().editElement(currentModifiedBean, columnPosition);
|
||||
text.setText(originalValue == null ? "" : originalValue.toString());
|
||||
text.setText("");
|
||||
text.setSelection(selection.x, selection.y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.util.zip.ZipFile;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
@@ -57,7 +58,6 @@ import org.eclipse.core.runtime.Path;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
import org.talend.commons.utils.StringUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
@@ -409,7 +409,7 @@ public class FilesUtils {
|
||||
List<URL> urls = new ArrayList<URL>();
|
||||
List<File> files = getFiles(file, extension, excludedFile, excludedFolder, nested);
|
||||
for (File file2 : files) {
|
||||
urls.add(file2.toURI().toURL());
|
||||
urls.add(file2.toURL());
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ public class FilesUtils {
|
||||
if (file.isDirectory()) {
|
||||
copyDirectory(file, targetfolder);
|
||||
} else if (file.isFile()) {
|
||||
copyFile(file, new File(targetfolder.getAbsolutePath() + File.separator + file.getName()));
|
||||
copyFile(file, targetfolder);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -1078,30 +1078,4 @@ public class FilesUtils {
|
||||
deleteFile(srcfolder, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC xqliu Comment method "getAllFilesFromFolder".
|
||||
*
|
||||
* @param aFolder
|
||||
* @param filenameFilter
|
||||
* @return
|
||||
*/
|
||||
public static List<File> getAllFilesFromFolder(File aFolder, FilenameFilter filenameFilter) {
|
||||
List<File> files = new ArrayList<File>();
|
||||
getAllFilesFromFolder(aFolder, files, filenameFilter);
|
||||
return files;
|
||||
}
|
||||
|
||||
public static String getFileRealPath(String filePath) {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
filePath = filePath.replace("%20", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
file = new File(filePath);
|
||||
if (file.exists()) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
pluginName=\u7EC4\u4EF6\u6A21\u5757
|
||||
prefColors=\u4EE3\u7801\u67E5\u770B\u5668\u989C\u8272\u914D\u7F6E
|
||||
defaultTypeAndLength=\u9ED8\u8BA4\u7C7B\u578B\u548C\u957F\u5EA6
|
||||
@@ -1,18 +1,11 @@
|
||||
UpdatesConstants.Context=Context
|
||||
UpdatesConstants.Job=Job
|
||||
VersionSection.Version=Versie
|
||||
ContextProcessSection.errorTitle=Fout
|
||||
VersionSection.CreationDate=Creatie Datum
|
||||
ContextProcessSection.7=Naam voor nieuwe Context
|
||||
ContextProcessSection.6=Nieuwe Context
|
||||
RoutinesFunctionProposal.User=Gebruiker
|
||||
ContextProcessSection.49=Standaard Context
|
||||
XmlArray.InvalidFile=Ongeldig bestand
|
||||
ContextProcessSection.29=Fout
|
||||
EUpdateItemType.Name=Naam
|
||||
ContextParameterProposal.ContextVariable=Context variabele
|
||||
UpdatesConstants.Joblet=Joblet
|
||||
VersionSection.ModificationDate=Wijzigings Datum
|
||||
ComponentsFormatPreferencePage.add=Toevoegen
|
||||
ComponentToRepositoryProperty.error=Fout
|
||||
ContextSetConfigurationDialog.nameNotValid=Ongeldige naam
|
||||
@@ -21,7 +14,6 @@ ProcessorUtilities.generatingJob=Job genereren...
|
||||
ProcessorUtilities.loadingJob=Job laden...
|
||||
VariableItemEditor.name=Naam
|
||||
VariableItemEditor.new=Nieuw
|
||||
XSDValidater.IllegalArgument=De input xsd file bestaat niet.
|
||||
ApplicationActionBarAdvisor.menuFileLabel=&Bestand
|
||||
ApplicationActionBarAdvisor.navigateLabel=&Navigeer
|
||||
ApplicationActionBarAdvisor.gotoLabel=&Ga naar
|
||||
@@ -38,23 +30,15 @@ ConextTableValuesComposite.nameLabel=Naam
|
||||
ContextTemplateComposite.CommentLabel=Opmerking
|
||||
ContextTemplateComposite.nameLabel=Naam
|
||||
ContextTemplateComposite.sourceLabel=Bron
|
||||
ContextTreeConstants.contextName=Context
|
||||
UpdatesConstants.ContextGroup=Context Groep
|
||||
EComponentCategory_assignment=Toewijzing
|
||||
EComponentCategory_context=Context
|
||||
EComponentCategory_properties=Eigenschappen
|
||||
EComponentCategory_sqlTemplate=SQL Template
|
||||
EComponentCategory_version=Versie
|
||||
AbstractBrandingService_job_license_header_content=// ============================================================================\n//\n// This source code has been automatically generated by_{0}\n// / JobDesigner (CodeGenerator version {1})\n// You can find more information about Talend products at www.talend.com.\n//\n// ============================================================================
|
||||
HTMLDocGenerator.comment=Opmerking
|
||||
HTMLDocGenerator.context=Context:
|
||||
HTMLDocGenerator.mapper.alias=Alias
|
||||
HTMLDocGenerator.name=Naam
|
||||
HTMLDocGenerator.project_description=Project omschrijving
|
||||
HTMLDocGenerator.project_name=Project Naam
|
||||
HTMLDocGenerator.properties=Eigenschappen
|
||||
HTMLDocGenerator.source=Bron
|
||||
HTMLDocGenerator.version=Versie
|
||||
ConnectionParameterName.UserLabel=Gebruiker
|
||||
ConnectionParameterName.PasswordLabel=Wachtwoord
|
||||
AbstractBrandingService.routines_license_header_content1=Copyright (c) 2005-2012, Talend Inc.n//n// This source code has been automatically generated by_{0}n// CodeGenerator version {1}n// You can find more information about Talend products at www.talend.com.n// You may distribute this code under the terms of the GNU LGPL licensen// http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
@@ -1,292 +0,0 @@
|
||||
MetadataTypeLengthConstants.LIST_LENGTH=\u5217\u8868
|
||||
SelectRepositoryContextDialog.SelectAll=\u5168\u9009
|
||||
ColorsCodeViewerPreferencePage.keyword2Color=\u5173\u952E\u5B572 \u989C\u8272
|
||||
MetadataDialog.Message=\u6240\u6709\u6765\u81EA\u8F93\u5165Schema\u7684\u5217\u5C06\u88AB\u8F6C\u6362\u5230\u8F93\u51FASchema
|
||||
MetadataDialog.TransferMessage=\u6240\u6709\u6765\u81EA\u8F93\u51FASchema\u7684\u5217\u5C06\u88AB\u8F6C\u6362\u5230\u8F93\u5165Schema
|
||||
EMetadataEncoding.Cyrillic=\u53E4\u4EE3\u65AF\u62C9\u592B\u8BED
|
||||
EUpdateResult.BuiltIn=\u66F4\u6539\u4E3ABuilt-In\u6A21\u5F0F
|
||||
EUpdateResult.Rename=\u66F4\u6539\u540D\u79F0
|
||||
ContextProcessSection.ParameterNameIsNotValid=\u53C2\u6570\u540D\u5B57\u65E0\u6548\u3002
|
||||
ColorsCodeViewerPreferencePage.DigitColor=\u6570\u5B57 \u989C\u8272
|
||||
EMetadataEncoding.Hebrew=\u5E0C\u4F2F\u6765\u8BED
|
||||
UpdatesConstants.Context=\u7EC4\u4EF6
|
||||
UpdatesConstants.Job=\u8fdb\u7a0b
|
||||
RepositoryUpdateManager.NoModificationTitle=\u6CA1\u6709\u9700\u8981\u7684\u4FEE\u6539
|
||||
CorePreferencePage.javaInterpreter=Java\u89E3\u91CA\u5668
|
||||
EMetadataEncoding.GB2312=\u4E2D\u6587
|
||||
MetadataEmfTableEditor.ColumnInvalid=\u5217\u540D{0}\u65E0\u6548\u3002
|
||||
NodeReturnProposal.VariableName=\n\n\u53D8\u91CF\u540D\uFF1A {5}
|
||||
ERepositoryObjectType.FolderNotFound=\u7C7B\u578B{0}\u7684\u76EE\u5F55\u672A\u627E\u5230
|
||||
CorePreferencePage.componentDefaultFileDirectory=\u7EC4\u4EF6\u7F3A\u7701\u6587\u4EF6\u76EE\u5F55
|
||||
ColorsCodeViewerPreferencePage.keyword1Color=\u5173\u952E\u5B571 \u989C\u8272
|
||||
CorePreferencePage.runInMultiThread=\u591A\u7EBF\u7A0B\u8FD0\u884C(\u521b\u5efa\u65b0\u4f5c\u4e1a\u9ed8\u8ba4\u91c7\u7528)
|
||||
MappingFileLoader.UndeclaredDbType="{0}"\u6CA1\u6709\u88AB\u7533\u660E\u7684\u6570\u636E\u5E93\u7C7B\u578B\uFF0C\u5728\u6570\u636E\u5E93ID"{1}"\u5728\u8282\u70B9\uFF1A{2}
|
||||
EConnectionType.tableMenu=\u540E\u8FD0\u884C
|
||||
MappingFileLoader.UnbindedDbTypes=\u5728\u6570\u636E\u5E93ID"{0}"\u7684Mapping\u6587\u4EF6\uFF0C\u6570\u636E\u5E93\u7C7B\u578B\u6CA1\u6709\u7528"{1}" Talend \u7C7B\u578B\uFF1A"{2}"\u7ED1\u5B9A
|
||||
MetadataTypeLengthPreferencePage.FIELD=\u6240\u6709\u5B57\u6BB5\u9ED8\u8BA4\u8BBE\u7F6E
|
||||
EConnectionType.onComponentErrorMenu=\u7EC4\u4EF6\u8FD0\u884C\u9519\u8BEF
|
||||
Parameter.Type=\u7C7B\u578B\uFF1A
|
||||
EConnectionType.onComponentOkMenu=\u7EC4\u4EF6\u8FD0\u884C\u6B63\u786E
|
||||
PerspectiveMenuManager.perspectiveLabel=\u900F\u89C6\u56FE(&P)
|
||||
NodeReturnProposal.Description=\u63CF\u8FF0\uFF1A {0}
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=\u8868\u89C6\u56FE
|
||||
Parameter.Value=\u503C\uFF1A
|
||||
EConnectionType.runAfterMenu=\u8FD0\u884C\u540E
|
||||
ContextParameterProposal.Type=\n\u7C7B\u578B\uFF1A {1}
|
||||
ColorsCodeViewerPreferencePage.fieldTip=\u7C97\u4F53(&B)
|
||||
GlobalServiceRegister.ServiceNotRegistered=\u670D\u52A1{0}\u6CA1\u6709\u88AB\u6CE8\u518C
|
||||
ConextTemplateComposite.OrderText=\u539F\u59CB\u987A\u5E8F
|
||||
SelectRepositoryContextDialog.Title=\u9009\u62E9\u4E0A\u4E0B\u6587\u53D8\u91CF
|
||||
ColorsCodeViewerPreferencePage.LabelColor=\u6807\u7B7E \u989C\u8272
|
||||
EUpdateResult.Add=\u6DFB\u52A0\u5230\u5E93
|
||||
ColorsCodeViewerPreferencePage.MarkupColor=\u6807\u8BB0 \u989C\u8272
|
||||
ColorsCodeViewerPreferencePage.Comment2Color=\u6CE8\u91CA2 \u989C\u8272
|
||||
EUpdateResult.JobletUpdate=\u66F4\u65B0joblet\u8282\u70B9
|
||||
JavaGlobalVariableProposal.Description=\u63CF\u8FF0\uFF1A {0}
|
||||
RoutinesFunctionProposal.ReturnType=\u8FD4\u56DE\u7C7B\u578B:
|
||||
EConnectionType.onSubjobOkMenu=\u5B50job\u6B63\u786E
|
||||
CorePreferencePage.groupBySource=\u5728\u4E0A\u4E0B\u6587\u201C\u6839\u636E\u6E90\u5206\u7EC4\u201D
|
||||
NodeReturnProposal.Availability=\n\u53EF\u7528\u6027\uFF1A {4}
|
||||
EConnectionType.onSubjobErrorMenu=\u5B50job\u9519\u8BEF
|
||||
RepositoryUpdateManager.ItemsToUpdate=\u68C0\u67E5\u9879\u76EE\u4EE5\u66F4\u65B0
|
||||
SelectRepositoryContextDialog.Label=\u9009\u62E9\u5E93\u4E0A\u4E0B\u6587\u4E2D\u7684\u53D8\u91CF\u3002
|
||||
EMetadataEncoding.Greek=\u5E0C\u814A
|
||||
EMetadataEncoding.UTF16BE=Unicode BigEndian (16\u4F4D)
|
||||
EConnectionType.synchronize=\u540C\u6B65
|
||||
VersionSection.Version=\u7248\u672C
|
||||
ContextParameterProposal.Description=\u63CF\u8FF0\uFF1A {0}
|
||||
EUpdateResult.Delete=\u4ECE\u5E93\u4E2D\u5220\u9664
|
||||
SelectRepositoryContextDialog.ExpandAll=\u5C55\u5F00
|
||||
NodeReturnProposal.Type=\n\u7C7B\u578B\uFF1A {3}
|
||||
ColorsCodeViewerPreferencePage.FunctionColor=\u65B9\u6CD5 \u989C\u8272
|
||||
EUpdateItemType.Components=\u7EC4\u4EF6
|
||||
MetadataTypeLengthConstants.CHARACTER_LENGTH=\u5b57\u7b26
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=\u7F29\u653E\u89C6\u56FE
|
||||
EConnectionType.mergeMenu=\u5408\u5E76
|
||||
ColorsCodeViewerPreferencePage.Comment1Color=\u6CE8\u91CA1 \u989C\u8272
|
||||
RoutinesFunctionProposal.VariableName=\n\n\u53D8\u91CF\u540D\uFF1A {2}
|
||||
RepositoryUpdateManager.RenameContextTitle=\u91CD\u547D\u540D\u95EE\u9898
|
||||
EUpdateItemType.Schema=\u67B6\u6784
|
||||
MetadataEmfTableEditor.ColumnNameExists=\u5217\u540D{0}\u5DF2\u5B58\u5728\u3002
|
||||
Parameter.Name=\u53C2\u6570\u540D
|
||||
FunctionManager.PurePerl.ParaName=\u81EA\u5B9A\u4E49\u53C2\u6570
|
||||
ContextValueErrorChecker.ErrorTitile=\u4E0A\u4E0B\u6587\u503C\u9519\u8BEF:
|
||||
EUpdateItemType.Query=\u67E5\u8BE2
|
||||
ExtractMetaDataFromDataBase.SchemaNoPresent=Schema\u5728\u6570\u636E\u5E93\u4E2D\u672A\u51FA\u73B0
|
||||
PerlGlobalVariableProposal.Description=\u63CF\u8FF0:{0}
|
||||
UpdatesConstants.Component=\u7EC4\u4EF6
|
||||
Parameter.Comment=\u6CE8\u91CA\uFF1A
|
||||
CorePreferencePage.perlInterpreter=Perl\u89E3\u91CA\u5668
|
||||
ColorsCodeViewerPreferencePage.OperatorColor=\u64CD\u4F5C\u7B26 \u989C\u8272
|
||||
EMetadataEncoding.GB18030=\u4E2D\u6587\u56FD\u6807
|
||||
ContextProcessSection.errorTitle=\u9519\u8BEF
|
||||
EConnectionType.parallelize=\u5E76\u884C
|
||||
MetadataDialog.SchemaModification=Schema\u7F16\u8F91
|
||||
VersionSection.CreationDate=\u521B\u5EFA\u65E5\u671F
|
||||
JavaGlobalVariableProposal.VariableName=\n\n\u53D8\u91CF\u540D:{1}
|
||||
MappingFileLoader.UnbindedTalendTypes=\u5728\u6570\u636E\u5E93ID"{0}"\u7684Mapping\u6587\u4EF6\uFF0CTalend\u7C7B\u578B\u6CA1\u6709\u7528"{1}"\u6570\u636E\u5E93\u7C7B\u578B:{2}\u7ED1\u5B9A
|
||||
MetadataTableEditor.ColumnNameExists=\u5217\u540D{0}\u5DF2\u7ECF\u5B58\u5728\u3002
|
||||
MetadataTableEditor.ColumnNameIsInvalid=\u5217\u540D{0}
|
||||
ColorsCodeViewerPreferencePage.defaultColor=\u9ED8\u8BA4 \u989C\u8272
|
||||
ContextProcessSection.7=\u4E3A\u65B0\u7684\u4E0A\u4E0B\u6587\u6307\u5B9A\u540D\u5B57
|
||||
ContextProcessSection.6=\u65B0\u7684\u4E0A\u4E0B\u6587
|
||||
EConnectionType.mainMenu=\u4E3B\u7EBF
|
||||
ContextProcessSection.4=\u6DFB\u52A0\u65B0\u7684\u4E0A\u4E0B\u6587 ->(
|
||||
ContextProcessSection.2=\u8BF7\u786E\u8BA4?
|
||||
ContextProcessSection.1=\u83DC\u5355\u8868\u683C
|
||||
EUpdateItemType.Property=\u5C5E\u6027
|
||||
SelectRepositoryContextDialog.DeselectAll=\u5168\u90E8\u4E0D\u9009
|
||||
CorePreferencePage.iReportPath=iReport \u8DEF\u5F84
|
||||
MetadataTalendType.DBMSNotSetted=\u6570\u636E\u5E93\u672A\u8BBE\u7F6E
|
||||
ContextParameterProposal.VariableName=\n\n\u53D8\u91CF\u540D\uFF1A {2}
|
||||
ColorsCodeViewerPreferencePage.InvalidColor=\u975E\u6CD5 \u989C\u8272
|
||||
ExtractMetaDataFromDataBase.dbTypeNotFound=dbType{0}\u672A\u627E\u5230
|
||||
RepositoryUpdateManager.NoModificationMessages=\u6CA1\u6709\u9700\u8981\u7684\u66F4\u65B0
|
||||
EMetadataEncoding.Latin6=Latin6 (\u65E5\u8033\u66FC\u8BED)
|
||||
EMetadataEncoding.Latin5=Latin5 (\u571F\u8033\u5176\u8BED)
|
||||
RoutinesFunctionProposal.User=\u7528\u6237
|
||||
EMetadataEncoding.Latin4=Latin4 (\u5317\u6B27)
|
||||
EMetadataEncoding.Latin3=Latin3 (\u5357\u6B27)
|
||||
ColorsCodeViewerPreferencePage.Literal2Color=\u6587\u5B572 \u989C\u8272
|
||||
EMetadataEncoding.Latin2=Latin2 (\u4E1C\u6B27)
|
||||
EMetadataEncoding.Latin1=Latin1 (\u897F\u6B27)
|
||||
EMetadataEncoding.UTF16=Unicode 2.0 (16\u4F4D)
|
||||
RoutinesFunctionProposal.System=\u7CFB\u7EDF
|
||||
CorePreferencePage.temporaryFiles=\u4E34\u65F6\u6587\u4EF6
|
||||
EUpdateResult.Reload=\u91CD\u65B0\u52A0\u8F7D\u7EC4\u4EF6
|
||||
RepositoryUpdateManager.Title=\u4fee\u6539
|
||||
ContextProcessSection.49=\u7F3A\u7701\u4E0A\u4E0B\u6587
|
||||
PerlGlobalVariableProposal.VariableName=\n\n\u53D8\u91CF\u540D:{1}
|
||||
RepositoryObject.NotImplemented=\u672A\u5B9E\u73B0
|
||||
MetadataTypeLengthPreferencePage.VALUE=\u7A7A\u503C\u5B57\u6BB5\u9ED8\u8BA4\u8BBE\u7F6E
|
||||
ERepositoryObjectType.NotImplemented=\u672A\u5B9E\u73B0
|
||||
ExtractMetaDataFromDataBase.connectionSuccessful=\u8FDE\u63A5\u6210\u529F
|
||||
LogImageCacheAction.CacheImage=\u7F13\u5B58\u56FE\u7247
|
||||
ContextParameterProposal.NoCommentAvaiable=\u6CA1\u6709\u6CE8\u91CA\u3002
|
||||
SelectRepositoryContextGroupDialog.Default=\u7F3A\u7701
|
||||
FunctionManager.PurePerl.Desc=\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u8868\u8FBE\u5F0F
|
||||
XmlArray.InvalidFile=\u65E0\u6548\u7684\u6587\u4EF6\u3002
|
||||
EConnectionType.lookupMenu=\u67E5\u8BE2
|
||||
ContextProcessSection.30=\u540D\u5B57\u5DF2\u5B58\u5728
|
||||
EUpdateItemType.Variable=\u53D8\u91CF
|
||||
MetadataTypeLengthConstants.OBJECT_LENGTH=\u6a21\u5757
|
||||
ContextProcessSection.29=\u9519\u8BEF
|
||||
CorePreferencePage.previewLimit=\u9884\u89C8\u9650\u5236
|
||||
RoutinesFunctionProposal.Description=\u63CF\u8FF0:
|
||||
LogImageCacheAction.CacheImageDesc=\u7F13\u5B58\u56FE\u7247\u4FE1\u606F\u63CF\u8FF0
|
||||
ColorsCodeViewerPreferencePage.Literal1Color=\u6587\u5B571 \u989C\u8272
|
||||
ConextTemplateComposite.OrderMessages=\u5982\u679C\u60A8\u60F3\u91CD\u65B0\u6392\u5217\u53D8\u91CF\uFF0C\u5FC5\u987B\u9009\u4E2D\u5B83.
|
||||
MetadataTypeLengthConstants.VALUE_DEFAULT_TYPE=\u9ED8\u8BA4\u7C7B\u578B
|
||||
EUpdateItemType.Name=\u8fde\u63a5\u540d
|
||||
ContextProcessSection.13=\u4E3A\u4E0A\u4E0B\u6587\u6307\u5B9A\u65B0\u540D\u5B57{0}
|
||||
ContextProcessSection.12=\u4E3A\u4E0A\u4E0B\u6587\u6539\u540D
|
||||
ContextParameterProposal.ContextVariable=\n\n\u4E0A\u4E0B\u6587\u53D8\u91CF\u3002
|
||||
EMetadataEncoding.Big5=\u7E41\u4F53\u4E2D\u6587
|
||||
Function.FunctionName=\u51FD\u6570\u540D{0}
|
||||
ContextProcessSection.RemoveInformation={0}\u4E3A\u9ED8\u8BA4\u7684\u4E0A\u4E0B\u6587,\u4E0D\u80FD\u5220\u9664
|
||||
MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE=\u9ED8\u8BA4\u7C7B\u578B
|
||||
RoutinesFunctionProposal.CreatedBy=\u88AB\u521B\u5EFA:
|
||||
RepositoryUpdateManager.Messages=\u60A8\u60F3\u5C06\u8FD9\u4E9B\u4FEE\u6539\u4F20\u9012\u5230\u6240\u6709\u4F5C\u4E1A\u4E2D\u5417\uFF1F\u53EF\u80FD\u9700\u8981\u8F83\u957F\u65F6\u95F4\u3002
|
||||
MappingFileLoader.InvalidTalendType="{0}"\u662F\u4E00\u4E2A\u975E\u6CD5\u7684Talend\u7C7B\u578B\u5BF9\u6570\u636E\u5E93ID"{2}"\uFF0C\u5728\u8282\u70B9\uFF1A{3}
|
||||
RepositoryUpdateManager.Check=\u68C0\u67E5\u4E2D...
|
||||
RoutinesFunctionProposal.Example=\u793A\u4F8B:
|
||||
TalendType.TypeName=\u7C7B\u578B\u540D{0}
|
||||
MetadataTableEditor.ColumnNameIsNull=\u9519\u8BEF\uFF1A\u5217\u540D\u4E3Anull
|
||||
ColorsCodeViewerPreferencePage.keyword3Color=\u5173\u952E\u5B573 \u989C\u8272
|
||||
NodeReturnProposal.GlobalVariable=\n\n\u5168\u5C40\u53D8\u91CF\uFF0C\u7EC4\u4EF6\u5C5E\u6027 {1} [{2}].
|
||||
ListPreferencePage.RemoveButtonName=\u79FB\u9664
|
||||
MetadataTypeLengthPreferencePage.DBTYPE=\u6570\u636E\u7C7B\u578B\u7684\u9ED8\u8BA4\u957F\u5EA6
|
||||
EMetadataEncoding.EUC_CN=\u7B80\u4F53\u4E2D\u6587(\u6269\u5C55\u7684Unix Code-CN)
|
||||
EConnectionType.iteratorMenu=\u8FED\u4EE3
|
||||
EMetadataEncoding.Arabic=\u963F\u62C9\u4F2F\u8BED
|
||||
EMetadataEncoding.Microsoft_Latin1=\u5FAE\u8F6F(Latin-1)
|
||||
MetadataEmfTableEditor.ColumnNameIsNullError=\u9519\u8BEF\uFF1A\u5217\u540D\u4E3Anull
|
||||
MappingFileLoader.DbmsIdAlreadyExists=\u6570\u636E\u5E93ID"{0}"\u5DF2\u7ECF\u5B58\u5728\uFF01
|
||||
EConnectionType.runIfMenu=\u6B63\u5E38\u65F6\u8FD0\u884C
|
||||
VersionSection.ModificationDate=\u4FEE\u6539\u65E5\u671F
|
||||
MappingFileLoader.DbTypeAlreadyExists=\u5728\u6570\u636E\u5E93ID{0}\u4E2D\uFF0C\u6570\u636E\u7C7B\u578B"{1}" \u51FA\u73B0\u591A\u6B21\u5728\u6587\u4EF6"{2}" \u8282\u70B9:{3}
|
||||
AbstractComponentsProvider.folderNotExist=\u6587\u4EF6\u5939{0}\u4E0D\u5B58\u5728.
|
||||
AbstractItemMigrationTask.taskFailed=\u8FC1\u79FB{0}\u9879\u76EE\u5931\u8D25{1}
|
||||
ColumnNameChangedExt.columnChanged=\u7ED3\u70B9: {0} \u5217\u6539\u53D8: {1}-> {2}
|
||||
ComponentsFormatPreferencePage.add=\u6DFB\u52A0
|
||||
ComponentsFormatPreferencePage.formatConnection=\u683C\u5F0F\u5316\u9ED8\u8BA4\u8FDE\u63A5
|
||||
ComponentsFormatPreferencePage.formatLable=\u683C\u5F0F\u5316\u9ED8\u8BA4\u6807\u7B7E
|
||||
ComponentsFormatPreferencePage.remove=\u79FB\u9664
|
||||
ComponentToRepositoryProperty.error=\u9519\u8BEF
|
||||
ComponentToRepositoryProperty.ImpossibleUseOCI=\u4E0D\u80FD\u518D\u5E93\u4E2D\u4F7F\u7528OCI\u7C7B\u578B\uFF01
|
||||
ContextComposite.tableValue=\u8868\u683C\u5F0F\u503C
|
||||
ContextComposite.treeValue=\u6811\u683C\u5F0F\u503C
|
||||
ContextComposite.variable=\u53D8\u91CF
|
||||
ContextSetConfigurationDialog.nameNotValid=\u8BE5\u540D\u79F0\u65E0\u6548
|
||||
ConextTemplateComposite.addToRepositoryContextAction.label=\u6DFB\u52A0\u5230repository\u4E0A\u4E0B\u6587
|
||||
DbTableSelectorDialog.textContent=\u9009\u62E9\u8868\u540D
|
||||
ECodeLanguage.unknowLanguage=\u672A\u77E5\u8BED\u8A00
|
||||
ExtractMetaDataUtils.noData=\u672A\u627E\u5230\u6570\u636E.
|
||||
JavaSimpleDateFormatProposalProvider.quoteDisplayError=\u4E24\u4E2A\u5355\u5F15\u53F7\u663E\u793A\u4E3A\u4E00\u4E2A\u5355\u5F15\u53F7
|
||||
MetadataDialog.CopyToInput.toolTipText=\u5C06\u8F93\u51FAschema\u6240\u6709\u5217\u590D\u5236\u5230\u8F93\u5165schema
|
||||
MetadataDialog.CopySelectionToInput.toolTipText=\u5C06\u8F93\u51FAschema\u5DF2\u9009\u62E9\u7684\u5217\u590D\u5236\u5230\u8F93\u5165schema
|
||||
MetadataDialog.CopyToOutput=\u5C06\u8F93\u5165schema\u6240\u6709\u5217\u590D\u5236\u5230\u8F93\u51FAschema
|
||||
MetadataDialog.CopySelectionToOutput=\u5C06\u8F93\u5165schema\u5DF2\u9009\u62E9\u7684\u5217\u590D\u5236\u5230\u8F93\u51FAschema
|
||||
MetadataTalendType.dbIdNotFound=DBMS Id\uFF1A{0}\u65E0\u6CD5\u627E\u5230\uFF01
|
||||
PaletteContentDialog.connection=\u683C\u5F0F\u5316\u9ED8\u8BA4\u8FDE\u63A5
|
||||
PaletteContentDialog.lable=\u683C\u5F0F\u5316\u9ED8\u8BA4\u6807\u7B7E
|
||||
PatternCalendar.example=\u793A\u4F8B:
|
||||
SchemaCellEditor.giveSchemaName=\u7ED9\u56FE\u89E3\u547D\u540D
|
||||
SchemaCellEditor.inputName=\u8F93\u5165\u540D\u79F0
|
||||
SchemaCellEditor.nameExistOrInvalid=\u6539\u540D\u79F0\u5DF2\u5B58\u5728\u6216\u65E0\u6548
|
||||
SchemaCellEditor.schemaName=\u56FE\u89E3\u540D
|
||||
SchemaOperationChoiceDialog.ChangeBuiltInMessage=\u66F4\u6539\u56FE\u89E3\u5230built-in\u6A21\u5F0F
|
||||
SchemaOperationChoiceDialog.ChangeRepositoryMessage=\u4ECE\u5E93\u4E2D\u66F4\u6539Schema
|
||||
SchemaOperationChoiceDialog.CreateBuiltInMessage=Built-in\u4E2D\u521B\u5EFA\u56FE\u89E3
|
||||
SchemaOperationChoiceDialog.CreateRepositoryMessage=\u4ECE\u5E93\u4E2D\u521B\u5EFA\u56FE\u89E3\u3002
|
||||
SchemaOperationChoiceDialog.EditSchemaMessage=\u7F16\u8F91\u67B6\u6784
|
||||
SchemaOperationChoiceDialog.StatusMessage=\u65E0\u6548\u6216\u5DF2\u5B58\u5728\u7684\u56FE\u89E3
|
||||
SchemaOperationChoiceDialog.Title=\u67B6\u6784
|
||||
VariableItemEditor.name=\u57fa\u672c\u6570\u636e\u540d
|
||||
VariableItemEditor.new=\u65b0
|
||||
VariableItemEditor.remove=\u79FB\u9664
|
||||
VariableItemEditor.twmplatePattern=\u6A21\u677F\u6837\u5F0F\uFF1A
|
||||
VariableItemEditor.variable=\u53D8\u91CF\uFF1A
|
||||
VersionSection.Status=\u72B6\u6001
|
||||
XSDValidater.IllegalArgument=\u8F93\u5165\u7684xsd\u6587\u4EF6\u4E0D\u5B58\u5728
|
||||
MultiStringSelectionDialog.nameEmpty=\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A
|
||||
ApplicationActionBarAdvisor.menuFileLabel=\u6587\u4EF6(&F)
|
||||
ApplicationActionBarAdvisor.menuEditLabel=\u7F16\u8F91(&E)
|
||||
ApplicationActionBarAdvisor.gotoLabel=\u8DF3\u8F6C
|
||||
ApplicationActionBarAdvisor.projectLabel=\u5DE5\u7A0B
|
||||
ApplicationActionBarAdvisor.menuWindowLabel=\u7A97\u53E3(&W)
|
||||
ApplicationActionBarAdvisor.menuHelpLabel=\u5E2E\u52A9(&H)
|
||||
BusinessAppearanceComposite.textAlignmentGroup=\u6587\u672C\u5BF9\u9F50
|
||||
BusinessAppearanceComposite.textAlignment.horizontal=\u6C34\u5E73
|
||||
BusinessAppearanceComposite.textAlignment.vertical=\u5782\u76F4
|
||||
BusinessAppearanceComposite.textAlignment.horizontal.left=\u5DE6
|
||||
BusinessAppearanceComposite.textAlignment.horizontal.right=\u53F3
|
||||
BusinessAppearanceComposite.textAlignment.horizontal.centre=\u4E2D\u592E
|
||||
BusinessAppearanceComposite.textAlignment.vertical.top=\u9876\u90E8
|
||||
BusinessAppearanceComposite.textAlignment.vertical.bottom=\u5E95\u90E8
|
||||
BusinessAppearanceComposite.textAlignment.vertical.centre=\u4E2D\u592E
|
||||
ComponentsFormatPreferencePage.errorCreateConnectionName=\u547D\u540D"{0}"\u65E0\u6548
|
||||
ComponentsFormatPreferencePage.ErrorTitle=\u9519\u8BEF
|
||||
ConextTableValuesComposite.nameLabel=\u57fa\u672c\u6570\u636e\u540d
|
||||
ContextTemplateComposite.CommentLabel=\u5907\u6CE8
|
||||
ContextTemplateComposite.nameLabel=\u57fa\u672c\u6570\u636e\u540d
|
||||
ContextTemplateComposite.scriptCodeLabel=\u811A\u672C\u4EE3\u7801
|
||||
ContextTemplateComposite.sourceLabel=\u8D44\u6E90
|
||||
ContextTemplateComposite.typeLabel=\u7C7B\u578B
|
||||
ContextTreeConstants.contextName=\u7EC4\u4EF6
|
||||
ContextTreeConstants.promptName=\u63D0\u793A
|
||||
ContextTreeConstants.valueName=\u53C2\u6570\u503C
|
||||
ContextTreeConstants.variableName=\u53D8\u91CF
|
||||
GroupByContextAction.groupContext=\u6309\u4E0A\u4E0B\u6587\u5206\u7EC4
|
||||
GroupByVariableAction.groupVariable=\u6309\u53D8\u91CF\u5206\u7EC4
|
||||
SchemaXPathQuerysDialog.Mappings=\u6620\u5C04
|
||||
XPathQueryMetadataTableEditorViewExt.xpathQuerys=XML \u6587\u4EF6\u7ED3\u6784\u67E5\u8BE2\u8BED\u53E5
|
||||
EComponentCategory_advanceSetting=\u9AD8\u7EA7\u8BBE\u7F6E
|
||||
EComponentCategory_appearance=\u5916\u89C2
|
||||
EComponentCategory_assignment=\u6307\u6D3E
|
||||
EComponentCategory_context=\u7EC4\u4EF6
|
||||
EComponentCategory_doc=\u6587\u6863
|
||||
EComponentCategory_main=\u4E3B\u7EBF
|
||||
EComponentCategory_sqlTemplate=SQL\u6A21\u677F
|
||||
EComponentCategory_statsAndLogs=\u9759\u6001\u4FE1\u606F\u548C\u65E5\u5FD7
|
||||
EComponentCategory_version=\u7248\u672C
|
||||
EComponentCategory_view=\u89c6\u56fe
|
||||
EComponentCategory.advancedSettings=\u9AD8\u7EA7\u8BBE\u7F6E
|
||||
HTMLDocGenerator.author=\u4F5C\u8005
|
||||
HTMLDocGenerator.author1=\u4F5C\u8005
|
||||
HTMLDocGenerator.column=\u5217
|
||||
HTMLDocGenerator.component_list=\u7ec4\u4ef6\u5217\u8868
|
||||
HTMLDocGenerator.component_name=\u7ec4\u4ef6\u540d
|
||||
HTMLDocGenerator.content=\u5185\u5BB9
|
||||
HTMLDocGenerator.context=\u4e0a\u4e0b\u6587\uff1a
|
||||
HTMLDocGenerator.description=\u5FC5\u8981\u7684
|
||||
HTMLDocGenerator.job_description=\u5FC5\u8981\u7684
|
||||
HTMLDocGenerator.key=\u5173\u952E\u5B57
|
||||
HTMLDocGenerator.label=\u6807\u7B7E
|
||||
HTMLDocGenerator.length=\u957F\u5EA6
|
||||
HTMLDocGenerator.mapper.alias=\u522B\u79F0
|
||||
HTMLDocGenerator.mapper.expression=\u8868\u8FBE\u5F0F
|
||||
HTMLDocGenerator.mapper.operator=\u64CD\u4F5C\u7B26
|
||||
HTMLDocGenerator.mapper.table.name=\u6570\u636e\u8868
|
||||
HTMLDocGenerator.modification=\u4fee\u6539
|
||||
HTMLDocGenerator.name=\u4f5c\u4e1a\u540d
|
||||
HTMLDocGenerator.nullable=\u53EF\u4E3A\u7A7A
|
||||
HTMLDocGenerator.precision=\u7CBE\u5EA6
|
||||
HTMLDocGenerator.project_description=\u5de5\u7a0b\u63cf\u8ff0
|
||||
HTMLDocGenerator.project_name=\u5de5\u7a0b\u540d
|
||||
HTMLDocGenerator.prompt=\u63D0\u793A
|
||||
HTMLDocGenerator.purpose=\u76EE\u7684
|
||||
HTMLDocGenerator.row_default=\u65e0
|
||||
HTMLDocGenerator.row_functions=\u51FD\u6570
|
||||
HTMLDocGenerator.status=\u72B6\u6001
|
||||
HTMLDocGenerator.type=\u7C7B\u578B
|
||||
HTMLDocGenerator.unique_name=\u552f\u4e00\u540d\u5b57
|
||||
HTMLDocGenerator.value=\u503c
|
||||
HTMLDocGenerator.version=\u7248\u672C
|
||||
ConnectionParameters.exceptionMessage=\u8FD9\u662F\u50A8\u5B58\u5E93\uFF0C\u4E0D\u80FD\u8C03\u7528\u4E9B\u65B9\u6CD5\u3002
|
||||
ConnectionParameterName.HostLabel=\u4e3b\u673a
|
||||
ConnectionParameterName.PortLabel=\u7aef\u53e3
|
||||
ConnectionParameterName.SchemaLabel=\u67B6\u6784
|
||||
ConnectionParameterName.UserLabel=\u7528\u6237
|
||||
ConnectionParameterName.PasswordLabel=\u5bc6\u7801
|
||||
ConnectionParameterName.DbPathLabel=\u6570\u636E\u5E93\u7684\u6839\u8DEF\u5F84
|
||||
@@ -1,2 +0,0 @@
|
||||
CreateRuleDialog.conditionLabel=\u6761\u4EF6
|
||||
CreateRuleDialog.nameLabel=\u57fa\u672c\u6570\u636e\u540d
|
||||
@@ -152,25 +152,3 @@ 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.
|
||||
ProxyRepositoryFactory.projectIsNotCompatible=The project {0} had been opend by a more recent studio so cannot open it.
|
||||
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?
|
||||
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
|
||||
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
|
||||
|
||||
@@ -118,17 +118,3 @@ 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.
|
||||
ProxyRepositoryFactory.projectIsNotCompatible=Le projet {0} a été ouvert par un studio plus récent. Impossible de l'ouvrir.
|
||||
NewFolderWizard.description=Créer un nouveau dossier dans le référentiel
|
||||
NewFolderWizard.failureText=Une erreur est survenue. Impossible de créer les dossiers. Consultez le log pour plus d'informations.
|
||||
NewFolderWizard.label=Libellé
|
||||
NewFolderWizard.nameEmpty=Libellé requis
|
||||
NewFolderWizard.nameIncorrect=Le libellé contient des caractères incorrects.
|
||||
NewFolderWizard.nameInvalid=Libellé {0} interdit.
|
||||
NewFolderWizard.title=Dossier
|
||||
NewFolderWizard.windowTitle=Nouveau dossier
|
||||
CreateFolderAction.action.title=Créer le dossier
|
||||
RenameFolderAction.action.title=Renommer le dossier
|
||||
RenameFolderAction.warning.editorOpen.message=Impossible de renommer le dossier "{1}" car un élément ({0}) contenu dans ce dossier est ouvert.\n Fermez-le et réessayez.
|
||||
RenameFolderAction.warning.editorOpen.title=Action indisponible
|
||||
RenameFolderAction.warning.cannotFind.message=Impossible de renommer le dossier, il a été déplacé ou supprimé. Cliquez sur le bouton Rafraîchir pour mettre à jour le référentiel.
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
AbstractEMFRepositoryFactory.job=Job
|
||||
CreateSandboxProjectDialog.userFirstname=Voornaam
|
||||
CreateSandboxProjectDialog.userLastname=Achternaam
|
||||
CreateSandboxProjectDialog.Password=Wachtwoord
|
||||
PropertiesWizardPage.Name=Naam
|
||||
PropertiesWizardPage.Version=Versie
|
||||
JobletReferenceDialog.project=PROJECT
|
||||
ProjectRepositoryNode.invalidItem=Ongeldig item
|
||||
RepositoryDropAdapter_moveTitle=Verplaatsen
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
AbstractEMFRepositoryFactory.cannotGenerateItem=\u65E0\u6CD5\u751F\u6210\u7C98\u8D34\u9879\u76EE\u7684\u6807\u7B7E.
|
||||
AbstractEMFRepositoryFactory.job=\u4f5c\u4e1a
|
||||
ProxyRepositoryFactory.bussinessException.itemNonModifiable=\u4e0d\u53ef\u4fee\u6539\u9879
|
||||
ProxyRepositoryFactory.illegalArgumentException.labelNotMatchPattern=\u6807\u7b7e {0} \u4e0e\u6a21\u5f0f {1} \u4e0d\u7b26
|
||||
ProxyRepositoryFactory.initializeProjectConnection=\u521D\u59CB\u5316\u5DE5\u7A0B\u8FDE\u63A5
|
||||
ProxyRepositoryFactory.Label=\u6807\u7B7E
|
||||
ProxyRepositoryFactory.log.Restoration=[{0}] \u88ab {1} \u6062\u590d\u5230 \u201c/{2}\u201d\u3002
|
||||
ProxyRepositoryFactory.log.lock=\u201c{1}\u201d\u88ab[{0}]\u9501\u5b9a\u3002
|
||||
ProxyRepositoryFactory.log.loggedOn={0}\u6ce8\u518c\u5165{1}\u3002
|
||||
ProxyRepositoryFactory.log.logicalDeletion=\u903b\u8f91[{0}]\u88ab{1}\u5220\u9664\u3002
|
||||
ProxyRepositoryFactory.log.move=\u4ece\u201c{1}\u201d\u79fb\u52a8\u5230[{0}]\u3002
|
||||
ProxyRepositoryFactory.log.physicalDeletion=\u7269\u7406\u6027\u5220\u9664 \u7531{1}\u5220\u9664[{0}]\u3002
|
||||
ProxyRepositoryFactory.log.tempFolderEmptied=\u4e34\u65f6\u6587\u4ef6\u5939\u6e05\u7a7a(\u6587\u4ef6{0}\u5728{1}ms\u5185\u88ab\u5220\u9664)
|
||||
ProxyRepositoryFactory.log.unlock=[{0}]\u88ab\u201c{1}\u201d\u89e3\u9501\u3002
|
||||
ProxyRepositoryFactory.logonInProgress=\u6B63\u5728\u767B\u5F55...
|
||||
CreateSandboxProjectDialog.ProjectDesc=\u5FC5\u8981\u7684
|
||||
CreateSandboxProjectDialog.ProjectLabel=\u6807\u7B7E
|
||||
CreateSandboxProjectDialog.ProjectSvnAdvance=SVN\u9AD8\u7EA7\u8BBE\u7F6E
|
||||
CreateSandboxProjectDialog.successTitile=\u6210\u529f
|
||||
CreateSandboxProjectDialog.Login=\u987b\u6307\u5b9a\u767b\u5f55
|
||||
CreateSandboxProjectDialog.Password=\u5bc6\u7801
|
||||
PropertiesWizardPage.Author=\u4F5C\u8005
|
||||
PropertiesWizardPage.Description=\u5FC5\u8981\u7684
|
||||
PropertiesWizardPage.EmptyDescWarning=\u5EFA\u8BAE\u4E0D\u8981\u4F7F\u7528\u7A7A\u63CF\u8FF0\u4FE1\u606F\u3002
|
||||
PropertiesWizardPage.EmptyPurposeWarning=\u5EFA\u8BAE\u4E0D\u8981\u4F7F\u7528\u7A7A\u76EE\u7684\u4FE1\u606F
|
||||
PropertiesWizardPage.ItemExistsError=\u76F8\u540C\u540D\u79F0\u7684\u9879\u5DF2\u5B58\u5728\uFF0C\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u68C0\u67E5\u56DE\u6536\u7AD9
|
||||
PropertiesWizardPage.KeywordsError=\u540D\u5B57\u4E0D\u5408\u6CD5
|
||||
PropertiesWizardPage.Name=\u4f5c\u4e1a\u540d
|
||||
PropertiesWizardPage.NameEmptyError=\u4f5c\u4e1a\u540d\u4e3a\u7a7a\u3002
|
||||
PropertiesWizardPage.NameFormatError=\u4f5c\u4e1a\u540d\u5305\u542b\u4e0d\u5408\u6cd5\u7b26\u3002
|
||||
PropertiesWizardPage.Path=\u8DEF\u5F84
|
||||
PropertiesWizardPage.Purpose=\u76EE\u7684
|
||||
PropertiesWizardPage.Select=\u9009\u62E9
|
||||
PropertiesWizardPage.SelectfolderMessage=\u9009\u62E9\u5C06\u8981\u521B\u5EFA\u6761\u76EE\u7684\u6587\u4EF6\u5939
|
||||
PropertiesWizardPage.SelectfolderTitle=\u9009\u62E9\u76EE\u5F55
|
||||
PropertiesWizardPage.Status=\u72B6\u6001
|
||||
PropertiesWizardPage.Version=\u7248\u672C
|
||||
EAuthenticationMethod.anonymousAuth=\u533f\u540d\u9a8c\u8bc1
|
||||
EAuthenticationMethod.simpleAuth=\u7b80\u5355\u9a8c\u8bc1
|
||||
AdvancedSocketFactory.failedInitial=\u9519\u8BEF\uFF1A\u65E0\u6CD5\u521D\u59CB\u5316\uFF1A
|
||||
CopyAction.thisText.copy=\u590D\u5236
|
||||
RestoreAction.action.title=\u6062\u590D
|
||||
RestoreAction.action.toolTipText=\u6062\u590D
|
||||
PasteAction.thisText.paste=\u7C98\u8D34
|
||||
DeleteAction.action.foreverTitle=\u6c38\u4e45\u5220\u9664
|
||||
DeleteAction.action.logicalToolTipText=\u5c06\u5bf9\u8c61\u653e\u5165\u56de\u6536\u7ad9
|
||||
DeleteAction.dialog.message0=\u5C06\u6C38\u4E45\u5220\u9664\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\u3002
|
||||
DeleteAction.dialog.title=\u6c38\u4e45\u5220\u9664
|
||||
DeleteAction.error.title=\u7981\u6b62\u5220\u9664
|
||||
DuplicateAction.cannotGenerateItem=\u65E0\u6CD5\u751F\u6210\u7C98\u8D34\u9879\u76EE\u7684\u6807\u7B7E.
|
||||
DuplicateAction.dialog.title=\u8BF7\u8F93\u5165\u4F5C\u4E1A\u540D
|
||||
DuplicateAction.thisText.duplicate=\u91CD\u590D
|
||||
DuplicateAction.NameEmptyError=\u4f5c\u4e1a\u540d\u4e3a\u7a7a\u3002
|
||||
DuplicateAction.NameFormatError=\u4f5c\u4e1a\u540d\u5305\u542b\u4e0d\u5408\u6cd5\u7b26\u3002
|
||||
DuplicateAction.ItemExistsError=\u76F8\u540C\u540D\u79F0\u7684\u9879\u5DF2\u5B58\u5728\uFF0C\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u68C0\u67E5\u56DE\u6536\u7AD9
|
||||
DuplicateAction.KeywordsError=\u540D\u5B57\u4E0D\u5408\u6CD5
|
||||
EmptyRecycleBinAction.action.title=\u6e05\u7a7a\u56de\u6536\u7ad9
|
||||
EmptyRecycleBinAction.action.toolTipText=\u6e05\u7a7a\u56de\u6536\u7ad9
|
||||
EmptyRecycleBinAction.dialog.title=\u6e05\u7a7a\u56de\u6536\u7ad9
|
||||
PasteObjectAction.error.labelAlreadyExists=\u5df2\u7ecf\u5b58\u5728\u5f53\u524d\u8def\u5f84\u4e0b\u5e26\u6b64\u6807\u7b7e\u7684\u5bf9\u8c61
|
||||
PasteObjectAction.error.title=\u65e0\u6cd5\u7c98\u8d34
|
||||
JobletReferenceDialog.DeletedInfor=\u5728\u56DE\u6536\u7AD9
|
||||
JobletReferenceDialog.project=\u5de5\u7a0b
|
||||
JobletReferenceDialog.Title=\u5220\u9664joblet\u5931\u8D25
|
||||
CopyToGenericSchemaHelper.cannotGenarateItem=\u65E0\u6CD5\u751F\u6210\u7C98\u8D34\u9879\u76EE\u7684\u6807\u7B7E.
|
||||
ContextReferenceDialog.Recycle=\u5728\u56DE\u6536\u7AD9
|
||||
ContextReferenceDialog.Types=\u7C7B\u578B
|
||||
@@ -5,5 +5,4 @@ Bundle-SymbolicName: org.talend.core.repository.test
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Fragment-Host: org.talend.core.repository
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: org.junit4,
|
||||
org.talend.testutils
|
||||
Require-Bundle: org.junit4
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.model.actions;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.RepositoryViewObject;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC hcyi class global comment. Detailled comment
|
||||
*/
|
||||
public class MoveObjectActionTest {
|
||||
|
||||
@Test
|
||||
public void testValidateAction() {
|
||||
// mock
|
||||
RepositoryNode sourceNode = mock(RepositoryNode.class);
|
||||
RepositoryViewObject object = mock(RepositoryViewObject.class);
|
||||
Property property = mock(Property.class);
|
||||
Item item = mock(Item.class);
|
||||
// when
|
||||
when(sourceNode.getObject()).thenReturn(object);
|
||||
when(object.getRepositoryObjectType()).thenReturn(ERepositoryObjectType.SERVICESOPERATION);
|
||||
when(object.getProperty()).thenReturn(property);
|
||||
when(object.getRepositoryStatus()).thenReturn(ERepositoryStatus.DEFAULT);
|
||||
when(property.getItem()).thenReturn(item);
|
||||
//
|
||||
MoveObjectAction moveObjectAction = MoveObjectAction.getInstance();
|
||||
assertFalse(moveObjectAction.validateAction(sourceNode, null, true));
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@
|
||||
// ============================================================================
|
||||
package org.talend.repository.utils;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -54,8 +56,6 @@ import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
import org.talend.repository.ProjectManager;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* DOC nrousseau class global comment. Detailled comment
|
||||
*/
|
||||
@@ -104,7 +104,7 @@ public class XmiResourceManagerTest {
|
||||
if (prj.exists()) {
|
||||
prj.delete(true, null); // always delete to avoid conflicts between 2 tests
|
||||
}
|
||||
desc = workspace.newProjectDescription(technicalLabel);
|
||||
desc = workspace.newProjectDescription(projectInfor.getLabel());
|
||||
desc.setNatureIds(new String[] { TalendNature.ID });
|
||||
desc.setComment(projectInfor.getDescription());
|
||||
|
||||
@@ -653,7 +653,7 @@ public class XmiResourceManagerTest {
|
||||
* .
|
||||
*
|
||||
* @throws PersistenceException
|
||||
* @throws CoreException
|
||||
* @throws CoreException
|
||||
*/
|
||||
@Test
|
||||
public void testMoveResource() throws PersistenceException, CoreException {
|
||||
@@ -680,7 +680,7 @@ public class XmiResourceManagerTest {
|
||||
xrm.saveResource(processItemResource);
|
||||
xrm.saveResource(propertyResource);
|
||||
xrm.saveResource(screenshotsResource);
|
||||
|
||||
|
||||
IFolder folder = project.getFolder("/temp");
|
||||
if (!folder.exists()) {
|
||||
folder.create(false, true, null);
|
||||
@@ -1159,8 +1159,7 @@ public class XmiResourceManagerTest {
|
||||
assertTrue(emfProject.eResource().isLoaded());
|
||||
xrm.unloadResources();
|
||||
assertTrue(emfProject.eResource() == null);
|
||||
assertTrue(sampleProject.getEmfProject().eResource() != null); // not same instance so emf should be loaded
|
||||
// still
|
||||
assertTrue(sampleProject.getEmfProject().eResource() != null); // not same instance so emf should be loaded still
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,6 @@ Bundle-Name: Core Repository
|
||||
Bundle-SymbolicName: org.talend.core.repository;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.core.runtime,
|
||||
org.talend.commons,
|
||||
org.eclipse.emf.ecore.xmi,
|
||||
@@ -14,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,
|
||||
|
||||
@@ -577,11 +577,10 @@
|
||||
<extension
|
||||
point="org.talend.core.repository.login.task">
|
||||
<loginTask
|
||||
class="org.talend.core.repository.GeneratedJetEmitersLoginTask"
|
||||
priority="highest">
|
||||
class="org.talend.core.repository.GeneratedJetEmitersLoginTask">
|
||||
</loginTask>
|
||||
</extension>
|
||||
<extension
|
||||
<extension
|
||||
point="org.talend.core.repository.checkDeleteItemReference">
|
||||
<check
|
||||
class="org.talend.core.repository.model.CheckJobletDeleteReference"
|
||||
@@ -592,13 +591,5 @@
|
||||
priority="high">
|
||||
</check>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.talend.core.repository.login.task">
|
||||
<loginTask
|
||||
class="org.talend.core.repository.ReadOnlyProjectConfirm"
|
||||
priority="high">
|
||||
</loginTask>
|
||||
</extension>
|
||||
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -1,123 +1,123 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.talend.core.repository" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="org.talend.core.repository" id="checkDeleteItemReference" name="Check Delete Item Reference"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="check" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="check">
|
||||
<complexType>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":org.talend.core.repository.ICheckDeleteItemReference"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="priority">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
<simpleType>
|
||||
<restriction base="string">
|
||||
<enumeration value="lowest">
|
||||
</enumeration>
|
||||
<enumeration value="low">
|
||||
</enumeration>
|
||||
<enumeration value="normal">
|
||||
</enumeration>
|
||||
<enumeration value="high">
|
||||
</enumeration>
|
||||
<enumeration value="highest">
|
||||
</enumeration>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.talend.core.repository" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="org.talend.core.repository" id="checkDeleteItemReference" name="Check Delete Item Reference"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="check" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="check">
|
||||
<complexType>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":org.talend.core.repository.ICheckDeleteItemReference"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="priority">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
<simpleType>
|
||||
<restriction base="string">
|
||||
<enumeration value="lowest">
|
||||
</enumeration>
|
||||
<enumeration value="low">
|
||||
</enumeration>
|
||||
<enumeration value="normal">
|
||||
</enumeration>
|
||||
<enumeration value="high">
|
||||
</enumeration>
|
||||
<enumeration value="highest">
|
||||
</enumeration>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
||||
|
||||
@@ -76,13 +76,6 @@ just set the value Metadata
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="alias" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
It is the alias of this type.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="type" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
@@ -123,13 +116,6 @@ like this: DI|DQ ....
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name_pattern" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
|
||||
@@ -112,18 +112,18 @@ EmptyRecycleBinAction.dialog.allDependencies=You can't empty the Recycle Bin.\nO
|
||||
PasteObjectAction.error.labelAlreadyExists=An object with this label already exists at this path
|
||||
PasteObjectAction.error.title=Paste impossible
|
||||
JobletReferenceDialog.DeletedInfor=in Recycle Bin
|
||||
JobletReferenceDialog.Messages=Some joblets cannot be deleted because they are referenced from jobs.
|
||||
JobletReferenceDialog.Messages=Joblet({0} {1}) is referenced from\:\n
|
||||
JobletReferenceDialog.NodeTotals=Totals
|
||||
JobletReferenceDialog.NodeTotalsTip=The totals of node reference
|
||||
JobletReferenceDialog.project=Project
|
||||
JobletReferenceDialog.ReferenceJob=Reference Job
|
||||
JobletReferenceDialog.Title=Delete the joblet failure
|
||||
ContextReferenceDialog.Title=Delete Context Group
|
||||
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.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.
|
||||
|
||||
@@ -68,7 +68,6 @@ public class MetadataColumnRepositoryObject extends MetadataColumn implements IS
|
||||
setTdColumn(column);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
// update column
|
||||
@@ -77,131 +76,98 @@ public class MetadataColumnRepositoryObject extends MetadataColumn implements IS
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return getTdColumn().getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLabel(String label) {
|
||||
this.getTdColumn().setLabel(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return getTdColumn().getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
getTdColumn().setId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return getTdColumn();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
}
|
||||
|
||||
private void updateColumn(Property property) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return viewObject.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.METADATA_CON_COLUMN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return SubItemHelper.isDeleted(getTdColumn());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
this.repositoryNode = node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.tdColumn;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public interface ICheckDeleteItemReference {
|
||||
|
||||
public Set<ItemReferenceBean> getItemReferenceBeans(List<? extends IRepositoryNode> deleteNodes,
|
||||
DeleteActionCache deleteActionCache);
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public interface ICheckDeleteItemReference {
|
||||
|
||||
public Set<ItemReferenceBean> getItemReferenceBeans(List<? extends IRepositoryNode> deleteNodes,
|
||||
DeleteActionCache deleteActionCache);
|
||||
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ public interface IDBMetadataProvider {
|
||||
public Map getConnectionMap();
|
||||
|
||||
/** test connection used for test a connection,for example ,click "check" button on database wizard **/
|
||||
|
||||
public ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema, String server,
|
||||
String port, final String driverClassName, final String driverJarPath, String dbVersionString,
|
||||
String additionalParam, Map<String, Object> otherParameters);
|
||||
String port, final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam);
|
||||
|
||||
/** when check connection ,will update the package,this one no use for HBASE **/
|
||||
public void updatePackage(IMetadataConnection metadataConnection);
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.talend.core.repository;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.SubMonitor;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
|
||||
public class ReadOnlyProjectConfirm implements IRunnableWithProgress {
|
||||
|
||||
private static Logger log = Logger.getLogger(ReadOnlyProjectConfirm.class);
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
log.info("ReadOnly confirm"); //$NON-NLS-1$
|
||||
SubMonitor subMonitor = SubMonitor.convert(monitor, 1);
|
||||
subMonitor.setTaskName("ReadOnly confirm.");
|
||||
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
|
||||
service.openReadOnlyDialog(new Shell());
|
||||
|
||||
subMonitor.done();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.constants;
|
||||
|
||||
/**
|
||||
* Constants related to repostiory <br/>
|
||||
*
|
||||
*/
|
||||
public final class Constant {
|
||||
|
||||
/**
|
||||
* constant used for OSGI event bus notification for repository Items
|
||||
*/
|
||||
public static final String REPOSITORY_ITEM_EVENT_PREFIX = "org/talend/repository/item/"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* suffix used when issuing an event on the OSGI event bus when an lock is done
|
||||
*/
|
||||
public static final String ITEM_LOCK_EVENT_SUFFIX = "lock"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* suffix used when issuing an event on the OSGI event bus when an unlock is done
|
||||
*/
|
||||
public static final String ITEM_UNLOCK_EVENT_SUFFIX = "unlock"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* key used to get/set the property of an event related to an item (REPOSITORY_ITEM_EVENT_PREFIX). The value is the
|
||||
* Item instance.
|
||||
*/
|
||||
public static final String ITEM_EVENT_PROPERTY_KEY = "item"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* key used to get/set the property of an event related to a list of files modified in the repository
|
||||
* (REPOSITORY_ITEM_EVENT_PREFIX). The value is the Collection of String (list of all files modified).
|
||||
*/
|
||||
public static final String FILE_LIST_EVENT_SUFFIX = "fileList"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* key used to get/set the property of an event related to a list of files modified in the repository
|
||||
* (REPOSITORY_ITEM_EVENT_PREFIX). The value is the Collection of String (list of all files modified).
|
||||
*/
|
||||
public static final String FILE_LIST_EVENT_PROPERTY_KEY = "fileList"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
@@ -16,8 +16,6 @@ package org.talend.core.repository.constants;
|
||||
*/
|
||||
public class FileConstants {
|
||||
|
||||
public static final String OLD_TALEND_PROJECT_FILENAME = "talendProject"; //$NON-NLS-1$
|
||||
|
||||
public static final String LOCAL_PROJECT_FILENAME = "talend.project"; //$NON-NLS-1$
|
||||
|
||||
public static final String PROPERTIES_EXTENSION = "properties"; //$NON-NLS-1$
|
||||
@@ -46,39 +44,11 @@ public class FileConstants {
|
||||
// MOD klliu 2010-11-26
|
||||
public static final String JRXML_EXTENSION = "jrxml"; //$NON-NLS-1$
|
||||
|
||||
/*
|
||||
* file suffix
|
||||
*/
|
||||
public static final String PROPERTIES_FILE_SUFFIX = '.' + PROPERTIES_EXTENSION;
|
||||
|
||||
public static final String ITEM_FILE_SUFFIX = '.' + ITEM_EXTENSION;
|
||||
|
||||
public static final String SCREENSHOT_FILE_SUFFIX = '.' + SCREENSHOT_EXTENSION;
|
||||
|
||||
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 JAR_FILE_SUFFIX = ".jar"; //$NON-NLS-1$
|
||||
|
||||
public static final String WAR_FILE_SUFFIX = ".war"; //$NON-NLS-1$
|
||||
|
||||
public static final String ESB_FILE_SUFFIX = ".esb"; //$NON-NLS-1$
|
||||
|
||||
public static final String SH_FILE_SUFFIX = ".sh"; //$NON-NLS-1$
|
||||
|
||||
public static final String BAT_FILE_SUFFIX = ".bat"; //$NON-NLS-1$
|
||||
|
||||
public static final String KAR_FILE_SUFFIX = ".kar"; //$NON-NLS-1$
|
||||
|
||||
public static final String XLS_FILE_SUFFIX = ".xls"; //$NON-NLS-1$
|
||||
|
||||
/*
|
||||
* file names
|
||||
*/
|
||||
public static final String MANIFEST_MF_FILE_NAME = "MANIFEST.MF"; //$NON-NLS-1$
|
||||
|
||||
public static final String META_INF_FOLDER_NAME = "META-INF"; //$NON-NLS-1$
|
||||
public static final String PROPERTIES_FILE_SUFFIX = '.' + PROPERTIES_EXTENSION;
|
||||
}
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.List;
|
||||
import java.util.Set;
|
||||
|
||||
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.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbstractCheckDeleteItemReference implements ICheckDeleteItemReference {
|
||||
|
||||
protected IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
|
||||
protected List<? extends IRepositoryNode> deleteNodes;
|
||||
|
||||
public Set<ItemReferenceBean> getItemReferenceBeans(List<? extends IRepositoryNode> deleteNodes,
|
||||
DeleteActionCache deleteActionCache) {
|
||||
this.deleteNodes = deleteNodes;
|
||||
Set<ItemReferenceBean> refBeans = new HashSet<ItemReferenceBean>();
|
||||
|
||||
if (deleteActionCache == null) {
|
||||
deleteActionCache = DeleteActionCache.getInstance();
|
||||
deleteActionCache.createRecords();
|
||||
}
|
||||
|
||||
for (IRepositoryNode repositoryNode : deleteNodes) {
|
||||
refBeans.addAll(checkItemReferenceBeans(factory, deleteActionCache, repositoryNode));
|
||||
}
|
||||
|
||||
return refBeans;
|
||||
}
|
||||
|
||||
protected abstract Set<ItemReferenceBean> checkItemReferenceBeans(IProxyRepositoryFactory factory,
|
||||
DeleteActionCache deleteActionCache, IRepositoryNode currentJobNode);
|
||||
|
||||
protected boolean isItemInDeleteList(ItemReferenceBean bean, boolean isRefer) {
|
||||
if (deleteNodes == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String itemName;
|
||||
String itemVersion;
|
||||
ERepositoryObjectType itemType;
|
||||
for (IRepositoryNode node : deleteNodes) {
|
||||
IRepositoryViewObject repObj = node.getObject();
|
||||
Property property = repObj.getProperty();
|
||||
String label = property.getLabel();
|
||||
String version = property.getVersion();
|
||||
ERepositoryObjectType type = repObj.getRepositoryObjectType();
|
||||
if (isRefer) {
|
||||
itemName = bean.getReferenceItemName();
|
||||
itemVersion = bean.getReferenceItemVersion();
|
||||
itemType = bean.getReferenceItemType();
|
||||
} else {
|
||||
itemName = bean.getItemName();
|
||||
itemVersion = bean.getItemVersion();
|
||||
itemType = bean.getItemType();
|
||||
}
|
||||
if (label.equals(itemName) && version.equals(itemVersion) && type == itemType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.List;
|
||||
import java.util.Set;
|
||||
|
||||
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.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbstractCheckDeleteItemReference implements ICheckDeleteItemReference {
|
||||
|
||||
protected IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
|
||||
protected List<? extends IRepositoryNode> deleteNodes;
|
||||
|
||||
public Set<ItemReferenceBean> getItemReferenceBeans(List<? extends IRepositoryNode> deleteNodes,
|
||||
DeleteActionCache deleteActionCache) {
|
||||
this.deleteNodes = deleteNodes;
|
||||
Set<ItemReferenceBean> refBeans = new HashSet<ItemReferenceBean>();
|
||||
|
||||
if (deleteActionCache == null) {
|
||||
deleteActionCache = DeleteActionCache.getInstance();
|
||||
deleteActionCache.createRecords();
|
||||
}
|
||||
|
||||
for (IRepositoryNode repositoryNode : deleteNodes) {
|
||||
refBeans.addAll(checkItemReferenceBeans(factory, deleteActionCache, repositoryNode));
|
||||
}
|
||||
|
||||
return refBeans;
|
||||
}
|
||||
|
||||
protected abstract Set<ItemReferenceBean> checkItemReferenceBeans(IProxyRepositoryFactory factory,
|
||||
DeleteActionCache deleteActionCache, IRepositoryNode currentJobNode);
|
||||
|
||||
protected boolean isItemInDeleteList(ItemReferenceBean bean, boolean isRefer) {
|
||||
if (deleteNodes == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String itemName;
|
||||
String itemVersion;
|
||||
ERepositoryObjectType itemType;
|
||||
for (IRepositoryNode node : deleteNodes) {
|
||||
IRepositoryViewObject repObj = node.getObject();
|
||||
Property property = repObj.getProperty();
|
||||
String label = property.getLabel();
|
||||
String version = property.getVersion();
|
||||
ERepositoryObjectType type = repObj.getRepositoryObjectType();
|
||||
if (isRefer) {
|
||||
itemName = bean.getReferenceItemName();
|
||||
itemVersion = bean.getReferenceItemVersion();
|
||||
itemType = bean.getReferenceItemType();
|
||||
} else {
|
||||
itemName = bean.getItemName();
|
||||
itemVersion = bean.getItemVersion();
|
||||
itemType = bean.getItemType();
|
||||
}
|
||||
if (label.equals(itemName) && version.equals(itemVersion) && type == itemType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ import org.talend.designer.core.model.utils.emf.component.ComponentFactory;
|
||||
import org.talend.designer.core.model.utils.emf.component.IMPORTType;
|
||||
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.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
@@ -325,8 +324,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
protected abstract FolderHelper getFolderHelper(org.talend.core.model.properties.Project emfProject);
|
||||
|
||||
protected Item copyFromResource(Resource createResource) throws PersistenceException, BusinessException {
|
||||
boolean changeLabelWithCopyPrefix = true;
|
||||
return copyFromResource(createResource, changeLabelWithCopyPrefix);
|
||||
return copyFromResource(createResource, true);
|
||||
}
|
||||
|
||||
protected Item copyFromResource(Resource createResource, boolean changeLabelWithCopyPrefix) throws PersistenceException,
|
||||
@@ -343,49 +341,30 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
return newItem;
|
||||
}
|
||||
|
||||
protected Item copyFromResource(Resource createResource, String newItemLabel) throws PersistenceException, BusinessException {
|
||||
if (newItemLabel != null) {
|
||||
Item newItem = (Item) EcoreUtil.getObjectByType(createResource.getContents(), PropertiesPackage.eINSTANCE.getItem());
|
||||
Property property = newItem.getProperty();
|
||||
property.setId(getNextId());
|
||||
property.setAuthor(getRepositoryContext().getUser());
|
||||
property.setLabel(newItemLabel);
|
||||
property.setDisplayName(newItemLabel);
|
||||
if (!isNameAvailable(getRepositoryContext().getProject(), property.getItem(), null)) {
|
||||
throw new BusinessException(Messages.getString("AbstractEMFRepositoryFactory.cannotGenerateItem")); //$NON-NLS-1$
|
||||
}
|
||||
EcoreUtil.resolveAll(createResource);
|
||||
return newItem;
|
||||
} else {
|
||||
boolean changeLabelWithCopyPrefix = true;
|
||||
return copyFromResource(createResource, changeLabelWithCopyPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method "setPropNewName". Try first the new name with "[PROPERTY_NAME]_Copy", then, if it already exists, try
|
||||
* again with "[PROPERTY_NAME]_CopyN" where N is number between 1 and Integer.MAX.
|
||||
* DOC smallet Comment method "getCopiedLabel".
|
||||
*
|
||||
* @param copiedProperty
|
||||
* @return
|
||||
* @throws PersistenceException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
private void setPropNewName(Property copiedProperty) throws PersistenceException, BusinessException {
|
||||
String originalLabel = copiedProperty.getLabel();
|
||||
String copy = "_Copy"; //$NON-NLS-1$
|
||||
String initialTry = originalLabel + copy;
|
||||
String add1 = "Copy_of_"; //$NON-NLS-1$
|
||||
String initialTry = add1 + originalLabel;
|
||||
copiedProperty.setLabel(initialTry);
|
||||
// changed by hqzhang for TDI-19965
|
||||
copiedProperty.setDisplayName(initialTry);
|
||||
if (isNameAvailable(getRepositoryContext().getProject(), copiedProperty.getItem(), null)) {
|
||||
return;
|
||||
} else {
|
||||
long index = 1;
|
||||
char j = 'a';
|
||||
while (!isNameAvailable(getRepositoryContext().getProject(), copiedProperty.getItem(), null)) {
|
||||
if (index < 0) {
|
||||
if (j > 'z') {
|
||||
throw new BusinessException(Messages.getString("AbstractEMFRepositoryFactory.cannotGenerateItem")); //$NON-NLS-1$
|
||||
}
|
||||
String nextTry = originalLabel + copy + (index++);
|
||||
String nextTry = initialTry + "_" + (j++) + ""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
copiedProperty.setLabel(nextTry);
|
||||
// changed by hqzhang for TDI-19965
|
||||
copiedProperty.setDisplayName(nextTry);
|
||||
@@ -884,7 +863,8 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
allVersion.addAll(getAllVersion(project, property.getId(), false));
|
||||
}
|
||||
if (allVersion.size() == 0 && project.getEmfProject().getReferencedProjects().size() > 0) {
|
||||
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(project);
|
||||
String parentBranch = getRepositoryContext().getFields().get(
|
||||
IProxyRepositoryFactory.BRANCH_SELECTION + "_" + project.getTechnicalLabel());
|
||||
|
||||
for (ProjectReference refProject : (List<ProjectReference>) project.getEmfProject().getReferencedProjects()) {
|
||||
if (refProject.getBranch() != null && !parentBranch.equals(refProject.getBranch())) {
|
||||
|
||||
@@ -1,183 +1,183 @@
|
||||
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.INode;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.ICheckDeleteItemReference;
|
||||
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 ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class CheckJobletDeleteReference extends AbstractCheckDeleteItemReference implements ICheckDeleteItemReference {
|
||||
|
||||
// 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(); // hywang add
|
||||
boolean needCheckJobletIfUsedInProcess = false;
|
||||
if (nodeItem instanceof JobletProcessItem) {
|
||||
needCheckJobletIfUsedInProcess = true;
|
||||
}
|
||||
Set<ItemReferenceBean> list = new HashSet<ItemReferenceBean>();
|
||||
if (object != null && needCheckJobletIfUsedInProcess) {
|
||||
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 JobletProcessItem)) {
|
||||
return list;
|
||||
}
|
||||
EList nodesList = null;
|
||||
// wzhang added to 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);
|
||||
List<IRepositoryViewObject> jobletes = factory.getAll(refP, ERepositoryObjectType.JOBLET, true);
|
||||
processes.addAll(jobletes);
|
||||
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();
|
||||
} else if (item2 instanceof JobletProcessItem) {
|
||||
nodesList = ((JobletProcessItem) item2).getJobletProcess().getNode();
|
||||
}
|
||||
}
|
||||
if (nodesList != null) {
|
||||
for (Object object2 : nodesList) {
|
||||
if (object2 instanceof NodeType) {
|
||||
NodeType nodeType = (NodeType) object2;
|
||||
nodeType.getElementParameter();
|
||||
boolean equals = nodeType.getComponentName().equals(label);
|
||||
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 = node.getComponent().getName().equals(label);
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
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.INode;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.ICheckDeleteItemReference;
|
||||
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 ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class CheckJobletDeleteReference extends AbstractCheckDeleteItemReference implements ICheckDeleteItemReference {
|
||||
|
||||
// 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(); // hywang add
|
||||
boolean needCheckJobletIfUsedInProcess = false;
|
||||
if (nodeItem instanceof JobletProcessItem) {
|
||||
needCheckJobletIfUsedInProcess = true;
|
||||
}
|
||||
Set<ItemReferenceBean> list = new HashSet<ItemReferenceBean>();
|
||||
if (object != null && needCheckJobletIfUsedInProcess) {
|
||||
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 JobletProcessItem)) {
|
||||
return list;
|
||||
}
|
||||
EList nodesList = null;
|
||||
// wzhang added to 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);
|
||||
List<IRepositoryViewObject> jobletes = factory.getAll(refP, ERepositoryObjectType.JOBLET, true);
|
||||
processes.addAll(jobletes);
|
||||
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();
|
||||
} else if (item2 instanceof JobletProcessItem) {
|
||||
nodesList = ((JobletProcessItem) item2).getJobletProcess().getNode();
|
||||
}
|
||||
}
|
||||
if (nodesList != null) {
|
||||
for (Object object2 : nodesList) {
|
||||
if (object2 instanceof NodeType) {
|
||||
NodeType nodeType = (NodeType) object2;
|
||||
nodeType.getElementParameter();
|
||||
boolean equals = nodeType.getComponentName().equals(label);
|
||||
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 = node.getComponent().getName().equals(label);
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.FolderItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.MigrationTask;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.SpagoBiServer;
|
||||
import org.talend.core.model.properties.Status;
|
||||
@@ -228,7 +227,7 @@ public interface IRepositoryFactory {
|
||||
|
||||
void setSpagoBiServer(List<SpagoBiServer> list) throws PersistenceException;
|
||||
|
||||
void setMigrationTasksDone(Project project, List<MigrationTask> list) throws PersistenceException;
|
||||
void setMigrationTasksDone(Project project, List<String> list) throws PersistenceException;
|
||||
|
||||
public String isServerValid() throws BusinessException;
|
||||
|
||||
@@ -242,8 +241,6 @@ public interface IRepositoryFactory {
|
||||
|
||||
public Item copy(Item item, IPath path, boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException;
|
||||
|
||||
public Item copy(Item sourceItem, IPath targetPath, String newItemLabel) throws PersistenceException, BusinessException;
|
||||
|
||||
/**
|
||||
* DOC mhelleboid Comment method "cancel".
|
||||
*
|
||||
@@ -382,7 +379,4 @@ public interface IRepositoryFactory {
|
||||
* update the lock status
|
||||
*/
|
||||
public void updateLockStatus() throws PersistenceException;
|
||||
|
||||
public boolean isModified(Property property);
|
||||
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ import org.talend.core.model.properties.InformationLevel;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobDocumentationItem;
|
||||
import org.talend.core.model.properties.JobletDocumentationItem;
|
||||
import org.talend.core.model.properties.MigrationTask;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.PropertiesPackage;
|
||||
import org.talend.core.model.properties.Property;
|
||||
@@ -101,7 +101,6 @@ import org.talend.core.model.repository.RepositoryContentManager;
|
||||
import org.talend.core.model.repository.RepositoryObject;
|
||||
import org.talend.core.model.repository.RepositoryViewObject;
|
||||
import org.talend.core.repository.CoreRepositoryPlugin;
|
||||
import org.talend.core.repository.constants.Constant;
|
||||
import org.talend.core.repository.constants.FileConstants;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.utils.RepositoryPathProvider;
|
||||
@@ -144,7 +143,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
private boolean fullLogonFinished;
|
||||
|
||||
private final ProjectManager projectManager;
|
||||
private ProjectManager projectManager;
|
||||
|
||||
@Override
|
||||
public synchronized void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
@@ -261,23 +260,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
this.repositoryFactoryFromProvider.executeMigrations(mainProject, beforeLogon, monitorWrap);
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC ycbai Comment method "checkProjectCompatibility".
|
||||
*
|
||||
* @param project
|
||||
* @throws LoginException
|
||||
*/
|
||||
private void checkProjectCompatibility(Project project) throws LoginException {
|
||||
IMigrationToolService migrationToolService = (IMigrationToolService) GlobalServiceRegister.getDefault().getService(
|
||||
IMigrationToolService.class);
|
||||
// update migration system.
|
||||
migrationToolService.updateMigrationSystem(project.getEmfProject(), false);
|
||||
boolean isProjectCompatibility = migrationToolService.checkMigrationTasks(project.getEmfProject());
|
||||
if (!isProjectCompatibility) {
|
||||
throw new LoginException(Messages.getString("ProxyRepositoryFactory.projectIsNotCompatible", project.getLabel())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkFileNameAndPath(Project project, Item item, String pattern, IPath path, boolean folder,
|
||||
boolean... isImportItem) throws PersistenceException {
|
||||
String fileName = item.getProperty().getLabel();
|
||||
@@ -535,17 +517,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// TUP-202 sizhaoliu 2012-10-3 recursively check lock status of items in sub folders
|
||||
FolderItem folderItem = repositoryFactoryFromProvider.getFolderItem(baseProject, type, path);
|
||||
if (folderItem != null) {
|
||||
for (Object child : folderItem.getChildren()) {
|
||||
if (child instanceof FolderItem) {
|
||||
if (hasLockedItems(type, path.append(((FolderItem) child).getProperty().getLabel()))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -836,8 +807,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
// TODO SML Renommer et finir la m<>thode et la plugger dans toutes les m<>thodes
|
||||
private void checkAvailability(IRepositoryViewObject objToMove) throws BusinessException {
|
||||
if (!getRepositoryContext().isEditableAsReadOnly()
|
||||
&& (!isPotentiallyEditable(objToMove) || ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject())) {
|
||||
if (!isPotentiallyEditable(objToMove) || ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
|
||||
throw new BusinessException(Messages.getString("ProxyRepositoryFactory.bussinessException.itemNonModifiable")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
@@ -898,10 +868,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
EventAdmin eventAdmin = (EventAdmin) bundleContext.getService(ref);
|
||||
|
||||
Dictionary<String, Object> properties = new Hashtable<String, Object>();
|
||||
properties.put(Constant.ITEM_EVENT_PROPERTY_KEY, item);
|
||||
properties.put("item", item);
|
||||
|
||||
Event lockEvent = new Event(Constant.REPOSITORY_ITEM_EVENT_PREFIX
|
||||
+ (lock ? Constant.ITEM_LOCK_EVENT_SUFFIX : Constant.ITEM_UNLOCK_EVENT_SUFFIX), properties);
|
||||
Event lockEvent = new Event("org/talend/repository/item/" + (lock ? "lock" : "unlock"), properties);
|
||||
|
||||
eventAdmin.postEvent(lockEvent);
|
||||
}
|
||||
@@ -1184,7 +1153,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMigrationTasksDone(Project project, List<MigrationTask> list) throws PersistenceException {
|
||||
public void setMigrationTasksDone(Project project, List<String> list) throws PersistenceException {
|
||||
this.repositoryFactoryFromProvider.setMigrationTasksDone(project, list);
|
||||
}
|
||||
|
||||
@@ -1321,23 +1290,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item copy(Item sourceItem, IPath targetPath, String newItemLabel) throws PersistenceException, BusinessException {
|
||||
|
||||
if (sourceItem instanceof ProcessItem) {
|
||||
try {
|
||||
coreService.checkJob(sourceItem.getProperty().getLabel());
|
||||
} catch (BusinessException e) {
|
||||
throw new PersistenceException(e);
|
||||
} catch (RuntimeException e) {
|
||||
// don't do anything
|
||||
}
|
||||
}
|
||||
Item targetItem = this.repositoryFactoryFromProvider.copy(sourceItem, targetPath, newItemLabel);
|
||||
return targetItem;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveCopy(Item sourceItem, Item targetItem) {
|
||||
fireRepositoryPropertyChange(ERepositoryActionName.COPY.getName(), sourceItem, targetItem);
|
||||
@@ -1382,10 +1334,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
*/
|
||||
@Override
|
||||
public void unlock(Item obj) throws PersistenceException, LoginException {
|
||||
if (!(obj instanceof FolderItem) && (obj.eResource() == null || obj.getProperty().eResource() == null)) {
|
||||
// item has been unloaded
|
||||
obj = getUptodateProperty(obj.getProperty()).getItem();
|
||||
}
|
||||
if (getStatus(obj) == ERepositoryStatus.LOCK_BY_USER || obj instanceof JobletDocumentationItem
|
||||
|| obj instanceof JobDocumentationItem) {
|
||||
Date commitDate = obj.getState().getCommitDate();
|
||||
@@ -1547,9 +1495,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (!projectManager.isInCurrentMainProject(item)) {
|
||||
return false;
|
||||
}
|
||||
if (getRepositoryContext().isEditableAsReadOnly()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ERepositoryStatus status = getStatus(item);
|
||||
if (status.isPotentiallyEditable()) {
|
||||
@@ -1728,9 +1673,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
// monitorWrap.worked(1);
|
||||
TimeMeasure.step("logOnProject", "beforeLogon");
|
||||
|
||||
// Check project compatibility
|
||||
checkProjectCompatibility(project);
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask("Execute before logon migrations tasks", 1); //$NON-NLS-1$
|
||||
executeMigrations(project, true, currentMonitor);
|
||||
@@ -1885,13 +1827,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
for (Project p : projectManager.getReferencedProjects(project)) {
|
||||
IRepositoryViewObject specVersion = getSpecificVersion(p, id, version, avoidSaveProject);
|
||||
if (specVersion != null) {
|
||||
return specVersion;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2080,9 +2015,4 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
this.repositoryFactoryFromProvider.updateLockStatus();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified(Property property) {
|
||||
return repositoryFactoryFromProvider.isModified(property);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ import org.talend.repository.model.IRepositoryNode;
|
||||
import orgomg.cwm.objectmodel.core.ModelElement;
|
||||
import orgomg.cwm.resource.relational.Catalog;
|
||||
|
||||
|
||||
/**
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
*/
|
||||
public class MetadataCatalogRepositoryObject extends MetadataCatalog implements ISubRepositoryObject {
|
||||
|
||||
@@ -62,7 +63,6 @@ public class MetadataCatalogRepositoryObject extends MetadataCatalog implements
|
||||
this.catalog = catalog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
// update table
|
||||
@@ -71,27 +71,22 @@ public class MetadataCatalogRepositoryObject extends MetadataCatalog implements
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return getCatalog().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return getCatalog().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
}
|
||||
|
||||
@@ -99,94 +94,68 @@ public class MetadataCatalogRepositoryObject extends MetadataCatalog implements
|
||||
// FIXME empty method ?
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return this.viewObject.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.METADATA_CON_CATALOG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
this.repositoryNode = node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.catalog;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ import org.talend.repository.model.IRepositoryNode;
|
||||
import orgomg.cwm.objectmodel.core.ModelElement;
|
||||
import orgomg.cwm.resource.relational.Schema;
|
||||
|
||||
|
||||
/**
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
*/
|
||||
public class MetadataSchemaRepositoryObject extends MetadataSchema implements ISubRepositoryObject {
|
||||
|
||||
@@ -57,7 +58,6 @@ public class MetadataSchemaRepositoryObject extends MetadataSchema implements IS
|
||||
this.schema = schema;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
// update table
|
||||
@@ -66,121 +66,90 @@ public class MetadataSchemaRepositoryObject extends MetadataSchema implements IS
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return getSchema().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return getSchema().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
}
|
||||
|
||||
private void updateCatalog(Property property) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return this.viewObject.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.METADATA_CON_SCHEMA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
this.repositoryNode = node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.schema;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
// update table
|
||||
@@ -71,7 +70,6 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
@@ -94,12 +92,10 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
return this.table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return getTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
|
||||
if (table.eContainer() instanceof SAPFunctionUnit) {
|
||||
@@ -205,94 +201,68 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return viewObject.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.METADATA_CON_TABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return SubItemHelper.isDeleted(table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
this.repositoryNode = node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.table;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import orgomg.cwm.objectmodel.core.ModelElement;
|
||||
|
||||
|
||||
/**
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
*/
|
||||
public class MetadataXmlElementTypeRepositoryObject extends MetadataXmlElementType implements ISubRepositoryObject {
|
||||
|
||||
@@ -46,7 +47,6 @@ public class MetadataXmlElementTypeRepositoryObject extends MetadataXmlElementTy
|
||||
return this.tdXmlElementType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return this.viewObject.getChildren();
|
||||
}
|
||||
@@ -62,7 +62,6 @@ public class MetadataXmlElementTypeRepositoryObject extends MetadataXmlElementTy
|
||||
this.tdXmlElementType = tdElementType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
updateCatalog(property);
|
||||
@@ -70,116 +69,86 @@ public class MetadataXmlElementTypeRepositoryObject extends MetadataXmlElementTy
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return getTdXmlElementType().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return getTdXmlElementType().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
}
|
||||
|
||||
private void updateCatalog(Property property) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.MDM_ELEMENT_TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
this.repositoryNode = node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.tdXmlElementType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import orgomg.cwm.objectmodel.core.ModelElement;
|
||||
|
||||
|
||||
/**
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
* DOC klliu class global comment. Detailled comment
|
||||
*/
|
||||
public class MetadataXmlSchemaRepositoryObject extends MetadataXmlSchema implements ISubRepositoryObject {
|
||||
|
||||
@@ -42,12 +43,10 @@ public class MetadataXmlSchemaRepositoryObject extends MetadataXmlSchema impleme
|
||||
return this.viewObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return this.repositoryNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void setRepositoryNode(IRepositoryNode repositoryNode) {
|
||||
this.repositoryNode = repositoryNode;
|
||||
}
|
||||
@@ -56,7 +55,6 @@ public class MetadataXmlSchemaRepositoryObject extends MetadataXmlSchema impleme
|
||||
return this.tdXmlSchema;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return this.viewObject.getChildren();
|
||||
}
|
||||
@@ -72,32 +70,26 @@ public class MetadataXmlSchemaRepositoryObject extends MetadataXmlSchema impleme
|
||||
this.tdXmlSchema = tdXmlSchema;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return getTdXmlSchema().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return getTdXmlSchema().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.MDM_SCHEMA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
}
|
||||
|
||||
@@ -105,81 +97,58 @@ public class MetadataXmlSchemaRepositoryObject extends MetadataXmlSchema impleme
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
updateCatalog(property);
|
||||
return property;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.tdXmlSchema;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.MetadataColumnRepositoryObject;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.IRepositoryContentHandler;
|
||||
import org.talend.core.model.repository.RepositoryContentManager;
|
||||
import org.talend.core.model.repository.RepositoryObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.repository.ProjectManager;
|
||||
@@ -59,13 +57,6 @@ public abstract class AbstractCreateAction extends AContextualAction {
|
||||
if (repNode.getObject() instanceof MetadataColumnRepositoryObject) {
|
||||
repNode = repNode.getParent().getParent();
|
||||
}
|
||||
|
||||
for (IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
|
||||
if (handler.hideAction(repNode, this.getClass())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
init(repNode);
|
||||
repositoryNode = repNode;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ public class AbstractResourceChangesService implements IService {
|
||||
public void handleUnload(Resource toBeUnloadedResource) {
|
||||
}
|
||||
|
||||
// Add new elements to resource, remove elements from resource, delete resource
|
||||
public void handleLogicalDelete(Property prop) {
|
||||
}
|
||||
|
||||
@@ -97,5 +96,4 @@ public class AbstractResourceChangesService implements IService {
|
||||
public void openDependcesDialog(List<IRepositoryNode> nodes) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,201 +1,201 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.keyvalue.MultiKey;
|
||||
import org.apache.commons.collections.map.MultiKeyMap;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.ICheckDeleteItemReference;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class RepositoryNodeDeleteManager {
|
||||
|
||||
private static RepositoryNodeDeleteManager instance;
|
||||
|
||||
public static final String EXTENTION_ID = "org.talend.core.repository.checkDeleteItemReference"; //$NON-NLS-1$
|
||||
|
||||
private static final String ATT_CLASS = "class"; //$NON-NLS-1$
|
||||
|
||||
private static final String ATT_PRIORITY = "priority"; //$NON-NLS-1$
|
||||
|
||||
private static IConfigurationElement[] configurationElements;
|
||||
|
||||
private RepositoryNodeDeleteManager() {
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
configurationElements = registry.getConfigurationElementsFor(EXTENTION_ID);
|
||||
}
|
||||
|
||||
public static synchronized RepositoryNodeDeleteManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new RepositoryNodeDeleteManager();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
static class DeleteCheck {
|
||||
|
||||
public final ICheckDeleteItemReference checkDeleteItemReference;
|
||||
|
||||
public final Priority priority;
|
||||
|
||||
enum Priority {
|
||||
LOWEST,
|
||||
LOW,
|
||||
NORMAL,
|
||||
HIGH,
|
||||
HIGHEST
|
||||
}
|
||||
|
||||
public DeleteCheck(ICheckDeleteItemReference checkDeleteItemReference, Priority priority) {
|
||||
this.checkDeleteItemReference = checkDeleteItemReference;
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<ItemReferenceBean> getUnDeleteItems(List<? extends IRepositoryNode> deleteObjs,
|
||||
DeleteActionCache deleteActionCache) {
|
||||
return getUnDeleteItems(deleteObjs, deleteActionCache, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ItemReferenceBean> getUnDeleteItems(List<? extends IRepositoryNode> deleteNodes,
|
||||
DeleteActionCache deleteActionCache, boolean updateDelList) {
|
||||
List<ItemReferenceBean> beans = new ArrayList<ItemReferenceBean>();
|
||||
Set<ItemReferenceBean> refBeans = new HashSet<ItemReferenceBean>();
|
||||
List<DeleteCheck> deleteChecks = new ArrayList<DeleteCheck>();
|
||||
|
||||
if (deleteNodes == null || deleteNodes.size() == 0) {
|
||||
return beans;
|
||||
}
|
||||
|
||||
try {
|
||||
for (IConfigurationElement element : configurationElements) {
|
||||
ICheckDeleteItemReference checkDeleteItemReference = (ICheckDeleteItemReference) element
|
||||
.createExecutableExtension(ATT_CLASS);
|
||||
String priorityStr = element.getAttribute(ATT_PRIORITY);
|
||||
DeleteCheck.Priority priority = (priorityStr != null && priorityStr.length() > 0) ? DeleteCheck.Priority
|
||||
.valueOf(priorityStr.toUpperCase()) : DeleteCheck.Priority.NORMAL;
|
||||
DeleteCheck deleteCheck = new DeleteCheck(checkDeleteItemReference, priority);
|
||||
if (!deleteChecks.contains(deleteCheck)) {
|
||||
deleteChecks.add(deleteCheck);
|
||||
}
|
||||
}
|
||||
sortDeleteChecks(deleteChecks);
|
||||
for (DeleteCheck deleteCheck : deleteChecks) {
|
||||
refBeans.addAll(deleteCheck.checkDeleteItemReference.getItemReferenceBeans(deleteNodes, deleteActionCache));
|
||||
}
|
||||
|
||||
MultiKeyMap item2beansMap = new MultiKeyMap();
|
||||
for (ItemReferenceBean refBean : refBeans) {
|
||||
List<ItemReferenceBean> beansList = (List<ItemReferenceBean>) item2beansMap.get(refBean.getItemName(),
|
||||
refBean.getItemVersion(), refBean.getItemType());
|
||||
if (beansList == null) {
|
||||
beansList = new ArrayList<ItemReferenceBean>();
|
||||
item2beansMap.put(refBean.getItemName(), refBean.getItemVersion(), refBean.getItemType(), beansList);
|
||||
}
|
||||
if (!beansList.contains(refBean)) {
|
||||
beansList.add(refBean);
|
||||
}
|
||||
}
|
||||
|
||||
Iterator it = item2beansMap.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Object obj = it.next();
|
||||
if (obj instanceof MultiKey) {
|
||||
Object[] keys = ((MultiKey) obj).getKeys();
|
||||
if (keys.length >= 3) {
|
||||
String itemName = String.valueOf(keys[0]);
|
||||
String itemVersion = String.valueOf(keys[1]);
|
||||
ERepositoryObjectType itemType = (ERepositoryObjectType) keys[2];
|
||||
ItemReferenceBean parentBean = new ItemReferenceBean();
|
||||
parentBean.setItemName(itemName);
|
||||
parentBean.setItemVersion(itemVersion);
|
||||
parentBean.setItemType(itemType);
|
||||
parentBean.setHost(true);
|
||||
parentBean.addChildren((List<ItemReferenceBean>) item2beansMap.get(obj));
|
||||
beans.add(parentBean);
|
||||
}
|
||||
}
|
||||
}
|
||||
sortReferenceBeans(beans);
|
||||
|
||||
if (updateDelList) {
|
||||
List<String> unDeleteItemNames = new ArrayList<String>();
|
||||
for (ItemReferenceBean bean : beans) {
|
||||
unDeleteItemNames.add(bean.getItemName());
|
||||
}
|
||||
Iterator<? extends IRepositoryNode> nodeIter = deleteNodes.iterator();
|
||||
while (nodeIter.hasNext()) {
|
||||
IRepositoryNode node = nodeIter.next();
|
||||
Object label = node.getProperties(EProperties.LABEL);
|
||||
if (unDeleteItemNames.contains(label)) {
|
||||
nodeIter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return beans;
|
||||
}
|
||||
|
||||
private void sortDeleteChecks(List<DeleteCheck> deleteChecks) {
|
||||
Collections.sort(deleteChecks, new Comparator<DeleteCheck>() {
|
||||
|
||||
@Override
|
||||
public int compare(DeleteCheck check1, DeleteCheck check2) {
|
||||
return check1.priority.compareTo(check2.priority);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sortReferenceBeans(List<ItemReferenceBean> beans) {
|
||||
Collections.sort(beans, new Comparator<ItemReferenceBean>() {
|
||||
|
||||
@Override
|
||||
public int compare(ItemReferenceBean bean1, ItemReferenceBean bean2) {
|
||||
int ordinal1 = bean1.getItemType().ordinal();
|
||||
int ordinal2 = bean2.getItemType().ordinal();
|
||||
if (ordinal1 > ordinal2) {
|
||||
return 1;
|
||||
} else if (ordinal1 < ordinal2) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.keyvalue.MultiKey;
|
||||
import org.apache.commons.collections.map.MultiKeyMap;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.ICheckDeleteItemReference;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.ItemReferenceBean;
|
||||
import org.talend.repository.ui.actions.DeleteActionCache;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class RepositoryNodeDeleteManager {
|
||||
|
||||
private static RepositoryNodeDeleteManager instance;
|
||||
|
||||
public static final String EXTENTION_ID = "org.talend.core.repository.checkDeleteItemReference"; //$NON-NLS-1$
|
||||
|
||||
private static final String ATT_CLASS = "class"; //$NON-NLS-1$
|
||||
|
||||
private static final String ATT_PRIORITY = "priority"; //$NON-NLS-1$
|
||||
|
||||
private static IConfigurationElement[] configurationElements;
|
||||
|
||||
private RepositoryNodeDeleteManager() {
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
configurationElements = registry.getConfigurationElementsFor(EXTENTION_ID);
|
||||
}
|
||||
|
||||
public static synchronized RepositoryNodeDeleteManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new RepositoryNodeDeleteManager();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
static class DeleteCheck {
|
||||
|
||||
public final ICheckDeleteItemReference checkDeleteItemReference;
|
||||
|
||||
public final Priority priority;
|
||||
|
||||
enum Priority {
|
||||
LOWEST,
|
||||
LOW,
|
||||
NORMAL,
|
||||
HIGH,
|
||||
HIGHEST
|
||||
}
|
||||
|
||||
public DeleteCheck(ICheckDeleteItemReference checkDeleteItemReference, Priority priority) {
|
||||
this.checkDeleteItemReference = checkDeleteItemReference;
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<ItemReferenceBean> getUnDeleteItems(List<? extends IRepositoryNode> deleteObjs,
|
||||
DeleteActionCache deleteActionCache) {
|
||||
return getUnDeleteItems(deleteObjs, deleteActionCache, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ItemReferenceBean> getUnDeleteItems(List<? extends IRepositoryNode> deleteNodes,
|
||||
DeleteActionCache deleteActionCache, boolean updateDelList) {
|
||||
List<ItemReferenceBean> beans = new ArrayList<ItemReferenceBean>();
|
||||
Set<ItemReferenceBean> refBeans = new HashSet<ItemReferenceBean>();
|
||||
List<DeleteCheck> deleteChecks = new ArrayList<DeleteCheck>();
|
||||
|
||||
if (deleteNodes == null || deleteNodes.size() == 0) {
|
||||
return beans;
|
||||
}
|
||||
|
||||
try {
|
||||
for (IConfigurationElement element : configurationElements) {
|
||||
ICheckDeleteItemReference checkDeleteItemReference = (ICheckDeleteItemReference) element
|
||||
.createExecutableExtension(ATT_CLASS);
|
||||
String priorityStr = element.getAttribute(ATT_PRIORITY);
|
||||
DeleteCheck.Priority priority = (priorityStr != null && priorityStr.length() > 0) ? DeleteCheck.Priority
|
||||
.valueOf(priorityStr.toUpperCase()) : DeleteCheck.Priority.NORMAL;
|
||||
DeleteCheck deleteCheck = new DeleteCheck(checkDeleteItemReference, priority);
|
||||
if (!deleteChecks.contains(deleteCheck)) {
|
||||
deleteChecks.add(deleteCheck);
|
||||
}
|
||||
}
|
||||
sortDeleteChecks(deleteChecks);
|
||||
for (DeleteCheck deleteCheck : deleteChecks) {
|
||||
refBeans.addAll(deleteCheck.checkDeleteItemReference.getItemReferenceBeans(deleteNodes, deleteActionCache));
|
||||
}
|
||||
|
||||
MultiKeyMap item2beansMap = new MultiKeyMap();
|
||||
for (ItemReferenceBean refBean : refBeans) {
|
||||
List<ItemReferenceBean> beansList = (List<ItemReferenceBean>) item2beansMap.get(refBean.getItemName(),
|
||||
refBean.getItemVersion(), refBean.getItemType());
|
||||
if (beansList == null) {
|
||||
beansList = new ArrayList<ItemReferenceBean>();
|
||||
item2beansMap.put(refBean.getItemName(), refBean.getItemVersion(), refBean.getItemType(), beansList);
|
||||
}
|
||||
if (!beansList.contains(refBean)) {
|
||||
beansList.add(refBean);
|
||||
}
|
||||
}
|
||||
|
||||
Iterator it = item2beansMap.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Object obj = it.next();
|
||||
if (obj instanceof MultiKey) {
|
||||
Object[] keys = ((MultiKey) obj).getKeys();
|
||||
if (keys.length >= 3) {
|
||||
String itemName = String.valueOf(keys[0]);
|
||||
String itemVersion = String.valueOf(keys[1]);
|
||||
ERepositoryObjectType itemType = (ERepositoryObjectType) keys[2];
|
||||
ItemReferenceBean parentBean = new ItemReferenceBean();
|
||||
parentBean.setItemName(itemName);
|
||||
parentBean.setItemVersion(itemVersion);
|
||||
parentBean.setItemType(itemType);
|
||||
parentBean.setHost(true);
|
||||
parentBean.addChildren((List<ItemReferenceBean>) item2beansMap.get(obj));
|
||||
beans.add(parentBean);
|
||||
}
|
||||
}
|
||||
}
|
||||
sortReferenceBeans(beans);
|
||||
|
||||
if (updateDelList) {
|
||||
List<String> unDeleteItemNames = new ArrayList<String>();
|
||||
for (ItemReferenceBean bean : beans) {
|
||||
unDeleteItemNames.add(bean.getItemName());
|
||||
}
|
||||
Iterator<? extends IRepositoryNode> nodeIter = deleteNodes.iterator();
|
||||
while (nodeIter.hasNext()) {
|
||||
IRepositoryNode node = nodeIter.next();
|
||||
Object label = node.getProperties(EProperties.LABEL);
|
||||
if (unDeleteItemNames.contains(label)) {
|
||||
nodeIter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return beans;
|
||||
}
|
||||
|
||||
private void sortDeleteChecks(List<DeleteCheck> deleteChecks) {
|
||||
Collections.sort(deleteChecks, new Comparator<DeleteCheck>() {
|
||||
|
||||
@Override
|
||||
public int compare(DeleteCheck check1, DeleteCheck check2) {
|
||||
return check1.priority.compareTo(check2.priority);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sortReferenceBeans(List<ItemReferenceBean> beans) {
|
||||
Collections.sort(beans, new Comparator<ItemReferenceBean>() {
|
||||
|
||||
@Override
|
||||
public int compare(ItemReferenceBean bean1, ItemReferenceBean bean2) {
|
||||
int ordinal1 = bean1.getItemType().ordinal();
|
||||
int ordinal2 = bean2.getItemType().ordinal();
|
||||
if (ordinal1 > ordinal2) {
|
||||
return 1;
|
||||
} else if (ordinal1 < ordinal2) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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 java.util.Set;
|
||||
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.core.model.metadata.MetadataColumnRepositoryObject;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.model.StableRepositoryNode;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public class RepositoryNodeManager {
|
||||
|
||||
public static void createTables(RepositoryNode node, IRepositoryViewObject repObj, Connection metadataConnection) {
|
||||
createTables(node, repObj, metadataConnection, ERepositoryObjectType.METADATA_CON_TABLE);
|
||||
}
|
||||
|
||||
public static void createTables(RepositoryNode node, final IRepositoryViewObject repObj, Connection metadataConnection,
|
||||
ERepositoryObjectType repositoryObjectType) {
|
||||
Set<MetadataTable> tableset = ConnectionHelper.getTables(metadataConnection);
|
||||
for (MetadataTable currentTable : tableset) {
|
||||
if (currentTable == null) {
|
||||
continue;
|
||||
}
|
||||
RepositoryNode tableNode = createMetatableNode(node, repObj, currentTable, repositoryObjectType);
|
||||
if (!SubItemHelper.isDeleted(currentTable)) {
|
||||
node.getChildren().add(tableNode);
|
||||
}
|
||||
if (currentTable.getColumns().size() > 0) {
|
||||
createColumns(tableNode, repObj, currentTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static RepositoryNode createMetatableNode(RepositoryNode node, IRepositoryViewObject repObj, MetadataTable table) {
|
||||
return createMetatableNode(node, repObj, table, ERepositoryObjectType.METADATA_CON_TABLE);
|
||||
}
|
||||
|
||||
public static RepositoryNode createMetatableNode(RepositoryNode node, IRepositoryViewObject repObj, MetadataTable table,
|
||||
ERepositoryObjectType repositoryObjectType) {
|
||||
MetadataTableRepositoryObject modelObj = new MetadataTableRepositoryObject(repObj, table);
|
||||
RepositoryNode tableNode = new RepositoryNode(modelObj, node, ENodeType.REPOSITORY_ELEMENT);
|
||||
tableNode.setProperties(EProperties.LABEL, modelObj.getLabel());
|
||||
tableNode.setProperties(EProperties.CONTENT_TYPE, repositoryObjectType);
|
||||
return tableNode;
|
||||
}
|
||||
|
||||
public static void createColumns(RepositoryNode tableNode, IRepositoryViewObject repObj, MetadataTable metadataTable) {
|
||||
createColumns(tableNode, repObj, metadataTable, ERepositoryObjectType.METADATA_CON_COLUMN);
|
||||
}
|
||||
|
||||
public static void createColumns(RepositoryNode tableNode, IRepositoryViewObject repObj, MetadataTable metadataTable,
|
||||
String columnsFolderName) {
|
||||
createColumns(tableNode, repObj, metadataTable, ERepositoryObjectType.METADATA_CON_COLUMN, columnsFolderName);
|
||||
}
|
||||
|
||||
public static void createColumns(RepositoryNode tableNode, IRepositoryViewObject repObj, MetadataTable metadataTable,
|
||||
ERepositoryObjectType repositoryObjectType) {
|
||||
createColumns(tableNode, repObj, metadataTable, repositoryObjectType, Messages.getString("ProjectRepositoryNode.columns"));
|
||||
}
|
||||
|
||||
public static void createColumns(RepositoryNode tableNode, IRepositoryViewObject repObj, MetadataTable metadataTable,
|
||||
ERepositoryObjectType repositoryObjectType, String columnsFolderName) {
|
||||
List<MetadataColumn> columnList = new ArrayList<MetadataColumn>();
|
||||
columnList.addAll(metadataTable.getColumns());
|
||||
int num = columnList.size();
|
||||
StringBuffer floderName = new StringBuffer();
|
||||
floderName.append(columnsFolderName);//$NON-NLS-1$
|
||||
floderName.append("(");//$NON-NLS-1$
|
||||
floderName.append(num);
|
||||
floderName.append(")");//$NON-NLS-1$
|
||||
RepositoryNode columnsNode = new StableRepositoryNode(tableNode, floderName.toString(), ECoreImage.FOLDER_CLOSE_ICON);
|
||||
tableNode.getChildren().add(columnsNode);
|
||||
|
||||
for (MetadataColumn column : columnList) {
|
||||
if (column == null) {
|
||||
continue;
|
||||
}
|
||||
RepositoryNode columnNode = createMataColumnNode(columnsNode, repObj, column);
|
||||
columnsNode.getChildren().add(columnNode);
|
||||
}
|
||||
}
|
||||
|
||||
public static RepositoryNode createMataColumnNode(RepositoryNode node, IRepositoryViewObject repObj, MetadataColumn column) {
|
||||
return createMataColumnNode(node, repObj, column, ERepositoryObjectType.METADATA_CON_COLUMN);
|
||||
}
|
||||
|
||||
public static RepositoryNode createMataColumnNode(RepositoryNode node, IRepositoryViewObject repObj, MetadataColumn column,
|
||||
ERepositoryObjectType repositoryObjectType) {
|
||||
MetadataColumnRepositoryObject columnObj = new MetadataColumnRepositoryObject(repObj, column);
|
||||
RepositoryNode columnNode = new RepositoryNode(columnObj, node, ENodeType.REPOSITORY_ELEMENT);
|
||||
columnNode.setProperties(EProperties.LABEL, columnObj.getLabel());
|
||||
columnNode.setProperties(EProperties.CONTENT_TYPE, repositoryObjectType);
|
||||
return columnNode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +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;
|
||||
|
||||
/**
|
||||
* @author Marvin Wang
|
||||
* @version 1.0 jdk1.6
|
||||
* @date Sep 14, 2012
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,8 +36,6 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
|
||||
import org.eclipse.emf.ecore.resource.URIConverter;
|
||||
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.xmi.XMLResource;
|
||||
import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl;
|
||||
import org.talend.commons.emf.EmfHelper;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
@@ -76,6 +73,8 @@ import org.talend.repository.ProjectManager;
|
||||
*/
|
||||
public class XmiResourceManager {
|
||||
|
||||
private static final String OLD_PROJECT_FILENAME = "talendProject"; //$NON-NLS-1$
|
||||
|
||||
// PTODO mhelleboid should use a custom ResourceFactory
|
||||
// PTODO mhelleboid test duplicate resourcesUri in resourceSet !
|
||||
|
||||
@@ -87,20 +86,14 @@ public class XmiResourceManager {
|
||||
|
||||
public XmiResourceManager() {
|
||||
setUseOldProjectFile(false);
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_USE_PARSER_POOL, new XMLParserPoolImpl());
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, new HashMap<Object, Object>());
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
|
||||
resourceSet.getLoadOptions().put("OPTION_DEFER_IDREF_RESOLUTION", Boolean.TRUE);
|
||||
resourceSet.getLoadOptions().put("OPTION_USE_PARSER_POOL", Boolean.TRUE);
|
||||
}
|
||||
|
||||
public void resetResourceSet() {
|
||||
resourceSet = new ResourceSetImpl();
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_ATTACHMENT, Boolean.TRUE);
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_USE_PARSER_POOL, new XMLParserPoolImpl());
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, new HashMap<Object, Object>());
|
||||
resourceSet.getLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
|
||||
resourceSet.getLoadOptions().put("OPTION_DEFER_IDREF_RESOLUTION", Boolean.TRUE);
|
||||
resourceSet.getLoadOptions().put("OPTION_USE_PARSER_POOL", Boolean.TRUE);
|
||||
}
|
||||
|
||||
public Project loadProject(IProject project) throws PersistenceException {
|
||||
@@ -140,7 +133,6 @@ public class XmiResourceManager {
|
||||
//
|
||||
URI propertyUri = URIHelper.convert(iResource.getFullPath());
|
||||
URI itemResourceURI = getItemResourceURI(propertyUri);
|
||||
URI screenshotResourceURI = getScreenshotResourceURI(itemResourceURI);
|
||||
List<Resource> resources = new ArrayList<Resource>(resourceSet.getResources());
|
||||
for (Resource res : resources) {
|
||||
if (res != null) {
|
||||
@@ -152,10 +144,6 @@ public class XmiResourceManager {
|
||||
res.unload();
|
||||
resourceSet.getResources().remove(res);
|
||||
}
|
||||
if (screenshotResourceURI.toString().equals(res.getURI().toString())) {
|
||||
res.unload();
|
||||
resourceSet.getResources().remove(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,16 +367,6 @@ public class XmiResourceManager {
|
||||
}
|
||||
Resource itemResource = null;
|
||||
if (fileExist) {
|
||||
List<Resource> resources = new ArrayList<Resource>(resourceSet.getResources());
|
||||
// for (Resource res : resources) {
|
||||
// if (res != null) {
|
||||
// if (itemResourceURI.toString().equals(res.getURI().toString())) {
|
||||
// res.unload();
|
||||
// resourceSet.getResources().remove(res);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
try {
|
||||
// judge whether the physical file exists or not
|
||||
itemResource = resourceSet.getResource(itemResourceURI, true);
|
||||
@@ -678,10 +656,10 @@ public class XmiResourceManager {
|
||||
|
||||
for (Resource resource : resourcesToSave) {
|
||||
// add for bug TDI-20844
|
||||
// if (ResourceFilenameHelper.mustChangeLabel(fileNameTest) && resource.getURI() != null
|
||||
// && resource.getURI().toString().endsWith(".screenshot")) {
|
||||
// continue;
|
||||
// }
|
||||
if (ResourceFilenameHelper.mustChangeLabel(fileNameTest) && resource.getURI() != null
|
||||
&& resource.getURI().toString().endsWith(".screenshot")) {
|
||||
continue;
|
||||
}
|
||||
saveResource(resource);
|
||||
}
|
||||
if (!resourceProperty.equals(lastVersionProperty)) {
|
||||
@@ -706,7 +684,7 @@ public class XmiResourceManager {
|
||||
|
||||
public String getProjectFilename() {
|
||||
if (useOldProjectFile) {
|
||||
return FileConstants.OLD_TALEND_PROJECT_FILENAME;
|
||||
return OLD_PROJECT_FILENAME;
|
||||
} else {
|
||||
return FileConstants.LOCAL_PROJECT_FILENAME;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -55,7 +55,6 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = viewObject.getProperty();
|
||||
// update table
|
||||
@@ -64,7 +63,6 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return viewObject.getVersion();
|
||||
}
|
||||
@@ -87,12 +85,10 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
return this.table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return getTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
|
||||
if (table.eContainer() instanceof SAPFunctionUnit) {
|
||||
@@ -167,94 +163,68 @@ public class MetadataTableRepositoryObject extends MetadataTable implements ISub
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return viewObject.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return viewObject.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return viewObject.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return viewObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return viewObject.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return viewObject.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return viewObject.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return viewObject.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return viewObject.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return viewObject.getRepositoryNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return viewObject.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return viewObject.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.METADATA_CON_TABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return SubItemHelper.isDeleted(table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
viewObject.setRepositoryNode(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.table;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return viewObject.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
public static ProjectRepositoryNode getInstance() {
|
||||
if (defaultProjRepoNode == null) {
|
||||
defaultProjRepoNode = new ProjectRepositoryNode(null, null, ENodeType.STABLE_SYSTEM_FOLDER);
|
||||
ProjectManager.getInstance().updateViewProjectNode(defaultProjRepoNode);
|
||||
defaultProjRepoNode.initialize(null);
|
||||
}
|
||||
return defaultProjRepoNode;
|
||||
@@ -671,7 +672,8 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
|
||||
private void intitializeRefProject(Project project, Object parent) {
|
||||
for (ProjectReference refProject : (List<ProjectReference>) project.getReferencedProjects()) {
|
||||
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(project);
|
||||
String parentBranch = ProxyRepositoryFactory.getInstance().getRepositoryContext().getFields()
|
||||
.get(IProxyRepositoryFactory.BRANCH_SELECTION + "_" + project.getTechnicalLabel()); //$NON-NLS-1$
|
||||
if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
|
||||
Project p = refProject.getReferencedProject();
|
||||
List<Project> list = nodeAndProject.get(parent);
|
||||
@@ -913,11 +915,8 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
}
|
||||
} else if (item.getState() != null && item.getState().isDeleted()) {
|
||||
try {
|
||||
if (ProxyRepositoryFactory.getInstance().getLastVersion(item.getProperty().getId()) != null
|
||||
&& item.getProperty()
|
||||
.getVersion()
|
||||
.equals(ProxyRepositoryFactory.getInstance().getLastVersion(item.getProperty().getId())
|
||||
.getVersion())) {
|
||||
if (item.getProperty().getVersion()
|
||||
.equals(ProxyRepositoryFactory.getInstance().getLastVersion(item.getProperty().getId()).getVersion())) {
|
||||
RepositoryNode repNode = new RepositoryNode(new RepositoryViewObject(item.getProperty()), currentParentNode,
|
||||
ENodeType.REPOSITORY_ELEMENT);
|
||||
repNode.setProperties(EProperties.CONTENT_TYPE, itemType);
|
||||
@@ -983,18 +982,18 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
}
|
||||
|
||||
if (connection != null) {
|
||||
QueriesConnection queriesConnection = connection.getQueries();
|
||||
if (queriesConnection != null) {
|
||||
for (Query query : queriesConnection.getQuery()) {
|
||||
if (SubItemHelper.isDeleted(query)) {
|
||||
RepositoryNode queryNode = createQueryNode(currentParentNode,
|
||||
new RepositoryViewObject(item.getProperty()), query);
|
||||
currentParentNode.getChildren().add(queryNode);
|
||||
queryNode.setParent(currentParentNode);
|
||||
}
|
||||
QueriesConnection queriesConnection = connection.getQueries();
|
||||
if (queriesConnection != null) {
|
||||
for (Query query : queriesConnection.getQuery()) {
|
||||
if (SubItemHelper.isDeleted(query)) {
|
||||
RepositoryNode queryNode = createQueryNode(currentParentNode,
|
||||
new RepositoryViewObject(item.getProperty()), query);
|
||||
currentParentNode.getChildren().add(queryNode);
|
||||
queryNode.setParent(currentParentNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1210,7 +1209,8 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
private void handleReferenced(RepositoryNode parent) {
|
||||
if (parent.getType().equals(ENodeType.SYSTEM_FOLDER)) {
|
||||
for (ProjectReference refProject : (List<ProjectReference>) project.getEmfProject().getReferencedProjects()) {
|
||||
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(project);
|
||||
String parentBranch = ProxyRepositoryFactory.getInstance().getRepositoryContext().getFields()
|
||||
.get(IProxyRepositoryFactory.BRANCH_SELECTION + "_" + project.getTechnicalLabel()); //$NON-NLS-1$
|
||||
// if not a DB ref project, modified by nma, order 12519
|
||||
if (refProject.getReferencedProject().getUrl() != null
|
||||
&& refProject.getReferencedProject().getUrl().startsWith("teneo") //$NON-NLS-1$
|
||||
@@ -1223,8 +1223,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
referencedProjectNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.REFERENCED_PROJECTS);
|
||||
parent.getChildren().add(referencedProjectNode);
|
||||
// fix the bug for Ref-project
|
||||
// TDI-23358, revert to before
|
||||
// ProjectManager.getInstance().updateViewProjectNode(referencedProjectNode);
|
||||
ProjectManager.getInstance().updateViewProjectNode(referencedProjectNode);
|
||||
|
||||
referencedProjectNode.initialize(currentPerspective);
|
||||
}
|
||||
@@ -1928,9 +1927,4 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
// reset it
|
||||
defaultProjRepoNode = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,24 +44,20 @@ public class QueryRepositoryObject extends org.talend.core.model.metadata.Query
|
||||
this.query = table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
Property property = repObj.getProperty();
|
||||
updateQuery(property);
|
||||
return property;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return repObj.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return query.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return query.getId();
|
||||
}
|
||||
@@ -70,12 +66,10 @@ public class QueryRepositoryObject extends org.talend.core.model.metadata.Query
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMetadataObject getAbstractMetadataObject() {
|
||||
return getQuery();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromParent() {
|
||||
query.getQueries().getQuery().remove(query);
|
||||
}
|
||||
@@ -104,94 +98,68 @@ public class QueryRepositoryObject extends org.talend.core.model.metadata.Query
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getAuthor() {
|
||||
return repObj.getAuthor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getChildren() {
|
||||
return repObj.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreationDate() {
|
||||
return repObj.getCreationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return repObj.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getInformationStatus() {
|
||||
return repObj.getInformationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getModificationDate() {
|
||||
return repObj.getModificationDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return repObj.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectLabel() {
|
||||
return repObj.getProjectLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPurpose() {
|
||||
return repObj.getPurpose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRepositoryNode getRepositoryNode() {
|
||||
return repObj.getRepositoryNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryStatus getRepositoryStatus() {
|
||||
return repObj.getRepositoryStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusCode() {
|
||||
return repObj.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERepositoryObjectType getRepositoryObjectType() {
|
||||
return ERepositoryObjectType.METADATA_CON_QUERY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return repObj.isDeleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRepositoryNode(IRepositoryNode node) {
|
||||
repObj.setRepositoryNode(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelElement getModelElement() {
|
||||
return this.query;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.repository.IRepositoryViewObject#isModified()
|
||||
*/
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return repObj.isModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ 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 {
|
||||
|
||||
@@ -216,10 +216,6 @@ public class MoveObjectAction {
|
||||
public boolean isLock(RepositoryNode sourceNode) {
|
||||
boolean isLock = false;
|
||||
|
||||
if (ProxyRepositoryFactory.getInstance().getRepositoryContext().isEditableAsReadOnly()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
ProxyRepositoryFactory.getInstance().initialize();
|
||||
|
||||
@@ -76,6 +76,7 @@ public class CopyAction extends AContextualAction {
|
||||
// refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(TreeViewer viewer, IStructuredSelection selection) {
|
||||
boolean canWork = true;
|
||||
RepositoryNode node = (RepositoryNode) selection.getFirstElement();
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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 org.eclipse.core.runtime.IPath;
|
||||
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.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
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.core.ui.images.OverlayImageProvider;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
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.wizards.folder.FolderWizard;
|
||||
|
||||
/**
|
||||
* Action used to create a new folder in repository.<br/>
|
||||
*
|
||||
* $Id: CreateFolderAction.java 82396 2012-04-24 09:28:34Z zwzhao $
|
||||
*
|
||||
*/
|
||||
public class CreateFolderAction extends AContextualAction {
|
||||
|
||||
public CreateFolderAction() {
|
||||
super();
|
||||
this.setText(Messages.getString("CreateFolderAction.action.title")); //$NON-NLS-1$
|
||||
this.setToolTipText(Messages.getString("CreateFolderAction.action.toolTipText")); //$NON-NLS-1$
|
||||
|
||||
Image folderImg = ImageProvider.getImage(ECoreImage.FOLDER_CLOSE_ICON);
|
||||
this.setImageDescriptor(OverlayImageProvider.getImageWithNew(folderImg));
|
||||
}
|
||||
|
||||
/*
|
||||
* (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();
|
||||
RepositoryNode node = (RepositoryNode) obj;
|
||||
|
||||
ERepositoryObjectType objectType = null;
|
||||
IPath path = null;
|
||||
|
||||
path = RepositoryNodeUtilities.getPath(node);
|
||||
if (RepositoryConstants.isSystemFolder(path.toString())) {
|
||||
return;
|
||||
}
|
||||
objectType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
|
||||
|
||||
if (objectType != null) {
|
||||
FolderWizard processWizard = new FolderWizard(path, objectType, null);
|
||||
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)
|
||||
*/
|
||||
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 property = node.getProperties(EProperties.CONTENT_TYPE);
|
||||
switch (node.getType()) {
|
||||
case REPOSITORY_ELEMENT:
|
||||
case STABLE_SYSTEM_FOLDER:
|
||||
canWork = false;
|
||||
break;
|
||||
case SYSTEM_FOLDER:
|
||||
if (ERepositoryObjectType.GENERATED.equals(property) || ERepositoryObjectType.JOBS.equals(property)
|
||||
|| ERepositoryObjectType.JOBLETS.equals(property) || ERepositoryObjectType.SQLPATTERNS.equals(property)
|
||||
|| ERepositoryObjectType.REFERENCED_PROJECTS.equals(property)
|
||||
|| ERepositoryObjectType.SVN_ROOT.equals(property)) {
|
||||
canWork = false;
|
||||
}
|
||||
break;
|
||||
case SIMPLE_FOLDER:
|
||||
if (ERepositoryObjectType.JOB_DOC.equals(property) || ERepositoryObjectType.JOBLET_DOC.equals(property)
|
||||
|| (ERepositoryObjectType.SQLPATTERNS.equals(property) && !isUnderUserDefined(node))) {
|
||||
canWork = false;
|
||||
}
|
||||
if (node.getObject().getProperty().getItem().getState().isDeleted()) {
|
||||
canWork = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
if (canWork && !ProjectManager.getInstance().isInCurrentMainProject(node)) {
|
||||
canWork = false;
|
||||
}
|
||||
}
|
||||
setEnabled(canWork);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,6 +54,7 @@ import org.talend.core.ICoreService;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.ITDQRepositoryService;
|
||||
import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
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;
|
||||
@@ -213,6 +214,7 @@ public class DeleteAction extends AContextualAction {
|
||||
if (isInDeletedFolder(deletedFolder, node.getParent())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TDI-22550
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService coreService = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
@@ -227,7 +229,6 @@ public class DeleteAction extends AContextualAction {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean needReturn = deleteElements(factory, deleteActionCache, node);
|
||||
if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET) {
|
||||
needToUpdataPalette = true;
|
||||
@@ -655,7 +656,9 @@ public class DeleteAction extends AContextualAction {
|
||||
if (ctx == null) {
|
||||
return false;
|
||||
}
|
||||
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(parentProject);
|
||||
RepositoryContext repositoryContext = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
|
||||
String parentBranch = repositoryContext.getFields().get(
|
||||
IProxyRepositoryFactory.BRANCH_SELECTION + "_" + parentProject.getTechnicalLabel()); //$NON-NLS-1$
|
||||
|
||||
EList referencedProjects = parentProject.getEmfProject().getReferencedProjects();
|
||||
for (ProjectReference pRef : (List<ProjectReference>) referencedProjects) {
|
||||
@@ -729,6 +732,7 @@ public class DeleteAction extends AContextualAction {
|
||||
allJobVersions.addAll(factory.getAllVersion(process.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
List<IRepositoryViewObject> jobletes = factory.getAll(refP, ERepositoryObjectType.JOBLET);
|
||||
allJobVersions.addAll(jobletes);
|
||||
deleteActionCache.setProcessList(allJobVersions);
|
||||
@@ -808,7 +812,6 @@ public class DeleteAction extends AContextualAction {
|
||||
contextList = service.getProcessFromProcessItem((ProcessItem) item2).getContextManager()
|
||||
.getListContext();
|
||||
}
|
||||
|
||||
}
|
||||
if (item2 instanceof JobletProcessItem) {
|
||||
contextList = service.getProcessFromJobletProcessItem((JobletProcessItem) item2)
|
||||
@@ -816,6 +819,7 @@ public class DeleteAction extends AContextualAction {
|
||||
} else if (item2 instanceof ConnectionItem) {
|
||||
contextID = ((ConnectionItem) item2).getConnection().getContextId();
|
||||
}
|
||||
|
||||
if (contextList != null) {
|
||||
// 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
|
||||
@@ -868,12 +872,12 @@ public class DeleteAction extends AContextualAction {
|
||||
Property property2 = openedProcess.getProperty();
|
||||
Item item2 = property2.getItem();
|
||||
String path = item2.getState().getPath();
|
||||
|
||||
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());
|
||||
@@ -1045,26 +1049,15 @@ public class DeleteAction extends AContextualAction {
|
||||
* @return
|
||||
*/
|
||||
private boolean isForbidNode(RepositoryNode node) {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
|
||||
IRepositoryViewObject nodeObject = node.getObject();
|
||||
|
||||
if (nodeObject == null || nodeObject.getProperty() == null || nodeObject.getProperty().getItem() == null) {
|
||||
// invalid item, but allow the delete
|
||||
// to review later, but normally we should be able to delete even invalid items.
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean locked = false;
|
||||
|
||||
if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
|
||||
if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER
|
||||
|| nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
|
||||
locked = true;
|
||||
}
|
||||
}
|
||||
// Avoid to delete node which is locked.
|
||||
if ((locked || RepositoryManager.isOpenedItemInEditor(nodeObject)) && !(DELETE_FOREVER_TITLE.equals(getText()))) {
|
||||
if (nodeObject != null
|
||||
&& nodeObject.getProperty() != null
|
||||
&& nodeObject.getProperty().getItem() != null
|
||||
&& (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER
|
||||
|| nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER || RepositoryManager
|
||||
.isOpenedItemInEditor(nodeObject)) && !(DELETE_FOREVER_TITLE.equals(getText()))) {
|
||||
|
||||
final String title = Messages.getString("DeleteAction.error.title"); //$NON-NLS-1$
|
||||
String nodeName = ERepositoryObjectType.getDeleteFolderName(nodeObject.getRepositoryObjectType());
|
||||
@@ -1274,8 +1267,7 @@ public class DeleteAction extends AContextualAction {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
/* *
|
||||
* Remove the dbconnection in sql explorer after logical delete.
|
||||
*
|
||||
* @param node
|
||||
@@ -1318,10 +1310,6 @@ public class DeleteAction extends AContextualAction {
|
||||
if (factory.isUserReadOnlyOnCurrentProject()) {
|
||||
visible = false;
|
||||
}
|
||||
// TDI-23105:only for read-only(tag) project > also for offline, since TDI-23336
|
||||
if (factory.getRepositoryContext().isOffline() || factory.getRepositoryContext().isEditableAsReadOnly()) {
|
||||
visible = false;
|
||||
}
|
||||
for (Object o : (selection).toArray()) {
|
||||
if (visible) {
|
||||
RepositoryNode node = (RepositoryNode) o;
|
||||
@@ -1402,15 +1390,6 @@ public class DeleteAction extends AContextualAction {
|
||||
break;
|
||||
}
|
||||
|
||||
if (contentType == ERepositoryObjectType.METADATA_VALIDATION_RULES) {
|
||||
RepositoryNode parent = node.getParent().getParent();
|
||||
if (parent != null && ERepositoryObjectType.METADATA_CON_TABLE == parent.getObjectType()) {
|
||||
enabled = false;
|
||||
visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
IRepositoryViewObject repObj = node.getObject();
|
||||
|
||||
ERepositoryStatus status = repObj.getRepositoryStatus();
|
||||
|
||||
@@ -125,13 +125,15 @@ public class DeleteTableAction extends AContextualAction {
|
||||
return;
|
||||
}
|
||||
boolean isSave = true;
|
||||
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance().getResourceChangeService(
|
||||
AbstractResourceChangesService.class);
|
||||
if (resChangeService != null) {
|
||||
List<IRepositoryNode> dependentNodes = resChangeService.getDependentNodes(node);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resChangeService.openDependcesDialog(dependentNodes);
|
||||
isSave = false;
|
||||
if (item instanceof ConnectionItem) {
|
||||
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance()
|
||||
.getResourceChangeService(AbstractResourceChangesService.class);
|
||||
if (resChangeService != null) {
|
||||
List<IRepositoryNode> dependentNodes = resChangeService.getDependentNodes(node);
|
||||
if (dependentNodes != null && !dependentNodes.isEmpty()) {
|
||||
resChangeService.openDependcesDialog(dependentNodes);
|
||||
isSave = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isSave) {
|
||||
|
||||
@@ -188,7 +188,7 @@ public class DuplicateAction extends AContextualAction {
|
||||
String jobNameValue = null;
|
||||
|
||||
try {
|
||||
jobNameValue = getDuplicateName(sourceNode, initNameValue, selectionInClipboard);
|
||||
jobNameValue = getDuplicateName(initNameValue, selectionInClipboard);
|
||||
} catch (BusinessException e) {
|
||||
jobNameValue = ""; //$NON-NLS-1$
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public class DuplicateAction extends AContextualAction {
|
||||
|
||||
@Override
|
||||
public String isValid(String newText) {
|
||||
return validJobName(sourceNode, newText, selectionInClipboard);
|
||||
return validJobName(newText, selectionInClipboard);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -213,15 +213,14 @@ public class DuplicateAction extends AContextualAction {
|
||||
|
||||
}
|
||||
|
||||
public String getDuplicateName(RepositoryNode node, String value, final TreeSelection selectionInClipboard)
|
||||
throws BusinessException {
|
||||
public String getDuplicateName(String value, final TreeSelection selectionInClipboard) throws BusinessException {
|
||||
|
||||
if (validJobName(node, value, selectionInClipboard) == null) {
|
||||
if (validJobName(value, selectionInClipboard) == null) {
|
||||
return value;
|
||||
} else {
|
||||
char j = 'a';
|
||||
String temp = value;
|
||||
while (validJobName(node, temp, selectionInClipboard) != null) {
|
||||
while (validJobName(temp, selectionInClipboard) != null) {
|
||||
if (j > 'z') {
|
||||
throw new BusinessException(Messages.getString("DuplicateAction.cannotGenerateItem")); //$NON-NLS-1$
|
||||
}
|
||||
@@ -231,22 +230,6 @@ public class DuplicateAction extends AContextualAction {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValid(RepositoryNode node, String str) {
|
||||
String namePattern = "^\\w+$";
|
||||
Object contentType = node.getContentType();
|
||||
if (contentType == null) {
|
||||
contentType = node.getProperties(EProperties.CONTENT_TYPE);
|
||||
}
|
||||
if (contentType != null && contentType instanceof ERepositoryObjectType) {
|
||||
String tmp = ((ERepositoryObjectType) contentType).getNamePattern();
|
||||
if (tmp != null) {
|
||||
namePattern = tmp;
|
||||
}
|
||||
}
|
||||
Pattern pattern = Pattern.compile(namePattern);
|
||||
return pattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
public static boolean isValid(String str) {
|
||||
Pattern pattern = Pattern.compile("^\\w+$");
|
||||
;
|
||||
@@ -257,14 +240,12 @@ public class DuplicateAction extends AContextualAction {
|
||||
*
|
||||
* DOC YeXiaowei Comment method "isValid".
|
||||
*
|
||||
* @param node
|
||||
*
|
||||
* @param itemName
|
||||
* @param selectionInClipboard
|
||||
* @return null means valid, other means some error exist
|
||||
*/
|
||||
private String validJobName(RepositoryNode node, String itemName, TreeSelection selectionInClipboard) {
|
||||
if (!isValid(node, itemName)) {
|
||||
private String validJobName(String itemName, TreeSelection selectionInClipboard) {
|
||||
if (!isValid(itemName)) {
|
||||
return Messages.getString("DuplicateAction.NameFormatError");
|
||||
}
|
||||
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
|
||||
@@ -477,8 +458,8 @@ public class DuplicateAction extends AContextualAction {
|
||||
}
|
||||
// MOD qiongli 2012-10-16 TDQ-6166 notify sqlExplore when duplicate a new
|
||||
// connection
|
||||
if (copy instanceof ConnectionItem) {
|
||||
Connection connection = ((ConnectionItem) copy).getConnection();
|
||||
if (copy instanceof DatabaseConnectionItem) {
|
||||
Connection connection = ((DatabaseConnectionItem) copy).getConnection();
|
||||
if (connection != null) {
|
||||
connection.getSupplierDependency().clear();
|
||||
connection.setLabel(newJobName);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class EmptyRecycleBinAction extends AContextualAction {
|
||||
// TDI-20542
|
||||
List<IRepositoryNode> originalChildren = node.getChildren();
|
||||
final List<IRepositoryNode> children = new ArrayList<IRepositoryNode>(originalChildren);
|
||||
// MOD qiongli 2012-11-23 TUP-273 if a connection in recycle bin which depended by DQ analysis,should give a
|
||||
// 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;
|
||||
@@ -340,10 +340,6 @@ public class EmptyRecycleBinAction extends AContextualAction {
|
||||
if (factory.isUserReadOnlyOnCurrentProject()) {
|
||||
canWork = false;
|
||||
}
|
||||
// TDI-23105:only for read-only(tag) project > also for offline, since TDI-23336
|
||||
if (factory.getRepositoryContext().isOffline() || factory.getRepositoryContext().isEditableAsReadOnly()) {
|
||||
canWork = false;
|
||||
}
|
||||
if (canWork) {
|
||||
Object o = selection.getFirstElement();
|
||||
RepositoryNode node = (RepositoryNode) o;
|
||||
|
||||
@@ -94,6 +94,7 @@ 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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user