Compare commits
455 Commits
EAP/CDP71_
...
patch/7.3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab37af74fe | ||
|
|
8e09cbd65a | ||
|
|
743d863776 | ||
|
|
9a87e0c49e | ||
|
|
78522294dc | ||
|
|
2854fa80b5 | ||
|
|
7389610259 | ||
|
|
ae319f0d85 | ||
|
|
98a80d18b6 | ||
|
|
f878723f81 | ||
|
|
1ac0beea10 | ||
|
|
cc0cab9532 | ||
|
|
0d7971730f | ||
|
|
75cc28c0be | ||
|
|
f8e3b6d5cb | ||
|
|
8a82cff8f3 | ||
|
|
ab9d3d1db2 | ||
|
|
05779d09a3 | ||
|
|
d40317d16a | ||
|
|
0c3625940c | ||
|
|
00c0652cbb | ||
|
|
823b72bcd9 | ||
|
|
f760212388 | ||
|
|
9da9e8199a | ||
|
|
baf574ea55 | ||
|
|
892065d2c4 | ||
|
|
724dc1b72d | ||
|
|
132d794131 | ||
|
|
2298c44339 | ||
|
|
03e462f8ff | ||
|
|
f7fb174301 | ||
|
|
54fc6ecd51 | ||
|
|
779e9a8086 | ||
|
|
f2d189c792 | ||
|
|
84edc461db | ||
|
|
b06ee57323 | ||
|
|
4590b8456d | ||
|
|
b2c74643a7 | ||
|
|
b35fb11251 | ||
|
|
576d3abf29 | ||
|
|
14ca2dfaa7 | ||
|
|
b607ed6fb3 | ||
|
|
acd02c4c18 | ||
|
|
615a4f209e | ||
|
|
172f3c3483 | ||
|
|
a4ce2f457e | ||
|
|
f2af89413f | ||
|
|
0c8c872bd6 | ||
|
|
38ed0b9f1f | ||
|
|
4df14e99d0 | ||
|
|
0c3e5175dd | ||
|
|
4ed8a4a803 | ||
|
|
365700699e | ||
|
|
dab6da165f | ||
|
|
b33018d422 | ||
|
|
81ec1966bd | ||
|
|
d3246a9713 | ||
|
|
b098e18278 | ||
|
|
f635d5a9f6 | ||
|
|
49b4be0929 | ||
|
|
39afb9e94a | ||
|
|
d119efe8d6 | ||
|
|
66cdd796fd | ||
|
|
af3def7767 | ||
|
|
e7db5386c9 | ||
|
|
0b8f214c38 | ||
|
|
3c9684f993 | ||
|
|
de29a9fee4 | ||
|
|
e346460a75 | ||
|
|
294bb6a9c9 | ||
|
|
cb76ce50a7 | ||
|
|
e8e197e81c | ||
|
|
a5d5c0ef55 | ||
|
|
82b425506a | ||
|
|
932e8d61e3 | ||
|
|
6baf2b82be | ||
|
|
1331c1d70b | ||
|
|
e719944af0 | ||
|
|
333f9ad538 | ||
|
|
eede5c3bc2 | ||
|
|
cafb7db6b8 | ||
|
|
b042f20e49 | ||
|
|
c0fde38133 | ||
|
|
5efc4dd8c4 | ||
|
|
f5833bb365 | ||
|
|
548f6a97fd | ||
|
|
864ba43149 | ||
|
|
d0d955546b | ||
|
|
51cb13c619 | ||
|
|
e9d7c4a43c | ||
|
|
67d44985fa | ||
|
|
41f5d459f6 | ||
|
|
b38b96fedc | ||
|
|
df53ee1a1f | ||
|
|
035bc4a39c | ||
|
|
1105d9c65c | ||
|
|
488e7aaedb | ||
|
|
681dd59eb2 | ||
|
|
7a3c23cdb5 | ||
|
|
a6f4581b0a | ||
|
|
40e63f3c01 | ||
|
|
d54cddaedf | ||
|
|
41e2ef2d2d | ||
|
|
bccc406937 | ||
|
|
a9b3d20e06 | ||
|
|
47b5a7e251 | ||
|
|
e9b5fa3ba7 | ||
|
|
39a730cae4 | ||
|
|
d88d513e4e | ||
|
|
75176b6f45 | ||
|
|
11ecc1cbfd | ||
|
|
53efef8de0 | ||
|
|
db2eb01c38 | ||
|
|
f9af16ba90 | ||
|
|
23f2926741 | ||
|
|
48653aa380 | ||
|
|
d80fefc234 | ||
|
|
a0b395cd3a | ||
|
|
98bcc66479 | ||
|
|
a716257dd0 | ||
|
|
b164f8c447 | ||
|
|
dd352b4a8f | ||
|
|
08ac05c23e | ||
|
|
90a37f8418 | ||
|
|
137c543bfd | ||
|
|
42e94c6508 | ||
|
|
ff9c4c021a | ||
|
|
291f56e505 | ||
|
|
c67b2f479e | ||
|
|
45d373f447 | ||
|
|
edff6eeeb8 | ||
|
|
acd1555a2b | ||
|
|
97a77ec401 | ||
|
|
a5f6364467 | ||
|
|
db39d84224 | ||
|
|
d153fe9fa0 | ||
|
|
939e974d1c | ||
|
|
722a0b1341 | ||
|
|
7b391d516f | ||
|
|
b5478c3f2f | ||
|
|
0726cb38fd | ||
|
|
687ab637be | ||
|
|
4cb1deb115 | ||
|
|
c594011902 | ||
|
|
c6d7da2121 | ||
|
|
90951dced8 | ||
|
|
c22eba9ead | ||
|
|
e466c31b88 | ||
|
|
6a601fadd2 | ||
|
|
28a216d0af | ||
|
|
5622490ca4 | ||
|
|
283fa4ac93 | ||
|
|
b55a302e9f | ||
|
|
887d1249dc | ||
|
|
caa73983c8 | ||
|
|
7a502a7dc1 | ||
|
|
c395d11c00 | ||
|
|
1fc99eaa02 | ||
|
|
77a076cea1 | ||
|
|
94914d676b | ||
|
|
1faf28843b | ||
|
|
f62e85356c | ||
|
|
81a6422c0b | ||
|
|
941c36921b | ||
|
|
e01cecfb68 | ||
|
|
9d3fb2213b | ||
|
|
aa4ccadbaf | ||
|
|
1c7f2a311c | ||
|
|
0b7cba2a9d | ||
|
|
f8dd9f0c1a | ||
|
|
9c12a2e19e | ||
|
|
a2132cb833 | ||
|
|
ed4655f2aa | ||
|
|
910e3fb601 | ||
|
|
bda6b0a1a7 | ||
|
|
4ad4d3e5b2 | ||
|
|
8031d9adb3 | ||
|
|
74232f3dc3 | ||
|
|
b2e5ab5630 | ||
|
|
f1b9ed2e86 | ||
|
|
de48a67805 | ||
|
|
55723c1a48 | ||
|
|
7bb5692418 | ||
|
|
4010656564 | ||
|
|
966becc5e5 | ||
|
|
8bd1fd724f | ||
|
|
92d31aa477 | ||
|
|
b4f77effd8 | ||
|
|
3086f9be45 | ||
|
|
8dc5f853fd | ||
|
|
dfae595cbe | ||
|
|
b3271f70e0 | ||
|
|
486650da91 | ||
|
|
2885482d6f | ||
|
|
e35338ca0a | ||
|
|
76452e3799 | ||
|
|
4b0c75070d | ||
|
|
1ac63975c1 | ||
|
|
dffa6d97c9 | ||
|
|
eee0169c90 | ||
|
|
124ec1357d | ||
|
|
3e2f12848c | ||
|
|
22e607210d | ||
|
|
5780ce2693 | ||
|
|
04c0e2f42c | ||
|
|
3b6ffd8f49 | ||
|
|
61d8e73084 | ||
|
|
fffdd9a78e | ||
|
|
9186869001 | ||
|
|
c3f8ae1d53 | ||
|
|
294e8a23f5 | ||
|
|
637a2423a0 | ||
|
|
6ad0a9ac92 | ||
|
|
161e5d97a7 | ||
|
|
e6a9513d45 | ||
|
|
74174c14c6 | ||
|
|
2ec51860a5 | ||
|
|
bc3e338910 | ||
|
|
a823899d39 | ||
|
|
436af2427e | ||
|
|
d7252412ed | ||
|
|
af38e2a0b6 | ||
|
|
c3d3fcf665 | ||
|
|
987c6667ac | ||
|
|
f0401b97d1 | ||
|
|
26992f7cf9 | ||
|
|
169ab1c4cc | ||
|
|
f04049abc0 | ||
|
|
7e6f2dee19 | ||
|
|
2dd7ce6fac | ||
|
|
be373dd141 | ||
|
|
43876863e6 | ||
|
|
4ac2a830a9 | ||
|
|
3d6d3e77e3 | ||
|
|
71b4ccc531 | ||
|
|
48289a3c72 | ||
|
|
9a219873f1 | ||
|
|
d013d08bdc | ||
|
|
761dcc7902 | ||
|
|
0a85c8056c | ||
|
|
3df4cf1348 | ||
|
|
c7965cf552 | ||
|
|
61b55c0d2a | ||
|
|
be41bcbef3 | ||
|
|
2827919dae | ||
|
|
33848db788 | ||
|
|
ac359e295a | ||
|
|
6965eb79fa | ||
|
|
80f02ef1e7 | ||
|
|
7c50efdf21 | ||
|
|
7f40393753 | ||
|
|
356dba9940 | ||
|
|
83f7a577d9 | ||
|
|
e87f557a49 | ||
|
|
a51b3316d3 | ||
|
|
46a22c4ad0 | ||
|
|
f8cc600d06 | ||
|
|
3146ed307f | ||
|
|
f4f91a5323 | ||
|
|
2aee38595f | ||
|
|
dde32c8b49 | ||
|
|
563b69231f | ||
|
|
1ea6227f59 | ||
|
|
148e9e9253 | ||
|
|
1e6a43650f | ||
|
|
67616537b2 | ||
|
|
1df4e819e0 | ||
|
|
b3d6c45f2d | ||
|
|
f1341cd69f | ||
|
|
a64bcecb0c | ||
|
|
5707d4db94 | ||
|
|
5e20a78752 | ||
|
|
85e44cd5c6 | ||
|
|
8582c20f1a | ||
|
|
6216fd76ea | ||
|
|
71d339fc0a | ||
|
|
d286276e6d | ||
|
|
3996d24893 | ||
|
|
f37b5b6073 | ||
|
|
060a9c7f9e | ||
|
|
789b4c02c0 | ||
|
|
4c3e3dfb2c | ||
|
|
7b3a20a3b3 | ||
|
|
e3880f3904 | ||
|
|
d54ed2a62c | ||
|
|
cde1129ce4 | ||
|
|
1081ae3680 | ||
|
|
3e02adb157 | ||
|
|
c212142789 | ||
|
|
ab67a4cc91 | ||
|
|
675da3fc7d | ||
|
|
6f9ad53b0d | ||
|
|
6cfffe1775 | ||
|
|
3c2d416677 | ||
|
|
f7f5627679 | ||
|
|
939c328d1b | ||
|
|
cb31b968bf | ||
|
|
c0636a6822 | ||
|
|
1e31b9ed97 | ||
|
|
d07e5beaf9 | ||
|
|
281c39428c | ||
|
|
3eaef89b5d | ||
|
|
de34e9bcaa | ||
|
|
5d1956966c | ||
|
|
1b1966058f | ||
|
|
ca65a35c8e | ||
|
|
c0a2a27815 | ||
|
|
832b460e4b | ||
|
|
3e8c7bb5d6 | ||
|
|
2f5f944d0b | ||
|
|
cf52e1e004 | ||
|
|
a05b2538a1 | ||
|
|
b456595669 | ||
|
|
bf2699c7c9 | ||
|
|
35047b473d | ||
|
|
50233f93f3 | ||
|
|
bf3bbf6430 | ||
|
|
735bbef8f3 | ||
|
|
28782a40d4 | ||
|
|
da57b8a80a | ||
|
|
9d0049bede | ||
|
|
1bd0f7939c | ||
|
|
b8e4c3bc7a | ||
|
|
931178184c | ||
|
|
3f8fc4ef4f | ||
|
|
ad3490606d | ||
|
|
085406b8da | ||
|
|
e9ef85f8e5 | ||
|
|
7543617b31 | ||
|
|
e21bb53627 | ||
|
|
a8f36c79f5 | ||
|
|
58171338ac | ||
|
|
cebd4646d9 | ||
|
|
9f2997692a | ||
|
|
1387f66674 | ||
|
|
7ee7eddb9d | ||
|
|
e674ec78f7 | ||
|
|
08c2082e8a | ||
|
|
8740f3b1da | ||
|
|
e08c225198 | ||
|
|
fef6605f83 | ||
|
|
af83d9d393 | ||
|
|
45a92717f9 | ||
|
|
7191b77c5c | ||
|
|
18c2e53223 | ||
|
|
16fbcf34f3 | ||
|
|
495ebda155 | ||
|
|
8f36da5ee1 | ||
|
|
0828f2951a | ||
|
|
5da999c4bd | ||
|
|
39eee08210 | ||
|
|
1ab6486d9a | ||
|
|
aa7da99e0d | ||
|
|
a73f8621ed | ||
|
|
09cfc769da | ||
|
|
2a1d017208 | ||
|
|
1189973653 | ||
|
|
c80a96768e | ||
|
|
0e3957c3d7 | ||
|
|
e7399f9df5 | ||
|
|
7f67aeaf0e | ||
|
|
d12826089a | ||
|
|
2bb3e43bc6 | ||
|
|
55ff7cc279 | ||
|
|
56811e6ce4 | ||
|
|
e3701ceb7c | ||
|
|
bcebeb1e99 | ||
|
|
6e12e77255 | ||
|
|
a2a09fa98c | ||
|
|
a88b035f03 | ||
|
|
6173437d9b | ||
|
|
69c2ecd88f | ||
|
|
78e7aae03e | ||
|
|
62ba9f8604 | ||
|
|
4f5c792187 | ||
|
|
77ee82d889 | ||
|
|
8f81ff4534 | ||
|
|
0a8f2e769e | ||
|
|
28f8e109a6 | ||
|
|
5d21d9d3ea | ||
|
|
7d223ecff8 | ||
|
|
1ff9877dce | ||
|
|
75d51647fc | ||
|
|
4f55385a9a | ||
|
|
c942bade7a | ||
|
|
551eb69025 | ||
|
|
c0b192f427 | ||
|
|
ccd1d6d1d5 | ||
|
|
0d2e0c8149 | ||
|
|
67a9b521c9 | ||
|
|
4a8869304b | ||
|
|
6118d69c3e | ||
|
|
2fecdf1ceb | ||
|
|
60869a1240 | ||
|
|
332f6ff85b | ||
|
|
45caecd7f2 | ||
|
|
6e9daf05fb | ||
|
|
3cfb30a9a0 | ||
|
|
ea6595bab8 | ||
|
|
2454e6ba1c | ||
|
|
c9600e040e | ||
|
|
6254945a6e | ||
|
|
b54984ad2d | ||
|
|
59bb804cea | ||
|
|
ba9a85f59f | ||
|
|
d7d0dcefb7 | ||
|
|
65a71ba142 | ||
|
|
3f74eaa4d9 | ||
|
|
dffac5bcb4 | ||
|
|
d13cdc6349 | ||
|
|
1609837f67 | ||
|
|
eafc630094 | ||
|
|
ee68fe3be6 | ||
|
|
cfeb6118db | ||
|
|
5c140eb8a2 | ||
|
|
2f527b6195 | ||
|
|
30119635cb | ||
|
|
d50c690f42 | ||
|
|
10764112d7 | ||
|
|
84b1dd3a01 | ||
|
|
d8084ea4f0 | ||
|
|
8f2c264cc3 | ||
|
|
8a24ecd296 | ||
|
|
14c79d9602 | ||
|
|
f682de08d2 | ||
|
|
cec1999354 | ||
|
|
29b4de8ad7 | ||
|
|
cc44671136 | ||
|
|
2d4ce482ae | ||
|
|
257d1aa94b | ||
|
|
c5d28b4480 | ||
|
|
1d0650170f | ||
|
|
28a9bf7542 | ||
|
|
9a649d1c05 | ||
|
|
8889b7f0e9 | ||
|
|
43e6cc4b99 | ||
|
|
2735bef5ed | ||
|
|
dfe11f5469 | ||
|
|
cf96982dcf | ||
|
|
d7b24ab048 | ||
|
|
ce527ba33e | ||
|
|
9b3037d3a8 | ||
|
|
49ae1fe789 | ||
|
|
e27dcbcef6 | ||
|
|
dd61f6d257 | ||
|
|
6c690a9314 | ||
|
|
a24e1fb363 | ||
|
|
0878fc8bac | ||
|
|
4375dcbc66 | ||
|
|
a1ee13acc5 | ||
|
|
8b19375bc0 | ||
|
|
7b8cd7b14f | ||
|
|
8f8e0261d5 | ||
|
|
68db523503 | ||
|
|
2901e5e77e |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.common.ui.runtime.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.runtime.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.repository.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.runtime.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip.edit.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.help.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.helpers.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.librariesmanager.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.librariesmanager.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.metadata.managment.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.metadata.managment.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.migrationTool.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.edit.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.migration.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.presentation.onboarding.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.rcp.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.registration.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.items.importexport.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.items.importexport.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.localprovider.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.mdm.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.metadata.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.view.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.resources.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.fragment.jars.common.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.help.di.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.help.feature</artifactId>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<import plugin="org.eclipse.jdt.launching" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.hamcrest.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
<plugin id="org.eclipse.jdt.launching.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.eclipse.jdt.launching.ui.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.jdt.feature</artifactId>
|
||||
|
||||
@@ -6,14 +6,12 @@
|
||||
<license url="http://www.example.com/license">[Enter License Description here.]</license>
|
||||
<plugin id="org.talend.libraries.jdbc.access" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.as400" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.derby" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.exasol" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.h2" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.hsql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.ingres" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.mysql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.paraccel" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.postgresql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.sqlite3" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.teradata" download-size="0" install-size="0" version="0.0.0"/>
|
||||
</feature>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.jdbc.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.m2e.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.migration.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.rcp.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.update.p2.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.updates.feature</artifactId>
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<import plugin="com.thoughtworks.paranamer" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-mapper-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.codec" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.codec" version="1.14.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.compress" version="1.10.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.lang" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.lang3" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.log4j" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.servicemix.bundles.avro" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
|
||||
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.configuration" version="2.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.utils.feature</artifactId>
|
||||
|
||||
BIN
main/plugins/org.talend.common.ui.runtime/icons/lowercase.jpg
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/lowercase.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
main/plugins/org.talend.common.ui.runtime/icons/uppercase.jpg
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/uppercase.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
main/plugins/org.talend.common.ui.runtime/icons1/routinesjar.png
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons1/routinesjar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 768 B |
BIN
main/plugins/org.talend.common.ui.runtime/icons1/share.png
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons1/share.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.common.ui.runtime</artifactId>
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
@@ -38,6 +39,8 @@ public class ExceptionMessageDialog extends MessageDialog {
|
||||
|
||||
private String exceptionString = null;
|
||||
|
||||
private int[] diabledButtonIndex = new int[] {};
|
||||
|
||||
public ExceptionMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
|
||||
int dialogImageType, String[] dialogButtonLabels, int defaultIndex, Throwable ex) {
|
||||
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
|
||||
@@ -147,4 +150,21 @@ public class ExceptionMessageDialog extends MessageDialog {
|
||||
this.exceptionString = exceptionString;
|
||||
}
|
||||
|
||||
public void setDisabledButtons(int[] index) {
|
||||
this.diabledButtonIndex = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
super.createButtonsForButtonBar(parent);
|
||||
if (diabledButtonIndex == null) {
|
||||
return;
|
||||
}
|
||||
for (int index : diabledButtonIndex) {
|
||||
Button button = super.getButton(index);
|
||||
button.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -132,3 +132,8 @@ GlobalServiceRegister.ServiceNotRegistered=The service {0} has not been register
|
||||
MessageBoxExceptionHandler.showMessageForSchemaImportXml.unParseXML.title=The xml can't parse.
|
||||
MessageBoxExceptionHandler.showMessageForSchemaImportXml.unParseXML.msg=The xml can't parse in this format.
|
||||
HibernateUtils.auditDBIsNotUsable=The audit database must be empty or only contains tables related to audit.
|
||||
CasePushButton.CaseButton.Tip=Uppercase/Lowercase Db column
|
||||
QuotePushButton.QuoteButton.Tip=Add/Remove Quote on Db column
|
||||
QuoteManipulateDialog.title=Add/Remove quote on Db column
|
||||
QuoteManipulateDialog.addQuote=Add quote
|
||||
QuoteManipulateDialog.removeQuote=Remove quote
|
||||
|
||||
@@ -77,6 +77,7 @@ public enum ECoreImage implements IImage {
|
||||
ROUTES_ICON("/icons1/routes_icon.png"), //$NON-NLS-1$
|
||||
ROUTINE_ICON("/icons1/routine.png"), //$NON-NLS-1$
|
||||
ROUTINE_EDITOR_ICON("/icons1/routine_editor.png"), //$NON-NLS-1$
|
||||
ROUTINESJAR_ICON("/icons1/routinesjar.png"), //$NON-NLS-1$
|
||||
JOB_SCRIPTS_ICON("/icons1/job_scripts.png"), //$NON-NLS-1$
|
||||
JOB_SCRIPTS_TOOLBAR_ICON("/icons1/job_script_toolbar.png"), //$NON-NLS-1$
|
||||
FTP_ICON("/icons1/ftp.png"), //$NON-NLS-1$
|
||||
@@ -166,6 +167,7 @@ public enum ECoreImage implements IImage {
|
||||
RECYCLE_BIN_OVERLAY("/icons1/recycle_bin_overlay.gif"), //$NON-NLS-1$
|
||||
DELETED_OVERLAY("/icons1/deleted_overlay.gif"), //$NON-NLS-1$
|
||||
IMPORT_JAR("/icons1/importjar.gif"), //$NON-NLS-1$
|
||||
SHARE_LIBS("/icons1/share.png"), //$NON-NLS-1$
|
||||
REFERENCED_ICON("/icons1/referenced.png"), //$NON-NLS-1$
|
||||
|
||||
CDC_ADDED_OVERLAY("/icons1/cdc_added_overlay.png"), //$NON-NLS-1$
|
||||
|
||||
@@ -88,6 +88,8 @@ public enum EImage implements IImage {
|
||||
LEFTX_ICON("/icons/leftx.png"), //$NON-NLS-1$
|
||||
RIGHT_ICON("/icons/right.gif"), //$NON-NLS-1$
|
||||
RIGHTX_ICON("/icons/rightx.png"), //$NON-NLS-1$
|
||||
LOWERCASE_ICON("/icons/lowercase.jpg"), //$NON-NLS-1$
|
||||
UPPERCASE_ICON("/icons/uppercase.jpg"), //$NON-NLS-1$
|
||||
|
||||
KEY_ICON("/icons/key.gif"), //$NON-NLS-1$
|
||||
HIERARCHY_ICON("/icons/hierarchicalLayout.gif"), //$NON-NLS-1$
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.eclipse.core.internal.runtime.InternalPlatform;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC root class global comment. Detailled comment <br/>
|
||||
@@ -52,5 +54,9 @@ public class WindowSystem {
|
||||
public static boolean isOSX() {
|
||||
return Platform.WS_CARBON.equals(ws) || Platform.WS_COCOA.equals(ws);
|
||||
}
|
||||
|
||||
public static boolean isBigSurOrLater () {
|
||||
return isOSX() && ("10.16".compareTo(System.getProperty("os.version","0")) <= 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,11 @@ Require-Bundle: org.apache.log4j;visibility:=reexport,
|
||||
org.talend.libraries.apache,
|
||||
com.ibm.icu,
|
||||
org.apache.commons.io,
|
||||
org.talend.utils
|
||||
org.talend.utils,
|
||||
org.eclipse.core.net,
|
||||
org.eclipse.m2e.core,
|
||||
org.eclipse.m2e.maven.runtime,
|
||||
org.eclipse.core.resources
|
||||
Export-Package: org.talend.commons,
|
||||
org.talend.commons.exception,
|
||||
org.talend.commons.i18n,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.runtime</artifactId>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend</groupId>
|
||||
<artifactId>org.talend.tos</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.2-SNAPSHOT</version>
|
||||
<relativePath>../pom_server.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.11.0</version>
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.eclipse.core.net.proxy.IProxyService;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
@@ -24,6 +25,7 @@ import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
import org.talend.commons.exception.ExceptionService;
|
||||
import org.talend.commons.runtime.debug.TalendDebugHandler;
|
||||
import org.talend.commons.utils.system.EclipseCommandLine;
|
||||
@@ -55,6 +57,8 @@ public class CommonsPlugin implements BundleActivator {
|
||||
// TESB-17856: For commandline builds ESB Micorservice bundle
|
||||
private static boolean isESBMicorservice = false;
|
||||
|
||||
private static ServiceTracker proxyTracker;
|
||||
|
||||
public static boolean isWorkbenchCreated() {
|
||||
return isWorkbenchCreated;
|
||||
}
|
||||
@@ -107,7 +111,8 @@ public class CommonsPlugin implements BundleActivator {
|
||||
}
|
||||
|
||||
public static boolean isDebugMode() {
|
||||
return ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
return Boolean.getBoolean("talendDebug") //$NON-NLS-1$
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
}
|
||||
|
||||
public static boolean isJUnitTest() {
|
||||
@@ -179,4 +184,13 @@ public class CommonsPlugin implements BundleActivator {
|
||||
return FileLocator.toFileURL(entry);
|
||||
}
|
||||
|
||||
public static IProxyService getProxyService() {
|
||||
if (proxyTracker == null) {
|
||||
proxyTracker = new ServiceTracker(Platform.getBundle(PLUGIN_ID).getBundleContext(), IProxyService.class.getName(),
|
||||
null);
|
||||
proxyTracker.open();
|
||||
}
|
||||
return (IProxyService) proxyTracker.getService();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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.exception;
|
||||
|
||||
public class ClientException extends PersistenceException {
|
||||
|
||||
private Integer httpCode;
|
||||
|
||||
public ClientException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ClientException(Integer httpCode, String message) {
|
||||
super(message);
|
||||
this.httpCode = httpCode;
|
||||
}
|
||||
|
||||
public ClientException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public ClientException(Integer httpCode, String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.httpCode = httpCode;
|
||||
}
|
||||
|
||||
public ClientException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public ClientException(Integer httpCode, Throwable cause) {
|
||||
super(cause);
|
||||
this.httpCode = httpCode;
|
||||
}
|
||||
|
||||
public Integer getHttpCode() {
|
||||
return httpCode;
|
||||
}
|
||||
|
||||
public void setHttpCode(Integer httpCode) {
|
||||
this.httpCode = httpCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getLocalizedMessage();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.talend.commons.runtime.service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.osgi.framework.InvalidSyntaxException;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
|
||||
public interface ICollectDataService {
|
||||
|
||||
final String KEY_SOURCE = "source";
|
||||
|
||||
//
|
||||
final String AMC_FILE_TYPE_USED = "FILE_TYPE_USED";
|
||||
|
||||
final String AMC_DATABASE_TYPE_USED = "DATABASE_TYPE_USED";
|
||||
|
||||
final String AMC_PREVIEW_KEY = "amc.datasource";
|
||||
|
||||
final String AMC_PREVIEW_FILEVALUE = "File";
|
||||
|
||||
final String AMC_PREVIEW_DATABASEVALUE = "Database";
|
||||
|
||||
/**
|
||||
* @return json string
|
||||
*/
|
||||
String getCollectedDataJSON();
|
||||
|
||||
Properties getCollectedData();
|
||||
|
||||
public static ICollectDataService getInstance(String from) throws Exception {
|
||||
BundleContext bc = FrameworkUtil.getBundle(ICollectDataService.class).getBundleContext();
|
||||
Collection<ServiceReference<ICollectDataService>> tacokitServices = Collections.emptyList();
|
||||
try {
|
||||
tacokitServices = bc.getServiceReferences(ICollectDataService.class, null);
|
||||
} catch (InvalidSyntaxException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
if (tacokitServices != null) {
|
||||
for (ServiceReference<ICollectDataService> sr : tacokitServices) {
|
||||
if (from == null || from.equals(sr.getProperty(KEY_SOURCE))) {
|
||||
ICollectDataService tacokitService = bc.getService(sr);
|
||||
if (tacokitService != null) {
|
||||
return tacokitService;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,8 @@ public interface ITaCoKitService {
|
||||
|
||||
boolean isNeedMigration(String componentName, Map<String, String> properties);
|
||||
|
||||
boolean isTaCoKitType(Object repoType);
|
||||
|
||||
public static ITaCoKitService getInstance() throws Exception {
|
||||
BundleContext bc = FrameworkUtil.getBundle(ITaCoKitService.class).getBundleContext();
|
||||
Collection<ServiceReference<ITaCoKitService>> tacokitServices = Collections.emptyList();
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.runtime.service;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
*/
|
||||
@@ -19,6 +21,10 @@ public interface P2InstallComponent {
|
||||
|
||||
boolean install();
|
||||
|
||||
default boolean install(IProgressMonitor monitor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean needRelaunch();
|
||||
|
||||
String getInstalledMessages();
|
||||
|
||||
@@ -56,6 +56,19 @@ public class Hex {
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
public static boolean isNeedConvertToHex(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
int ch = value.charAt(i);
|
||||
if (ch < 32) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int toDigit(char ch, int index) {
|
||||
int digit = Character.digit(ch, 16);
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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 java.io.File;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
|
||||
public enum MojoType {
|
||||
|
||||
CI_BUILDER("org.talend.ci", "builder-maven-plugin", "ci.builder.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
CLOUD_PUBLISHER("org.talend.ci", "cloudpublisher-maven-plugin", "cloud.publisher.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SIGNER("org.talend.ci", "signer-maven-plugin", "signer.version"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
OSGI_HELPER("org.talend.ci", "osgihelper-maven-plugin", "osgihelper.version"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
private String groupId;
|
||||
|
||||
private String artifactId;
|
||||
|
||||
private String versionKey;
|
||||
|
||||
private MojoType(String groupId, String artifactId, String versionKey) {
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
this.versionKey = versionKey;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public String getArtifactId() {
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
public String getVersionKey() {
|
||||
return versionKey;
|
||||
}
|
||||
|
||||
public String getMojoArtifactIdFolder() {
|
||||
Path basePath = new File(MavenPlugin.getMaven().getLocalRepositoryPath()).toPath();
|
||||
return basePath.resolve(getGroupId().replaceAll("\\.", "/")).resolve(getArtifactId()).toString(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public String getMojoGAV() {
|
||||
return getGroupId() + ":" + getArtifactId() + ":" + getVersionKey(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,15 +15,17 @@ package org.talend.commons.utils;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
@@ -230,10 +232,50 @@ public class VersionUtils {
|
||||
* Check if studio version < other studio version record in remote project.
|
||||
*/
|
||||
public static boolean isInvalidProductVersion(String remoteFullProductVersion) {
|
||||
String localProductVersion = getInternalVersion();
|
||||
return isInvalidProductVersion(localProductVersion, remoteFullProductVersion);
|
||||
}
|
||||
|
||||
protected static boolean isInvalidProductVersion(String localProductVersion, String remoteFullProductVersion) {
|
||||
if (remoteFullProductVersion == null) {
|
||||
return false;
|
||||
}
|
||||
return getInternalVersion().compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) < 0;
|
||||
if (skipCheckingNightlyBuilds(localProductVersion, remoteFullProductVersion)) {
|
||||
return false;
|
||||
}
|
||||
return localProductVersion.compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) < 0;
|
||||
}
|
||||
|
||||
public static boolean productVersionIsNewer(String remoteFullProductVersion) {
|
||||
String localProductVersion = getInternalVersion();
|
||||
return productVersionIsNewer(localProductVersion, remoteFullProductVersion);
|
||||
}
|
||||
|
||||
protected static boolean productVersionIsNewer(String localProductVersion, String remoteFullProductVersion) {
|
||||
if (remoteFullProductVersion == null) {
|
||||
return false;
|
||||
}
|
||||
if (skipCheckingNightlyBuilds(localProductVersion, remoteFullProductVersion)) {
|
||||
return false;
|
||||
}
|
||||
return localProductVersion.compareTo(getProductVersionWithoutBranding(remoteFullProductVersion)) > 0;
|
||||
}
|
||||
|
||||
private static boolean skipCheckingNightlyBuilds(String localProductVersion, String remoteFullProductVersion) {
|
||||
String separator = "-"; //$NON-NLS-1$
|
||||
String localSuffix = StringUtils.substringAfterLast(localProductVersion, separator);
|
||||
|
||||
String remoteProductVersion = getProductVersionWithoutBranding(remoteFullProductVersion);
|
||||
String remoteSuffix = StringUtils.substringAfterLast(remoteProductVersion, separator);
|
||||
|
||||
String nightly = "SNAPSHOT"; //$NON-NLS-1$
|
||||
String milestone = "M"; //$NON-NLS-1$
|
||||
if ((localSuffix.equals(nightly) || localSuffix.startsWith(milestone))
|
||||
&& (remoteSuffix.equals(nightly) || remoteSuffix.startsWith(milestone))) {
|
||||
// skip checking between nightly/milestone build.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getTalendVersion(String productVersion) {
|
||||
@@ -262,24 +304,28 @@ public class VersionUtils {
|
||||
return version;
|
||||
}
|
||||
|
||||
public static String getMojoVersion(String mojoKey) {
|
||||
String version = null;
|
||||
public static String getMojoVersion(MojoType mojoType) {
|
||||
String mojoKey = mojoType.getVersionKey();
|
||||
String version = System.getProperty(mojoKey);
|
||||
if (StringUtils.isNotBlank(version)) {
|
||||
return version;
|
||||
}
|
||||
String talendVersion = getTalendVersion();
|
||||
Properties properties = new Properties();
|
||||
File file = new Path(Platform.getConfigurationLocation().getURL().getPath()).append("mojo_version.properties").toFile(); //$NON-NLS-1$
|
||||
if (file.exists()) {
|
||||
try (InputStream inStream = new FileInputStream(file)) {
|
||||
properties.load(inStream);
|
||||
version = properties.getProperty(mojoKey);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
if (version != null && !version.startsWith(talendVersion)) {
|
||||
ExceptionHandler
|
||||
.process(new Exception(
|
||||
"Incompatible Mojo version:" + mojoKey + "[" + version + "], use default version.")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
version = null;
|
||||
String majorVersion = StringUtils.substringBeforeLast(talendVersion, "."); //$NON-NLS-1$
|
||||
String artifactIdFolder = mojoType.getMojoArtifactIdFolder();
|
||||
Optional<File> optional = Stream.of(new File(artifactIdFolder).listFiles())
|
||||
.filter(f -> f.isDirectory() && f.getName().startsWith(majorVersion))
|
||||
.sorted((f1, f2) -> new DefaultArtifactVersion(f2.getName()).compareTo(new DefaultArtifactVersion(f1.getName())))
|
||||
.findFirst();
|
||||
if (optional.isPresent()) {
|
||||
File latestArtifact = optional.get();
|
||||
String fileName = mojoType.getArtifactId() + "-" + latestArtifact.getName(); //$NON-NLS-1$
|
||||
if (Stream.of(latestArtifact.listFiles())
|
||||
.filter(f -> f.getName().equals(fileName + ".jar") || f.getName().equals(fileName + ".pom")) //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.count() != 2) {
|
||||
ExceptionHandler.process(new Exception("Can't find plugin artifact " + mojoType.getMojoGAV())); //$NON-NLS-1$
|
||||
}
|
||||
version = latestArtifact.getName();
|
||||
}
|
||||
// default version
|
||||
if (StringUtils.isBlank(version)) {
|
||||
@@ -293,6 +339,7 @@ public class VersionUtils {
|
||||
version += "-" + revision; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
System.setProperty(mojoKey, version);
|
||||
return version;
|
||||
}
|
||||
|
||||
@@ -302,4 +349,25 @@ public class VersionUtils {
|
||||
talendVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSimplifiedPatchName(String projectPatchName) {
|
||||
|
||||
if (projectPatchName != null) {
|
||||
String result = null;
|
||||
if (projectPatchName.contains("_") && projectPatchName.split("_").length >= 3) {
|
||||
result = projectPatchName.split("_")[2];
|
||||
if (!result.startsWith("R")) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (projectPatchName.contains("-")) {
|
||||
String[] split = projectPatchName.split("-");
|
||||
if (split != null && split.length > 0) {
|
||||
return result + "-" + split[split.length - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public interface IExtendedList<T> extends List<T> {
|
||||
public void swapElements(List<Integer> indicesOrigin, List<Integer> indicesTarget);
|
||||
|
||||
public void swapElement(T object1, T object2);
|
||||
|
||||
public void replaceElement(int index, T object2);
|
||||
|
||||
/**
|
||||
* Getter for useEquals.
|
||||
|
||||
@@ -537,6 +537,11 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
fireReplacedEvent(index, replacedObject, element, false);
|
||||
return replacedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceElement(int index, T element) {
|
||||
this.list.set(index, element);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -109,11 +108,11 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
// MOD yyin 2012-05-15 TDQ-5190
|
||||
String sql = "SELECT DISTINCT CREATOR FROM SYSIBM.SYSTABLES"; //$NON-NLS-1$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String creator = rs.getString("CREATOR"); //$NON-NLS-1$
|
||||
@@ -331,18 +330,20 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
|
||||
throws SQLException {
|
||||
// for real
|
||||
String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where TBNAME='" + tableNamePattern + "' AND TBCREATOR = '" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ schemaPattern + "' ORDER BY TBCREATOR, TBNAME, COLNO"; //$NON-NLS-1$
|
||||
String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where TBNAME=? AND TBCREATOR = ? ORDER BY TBCREATOR, TBNAME, COLNO"; //$NON-NLS-1$
|
||||
|
||||
// for test
|
||||
// String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where NAME='NAME'";
|
||||
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, tableNamePattern);
|
||||
stmt.setString(2, schemaPattern);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
|
||||
// For real db2 for zos, should use these code.
|
||||
|
||||
@@ -25,7 +25,6 @@ public class JtdsDatabaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
|
||||
@Override
|
||||
public ResultSet getSchemas() throws SQLException {
|
||||
java.sql.Statement statement = connection.createStatement();
|
||||
String sql;
|
||||
if (((PackageFakeDatabaseMetadata) connection).getDatabaseMajorVersion() >= 9) {
|
||||
sql = JDBC3 ? "SELECT name AS TABLE_SCHEM, NULL as TABLE_CATALOG FROM " + connection.getCatalog() + ".sys.schemas"
|
||||
@@ -36,6 +35,7 @@ public class JtdsDatabaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
}
|
||||
|
||||
sql += " ORDER BY TABLE_SCHEM";
|
||||
return statement.executeQuery(sql);
|
||||
java.sql.PreparedStatement statement = connection.prepareStatement(sql);
|
||||
return statement.executeQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -148,19 +148,23 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
}
|
||||
|
||||
// For Calculation View
|
||||
if (ArrayUtils.contains(neededTypes, NEEDED_TYPES[3])) {
|
||||
if (ArrayUtils.contains(neededTypes, NEEDED_TYPES[3]) && "_SYS_BIC".equalsIgnoreCase(schemaPattern)) { //$NON-NLS-1$
|
||||
// check if the type is contained is in the types needed.
|
||||
String sqlcv = "SELECT OBJECT_NAME,PACKAGE_ID FROM _SYS_REPO.ACTIVE_OBJECT WHERE OBJECT_SUFFIX = 'calculationview'"; //$NON-NLS-1$
|
||||
if (tableNamePattern != null && !tableNamePattern.equals("%")) { //$NON-NLS-1$
|
||||
sqlcv += " AND (OBJECT_NAME LIKE '" + tableNamePattern + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE '" + tableNamePattern + "')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " AND (OBJECT_NAME LIKE ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE ? )"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
ResultSet rscv = null;
|
||||
Statement stmtcv = null;
|
||||
PreparedStatement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
try {
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
stmtcv = connection.prepareStatement(sqlcv);
|
||||
if (tableNamePattern != null && !tableNamePattern.equals("%")) {
|
||||
stmtcv.setString(1, tableNamePattern);
|
||||
stmtcv.setString(2, tableNamePattern);
|
||||
}
|
||||
rscv = stmtcv.executeQuery();
|
||||
while (rscv.next()) {
|
||||
String objectName = rscv.getString("OBJECT_NAME"); //$NON-NLS-1$
|
||||
if (objectName != null) {
|
||||
@@ -171,7 +175,7 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
packageId = packageId.trim();
|
||||
}
|
||||
String name = packageId + "/" + objectName; //$NON-NLS-1$
|
||||
String[] r = new String[] { "", "_SYS_BIC", name, NEEDED_TYPES[3], "", packageId }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
String[] r = new String[] { "", schemaPattern, name, NEEDED_TYPES[3], "", packageId }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
listcv.add(r);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
@@ -303,11 +307,11 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
if (!load) {
|
||||
String sqlcv = "SELECT * from \"" + schemaPattern + "\".\"" + tableNamePattern + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
ResultSet rscv = null;
|
||||
Statement stmtcv = null;
|
||||
PreparedStatement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
try {
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
stmtcv = connection.prepareStatement(sqlcv);
|
||||
rscv = stmtcv.executeQuery();
|
||||
int i = 1;
|
||||
while (rscv.next()) {
|
||||
String tableName = tableNamePattern;
|
||||
@@ -355,4 +359,16 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
tableResultSet.setData(list);
|
||||
return tableResultSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDatabaseProductName() throws SQLException {
|
||||
return this.connection.getMetaData().getDatabaseProductName();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDatabaseProductVersion() throws SQLException {
|
||||
return this.connection.getMetaData().getDatabaseProductVersion();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -62,11 +62,11 @@ public class SASDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
// see the feature 5827
|
||||
String sql = "SELECT DISTINCT LIBNAME FROM SASHELP.VTABLE"; //$NON-NLS-1$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String creator = rs.getString("LIBNAME"); //$NON-NLS-1$
|
||||
@@ -147,17 +147,21 @@ public class SASDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
public ResultSet getTables(String catalog, String schema, String tableNamePattern, String[] types) throws SQLException {
|
||||
String sql;
|
||||
if (schema != null) {
|
||||
sql = "SELECT * FROM SASHELP.VTABLE where LIBNAME = '" + schema + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sql = "SELECT * FROM SASHELP.VTABLE where LIBNAME = ?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
} else {
|
||||
sql = "SELECT * FROM SASHELP.VTABLE"; //$NON-NLS-1$
|
||||
}
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
if (schema != null) {
|
||||
stmt.setString(1, schema);
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("MEMNAME"); //$NON-NLS-1$
|
||||
@@ -229,18 +233,20 @@ public class SASDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
|
||||
throws SQLException {
|
||||
// for real
|
||||
String sql = "SELECT * FROM SASHELP.VCOLUMN where MEMNAME='" + tableNamePattern + "' AND LIBNAME = '" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ schemaPattern + "' ORDER BY LIBNAME, MEMNAME, VARNUM"; //$NON-NLS-1$
|
||||
String sql = "SELECT * FROM SASHELP.VCOLUMN where MEMNAME=? AND LIBNAME = ? ORDER BY LIBNAME, MEMNAME, VARNUM"; //$NON-NLS-1$
|
||||
|
||||
// for test
|
||||
// String sql = "SELECT * FROM SYSIBM.SYSCOLUMNS where NAME='NAME'";
|
||||
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, tableNamePattern);
|
||||
stmt.setString(2, schemaPattern);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
String tableName = rs.getString("MEMNAME"); //$NON-NLS-1$
|
||||
if (tableName != null) {
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* created by qiongli on 2013-11-13 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class Sybase16SADatabaseMetaData extends SybaseDatabaseMetaData {
|
||||
|
||||
private static Logger log = Logger.getLogger(Sybase16SADatabaseMetaData.class);
|
||||
|
||||
/**
|
||||
* DOC qiongli SybaseIQDatabaseMetaData constructor comment.
|
||||
*
|
||||
* @param connection
|
||||
* @throws SQLException
|
||||
*/
|
||||
public Sybase16SADatabaseMetaData(Connection connection) throws SQLException {
|
||||
super(connection);
|
||||
}
|
||||
|
||||
public ResultSet getCatalogs(String login, String database) throws SQLException {
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
|
||||
List<String> catList = new ArrayList<String>();
|
||||
if (!StringUtils.isEmpty(database)) {
|
||||
catList.add(database);
|
||||
}
|
||||
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, login);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
if (temp > 0) {
|
||||
String[] r = new String[] { catalogName };
|
||||
list.add(r);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error(e);
|
||||
} finally {
|
||||
try {
|
||||
if (rs != null) {
|
||||
rs.close();
|
||||
}
|
||||
if (stmt != null) {
|
||||
stmt.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SybaseResultSet tableResultSet = new SybaseResultSet();
|
||||
tableResultSet.setMetadata(new String[] { "TABLE_CAT" }); //$NON-NLS-1$
|
||||
tableResultSet.setData(list);
|
||||
return tableResultSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
|
||||
throws SQLException {
|
||||
return super.getColumns(null, schemaPattern, tableNamePattern, columnNamePattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
|
||||
return super.getPrimaryKeys(null, schema, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
|
||||
throws SQLException {
|
||||
return super.getTables(null, schemaPattern, tableNamePattern, types);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get a sql query by login name and catalog name.
|
||||
*
|
||||
* @param loginName
|
||||
* @param catalogName
|
||||
* @return
|
||||
*/
|
||||
protected String createSqlByLoginAndCatalog(String loginName, String catalogName) {
|
||||
String sql = "select count(*) from " + catalogName
|
||||
+ ".dbo.sysusers where suid in (select suid from " + catalogName + ".dbo.syslogins where name = ? )";
|
||||
return sql;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -54,10 +54,13 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
for (String catalogName : catList) {
|
||||
String sql = createSqlByLoginAndCatalog(login, catalogName);
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, login);
|
||||
stmt.setString(2, login);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
int temp = rs.getInt(1);
|
||||
@@ -92,11 +95,11 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
|
||||
String sql = "SELECT DISTINCT name FROM " + catalog + ".dbo.sysusers where suid > 0"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("name"); //$NON-NLS-1$
|
||||
@@ -136,9 +139,9 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
|
||||
*/
|
||||
protected String createSqlByLoginAndCatalog(String loginName, String catalogName) {
|
||||
return "select count(*) from " + catalogName //$NON-NLS-1$
|
||||
+ ".dbo.sysusers where suid in (select suid from master.dbo.syslogins where name = '" + loginName //$NON-NLS-1$
|
||||
+ "') or suid in (select altsuid from " + catalogName //$NON-NLS-1$
|
||||
+ ".dbo.sysalternates a, master.dbo.syslogins b where b.name = '" + loginName + "' and a.suid = b.suid)"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ ".dbo.sysusers where suid in (select suid from master.dbo.syslogins where name = ?"
|
||||
+ ") or suid in (select altsuid from " + catalogName //$NON-NLS-1$
|
||||
+ ".dbo.sysalternates a, master.dbo.syslogins b where b.name = ? and a.suid = b.suid)"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.talend.commons.utils.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -97,13 +97,12 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
int dbMajorVersion = connection.getMetaData().getDatabaseMajorVersion();
|
||||
String sql = "HELP COLUMN \"" + schema + "\".\"" + table + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
String columnName = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.INDICESV WHERE UPPER(databasename) = UPPER('" + schema //$NON-NLS-1$
|
||||
+ "') AND UPPER(tablename) = UPPER('" + table + "') AND UPPER(UniqueFlag) = UPPER('Y')"; //$NON-NLS-1$//$NON-NLS-2$
|
||||
sql = "SELECT * from DBC.INDICESV WHERE UPPER(databasename) = UPPER(?) AND UPPER(tablename) = UPPER(?) AND UPPER(UniqueFlag) = UPPER('Y')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
rs = getResultSet(catalog, schema, table, sql);
|
||||
while (rs.next()) {
|
||||
columnName = rs.getString("ColumnName").trim(); //$NON-NLS-1$
|
||||
@@ -112,8 +111,11 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
list.add(r);
|
||||
}
|
||||
} else {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, schema);
|
||||
stmt.setString(2, table);
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
|
||||
String pk = rs.getString("Primary?");//$NON-NLS-1$
|
||||
@@ -138,10 +140,10 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
|
||||
public ResultSet getResultSet(String catalog, String schema, String table, String sql) throws SQLException {
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
rs = stmt.executeQuery();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -203,17 +205,15 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
sysTable = "DBC.TABLESV";//$NON-NLS-1$
|
||||
}
|
||||
if (types != null && types.length > 0) {
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
|
||||
+ "') AND tablekind " + addTypesToSql(types); //$NON-NLS-1$
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER(?) AND tablekind " + addTypesToSql(types); //$NON-NLS-1$
|
||||
} else {
|
||||
// When the types is empty, all the tables and views will be retrieved.
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
|
||||
+ "') AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
|
||||
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER(?) AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// add the filter for table/views
|
||||
if (!StringUtils.isEmpty(tableNamePattern)) {
|
||||
sql = sql + " AND tablename LIKE '" + tableNamePattern + "'";//$NON-NLS-1$//$NON-NLS-2$
|
||||
sql = sql + " AND tablename LIKE ?";//$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
if (types != null && types.length > 0) {
|
||||
@@ -223,11 +223,18 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
}
|
||||
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
stmt.setString(1, database);
|
||||
|
||||
// add the filter for table/views
|
||||
if (!StringUtils.isEmpty(tableNamePattern)) {
|
||||
stmt.setString(2, tableNamePattern);
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("TableName").trim(); //$NON-NLS-1$
|
||||
@@ -326,21 +333,33 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
if (!StringUtils.isEmpty(database)) {
|
||||
sql = "HELP COLUMN \"" + database + "\".\"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$
|
||||
+ "') AND UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(databasename) = UPPER(?) AND UPPER(tablename) = UPPER(?)" //$NON-NLS-1$
|
||||
+ " Order by tablename "; //$NON-NLS-1$ //$NON-NLS-3$
|
||||
}
|
||||
} else {
|
||||
sql = "HELP COLUMN \"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$
|
||||
if (dbMajorVersion > 12) {
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER(?)" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$
|
||||
// //$NON-NLS-3$
|
||||
}
|
||||
}
|
||||
ResultSet rs = null;
|
||||
Statement stmt = null;
|
||||
PreparedStatement stmt = null;
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
try {
|
||||
stmt = connection.createStatement();
|
||||
rs = stmt.executeQuery(sql);
|
||||
stmt = connection.prepareStatement(sql);
|
||||
if (!StringUtils.isEmpty(database)) {
|
||||
if (dbMajorVersion > 12) {
|
||||
stmt.setString(1, database);
|
||||
stmt.setString(2, tableNamePattern);
|
||||
}
|
||||
} else {
|
||||
if (dbMajorVersion > 12) {
|
||||
stmt.setString(1, tableNamePattern);
|
||||
}
|
||||
}
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
String tableName = tableNamePattern;
|
||||
String columnName = null;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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.network;
|
||||
|
||||
public interface ITalendNexusPrefConstants {
|
||||
|
||||
public static final String NEXUS_TIMEOUT = "NEXUS_TIMEOUT"; //$NON-NLS-1$
|
||||
}
|
||||
@@ -15,6 +15,7 @@ package org.talend.commons.utils.network;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Authenticator;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.PasswordAuthentication;
|
||||
@@ -22,10 +23,17 @@ import java.net.SocketException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.runtime.utils.io.FileCopyUtils;
|
||||
|
||||
/**
|
||||
@@ -44,7 +52,17 @@ public class NetworkUtil {
|
||||
|
||||
private static final String HTTP_NETWORK_URL = "https://talend-update.talend.com";
|
||||
|
||||
private static final int DEFAULT_TIMEOUT = 4000;
|
||||
|
||||
private static final int DEFAULT_NEXUS_TIMEOUT = 20000;// same as preference value
|
||||
|
||||
public static final String ORG_TALEND_DESIGNER_CORE = "org.talend.designer.core"; //$NON-NLS-1$
|
||||
|
||||
public static boolean isNetworkValid() {
|
||||
return isNetworkValid(DEFAULT_TIMEOUT);
|
||||
}
|
||||
|
||||
public static boolean isNetworkValid(Integer timeout) {
|
||||
String disableInternet = System.getProperty(TALEND_DISABLE_INTERNET);
|
||||
if ("true".equals(disableInternet)) { //$NON-NLS-1$
|
||||
return false;
|
||||
@@ -55,8 +73,9 @@ public class NetworkUtil {
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDefaultUseCaches(false);
|
||||
conn.setUseCaches(false);
|
||||
conn.setConnectTimeout(4000);
|
||||
conn.setReadTimeout(4000);
|
||||
int conntimeout = timeout != null ? timeout.intValue() : DEFAULT_TIMEOUT;
|
||||
conn.setConnectTimeout(conntimeout);
|
||||
conn.setReadTimeout(conntimeout);
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
String strMessage = conn.getResponseMessage();
|
||||
if (strMessage.compareTo("Not Found") == 0) { //$NON-NLS-1$
|
||||
@@ -73,22 +92,23 @@ public class NetworkUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isNetworkValid(String url) {
|
||||
public static boolean isNetworkValid(String url, Integer timeout) {
|
||||
if (url == null) {
|
||||
return isNetworkValid();
|
||||
return isNetworkValid(timeout);
|
||||
}
|
||||
return checkValidWithHttp(url);
|
||||
return checkValidWithHttp(url, timeout);
|
||||
}
|
||||
|
||||
private static boolean checkValidWithHttp(String urlString) {
|
||||
private static boolean checkValidWithHttp(String urlString, Integer timeout) {
|
||||
HttpURLConnection conn = null;
|
||||
try {
|
||||
URL url = new URL(urlString);
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDefaultUseCaches(false);
|
||||
conn.setUseCaches(false);
|
||||
conn.setConnectTimeout(4000);
|
||||
conn.setReadTimeout(4000);
|
||||
int conntimeout = timeout != null ? timeout.intValue() : DEFAULT_TIMEOUT;
|
||||
conn.setConnectTimeout(conntimeout);
|
||||
conn.setReadTimeout(conntimeout);
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
conn.getResponseMessage();
|
||||
} catch (Exception e) {
|
||||
@@ -101,6 +121,18 @@ public class NetworkUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int getNexusTimeout() {
|
||||
int timeout = DEFAULT_NEXUS_TIMEOUT;
|
||||
try {
|
||||
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ORG_TALEND_DESIGNER_CORE);
|
||||
timeout = node.getInt(ITalendNexusPrefConstants.NEXUS_TIMEOUT, DEFAULT_NEXUS_TIMEOUT);
|
||||
} catch (Throwable e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return timeout;
|
||||
}
|
||||
|
||||
public static Authenticator getDefaultAuthenticator() {
|
||||
try {
|
||||
Field theAuthenticatorField = Authenticator.class.getDeclaredField("theAuthenticator");
|
||||
@@ -123,6 +155,28 @@ public class NetworkUtil {
|
||||
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
String httpProxyHost = System.getProperty("http.proxyHost"); //$NON-NLS-1$
|
||||
String httpProxyPort = System.getProperty("http.proxyPort"); //$NON-NLS-1$
|
||||
String httpsProxyHost = System.getProperty("https.proxyHost"); //$NON-NLS-1$
|
||||
String httpsProxyPort = System.getProperty("https.proxyPort"); //$NON-NLS-1$
|
||||
String requestingHost = getRequestingHost();
|
||||
int requestingPort = getRequestingPort();
|
||||
String proxyHost = null;
|
||||
String proxyPort = null;
|
||||
boolean isHttp = false;
|
||||
if ("http".equalsIgnoreCase(getRequestingScheme())) {
|
||||
isHttp = true;
|
||||
}
|
||||
if (isHttp && StringUtils.isNotBlank(httpProxyHost)) {
|
||||
proxyHost = httpProxyHost;
|
||||
proxyPort = httpProxyPort;
|
||||
} else {
|
||||
proxyHost = httpsProxyHost;
|
||||
proxyPort = httpsProxyPort;
|
||||
}
|
||||
if (!StringUtils.equals(proxyHost, requestingHost) || !StringUtils.equals(proxyPort, "" + requestingPort)) {
|
||||
return null;
|
||||
}
|
||||
String httpProxyUser = System.getProperty("http.proxyUser"); //$NON-NLS-1$
|
||||
String httpProxyPassword = System.getProperty("http.proxyPassword"); //$NON-NLS-1$
|
||||
String httpsProxyUser = System.getProperty("https.proxyUser"); //$NON-NLS-1$
|
||||
@@ -140,7 +194,11 @@ public class NetworkUtil {
|
||||
proxyPassword = httpsProxyPassword.toCharArray();
|
||||
}
|
||||
}
|
||||
return new PasswordAuthentication(proxyUser, proxyPassword);
|
||||
if (StringUtils.isBlank(proxyUser)) {
|
||||
return null;
|
||||
} else {
|
||||
return new PasswordAuthentication(proxyUser, proxyPassword);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
@@ -179,6 +237,58 @@ public class NetworkUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getLocalLoopbackAddresses(boolean wrapIpV6) {
|
||||
Set<String> addresses = new LinkedHashSet<>();
|
||||
try {
|
||||
addresses.add(getIp(InetAddress.getLoopbackAddress(), wrapIpV6));
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
try {
|
||||
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
while (networkInterfaces.hasMoreElements()) {
|
||||
NetworkInterface networkInterface = networkInterfaces.nextElement();
|
||||
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
|
||||
while (inetAddresses.hasMoreElements()) {
|
||||
InetAddress inetAddress = inetAddresses.nextElement();
|
||||
if (inetAddress != null && inetAddress.isLoopbackAddress()) {
|
||||
addresses.add(getIp(inetAddress, wrapIpV6));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
if (addresses.isEmpty()) {
|
||||
addresses.add("127.0.0.1");
|
||||
String ipv6Loopback = "::1";
|
||||
if (wrapIpV6) {
|
||||
ipv6Loopback = "[" + ipv6Loopback + "]";
|
||||
}
|
||||
addresses.add(ipv6Loopback);
|
||||
}
|
||||
|
||||
return new ArrayList<>(addresses);
|
||||
}
|
||||
|
||||
private static String getIp(InetAddress inetAddress, boolean wrapIpV6) {
|
||||
if (wrapIpV6 && Inet6Address.class.isInstance(inetAddress)) {
|
||||
String addr = inetAddress.getHostAddress();
|
||||
if (!addr.startsWith("[") || !addr.endsWith("]")) {
|
||||
int idx = addr.indexOf("%");
|
||||
if (idx > 0) {
|
||||
addr = addr.substring(0, idx);
|
||||
}
|
||||
addr = "[" + addr + "]";
|
||||
}
|
||||
return addr;
|
||||
} else {
|
||||
return inetAddress.getHostAddress();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isSelfAddress(String addr) {
|
||||
if (addr == null || addr.isEmpty()) {
|
||||
return false; // ?
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
package org.talend.commons.utils.network;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
@@ -23,6 +25,7 @@ import java.net.URISyntaxException;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -35,8 +38,16 @@ import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.eclipse.core.internal.net.ProxyManager;
|
||||
import org.eclipse.core.internal.net.ProxyType;
|
||||
import org.eclipse.core.net.proxy.IProxyChangeEvent;
|
||||
import org.eclipse.core.net.proxy.IProxyService;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.i18n.internal.Messages;
|
||||
import org.talend.daikon.sandbox.properties.ClassLoaderIsolatedSystemProperties;
|
||||
|
||||
import sun.net.spi.DefaultProxySelector;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
@@ -51,9 +62,31 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
private static final String PROP_ALLOW_PROXY_REDIRECT_EXCLUDE = "talend.studio.proxy.redirect.whiteList";
|
||||
|
||||
private static final String PROP_EXECUTE_CONNECTION_FAILED = "talend.studio.proxy.executeConnectionFailed";
|
||||
|
||||
private static final String PROP_UPDATE_SYSTEM_PROPERTIES_FOR_JRE = "talend.studio.proxy.jre.updateSystemProperties";
|
||||
|
||||
private static final String PROP_CHECK_PROXY = "talend.studio.proxy.checkProxy";
|
||||
|
||||
private static final String PROP_VALIDATE_URI = "talend.studio.proxy.validateUri";
|
||||
|
||||
private static final String PROP_PROXY_SELECTOR = "talend.studio.proxy.selector";
|
||||
|
||||
private static final String PROP_PROXY_SELECTOR_DEFAULT = "default";
|
||||
|
||||
private static final String PROP_PROXY_SELECTOR_JRE = "jre";
|
||||
|
||||
private static final String PROP_PROXY_HOST_MAP = "talend.studio.proxy.hostMap";
|
||||
|
||||
private static final String PROP_DISABLE_DEFAULT_SELECTOR = "talend.studio.proxy.disableDefaultSelector";
|
||||
private static final String PROP_DISABLE_DEFAULT_SELECTOR_PROVIDER = "talend.studio.proxy.disableDefaultSelectorProvider";
|
||||
|
||||
private static final String PROP_PROXY_EXCLUDE_LOOPBACK_ADDRESS_AUTOMATICALLY = "talend.studio.proxy.excludeLoopbackAutomatically";
|
||||
|
||||
private static final String PROP_PROXY_EXCLUDE_LOOPBACK_ADDRESS_AUTOMATICALLY_DEFAULT = "true";
|
||||
|
||||
private static final String PROP_PROXY_HTTP_NON_PROXYHOSTS = "http.nonProxyHosts";
|
||||
|
||||
private static final String PROP_PROXY_HTTPS_NON_PROXYHOSTS = "https.nonProxyHosts";
|
||||
|
||||
/**
|
||||
* Example: update.talend.com,socket:http,https:http;nexus.talend.com,socket,http;,socket:http
|
||||
@@ -67,7 +100,22 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
private static final String KEY_DEFAULT = ":default:";
|
||||
|
||||
private ProxySelector defaultSelector;
|
||||
private static Field uriHostField;
|
||||
|
||||
private static Method proxyManagerUpdateSystemPropertiesFunc;
|
||||
|
||||
private static boolean checkProxy = Boolean.valueOf(System.getProperty(PROP_CHECK_PROXY, Boolean.TRUE.toString()));
|
||||
|
||||
/**
|
||||
* Note: eclipse default selector may be different between TOS and TIS, TOS may use jre one, TIS may use egit one
|
||||
*/
|
||||
private ProxySelector eclipseDefaultSelector;
|
||||
|
||||
private ProxySelector jreDefaultSelector;
|
||||
|
||||
private EProxySelector eProxySelector;
|
||||
|
||||
private IProxyService proxyManager;
|
||||
|
||||
final private Map<Object, Collection<IProxySelectorProvider>> selectorProviders;
|
||||
|
||||
@@ -79,24 +127,125 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
private static Object instanceLock = new Object();
|
||||
|
||||
private List<String> localLoopbackAddresses;
|
||||
|
||||
private Object localLoopbackAddressesLock = new Object();
|
||||
|
||||
private boolean printProxyLog = false;
|
||||
|
||||
private boolean allowProxyRedirect = false;
|
||||
|
||||
private boolean disableDefaultSelector = false;
|
||||
private boolean disableDefaultSelectorProvider = false;
|
||||
|
||||
private TalendProxySelector(final ProxySelector defaultSelector) {
|
||||
this.defaultSelector = defaultSelector;
|
||||
private boolean validateUri = true;
|
||||
|
||||
private boolean executeConnectionFailed = true;
|
||||
|
||||
private boolean updateSystemPropertiesForJre = true;
|
||||
|
||||
private boolean excludeLoopbackAddressAutomatically = false;
|
||||
|
||||
private TalendProxySelector(final ProxySelector eclipseDefaultSelector) {
|
||||
this.eclipseDefaultSelector = eclipseDefaultSelector;
|
||||
this.jreDefaultSelector = new DefaultProxySelector();
|
||||
|
||||
selectorProviders = Collections.synchronizedMap(new HashMap<>());
|
||||
allowProxyRedirect = Boolean.valueOf(System.getProperty(PROP_ALLOW_PROXY_REDIRECT, Boolean.FALSE.toString()));
|
||||
disableDefaultSelector = Boolean.valueOf(System.getProperty(PROP_DISABLE_DEFAULT_SELECTOR, Boolean.FALSE.toString()));
|
||||
disableDefaultSelectorProvider = Boolean
|
||||
.valueOf(System.getProperty(PROP_DISABLE_DEFAULT_SELECTOR_PROVIDER, Boolean.FALSE.toString()));
|
||||
printProxyLog = Boolean.valueOf(System.getProperty(PROP_PRINT_LOGS, Boolean.FALSE.toString()));
|
||||
validateUri = Boolean.valueOf(System.getProperty(PROP_VALIDATE_URI, Boolean.TRUE.toString()));
|
||||
executeConnectionFailed = Boolean.valueOf(System.getProperty(PROP_EXECUTE_CONNECTION_FAILED, Boolean.TRUE.toString()));
|
||||
updateSystemPropertiesForJre = Boolean
|
||||
.valueOf(System.getProperty(PROP_UPDATE_SYSTEM_PROPERTIES_FOR_JRE, Boolean.TRUE.toString()));
|
||||
excludeLoopbackAddressAutomatically = Boolean.valueOf(System.getProperty(
|
||||
PROP_PROXY_EXCLUDE_LOOPBACK_ADDRESS_AUTOMATICALLY, PROP_PROXY_EXCLUDE_LOOPBACK_ADDRESS_AUTOMATICALLY_DEFAULT));
|
||||
|
||||
switch (System.getProperty(PROP_PROXY_SELECTOR, PROP_PROXY_SELECTOR_DEFAULT).toLowerCase()) {
|
||||
case PROP_PROXY_SELECTOR_JRE:
|
||||
this.eProxySelector = EProxySelector.jre;
|
||||
break;
|
||||
default:
|
||||
this.eProxySelector = EProxySelector.eclipse_default;
|
||||
break;
|
||||
}
|
||||
proxyManager = ProxyManager.getProxyManager();
|
||||
checkProxyManager(IProxyChangeEvent.PROXY_DATA_CHANGED);
|
||||
proxyManager.addProxyChangeListener(event -> checkProxyManager(event.getChangeType()));
|
||||
|
||||
initHostMap();
|
||||
initRedirectList();
|
||||
}
|
||||
|
||||
private void checkProxyManager(int changeEvent) {
|
||||
try {
|
||||
if (IProxyChangeEvent.PROXY_DATA_CHANGED == changeEvent
|
||||
|| IProxyChangeEvent.NONPROXIED_HOSTS_CHANGED == changeEvent) {
|
||||
if (this.excludeLoopbackAddressAutomatically && proxyManager.isProxiesEnabled()) {
|
||||
List<String> addresses = getLocalLoopbackAddresses();
|
||||
if (addresses != null && !addresses.isEmpty()) {
|
||||
if (org.eclipse.core.internal.net.ProxySelector
|
||||
.canSetBypassHosts(org.eclipse.core.internal.net.ProxySelector.getDefaultProvider())) {
|
||||
List<String> configuredProxies = Arrays.asList(proxyManager.getNonProxiedHosts());
|
||||
if (!configuredProxies.containsAll(addresses)) {
|
||||
Set<String> nonProxyHosts = new HashSet<>(addresses);
|
||||
nonProxyHosts.addAll(configuredProxies);
|
||||
ExceptionHandler.log(
|
||||
this.getClass().getName() + ":" + "-D" + PROP_PROXY_EXCLUDE_LOOPBACK_ADDRESS_AUTOMATICALLY
|
||||
+ "=true, adding missing loopback addresses into eclipse nonProxyHosts: "
|
||||
+ nonProxyHosts);
|
||||
proxyManager.setNonProxiedHosts(nonProxyHosts.toArray(new String[0]));
|
||||
}
|
||||
} else {
|
||||
updateNonProxyHosts(addresses, PROP_PROXY_HTTP_NON_PROXYHOSTS);
|
||||
updateNonProxyHosts(addresses, PROP_PROXY_HTTPS_NON_PROXYHOSTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateNonProxyHosts(List<String> localLoopbackAddresses, final String nonProxyProperty) {
|
||||
if (localLoopbackAddresses != null && !localLoopbackAddresses.isEmpty()) {
|
||||
Set<String> nonProxyHosts = new HashSet<>(localLoopbackAddresses);
|
||||
String property = System.getProperty(nonProxyProperty);
|
||||
boolean update = true;
|
||||
if (StringUtils.isNotBlank(property)) {
|
||||
List<String> configuredProxies = Arrays.asList(ProxyType.convertPropertyStringToHosts(property));
|
||||
if (configuredProxies.containsAll(localLoopbackAddresses)) {
|
||||
update = false;
|
||||
} else {
|
||||
nonProxyHosts.addAll(configuredProxies);
|
||||
}
|
||||
}
|
||||
if (update) {
|
||||
ExceptionHandler.log(this.getClass().getName() + ":" + "-D" + PROP_PROXY_EXCLUDE_LOOPBACK_ADDRESS_AUTOMATICALLY
|
||||
+ "=true, adding missing loopback addresses into " + nonProxyProperty + ": " + nonProxyHosts);
|
||||
System.setProperty(nonProxyProperty,
|
||||
ProxyType.convertHostsToPropertyString(nonProxyHosts.toArray(new String[0])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> getLocalLoopbackAddresses() {
|
||||
if (this.localLoopbackAddresses == null) {
|
||||
synchronized (localLoopbackAddressesLock) {
|
||||
if (this.localLoopbackAddresses == null) {
|
||||
List<String> addresses = NetworkUtil.getLocalLoopbackAddresses(false);
|
||||
final String localhost = "localhost";
|
||||
if (!addresses.contains(localhost)) {
|
||||
addresses.add(localhost);
|
||||
}
|
||||
this.localLoopbackAddresses = addresses;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.localLoopbackAddresses;
|
||||
}
|
||||
|
||||
private void initHostMap() {
|
||||
try {
|
||||
hostMap = new HashMap<>();
|
||||
@@ -176,6 +325,18 @@ public class TalendProxySelector extends ProxySelector {
|
||||
synchronized (instanceLock) {
|
||||
if (instance == null) {
|
||||
instance = new TalendProxySelector(proxySelector);
|
||||
try {
|
||||
uriHostField = URI.class.getDeclaredField("host");
|
||||
uriHostField.setAccessible(true);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
try {
|
||||
proxyManagerUpdateSystemPropertiesFunc = ProxyManager.class.getDeclaredMethod("updateSystemProperties");
|
||||
proxyManagerUpdateSystemPropertiesFunc.setAccessible(true);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,34 +349,92 @@ public class TalendProxySelector extends ProxySelector {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
if (instance.getDefaultProxySelector() == null
|
||||
if (instance.getEclipseDefaultSelector() == null
|
||||
|| (proxySelector != null && proxySelector.getClass().getName().endsWith(ECLIPSE_PROXY_SELECTOR))) {
|
||||
instance.setDefaultProxySelector(proxySelector);
|
||||
instance.setEclipseDefaultSelector(proxySelector);
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void checkProxy() {
|
||||
if (!checkProxy) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
TalendProxySelector.getInstance();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Proxy> select(final URI uri) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("TalendProxySelector.select " + uri);
|
||||
}
|
||||
if (uri == null) {
|
||||
List<Proxy> result = new ArrayList<>();
|
||||
result.add(Proxy.NO_PROXY);
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
if (this.excludeLoopbackAddressAutomatically) {
|
||||
List<String> addresses = getLocalLoopbackAddresses();
|
||||
if (addresses != null) {
|
||||
String host = uri.getHost();
|
||||
if (addresses.contains(host)) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log(uri + " is excluded from proxy");
|
||||
}
|
||||
List<Proxy> result = new ArrayList<>();
|
||||
result.add(Proxy.NO_PROXY);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
URI validatedUri = validateUri(uri);
|
||||
Set<Proxy> results = new LinkedHashSet<>();
|
||||
|
||||
try {
|
||||
final Set<Proxy> resultFromProviders = getProxysFromProviders(uri);
|
||||
final Set<Proxy> resultFromProviders = getProxysFromProviders(validatedUri);
|
||||
if (resultFromProviders != null && !resultFromProviders.isEmpty()) {
|
||||
results.addAll(resultFromProviders);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("TalendProxySelector.resultFromProviders " + results);
|
||||
}
|
||||
|
||||
ProxySelector defaultProxySelector = getDefaultProxySelector();
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("TalendProxySelector.defaultProxySelector " + defaultProxySelector);
|
||||
}
|
||||
if (defaultProxySelector != null) {
|
||||
URI newUri = getNewUri(uri);
|
||||
List<Proxy> defaultProxys = defaultProxySelector.select(newUri);
|
||||
/**
|
||||
* don't validate uri here, so that we can know whether it is an issue uri
|
||||
*/
|
||||
URI newUri = getNewUri(validatedUri, false);
|
||||
List<Proxy> defaultProxys = null;
|
||||
if (validateUri && StringUtils.isBlank(newUri.getHost())) {
|
||||
/**
|
||||
* If host is blank, force to use jre proxy selector to avoid the eclipse proxy selector bug
|
||||
*/
|
||||
defaultProxys = getJreProxySelector().select(newUri);
|
||||
} else {
|
||||
defaultProxys = defaultProxySelector.select(newUri);
|
||||
}
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("TalendProxySelector.defaultProxys " + defaultProxys);
|
||||
}
|
||||
try {
|
||||
results.addAll(filterProxys(uri, defaultProxys));
|
||||
results.addAll(filterProxys(validatedUri, defaultProxys));
|
||||
} catch (Exception e) {
|
||||
results.addAll(defaultProxys);
|
||||
ExceptionHandler.process(e);
|
||||
@@ -226,9 +445,60 @@ public class TalendProxySelector extends ProxySelector {
|
||||
ExceptionHandler.log("Selected proxys for " + uri + ", " + proxys);
|
||||
ExceptionHandler.process(new Exception("Proxy call stacks"), Priority.INFO);
|
||||
}
|
||||
if (results.isEmpty()) {
|
||||
results.add(Proxy.NO_PROXY);
|
||||
}
|
||||
return new LinkedList<Proxy>(results);
|
||||
}
|
||||
|
||||
private URI validateUri(URI uri) {
|
||||
if (!validateUri) {
|
||||
return uri;
|
||||
}
|
||||
|
||||
URI validatedUri = null;
|
||||
try {
|
||||
/**
|
||||
* DON'T use URI.create(), MUST use the conductor which requires authority
|
||||
*/
|
||||
validatedUri = new URI(uri.getScheme(), uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment());
|
||||
|
||||
/**
|
||||
* Validate the host, if the host is empty, it will cause the eclipse selector to return dirrect
|
||||
*/
|
||||
if (StringUtils.isBlank(validatedUri.getHost())) {
|
||||
String authority = validatedUri.getAuthority();
|
||||
if (StringUtils.isNotBlank(authority)) {
|
||||
// example: https://u:p@www.company.com:8081/path/a?param=b
|
||||
String host = null;
|
||||
int userInfoIndex = authority.indexOf('@');
|
||||
if (0 <= userInfoIndex) {
|
||||
authority = authority.substring(userInfoIndex + 1);
|
||||
}
|
||||
int portIndex = authority.lastIndexOf(':');
|
||||
if (0 <= portIndex) {
|
||||
host = authority.substring(0, portIndex);
|
||||
}
|
||||
try {
|
||||
uriHostField.set(validatedUri, host);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
if (validatedUri == null) {
|
||||
validatedUri = uri;
|
||||
}
|
||||
}
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("After validate: " + uri + " -> " + validatedUri);
|
||||
}
|
||||
return validatedUri;
|
||||
}
|
||||
|
||||
private List<Proxy> filterProxys(final URI uri, List<Proxy> defaultProxys) {
|
||||
List<Proxy> result = new ArrayList<>();
|
||||
if (defaultProxys != null && !defaultProxys.isEmpty()) {
|
||||
@@ -264,38 +534,48 @@ public class TalendProxySelector extends ProxySelector {
|
||||
return result;
|
||||
}
|
||||
|
||||
private URI getNewUri(URI uri) {
|
||||
private URI getNewUri(URI uri, boolean validateUri) {
|
||||
URI newUri = uri;
|
||||
if (newUri != null) {
|
||||
String host = newUri.getHost();
|
||||
Map<String, String> protocolMap = null;
|
||||
if (StringUtils.isNotBlank(host)) {
|
||||
protocolMap = hostMap.get(host.toLowerCase());
|
||||
}
|
||||
if (protocolMap == null) {
|
||||
protocolMap = hostMap.get(KEY_DEFAULT);
|
||||
}
|
||||
try {
|
||||
// get host before new URI, because the host may be set manually due to URI issue
|
||||
String host = newUri.getHost();
|
||||
newUri = new URI(newUri.getScheme(), newUri.getAuthority(), newUri.getPath(), newUri.getQuery(),
|
||||
newUri.getFragment());
|
||||
Map<String, String> protocolMap = null;
|
||||
if (StringUtils.isNotBlank(host)) {
|
||||
protocolMap = hostMap.get(host.toLowerCase());
|
||||
}
|
||||
if (protocolMap == null) {
|
||||
protocolMap = hostMap.get(KEY_DEFAULT);
|
||||
}
|
||||
|
||||
if (protocolMap != null) {
|
||||
String schema = newUri.getScheme();
|
||||
if (schema != null) {
|
||||
String lowercasedProtocol = schema.toLowerCase();
|
||||
String preferedProtocol = protocolMap.get(lowercasedProtocol);
|
||||
if (StringUtils.isNotBlank(preferedProtocol)) {
|
||||
try {
|
||||
newUri = new URI(preferedProtocol, newUri.getUserInfo(), newUri.getHost(), newUri.getPort(),
|
||||
newUri.getPath(), newUri.getQuery(), newUri.getFragment());
|
||||
} catch (URISyntaxException e) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.process(new Exception(
|
||||
Messages.getString("TalendProxySelector.exception.proxySelectionError", newUri), e),
|
||||
Priority.WARN);
|
||||
}
|
||||
if (protocolMap != null) {
|
||||
String schema = newUri.getScheme();
|
||||
if (schema != null) {
|
||||
String lowercasedProtocol = schema.toLowerCase();
|
||||
String preferedProtocol = protocolMap.get(lowercasedProtocol);
|
||||
if (StringUtils.isNotBlank(preferedProtocol)) {
|
||||
/**
|
||||
* Note: MUST use the constructor which requires authority, because some uri may be illegal,
|
||||
* then host info will be stored in authority field instead of host filed
|
||||
*/
|
||||
newUri = new URI(preferedProtocol, newUri.getAuthority(), newUri.getPath(), newUri.getQuery(),
|
||||
newUri.getFragment());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (URISyntaxException e) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.process(
|
||||
new Exception(Messages.getString("TalendProxySelector.exception.proxySelectionError", uri), e),
|
||||
Priority.WARN);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (validateUri) {
|
||||
newUri = validateUri(newUri);
|
||||
}
|
||||
return newUri;
|
||||
}
|
||||
|
||||
@@ -395,11 +675,45 @@ public class TalendProxySelector extends ProxySelector {
|
||||
}
|
||||
|
||||
public ProxySelector getDefaultProxySelector() {
|
||||
return defaultSelector;
|
||||
switch (eProxySelector) {
|
||||
case jre:
|
||||
return getJreProxySelector();
|
||||
default:
|
||||
return eclipseDefaultSelector;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaultProxySelector(final ProxySelector selector) {
|
||||
defaultSelector = selector;
|
||||
private ProxySelector getJreProxySelector() {
|
||||
try {
|
||||
/**
|
||||
* for tcompv0, daikon may create an isolated system properties for it, so proxies may be ignored in the new
|
||||
* system properties; here we try to call the method to add proxies into the isolated system properties
|
||||
*/
|
||||
if (updateSystemPropertiesForJre && ClassLoaderIsolatedSystemProperties.getInstance()
|
||||
.isIsolated(Thread.currentThread().getContextClassLoader())) {
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("Before update jre proxy system properties for the isolated classloader, http.proxyHost="
|
||||
+ System.getProperty("http.proxyHost"));
|
||||
}
|
||||
IProxyService proxyService = CommonsPlugin.getProxyService();
|
||||
proxyManagerUpdateSystemPropertiesFunc.invoke(proxyService);
|
||||
if (printProxyLog) {
|
||||
ExceptionHandler.log("After updated jre proxy system properties for the isolated classloader, http.proxyHost="
|
||||
+ System.getProperty("http.proxyHost"));
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return this.jreDefaultSelector;
|
||||
}
|
||||
|
||||
public ProxySelector getEclipseDefaultSelector() {
|
||||
return eclipseDefaultSelector;
|
||||
}
|
||||
|
||||
public void setEclipseDefaultSelector(ProxySelector eclipseDefaultSelector) {
|
||||
this.eclipseDefaultSelector = eclipseDefaultSelector;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -413,21 +727,26 @@ public class TalendProxySelector extends ProxySelector {
|
||||
});
|
||||
}
|
||||
|
||||
ProxySelector defaultProxySelector = getDefaultProxySelector();
|
||||
if (defaultProxySelector != null) {
|
||||
defaultProxySelector.connectFailed(uri, sa, ioe);
|
||||
if (executeConnectionFailed) {
|
||||
/**
|
||||
* Just try to make the behavior of jre proxy selector same like eclipse proxy selector
|
||||
*/
|
||||
ProxySelector defaultProxySelector = getDefaultProxySelector();
|
||||
if (defaultProxySelector != null) {
|
||||
defaultProxySelector.connectFailed(uri, sa, ioe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IProxySelectorProvider createDefaultProxySelectorProvider() {
|
||||
if (disableDefaultSelector) {
|
||||
if (disableDefaultSelectorProvider) {
|
||||
return null;
|
||||
}
|
||||
return new DefaultProxySelectorProvider(Thread.currentThread());
|
||||
}
|
||||
|
||||
public IProxySelectorProvider createDefaultProxySelectorProvider(String host) {
|
||||
if (disableDefaultSelector) {
|
||||
if (disableDefaultSelectorProvider) {
|
||||
return null;
|
||||
}
|
||||
return new DefaultProxySelectorProvider(host);
|
||||
@@ -445,6 +764,11 @@ public class TalendProxySelector extends ProxySelector {
|
||||
return possibleKeys;
|
||||
}
|
||||
|
||||
private enum EProxySelector {
|
||||
eclipse_default,
|
||||
jre
|
||||
}
|
||||
|
||||
private class DefaultProxySelectorProvider extends AbstractProxySelectorProvider {
|
||||
|
||||
private Thread currentThread = null;
|
||||
@@ -475,7 +799,7 @@ public class TalendProxySelector extends ProxySelector {
|
||||
|
||||
@Override
|
||||
public boolean canHandle(URI uri) {
|
||||
if (disableDefaultSelector) {
|
||||
if (disableDefaultSelectorProvider) {
|
||||
return false;
|
||||
}
|
||||
if (currentThread != null && Thread.currentThread() == currentThread) {
|
||||
|
||||
@@ -19,15 +19,18 @@ import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarInputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.runtime.service.ITaCoKitService;
|
||||
|
||||
@@ -58,8 +61,14 @@ public class UpdatesHelper {
|
||||
|
||||
public static final String COMPONENT_SUFFIX = "_java.xml";
|
||||
|
||||
public static final String COMPONENT_TEMPLATES = "templates";
|
||||
|
||||
public static final String NEW_COMPONENT_PREFIX = "installer$$";
|
||||
|
||||
public static final String PRE_TALEND_PATCH = "talend.patch";
|
||||
|
||||
public static final String RECORD_SEPERATOR = ",";
|
||||
|
||||
public static boolean existArtifacts(File base) {
|
||||
return new File(base, FILE_ARTIFACTS).exists() || new File(base, FILE_JAR_ARTIFACTS).exists()
|
||||
|| new File(base, FILE_XZ_ARTIFACTS).exists();
|
||||
@@ -83,6 +92,9 @@ public class UpdatesHelper {
|
||||
* will check that existed the plugins folder only.
|
||||
*/
|
||||
public static boolean isPlainUpdate(File file) {
|
||||
if (skipPatchFile(file)) {
|
||||
return false;
|
||||
}
|
||||
if (file != null && file.exists()) {
|
||||
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
|
||||
ZipFileStatus status = new ZipFileStatus(file);
|
||||
@@ -110,6 +122,9 @@ public class UpdatesHelper {
|
||||
* need check that contain "artifacts.xml", "content.xml" and "plugins" folder in same place.
|
||||
*/
|
||||
public static boolean isUpdateSite(File file) {
|
||||
if (skipPatchFile(file)) {
|
||||
return false;
|
||||
}
|
||||
if (file != null && file.exists()) {
|
||||
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
|
||||
|
||||
@@ -171,7 +186,8 @@ public class UpdatesHelper {
|
||||
}
|
||||
|
||||
private static void findUpdateBaseFile(Set<File> foundUpdateFiles, File baseFile) {
|
||||
if (isPlainUpdate(baseFile) || isUpdateSite(baseFile) && !isComponentUpdateSite(baseFile)) {
|
||||
if (isPlainUpdate(baseFile)
|
||||
|| isUpdateSite(baseFile) && !isComponentUpdateSite(baseFile)) {
|
||||
foundUpdateFiles.add(baseFile);
|
||||
} else if (baseFile.isDirectory()) {
|
||||
final File[] listFiles = baseFile.listFiles();
|
||||
@@ -184,6 +200,10 @@ public class UpdatesHelper {
|
||||
}
|
||||
|
||||
public static boolean isComponentUpdateSite(File file) {
|
||||
|
||||
if (skipPatchFile(file)) {
|
||||
return false;
|
||||
}
|
||||
if (file != null && file.exists()) {
|
||||
if (file.isFile() && file.getName().endsWith(FileExtensions.ZIP_FILE_SUFFIX)) {
|
||||
ZipFileStatus status = new ZipFileStatus(file) {
|
||||
@@ -296,6 +316,9 @@ public class UpdatesHelper {
|
||||
|
||||
public static boolean isOldComponent(File f) {
|
||||
if (f != null && f.exists() && f.isDirectory()) {
|
||||
if (f.getName().equals(COMPONENT_TEMPLATES)) {
|
||||
return true;
|
||||
}
|
||||
File[] listFiles = f.listFiles();
|
||||
if (listFiles != null) {
|
||||
for (File subFile : listFiles) {
|
||||
@@ -307,4 +330,53 @@ public class UpdatesHelper {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static File getProductFile() {
|
||||
try {
|
||||
return new File(Platform.getInstallLocation().getDataArea(FILE_ECLIPSE_PRODUCT).getPath());
|
||||
} catch (IOException e) {
|
||||
//
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Properties loadProductProperties(File productFile) {
|
||||
Properties prop = new Properties();
|
||||
if (productFile != null && productFile.exists()) {
|
||||
try (FileInputStream fis = new FileInputStream(productFile)) {
|
||||
prop.load(fis);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
||||
public static Set<String> getPatchesInstalled() {
|
||||
Set<String> installed = new HashSet<String>();
|
||||
File productFile = getProductFile();
|
||||
Properties props = loadProductProperties(productFile);
|
||||
props.forEach((k, v) -> {
|
||||
String key = String.valueOf(k);
|
||||
if (key.startsWith(PRE_TALEND_PATCH)) {
|
||||
String val = String.valueOf(v);
|
||||
String[] vals = val.split(RECORD_SEPERATOR);
|
||||
if (vals.length > 1) {
|
||||
installed.add(vals[1]);
|
||||
} else {
|
||||
installed.add(val);
|
||||
}
|
||||
}
|
||||
});
|
||||
return installed;
|
||||
}
|
||||
|
||||
public static boolean skipPatchFile(File patchFile) {
|
||||
Set<String> installedPathNames = getPatchesInstalled();
|
||||
if (patchFile != null && patchFile.isFile()) {
|
||||
String patchName = FilenameUtils.getBaseName(patchFile.getName());
|
||||
return installedPathNames.contains(patchName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,17 @@ public class EclipseCommandLine {
|
||||
*/
|
||||
static public final String TALEND_PROJECT_TYPE_COMMAND = "-talendProjectType"; //$NON-NLS-1$
|
||||
|
||||
static public final String TALEND_LICENCE_PATH = "talend.licence.path"; //$NON-NLS-1$
|
||||
|
||||
static public final String ARG_TALEND_LICENCE_PATH = "-" + TALEND_LICENCE_PATH; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* for relaunch of the plugins when relaunching the Studio
|
||||
*/
|
||||
static public final String TALEND_RELOAD_COMMAND = "-talendReload"; //$NON-NLS-1$
|
||||
|
||||
static public final String LOGIN_ONLINE_UPDATE = "--loginOnlineUpdate";
|
||||
|
||||
static public final String ARG_TALEND_BUNDLES_CLEANED = "-talend.studio.bundles.cleaned"; //$NON-NLS-1$
|
||||
|
||||
static public final String PROP_TALEND_BUNDLES_DO_CLEAN = "-talend.studio.bundles.doclean"; //$NON-NLS-1$
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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.time;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.log4j.Hierarchy;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.apache.log4j.RollingFileAppender;
|
||||
import org.apache.log4j.spi.LoggerFactory;
|
||||
import org.apache.log4j.spi.RootLogger;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
public class PerformanceLogManager {
|
||||
|
||||
private Hierarchy hierarchy;
|
||||
|
||||
public PerformanceLogManager() {
|
||||
Properties properties = new Properties();
|
||||
properties.put("log4j.rootCategory", ", A1");
|
||||
properties.put("log4j.appender.A1", RollingFileAppender.class.getName());
|
||||
IPath performanceLogPath = Platform.getLogFileLocation().removeLastSegments(1).append("performance.log");
|
||||
properties.put("log4j.appender.A1.File", performanceLogPath.toOSString());
|
||||
properties.put("log4j.appender.A1.MaxBackupIndex", "10");// same as .log's max backup log file count
|
||||
properties.put("log4j.appender.A1.MaxFileSize", "1000000");//1000*1000 byte, same as .log's max file size
|
||||
properties.put("log4j.appender.A1.layout", "org.apache.log4j.PatternLayout");
|
||||
properties.put("log4j.appender.A1.layout.ConversionPattern", "%d %-5p %c %x - %m%n");
|
||||
|
||||
this.hierarchy = new Hierarchy(new RootLogger(Level.INFO));
|
||||
new PropertyConfigurator().doConfigure(properties,hierarchy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this PluginLogManager is disabled for this level.
|
||||
* @param level level value
|
||||
* @return boolean true if it is disabled
|
||||
*/
|
||||
public boolean isDisabled(int level) {
|
||||
return this.hierarchy.isDisabled(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable logging for logging requests with level l or higher.
|
||||
* By default all levels are enabled.
|
||||
* @param level level object
|
||||
*/
|
||||
public void setThreshold(Level level) {
|
||||
this.hierarchy.setThreshold(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* The string version of setThreshold(Level level)
|
||||
* @param level level string
|
||||
*/
|
||||
public void setThreshold(String level) {
|
||||
this.hierarchy.setThreshold(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the repository-wide threshold.
|
||||
* @return Level
|
||||
*/
|
||||
public Level getThreshold() {
|
||||
return this.hierarchy.getThreshold();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new logger instance named as the first parameter
|
||||
* using the default factory. If a logger of that name already exists,
|
||||
* then it will be returned. Otherwise, a new logger will be instantiated
|
||||
* and then linked with its existing ancestors as well as children.
|
||||
* @param name logger name
|
||||
* @return Logger
|
||||
*/
|
||||
public Logger getLogger(String name) {
|
||||
return this.hierarchy.getLogger(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as getLogger(String name) but using a factory instance instead of
|
||||
* a default factory.
|
||||
* @param name logger name
|
||||
* @param factory factory instance
|
||||
* @return Logger
|
||||
*/
|
||||
public Logger getLogger(String name, LoggerFactory factory) {
|
||||
return this.hierarchy.getLogger(name,factory);
|
||||
}
|
||||
|
||||
public Logger getRootLogger() {
|
||||
return this.hierarchy.getRootLogger();
|
||||
}
|
||||
|
||||
public Logger exists(String name) {
|
||||
return this.hierarchy.exists(name);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
this.hierarchy.shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the loggers in this manager.
|
||||
* @return Enumeration logger enumeration
|
||||
*/
|
||||
public Enumeration getCurrentLoggers() {
|
||||
return this.hierarchy.getCurrentLoggers();
|
||||
}
|
||||
|
||||
public void resetConfiguration() {
|
||||
this.hierarchy.resetConfiguration();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,337 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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.time;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
|
||||
/**
|
||||
* DOC sbliu class global comment. Detailled comment
|
||||
*/
|
||||
public class PerformanceStatisticUtil {
|
||||
|
||||
private static final int MEGABYTE = 1024 * 1024;// MB = 1024*1024 byte
|
||||
|
||||
private static final int KILOBYTE = 1024;// kb=1024 byte
|
||||
|
||||
private static final int numOfBlocks = 256;
|
||||
|
||||
private static final int blockSizeKb = 512;
|
||||
|
||||
private static final String dataFile = "testio.data";
|
||||
|
||||
private static String recordingFileName = "performance_record";
|
||||
|
||||
private static File recordingFile = null;
|
||||
|
||||
private static enum BlockSequence {
|
||||
SEQUENTIAL,
|
||||
RANDOM;
|
||||
}
|
||||
|
||||
public static enum StatisticKeys {
|
||||
|
||||
IO_COUNT("I/O.count"), // io count
|
||||
IO_W_MB_SEC("I/O.write"), // write speed MB
|
||||
IO_R_MB_SEC("I/O.read"), // read speed MB
|
||||
IO_W_AVERAGE_MB_SEC("I/O.write.average"), // average speed of write MB
|
||||
IO_R_AVERAGE_MB_SEC("I/O.read.average"), // average speed of read
|
||||
|
||||
STARTUP_AVERAGE("startup.average"),
|
||||
STARTUP_MAX("startup.max"),
|
||||
STARTUP_COUNT("startup.count");
|
||||
|
||||
private String key;
|
||||
|
||||
StatisticKeys(String _key) {
|
||||
key = _key;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
public static void recordStartupEpapsedTime(double elapsedTimeInSeconds) {
|
||||
File file = getRecordingFile();
|
||||
|
||||
Properties props = PropertiesFileUtil.read(file, true);
|
||||
String propCount = props.getProperty(StatisticKeys.STARTUP_COUNT.get(), "0");
|
||||
String propMax = props.getProperty(StatisticKeys.STARTUP_MAX.get(), "0");
|
||||
String propAverage = props.getProperty(StatisticKeys.STARTUP_AVERAGE.get(), "0");
|
||||
|
||||
int iPropCount = Integer.parseInt(propCount);
|
||||
double iPropMax = Double.parseDouble(propMax);
|
||||
double iPropAverage = Double.parseDouble(propAverage);
|
||||
|
||||
iPropMax = iPropMax > elapsedTimeInSeconds ? iPropMax : elapsedTimeInSeconds;
|
||||
iPropAverage = (iPropAverage * iPropCount + elapsedTimeInSeconds) / (iPropCount + 1);
|
||||
iPropCount++;
|
||||
|
||||
props.setProperty(StatisticKeys.STARTUP_COUNT.get(), "" + iPropCount);
|
||||
props.setProperty(StatisticKeys.STARTUP_MAX.get(), "" + iPropMax);
|
||||
props.setProperty(StatisticKeys.STARTUP_AVERAGE.get(), "" + iPropAverage);
|
||||
|
||||
PropertiesFileUtil.store(file, props);
|
||||
}
|
||||
|
||||
public static File getRecordingFile() {
|
||||
if (recordingFile != null) {
|
||||
return recordingFile;
|
||||
}
|
||||
|
||||
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
|
||||
File file = new File(configurationLocation + "/data_collector/" + recordingFileName);
|
||||
File oldFile = new File(configurationLocation + "/" + recordingFileName);
|
||||
if(oldFile.exists()) {
|
||||
if(!file.exists()) {
|
||||
if(!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
try {
|
||||
Files.move(Paths.get(oldFile.toURI()), Paths.get(file.toURI()), StandardCopyOption.ATOMIC_MOVE);
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Files.deleteIfExists(Paths.get(oldFile.toURI()));
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
public static void setRecordingFile(File _recordingFile) {
|
||||
recordingFile = _recordingFile;
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
File _recordingFile = getRecordingFile();
|
||||
try {
|
||||
Files.deleteIfExists(Paths.get(_recordingFile.toURI()));
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static Lock lock = new ReentrantLock();
|
||||
private static Condition condition = lock.newCondition();
|
||||
private static boolean measureIOFinished = true;
|
||||
|
||||
public static void waitUntilFinish() throws InterruptedException {
|
||||
lock.lock();
|
||||
|
||||
try {
|
||||
if(!measureIOFinished) {
|
||||
condition.await(20, TimeUnit.SECONDS);
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void measureIO() {
|
||||
new Thread() {
|
||||
public void run() {
|
||||
measureIOFinished = false;
|
||||
try {
|
||||
_measureIO();
|
||||
} finally {
|
||||
measureIOFinished = true;
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private static void _measureIO() {
|
||||
File file = getRecordingFile();
|
||||
Properties props = PropertiesFileUtil.read(file, true);
|
||||
|
||||
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
||||
File workspace = root.getLocation().makeAbsolute().toFile();
|
||||
File locationDir = new File(workspace, "temp"); // here is workspace/temp dir
|
||||
File testFile = detectTestDataFile(locationDir);
|
||||
|
||||
if (testFile != null) {
|
||||
measureWrite(props, testFile);
|
||||
measureRead(props, testFile);
|
||||
|
||||
PropertiesFileUtil.store(file, props);
|
||||
}
|
||||
}
|
||||
|
||||
private static void measureWrite(Properties props, File testFile) {
|
||||
int blockSize = blockSizeKb * KILOBYTE;
|
||||
|
||||
long startTime = System.nanoTime();
|
||||
long totalBytesWrittenInMark = writeIO(numOfBlocks, BlockSequence.RANDOM, blockSize, testFile);
|
||||
totalBytesWrittenInMark = totalBytesWrittenInMark + writeIO(numOfBlocks, BlockSequence.SEQUENTIAL, blockSize, testFile);
|
||||
long endTime = System.nanoTime();
|
||||
|
||||
long elapsedTimeNs = endTime - startTime;
|
||||
double sec = (double) elapsedTimeNs / (double) 1000000000;
|
||||
double mbWritten = (double) totalBytesWrittenInMark / (double) MEGABYTE;
|
||||
double bwMbSec = mbWritten / sec;
|
||||
|
||||
String ioCount = props.getProperty(StatisticKeys.IO_COUNT.get(), "0");
|
||||
String ioWAverageMbSec = props.getProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), "0");
|
||||
String ioWMbSec = props.getProperty(StatisticKeys.IO_W_MB_SEC.get(), "0");
|
||||
|
||||
int digital_ioCount = Integer.parseInt(ioCount);
|
||||
double digital_ioWAverageMbSec = Double.parseDouble(ioWAverageMbSec);
|
||||
double digital_ioWMbSec = Double.parseDouble(ioWMbSec);
|
||||
|
||||
digital_ioWAverageMbSec = (digital_ioWAverageMbSec * digital_ioCount + bwMbSec) / (digital_ioCount + 1);
|
||||
digital_ioWMbSec = bwMbSec;
|
||||
|
||||
props.setProperty(StatisticKeys.IO_W_AVERAGE_MB_SEC.get(), format(digital_ioWAverageMbSec));
|
||||
props.setProperty(StatisticKeys.IO_W_MB_SEC.get(), format(digital_ioWMbSec));
|
||||
}
|
||||
|
||||
private static long writeIO(int numOfBlocks, BlockSequence blockSequence, int blockSize, File testFile) {
|
||||
byte[] blockArr = new byte[blockSize];
|
||||
for (int b = 0; b < blockArr.length; b++) {
|
||||
if (b % 2 == 0) {
|
||||
blockArr[b] = (byte) 0xFF;
|
||||
}
|
||||
}
|
||||
String mode = "rwd";// "rwd"
|
||||
|
||||
long totalBytesWrittenInMark = 0;
|
||||
try {
|
||||
try (RandomAccessFile rAccFile = new RandomAccessFile(testFile, mode)) {
|
||||
for (int b = 0; b < numOfBlocks; b++) {
|
||||
if (blockSequence == BlockSequence.RANDOM) {
|
||||
int rLoc = randInt(0, numOfBlocks - 1);
|
||||
rAccFile.seek(rLoc * blockSize);
|
||||
} else {
|
||||
rAccFile.seek(b * blockSize);
|
||||
}
|
||||
rAccFile.write(blockArr, 0, blockSize);
|
||||
totalBytesWrittenInMark += blockSize;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
|
||||
return totalBytesWrittenInMark;
|
||||
}
|
||||
|
||||
private static File detectTestDataFile(File location) {
|
||||
if (!location.exists()) {
|
||||
location.mkdirs();
|
||||
}
|
||||
|
||||
File testFile = null;
|
||||
try {
|
||||
testFile = new File(location.getAbsolutePath() + File.separator + dataFile);
|
||||
testFile.deleteOnExit();
|
||||
testFile.createNewFile();
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
|
||||
return testFile;
|
||||
}
|
||||
|
||||
public static void measureRead(Properties props, File testFile) {
|
||||
int blockSize = blockSizeKb * KILOBYTE;
|
||||
|
||||
long startTime = System.nanoTime();
|
||||
long totalBytesReadInMark = readIO(numOfBlocks, BlockSequence.RANDOM, blockSize, testFile);
|
||||
totalBytesReadInMark = totalBytesReadInMark + readIO(numOfBlocks, BlockSequence.SEQUENTIAL, blockSize, testFile);
|
||||
long endTime = System.nanoTime();
|
||||
long elapsedTimeNs = endTime - startTime;
|
||||
double sec = (double) elapsedTimeNs / (double) 1000000000;
|
||||
double mbRead = (double) totalBytesReadInMark / (double) MEGABYTE;
|
||||
double bwMbSec = mbRead / sec;
|
||||
|
||||
String ioCount = props.getProperty(StatisticKeys.IO_COUNT.get(), "0");
|
||||
String ioRAverageMbSec = props.getProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), "0");
|
||||
String ioRMbSec = props.getProperty(StatisticKeys.IO_R_MB_SEC.get(), "0");
|
||||
|
||||
int digital_ioCount = Integer.parseInt(ioCount);
|
||||
double digital_ioRAverageMbSec = Double.parseDouble(ioRAverageMbSec);
|
||||
double digital_ioRMbSec = Double.parseDouble(ioRMbSec);
|
||||
digital_ioRAverageMbSec = (digital_ioRAverageMbSec * digital_ioCount + bwMbSec) / (digital_ioCount + 1);
|
||||
digital_ioRMbSec = bwMbSec;
|
||||
digital_ioCount++;
|
||||
|
||||
props.setProperty(StatisticKeys.IO_R_AVERAGE_MB_SEC.get(), format(digital_ioRAverageMbSec));
|
||||
props.setProperty(StatisticKeys.IO_R_MB_SEC.get(), format(digital_ioRMbSec));
|
||||
props.setProperty(StatisticKeys.IO_COUNT.get(), "" + digital_ioCount);
|
||||
}
|
||||
|
||||
public static String format(double dvalue) {
|
||||
return BigDecimal.valueOf(dvalue).setScale(2, RoundingMode.HALF_UP).toString();
|
||||
}
|
||||
|
||||
private static long readIO(int numOfBlocks, BlockSequence blockSequence, int blockSize, File testFile) {
|
||||
long totalBytesReadInMark = 0;
|
||||
|
||||
byte[] blockArr = new byte[blockSize];
|
||||
for (int b = 0; b < blockArr.length; b++) {
|
||||
if (b % 2 == 0) {
|
||||
blockArr[b] = (byte) 0xFF;
|
||||
}
|
||||
}
|
||||
try {
|
||||
try (RandomAccessFile rAccFile = new RandomAccessFile(testFile, "r")) {
|
||||
for (int b = 0; b < numOfBlocks; b++) {
|
||||
if (blockSequence == BlockSequence.RANDOM) {
|
||||
int rLoc = randInt(0, numOfBlocks - 1);
|
||||
rAccFile.seek(rLoc * blockSize);
|
||||
} else {
|
||||
rAccFile.seek(b * blockSize);
|
||||
}
|
||||
rAccFile.readFully(blockArr, 0, blockSize);
|
||||
totalBytesReadInMark += blockSize;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
return totalBytesReadInMark;
|
||||
}
|
||||
|
||||
private static int randInt(int min, int max) {
|
||||
// nextInt is normally exclusive of the top value,
|
||||
// so add 1 to make it inclusive
|
||||
int randomNum = new Random().nextInt((max - min) + 1) + min;
|
||||
|
||||
return randomNum;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.time;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
public class PropertiesCollectorUtil {
|
||||
|
||||
private static final String ROOT_NODE = "additional_packages_records"; // additional packages
|
||||
|
||||
private static final String PREF_ADDITIONAL_PACKAGES = "AdditionalPackages"; // preference node
|
||||
|
||||
private static final String ADDITONAL_PACKAGE_FILE = "additionalPackages";
|
||||
|
||||
|
||||
public static String getAdditionalPackageRecording() {
|
||||
File file = getRecordFile(ADDITONAL_PACKAGE_FILE);
|
||||
|
||||
Properties props = PropertiesFileUtil.read(file, true);
|
||||
String records = props.getProperty(ROOT_NODE, "");
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
public static void storeAdditionalPackageRecording(String records) {
|
||||
File file = getRecordFile(ADDITONAL_PACKAGE_FILE);
|
||||
Properties props = PropertiesFileUtil.read(file, false);
|
||||
props.setProperty(ROOT_NODE, records);
|
||||
PropertiesFileUtil.store(file, props);
|
||||
}
|
||||
|
||||
private static File getRecordFile(String fileName) {
|
||||
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
|
||||
File file = new File(configurationLocation + "/data_collector/" + fileName);
|
||||
return file;
|
||||
}
|
||||
|
||||
public static String getAdditionalPackagePreferenceNode() {
|
||||
return PREF_ADDITIONAL_PACKAGES;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.time;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
|
||||
/**
|
||||
* DOC sbliu class global comment. Detailled comment
|
||||
*/
|
||||
public class PropertiesFileUtil {
|
||||
public static synchronized Properties read(File recordFile, boolean createIfNotExist) {
|
||||
Properties props = new Properties();
|
||||
if (recordFile != null && exist(recordFile, createIfNotExist)) {
|
||||
FileInputStream inStream = null;
|
||||
try {
|
||||
inStream = new FileInputStream(recordFile);
|
||||
props.load(inStream);
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
} finally {
|
||||
if (inStream != null) {
|
||||
try {
|
||||
inStream.close();
|
||||
} catch (IOException e) {//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
public static synchronized void store(File recordFile, Properties props) {
|
||||
if (props == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (recordFile != null && exist(recordFile, true)) {
|
||||
FileOutputStream outputStream = null;
|
||||
try {
|
||||
outputStream = new FileOutputStream(recordFile);
|
||||
props.store(outputStream, "");
|
||||
} catch (IOException e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
} finally {
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean exist(File recordFile, boolean createIfNotExist) {
|
||||
boolean exists = recordFile.exists();
|
||||
if (!exists && createIfNotExist) {
|
||||
try {
|
||||
if(!recordFile.getParentFile().exists()) {
|
||||
recordFile.getParentFile().mkdirs();
|
||||
}
|
||||
exists = recordFile.createNewFile();
|
||||
if (!exists) {
|
||||
throw new FileNotFoundException(recordFile.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.log(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 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.time;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* DOC sbliu class global comment. Detailled comment
|
||||
*/
|
||||
public class TimeMeasurePerformance extends TimeMeasure{
|
||||
static private Logger logger;
|
||||
|
||||
private static HashMap<String, TimeStack> timers;
|
||||
|
||||
private static long startTime = -1L;
|
||||
|
||||
private static int indent = 0;
|
||||
|
||||
public static void begin(String idTimer, String description) {
|
||||
startTime = System.nanoTime();
|
||||
|
||||
init();
|
||||
if (timers.containsKey(idTimer)) {
|
||||
log(indent(indent) + "Warning (start): timer " + idTimer + " already exists"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
indent++;
|
||||
TimeStack times = new TimeStack();
|
||||
timers.put(idTimer, times);
|
||||
|
||||
String message = "Start '" + idTimer + "' ...";
|
||||
if (description != null) {
|
||||
message = "Start '" + idTimer + "', " + description + " ...";
|
||||
}
|
||||
log(indent(indent) + message); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
private static void init() {
|
||||
if (timers == null) {
|
||||
timers = new HashMap<String, TimeStack>();
|
||||
}
|
||||
|
||||
if(logger == null) {
|
||||
configureLogger();
|
||||
}
|
||||
}
|
||||
|
||||
private static void log (String message) {
|
||||
logger.info(message);
|
||||
}
|
||||
|
||||
public static long end(String idTimer) {
|
||||
init();
|
||||
if (!timers.containsKey(idTimer)) {
|
||||
log(indent(indent) + "Warning (end): timer " + idTimer + " doesn't exist"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return -1;
|
||||
} else {
|
||||
TimeStack timeStack = timers.get(idTimer);
|
||||
timers.remove(idTimer);
|
||||
long elapsedTimeSinceLastRequest = timeStack.getLastStepElapsedTime();
|
||||
log(indent(indent) + "End '" + idTimer + "', elapsed time since last request: " //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ elapsedTimeSinceLastRequest + " ms "); //$NON-NLS-1$
|
||||
|
||||
long totalElapsedTime = timeStack.getTotalElapsedTime();
|
||||
|
||||
log(indent(indent) + "End '" + idTimer + "', total elapsed time: " + totalElapsedTime + " ms "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
indent--;
|
||||
return totalElapsedTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static long step(String idTimer, String stepName) {
|
||||
init();
|
||||
if (!timers.containsKey(idTimer)) {
|
||||
log(indent(indent) + "Warning (end): timer " + idTimer + " does'nt exist"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return -1;
|
||||
} else {
|
||||
TimeStack timeStack = timers.get(idTimer);
|
||||
timeStack.addStep();
|
||||
/*
|
||||
* trace the timeline of every step,problem is that the code below " Calendar ca = Calendar.getInstance();
|
||||
* Date now = ca.getTime();" will cost almost 13ms~15ms
|
||||
*/
|
||||
long time = timeStack.getLastStepElapsedTime();
|
||||
String timerStepName = idTimer + "', step name '" + stepName; //$NON-NLS-1$
|
||||
|
||||
log(indent(indent)
|
||||
+ "-> '" + timerStepName + "', elapsed time since previous step: " + time + " ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
return time;
|
||||
}
|
||||
}
|
||||
|
||||
private static void configureLogger() {
|
||||
try {
|
||||
PerformanceLogManager logManager = new PerformanceLogManager();
|
||||
logger = logManager.getLogger(TimeMeasurePerformance.class.getName());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error while initializing log properties.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void afterStartup() {
|
||||
double elapsedTimeInSeconds = (double)(System.nanoTime() - startTime)/1000000000;
|
||||
PerformanceStatisticUtil.recordStartupEpapsedTime(elapsedTimeInSeconds);
|
||||
PerformanceStatisticUtil.measureIO();
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.3.1-SNAPSHOT</version>
|
||||
<version>7.3.1-PATCH</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.ui</artifactId>
|
||||
|
||||
@@ -76,6 +76,8 @@ ExtendedTableMoveCommand.MoveLabel=Move up or down, one or more table entries
|
||||
ExtendedTablePasteCommand.Paste.Label=Paste data from the internal clipoard
|
||||
ExtendedTableRemoveCommand.Romve.Label=Remove table entries
|
||||
ExtendedTableResetDBTypesCommand.ResetDBTypes.Label=Reset all DB Types to get the defaults
|
||||
ExtendedTableCaseCommand.case.Label=Change selected DB columns to uppercase/lowercase
|
||||
ExtendedTableQuoteCommand.Quote.Label=Quote selected DB columns
|
||||
ImportPushButton.ImportButton.Tip=Replace all rows by import from xml file
|
||||
ImportPushButtonForExtendedTable.ErrorMsg.Text=Error occurred
|
||||
LabelledFileField.BrowseButton.Text=Browse...
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.composite;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Sash;
|
||||
|
||||
/**
|
||||
* This class is used for constructing 2 composites, putting 1 sashes in the middle composite, which is used for
|
||||
* changing other 2 composites.
|
||||
*
|
||||
*/
|
||||
public class TwoCompositesSashForm extends Composite {
|
||||
|
||||
public static final int SASH_WIDTH = 3;
|
||||
|
||||
private Composite leftComposite;
|
||||
|
||||
private Composite rightComposite;
|
||||
|
||||
private Sash midSash;
|
||||
|
||||
/**
|
||||
* Initialize.
|
||||
*
|
||||
* @param parent
|
||||
* @param style
|
||||
*/
|
||||
public TwoCompositesSashForm(Composite parent, int style) {
|
||||
super(parent, style);
|
||||
final GridLayout gridLayout = new GridLayout();
|
||||
gridLayout.numColumns = 3;
|
||||
gridLayout.marginBottom = 0;
|
||||
gridLayout.marginHeight = 0;
|
||||
gridLayout.marginLeft = 0;
|
||||
gridLayout.marginRight = 0;
|
||||
gridLayout.marginTop = 0;
|
||||
gridLayout.marginWidth = 0;
|
||||
gridLayout.horizontalSpacing = 0;
|
||||
|
||||
setLayout(gridLayout);
|
||||
final GridData gridData = new GridData(GridData.FILL_BOTH);
|
||||
setLayoutData(gridData);
|
||||
|
||||
addComponents();
|
||||
addSashListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes all widgets's position when sash was moved.
|
||||
*
|
||||
* @param shift
|
||||
*/
|
||||
private void setCompositesBounds(int shift) {
|
||||
// Set mid Composite Width.
|
||||
int midSashPreLocation = midSash.getBounds().x;
|
||||
midSash.setLocation(midSashPreLocation + shift, midSash.getBounds().y);
|
||||
if (midSash.getBounds().x > 0) {
|
||||
if (midSashPreLocation < 0) {
|
||||
leftComposite.setSize(leftComposite.getBounds().width + shift + midSashPreLocation, leftComposite
|
||||
.getBounds().height);
|
||||
} else {
|
||||
leftComposite.setSize(leftComposite.getBounds().width + shift, leftComposite.getBounds().height);
|
||||
}
|
||||
} else {
|
||||
leftComposite.setSize(0, leftComposite.getBounds().height);
|
||||
}
|
||||
// Set Right Composte Width.
|
||||
rightComposite.setLocation(rightComposite.getBounds().x + shift, rightComposite.getBounds().y);
|
||||
rightComposite.setSize(rightComposite.getBounds().width - shift, rightComposite.getBounds().height);
|
||||
}
|
||||
|
||||
public Composite getLeftComposite() {
|
||||
return this.leftComposite;
|
||||
}
|
||||
|
||||
public Composite getRightComposite() {
|
||||
return this.rightComposite;
|
||||
}
|
||||
|
||||
private void addSashListeners() {
|
||||
midSash.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
/*
|
||||
* (non-Java)
|
||||
*
|
||||
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
|
||||
*/
|
||||
public void handleEvent(Event event) {
|
||||
int shift = event.x - midSash.getBounds().x;
|
||||
setCompositesBounds(shift);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void addComponents() {
|
||||
leftComposite = new Composite(this, SWT.NONE);
|
||||
GridLayout gridLayout = new GridLayout();
|
||||
gridLayout.marginBottom = 0;
|
||||
gridLayout.marginHeight = 0;
|
||||
gridLayout.marginLeft = 0;
|
||||
gridLayout.marginRight = 0;
|
||||
gridLayout.marginTop = 0;
|
||||
gridLayout.marginWidth = 0;
|
||||
gridLayout.horizontalSpacing = 0;
|
||||
GridData gridData = new GridData(GridData.FILL_BOTH);
|
||||
|
||||
leftComposite.setLayout(gridLayout);
|
||||
leftComposite.setLayoutData(gridData);
|
||||
|
||||
midSash = new Sash(this, SWT.VERTICAL | SWT.SMOOTH);
|
||||
GridData gridData2 = new GridData(GridData.FILL_VERTICAL);
|
||||
midSash.setLayoutData(gridData2);
|
||||
midSash.setSize(SASH_WIDTH, midSash.getBounds().height);
|
||||
|
||||
rightComposite = new Composite(this, SWT.NONE);
|
||||
GridLayout gridLayout3 = new GridLayout();
|
||||
gridLayout3.marginBottom = 0;
|
||||
gridLayout3.marginHeight = 0;
|
||||
gridLayout3.marginLeft = 0;
|
||||
gridLayout3.marginRight = 0;
|
||||
gridLayout3.marginTop = 0;
|
||||
gridLayout3.marginWidth = 0;
|
||||
gridLayout3.horizontalSpacing = 0;
|
||||
rightComposite.setLayout(gridLayout3);
|
||||
GridData gridData4 = new GridData(GridData.FILL_BOTH);
|
||||
rightComposite.setLayoutData(gridData4);
|
||||
}
|
||||
|
||||
public void setGridDatas() {
|
||||
Composite composite = (Composite) leftComposite.getChildren()[0];
|
||||
GridLayout gridLayout2 = new GridLayout();
|
||||
gridLayout2.marginBottom = 0;
|
||||
gridLayout2.marginHeight = 0;
|
||||
gridLayout2.marginLeft = 0;
|
||||
gridLayout2.marginRight = 0;
|
||||
gridLayout2.marginTop = 0;
|
||||
gridLayout2.marginWidth = 0;
|
||||
gridLayout2.horizontalSpacing = 0;
|
||||
composite.setLayout(gridLayout2);
|
||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
Composite composite2 = (Composite) rightComposite.getChildren()[0];
|
||||
gridLayout2 = new GridLayout();
|
||||
gridLayout2.marginBottom = 0;
|
||||
gridLayout2.marginHeight = 0;
|
||||
gridLayout2.marginLeft = 0;
|
||||
gridLayout2.marginRight = 0;
|
||||
gridLayout2.marginTop = 0;
|
||||
gridLayout2.marginWidth = 0;
|
||||
gridLayout2.horizontalSpacing = 0;
|
||||
composite2.setLayout(gridLayout2);
|
||||
composite2.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,13 @@ import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveDownPushButtonFo
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.PastePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.RemovePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.RemovePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.ResetDBTypesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.SaveAsGenericSchemaPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.SelectContextVariablesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
|
||||
@@ -67,7 +69,11 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
protected ResetDBTypesPushButton resetDBTypesButton;
|
||||
|
||||
protected SelectContextVariablesPushButton selectContextVariablesButton;
|
||||
|
||||
protected CasePushButton caseButton;
|
||||
|
||||
protected QuotePushButton quoteButton;
|
||||
|
||||
/**
|
||||
* DOC amaumont MatadataToolbarEditor constructor comment.
|
||||
*
|
||||
@@ -103,7 +109,11 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
pasteButton = createPastePushButton();
|
||||
|
||||
addallButton = createAddAllPushButton();
|
||||
|
||||
|
||||
caseButton = createCasePushButton();
|
||||
|
||||
quoteButton = createQuotePushButton();
|
||||
|
||||
exportButton = createExportPushButton();
|
||||
|
||||
importButton = createImportPushButton();
|
||||
@@ -169,6 +179,14 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
protected SelectContextVariablesPushButton createSelectContextVariablesPushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected CasePushButton createCasePushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected QuotePushButton createQuotePushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for addButton.
|
||||
@@ -327,6 +345,14 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
if (getAddallButton() != null) {
|
||||
list.add(getAddallButton());
|
||||
}
|
||||
|
||||
if (getCaseButton() != null) {
|
||||
list.add(getCaseButton());
|
||||
}
|
||||
|
||||
if (getQuoteButton() != null) {
|
||||
list.add(getQuoteButton());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -348,6 +374,26 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
public AddAllPushButton getAddallButton() {
|
||||
return this.addallButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for caseButton.
|
||||
*
|
||||
* @return the caseButton
|
||||
*/
|
||||
public CasePushButton getCaseButton() {
|
||||
return this.caseButton;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for quoteButton.
|
||||
*
|
||||
* @return the quoteButton
|
||||
*/
|
||||
public QuotePushButton getQuoteButton() {
|
||||
return this.quoteButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.dataeditor.button;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedControlViewer;
|
||||
|
||||
public abstract class CasePushButton extends ExtendedPushButton {
|
||||
|
||||
/**
|
||||
* DOC CasePushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public CasePushButton(Composite parent, AbstractExtendedControlViewer extendedControlViewer) {
|
||||
super(parent, extendedControlViewer,
|
||||
Messages.getString("CasePushButton.CaseButton.Tip"), ImageProvider.getImage(EImage.UPPERCASE_ICON)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#getEnabledState()
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && !getExtendedControlViewer().isReadOnly();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.dataeditor.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class CasePushButtonForExtendedTable extends CasePushButton implements IExtendedTablePushButton {
|
||||
|
||||
private EnableStateListenerForTableButton enableStateHandler;
|
||||
private boolean isUpperCase = true;
|
||||
|
||||
/**
|
||||
* DOC CasePushButtonForExtendedTable constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public CasePushButtonForExtendedTable(Composite parent, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, extendedTableViewer);
|
||||
this.enableStateHandler = new EnableStateListenerForTableButton(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterCommandExecution(Command executedCommand) {
|
||||
super.afterCommandExecution(executedCommand);
|
||||
if (isUpperCase) {
|
||||
this.getButton().setToolTipText( Messages.getString("CasePushButton.CaseButton.Tip"));
|
||||
this.getButton().setImage(ImageProvider.getImage(EImage.LOWERCASE_ICON));
|
||||
this.isUpperCase = false;
|
||||
} else {
|
||||
this.getButton().setToolTipText( Messages.getString("CasePushButton.CaseButton.Tip"));
|
||||
this.getButton().setImage(ImageProvider.getImage(EImage.UPPERCASE_ICON));
|
||||
this.isUpperCase = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute() {
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
TableViewer tableViewer = extendedTableViewer.getTableViewerCreator().getTableViewer();
|
||||
ISelection selection = tableViewer.getSelection();
|
||||
StructuredSelection structuredSelection = (StructuredSelection) selection;
|
||||
Object[] objects = structuredSelection.toArray();
|
||||
int[] selectionIndices = extendedTableViewer.getTableViewerCreator().getTable().getSelectionIndices();
|
||||
return getCommandToExecute(extendedTableModel, Arrays.asList(objects), selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, boolean isUpperCase);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.ui.extended.button.IExtendedTablePushButton#getExtendedTableViewer()
|
||||
*/
|
||||
public AbstractExtendedTableViewer getExtendedTableViewer() {
|
||||
return (AbstractExtendedTableViewer) getExtendedControlViewer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && this.enableStateHandler.getEnabledState();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.dataeditor.button;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedControlViewer;
|
||||
|
||||
public abstract class QuotePushButton extends ExtendedPushButton {
|
||||
|
||||
private String dbmsId = null;
|
||||
|
||||
/**
|
||||
* DOC QuotePushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public QuotePushButton(Composite parent, AbstractExtendedControlViewer extendedControlViewer) {
|
||||
super(parent, extendedControlViewer,
|
||||
Messages.getString("QuotePushButton.QuoteButton.Tip"), ImageProvider.getImage(EImage.EDIT_ICON)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#getEnabledState()
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && !getExtendedControlViewer().isReadOnly();
|
||||
}
|
||||
|
||||
|
||||
public String getDbmsId() {
|
||||
return dbmsId;
|
||||
}
|
||||
|
||||
|
||||
public void setDbmsId(String dbmsId) {
|
||||
this.dbmsId = dbmsId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.dataeditor.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class QuotePushButtonForExtendedTable extends QuotePushButton implements IExtendedTablePushButton {
|
||||
|
||||
private String quote = null;
|
||||
private boolean isAddingQuote = true;
|
||||
private EnableStateListenerForTableButton enableStateHandler;
|
||||
|
||||
/**
|
||||
* DOC SchemaTargetAddPushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public QuotePushButtonForExtendedTable(Composite parent, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, extendedTableViewer);
|
||||
this.enableStateHandler = new EnableStateListenerForTableButton(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#beforeCommandExecution()
|
||||
*/
|
||||
@Override
|
||||
protected void beforeCommandExecution() {
|
||||
QuoteManipulateDialog dlg = new QuoteManipulateDialog(getButton().getShell());
|
||||
if (dlg.open() == Window.OK) {
|
||||
this.quote = dlg.getQuote();
|
||||
this.isAddingQuote = dlg.isAddingQuote();
|
||||
}
|
||||
}
|
||||
|
||||
protected Command getCommandToExecute() {
|
||||
if (quote == null) return null;
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
TableViewer tableViewer = extendedTableViewer.getTableViewerCreator().getTableViewer();
|
||||
ISelection selection = tableViewer.getSelection();
|
||||
StructuredSelection structuredSelection = (StructuredSelection) selection;
|
||||
Object[] objects = structuredSelection.toArray();
|
||||
int[] selectionIndices = extendedTableViewer.getTableViewerCreator().getTable().getSelectionIndices();
|
||||
return getCommandToExecute(extendedTableModel, Arrays.asList(objects), selectionIndices, quote, isAddingQuote );
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, String quote, boolean isAddingQuote);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.ui.extended.button.IExtendedTablePushButton#getExtendedTableViewer()
|
||||
*/
|
||||
public AbstractExtendedTableViewer getExtendedTableViewer() {
|
||||
return (AbstractExtendedTableViewer) getExtendedControlViewer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && this.enableStateHandler.getEnabledState();
|
||||
}
|
||||
|
||||
class QuoteManipulateDialog extends Dialog {
|
||||
|
||||
private Button addBtn;
|
||||
private Button removeBtn;
|
||||
private Text quoteTxt;
|
||||
private Button okBtn;
|
||||
boolean isAddingQuote = true;
|
||||
String quote = "";
|
||||
|
||||
public QuoteManipulateDialog(Shell parentShel) {
|
||||
super(parentShel);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
shell.setText(Messages.getString("QuoteManipulateDialog.title"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
// create OK and Cancel buttons by default
|
||||
okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
okBtn.setEnabled(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) Method declared on Dialog.
|
||||
*/
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 4;
|
||||
composite.setLayout(layout);
|
||||
GridData layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.widthHint = 400;
|
||||
composite.setLayoutData(layoutData);
|
||||
addBtn = new Button(composite, SWT.RADIO);
|
||||
addBtn.setSelection(true);
|
||||
Label label = new Label(composite, SWT.WRAP);
|
||||
label.setText(Messages.getString("QuoteManipulateDialog.addQuote")); //$NON-NLS-1$
|
||||
|
||||
removeBtn = new Button(composite, SWT.RADIO);
|
||||
Label label1 = new Label(composite, SWT.WRAP);
|
||||
label1.setText(Messages.getString("QuoteManipulateDialog.removeQuote")); //$NON-NLS-1$
|
||||
|
||||
quoteTxt = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
||||
layoutData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
layoutData.horizontalSpan = 4;
|
||||
quoteTxt.setLayoutData(layoutData);
|
||||
quoteTxt.setText("");
|
||||
quoteTxt.setFocus();
|
||||
|
||||
addBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
isAddingQuote = true;
|
||||
quoteTxt.setFocus();
|
||||
quote = quoteTxt.getText();
|
||||
}
|
||||
});
|
||||
|
||||
removeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
isAddingQuote = false;
|
||||
quoteTxt.setFocus();
|
||||
quote = quoteTxt.getText();
|
||||
}
|
||||
});
|
||||
|
||||
quoteTxt.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent e) {
|
||||
quote = quoteTxt.getText();
|
||||
if ( quote != null && quote.length() > 0) {
|
||||
okBtn.setEnabled(true);
|
||||
} else {
|
||||
okBtn.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return composite;
|
||||
}
|
||||
|
||||
public boolean isAddingQuote() {
|
||||
return this.isAddingQuote;
|
||||
}
|
||||
|
||||
public String getQuote() {
|
||||
return this.quote;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.dataeditor.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class ExtendedTableCaseCommand extends Command implements IExtendedTableCommand {
|
||||
|
||||
private ExtendedTableModel extendedTable;
|
||||
|
||||
private List beansToCovertCase;
|
||||
|
||||
private int[] selectionIndices;
|
||||
|
||||
private boolean isUpperCase;
|
||||
|
||||
|
||||
public static final String LABEL = Messages.getString("ExtendedTableCaseCommand.case.Label"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC ExtendedTableCaseCommand constructor comment.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
public ExtendedTableCaseCommand(ExtendedTableModel extendedTable, List beansToCovertCase, int[] selectionIndices, boolean isUpperCase) {
|
||||
super(LABEL);
|
||||
this.extendedTable = extendedTable;
|
||||
this.beansToCovertCase = new ArrayList(beansToCovertCase);
|
||||
this.selectionIndices = selectionIndices;
|
||||
this.isUpperCase = isUpperCase;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
convertCase(extendedTable, beansToCovertCase, selectionIndices, isUpperCase);
|
||||
|
||||
}
|
||||
|
||||
public abstract void convertCase(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, boolean isUpperCase);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#canUndo()
|
||||
*/
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#redo()
|
||||
*/
|
||||
@Override
|
||||
public void redo() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.advanced.dataeditor.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class ExtendedTableQuoteCommand extends Command implements IExtendedTableCommand {
|
||||
|
||||
private ExtendedTableModel extendedTable;
|
||||
|
||||
private List beansToQuote;
|
||||
|
||||
private int[] selectionIndices;
|
||||
|
||||
private String quote;
|
||||
|
||||
boolean isAddingQuote;
|
||||
|
||||
|
||||
public static final String LABEL = Messages.getString("ExtendedTableQuoteCommand.Quote.Label"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC ExtendedTableQuoteCommand constructor comment.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
public ExtendedTableQuoteCommand(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
super(LABEL);
|
||||
this.extendedTable = extendedTable;
|
||||
this.beansToQuote = new ArrayList(beansToQuote);
|
||||
this.selectionIndices = selectionIndices;
|
||||
this.quote = quote;
|
||||
this.isAddingQuote = isAddingQuote;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
toQuote(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
|
||||
}
|
||||
|
||||
public abstract void toQuote(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, String quote, boolean isAddingQuote);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#canUndo()
|
||||
*/
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#redo()
|
||||
*/
|
||||
@Override
|
||||
public void redo() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -240,7 +240,11 @@ public class BackgroundRefresher implements IBackgroundRefresher {
|
||||
|
||||
gc.dispose();
|
||||
|
||||
drawableComposite.getBgDrawableComposite().setBackgroundImage(newImage);
|
||||
if (WindowSystem.isBigSurOrLater()) {
|
||||
drawableComposite.refreshBgDrawableCompsite(newImage);
|
||||
} else {
|
||||
drawableComposite.getBgDrawableComposite().setBackgroundImage(newImage);
|
||||
}
|
||||
|
||||
clearImage(oldImage);
|
||||
oldImage = newImage;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.talend.commons.ui.swt.drawing.background;
|
||||
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
@@ -28,6 +29,8 @@ public interface IBgDrawableComposite {
|
||||
|
||||
public Composite getBgDrawableComposite();
|
||||
|
||||
public void refreshBgDrawableCompsite(Image image);
|
||||
|
||||
public void setOffset(Point offsetPoint);
|
||||
|
||||
public Point getOffset();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user