Compare commits

..

192 Commits

Author SHA1 Message Date
Sébastien Gandon
72194ae752 Merge release/5.2.1/tis_shared and release/5.2.1/tos for release/5.2.1. 2014-06-22 14:16:22 +02:00
sizhaoliu
b4bae1d6fe merge r95024 from trunk to branch 5.2
TDQ-6569 set Empty String if the tag of "DB ProductName" or "DB ProductVersion" is null.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@95049 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-10 10:59:26 +00:00
xqliu
cdb1987563 TDQ-5750 revert the commit 94963
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94973 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-07 08:46:32 +00:00
xqliu
0cfb90e704 merge r94962 from branch 5.1 to branch 5.2
TDQ-5750 TDQ-6565 save the reference resources and refresh the analysis editor after rename a FileConnection


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94963 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-07 07:44:23 +00:00
nrousseau
3a89a8f70c merge r94921 from trunk to branch 5.2
For bug TDI-24027


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94926 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-06 11:52:16 +00:00
wchen
14d1cf918c merge r94905 from trunk to branch 5.2
bug TDI-24074 fixed: Manual create a xml file will cause a NPE error 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94911 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-06 09:20:32 +00:00
nrousseau
5dbbf4355c merge r94877 from trunk to branch 5.2
TDI-24055 : fix problem of item loading during the logon of the studio (emf don't use yet the platform URI, but file URI)


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94878 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-06 04:25:57 +00:00
msjian
dfdda1fa78 merge r94778 from trunk to branch 5.2
TDQ-6534:fix this issue by filterd out the "embeded" in list "hive mode" completely


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94801 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-04 11:11:21 +00:00
nrousseau
2068b4c92b merge r94799 from trunk to branch 5.2
For bug TDI-23399


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94800 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-04 11:07:53 +00:00
nrousseau
a0f11f6306 merge r94720 from trunk to branch 5.2
TDI-23995 : fix problem of export when a screenshot is missing and allow to edit anything even if the screenshot is missing


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_2@94741 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-12-03 09:44:00 +00:00
mwang
9408850da9 For bug TDI-23719
git-svn-id: http://talendforge.org/svn/tos/trunk@94696 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-30 12:30:24 +00:00
mwang
12ab02c77c For bug TDI-23719
git-svn-id: http://talendforge.org/svn/tos/trunk@94693 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-30 12:08:33 +00:00
ilazebny
1290bba2bc Update version to 5.2.1 in poms
git-svn-id: http://talendforge.org/svn/tis_shared/trunk@94678 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-30 09:07:35 +00:00
ilazebny
b771d41167 Update version to 5.2.1 in poms
git-svn-id: http://talendforge.org/svn/tos/trunk@94677 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-30 09:07:23 +00:00
yyin
073a1b6d6e TDQ-6485 fixed: when click "check" on database wizard and then finish should not popup reload dialog.
git-svn-id: http://talendforge.org/svn/tos/trunk@94665 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-30 07:40:48 +00:00
mzhao
de6e63ed40 TDQ-6160 connecting to metastore with JDBC method, the thrift parameters are not needed.
git-svn-id: http://talendforge.org/svn/tos/trunk@94640 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 14:21:33 +00:00
plv
cc9959aedf bug TDI-23507:revert
git-svn-id: http://talendforge.org/svn/tos/trunk@94625 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 10:59:26 +00:00
wchen
fc2837bb1c bug TDI-23745 fixed: select context group list box only appear once when checking connection
git-svn-id: http://talendforge.org/svn/tos/trunk@94623 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 10:42:20 +00:00
nrousseau
1e68b00375 TDI-23971 : fix exceptions found from logs, just needs to have another temporary list when check from repository
git-svn-id: http://talendforge.org/svn/tos/trunk@94605 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 08:47:06 +00:00
hwang
e6f123e400 TDI-22839:Other joblets used in job locked when joblet saved
git-svn-id: http://talendforge.org/svn/tos/trunk@94602 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 08:32:47 +00:00
zshen
50ba17ea27 TDQ-6518 MDMWizard don't care about label and name property of connection when change name
git-svn-id: http://talendforge.org/svn/tos/trunk@94597 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 08:16:43 +00:00
fwang
3d0883d83d bug TDI-23890 fixed:Schemas and XML Export/Import feature
git-svn-id: http://talendforge.org/svn/tos/trunk@94595 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 08:02:16 +00:00
plv
a4604938ac bug TDI-23507:SQLserver JDBC: the sql of Guess Schema is wrong
git-svn-id: http://talendforge.org/svn/tos/trunk@94594 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 07:51:04 +00:00
nrousseau
322edb9e8b TDI-23966 : fixed, this will improve the speed of logon project, maybe not only for reference project, but also for single project on svn.
git-svn-id: http://talendforge.org/svn/tos/trunk@94577 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-29 06:11:00 +00:00
scorreia
898eac2281 i18n: synchronize Babili strings exported on 2012-11-28-18-05-51
git-svn-id: http://talendforge.org/svn/tos/trunk@94565 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 17:15:14 +00:00
mzhao
a93bc9b88c TDQ-6160 Profiling hive feature in embedded mode.
git-svn-id: http://talendforge.org/svn/tos/trunk@94555 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 14:35:16 +00:00
fwang
31c92aa35f bug TDI-23257 fixed:When drag&drop more a context or a metadata with a context linked, it should ask to copy all context group.
git-svn-id: http://talendforge.org/svn/tos/trunk@94534 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 10:23:49 +00:00
wchen
5f711bb746 bug TDI-23942 :DB connection :Export context:add another new group value for it : retreive schema, only one database can be detect
git-svn-id: http://talendforge.org/svn/tos/trunk@94510 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 07:19:22 +00:00
wchen
e38bc0f06b bug TDI-23745 fixed: select context group list box only appear once when checking connection
git-svn-id: http://talendforge.org/svn/tos/trunk@94507 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 07:13:23 +00:00
gliu
32f7bf8187 [TESB-7615] fixed:
Wrong Code Completion in JavaDSLProcessor

git-svn-id: http://talendforge.org/svn/tos/trunk@94498 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 06:17:08 +00:00
xqliu
f13fd458aa TDQ-6291 TDQ-6363 fix the problem: after reload a sybase, there will show schemas under connection
git-svn-id: http://talendforge.org/svn/tos/trunk@94489 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-28 03:54:18 +00:00
sizhaoliu
1ff4b3f557 TDQ-6481 TDQ-6501 add missing commit
git-svn-id: http://talendforge.org/svn/tos/trunk@94479 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 18:01:52 +00:00
ycbai
f29c206e7e bug TDI-23693 fixed : Exporting a Job as an Autonomous Job results in 1KB JAR files which fail to include the Job Classes
git-svn-id: http://talendforge.org/svn/tos/trunk@94461 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 11:04:18 +00:00
nrousseau
b516efe1ed TDI-23927 fixed: modify from enumeration directly
git-svn-id: http://talendforge.org/svn/tos/trunk@94458 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 10:48:17 +00:00
fwang
6b9c7c35a4 bug TDI-23943 fixed:If delete the column name in schema dialog of tRowGenerator, the Studio is blocked. Must kill the studio.
git-svn-id: http://talendforge.org/svn/tos/trunk@94455 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 10:18:41 +00:00
zshen
fd7be330b9 TDQ-6356 syn cache on the connectionUtils to fixed analysis execute fail
git-svn-id: http://talendforge.org/svn/tos/trunk@94449 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 09:12:43 +00:00
qiongli
c770c57486 TDQ-6437 TUP-273 Optimize code(extract out function 'openDependcesDialog').
git-svn-id: http://talendforge.org/svn/tos/trunk@94433 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 07:46:02 +00:00
hcyi
a9830686e0 bug TDI-22861 fixed : Can't start the studio if the AMC database is big .
git-svn-id: http://talendforge.org/svn/tos/trunk@94409 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-27 05:50:42 +00:00
plv
3e66a19b49 bug TDI-22005:No longer possible to read or conduct impact analysis on deleted items
git-svn-id: http://talendforge.org/svn/tos/trunk@94374 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 10:19:48 +00:00
wchen
68247df2ab bug TDI-23745 fixed: select context group list box only appear once when checking connection
git-svn-id: http://talendforge.org/svn/tos/trunk@94372 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 10:08:30 +00:00
nrousseau
8cffb66f47 TDI-23913 : fixed problem when try to refresh some items not existing anymore or items who can't display anymore.
git-svn-id: http://talendforge.org/svn/tos/trunk@94358 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 08:37:49 +00:00
mwang
16cea2beb3 For bug TDI-23399
git-svn-id: http://talendforge.org/svn/tos/trunk@94350 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 07:59:21 +00:00
mwang
61e303d05c For bug TDI-23719 and TDI-23399
git-svn-id: http://talendforge.org/svn/tos/trunk@94347 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 07:32:01 +00:00
jjzhou
3a9023bf9f Fix Bug TDI-23184 : trunjob: BufferOutput + tAggregateRow with List returns wrong List parent job
https://jira.talendforge.org/browse/TDI-23184

git-svn-id: http://talendforge.org/svn/tos/trunk@94339 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 06:53:57 +00:00
plv
8506faa505 bug TDI-20748:pop "Choose Context" dialog twice when edit schema with context model
git-svn-id: http://talendforge.org/svn/tos/trunk@94328 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 05:32:19 +00:00
xqliu
b702c56e55 TDQ-6185 TDQ-6419 don't use IWorkspaceRunnable in method LocalRepositoryFactory.moveFolder() because this method will be called recursive
git-svn-id: http://talendforge.org/svn/tos/trunk@94322 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 03:26:16 +00:00
msjian
4b39009d67 TDQ-6407: for top, not support hive embeded mode, so hide some menus
git-svn-id: http://talendforge.org/svn/tos/trunk@94316 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 03:09:02 +00:00
plv
9318abc4e9 bug TDI-22005:No longer possible to read or conduct impact analysis on deleted items
git-svn-id: http://talendforge.org/svn/tos/trunk@94315 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 03:07:26 +00:00
ycbai
02e77af11b bug TDI-23861 fixed : Loading JDBC connection from metadata repository add additional colon
git-svn-id: http://talendforge.org/svn/tos/trunk@94313 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-26 03:02:45 +00:00
qiongli
de398b1bcc TDQ-6437 TUP-273 (1)Give a warning when physical delete (or empty recycle bin )a folder in DI and contain connection depended by others.
(2)replace 'handleResourceChange' with 'hasDependcesInDQ'.add 'canEmptyRecycleBin' in TDQResourceChangedHandler.

git-svn-id: http://talendforge.org/svn/tos/trunk@94296 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 12:03:58 +00:00
qiongli
3086d14035 TDQ-6489 Optimize code of TDQ-6287.
git-svn-id: http://talendforge.org/svn/tos/trunk@94280 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 09:49:41 +00:00
qiongli
dd64c4c38c TDQ-6489 Optimize code of TDQ-6287.
git-svn-id: http://talendforge.org/svn/tos/trunk@94279 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 09:48:59 +00:00
plv
eec07d2941 bug TDI-22005:No longer possible to read or conduct impact analysis on deleted items
git-svn-id: http://talendforge.org/svn/tos/trunk@94278 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 09:43:40 +00:00
cli
9e6f270797 TUP-264: check the cache for lib and components
git-svn-id: http://talendforge.org/svn/tos/trunk@94269 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 07:58:52 +00:00
xqliu
996b2bbaae TDQ-6185 TDQ-6419 fix the problems when do the following operations in remote project mode: 1) rename a report; 2) drag&drop a report; 3) rename a report folder; 4) drag&drop a report folder; 5) delete report; 6) delete generated doc of report
git-svn-id: http://talendforge.org/svn/tos/trunk@94259 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 07:24:14 +00:00
cli
f95e644a5e TUP-264: check the cache for lib and components
git-svn-id: http://talendforge.org/svn/tos/trunk@94255 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 06:28:33 +00:00
zwzhao
ca86b3d911 bug TDI-23846 fixed : In SVN project, if a job is locked by userA, its jobscript can be edit by userB
git-svn-id: http://talendforge.org/svn/tos/trunk@94253 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 06:25:36 +00:00
wchen
7e3a95cacc bug TDI-23840 fixed: Get error when create connection
git-svn-id: http://talendforge.org/svn/tos/trunk@94233 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-23 02:32:36 +00:00
sgandon
f604d95fa1 Fix junit ant script to launch the test with a Studio.
update the script to use the properties prefix and suffix in the bundle selection

git-svn-id: http://talendforge.org/svn/tos/trunk@94222 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-22 14:46:47 +00:00
mwang
70a4cfd375 For bug TDQ-6462, just forgot to clear the configurations.
git-svn-id: http://talendforge.org/svn/tos/trunk@94206 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-22 08:51:24 +00:00
mwang
cbcbafa52f For bug TDQ-6462
git-svn-id: http://talendforge.org/svn/tos/trunk@94205 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-22 08:40:06 +00:00
hcyi
af55c03442 bug TUP-250 fixed : use jtds connect sqlserver database twice check failed(SSO) .
git-svn-id: http://talendforge.org/svn/tos/trunk@94197 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-22 07:59:26 +00:00
ycbai
5972f0cec4 bug TDI-22580 fixed : Hbase connection wizard: No db type and version option
git-svn-id: http://talendforge.org/svn/tos/trunk@94194 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-22 07:50:27 +00:00
fwang
ae97890240 bug TDI-23357 fixed:.dll can't be installed from modules view.
git-svn-id: http://talendforge.org/svn/tos/trunk@94191 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-22 07:30:55 +00:00
sgandon
5901144528 Fix junit ant script to launch the test with a Studio like the real product (using org.talend.configurator).
It creates a extrabundles.info by looking at all plugin starting with org.talend and ending with test.

git-svn-id: http://talendforge.org/svn/tos/trunk@94138 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-21 13:04:16 +00:00
cli
1ee049ed17 TUP-292: add two parameters to support logon remote project, when bootstrap
git-svn-id: http://talendforge.org/svn/tos/trunk@94088 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-21 06:20:31 +00:00
wchen
4649721f96 bug TDI-23840 fixed: Get error when create connection
git-svn-id: http://talendforge.org/svn/tos/trunk@94062 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-21 03:57:15 +00:00
plv
951b035c16 bug TDI-23794:drag&drop problem on oracle component,Db version is missing.
git-svn-id: http://talendforge.org/svn/tos/trunk@94041 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-21 03:09:52 +00:00
mwang
c330f6a1cc For bug TDI-23719, just add two parameters for getting data from HDFS
git-svn-id: http://talendforge.org/svn/tos/trunk@94036 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-21 02:10:40 +00:00
cli
0b1a118327 TDI-23641: enable to add/remove the classpath.jar when export job.
git-svn-id: http://talendforge.org/svn/tos/trunk@94013 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-20 09:55:32 +00:00
plv
c4c328deaf bug TDI-20748:pop "Choose Context" dialog twice when edit schema with context model
git-svn-id: http://talendforge.org/svn/tos/trunk@93999 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-20 07:09:01 +00:00
hcyi
43c35c79ec bug TUP-250 fixed : use jtds connect sqlserver database twice check failed(SSO) .
git-svn-id: http://talendforge.org/svn/tos/trunk@93978 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-20 02:35:39 +00:00
zwzhao
dd6f028573 bug TDI-23645 fixed : Web service of reference project can be edit in main project
git-svn-id: http://talendforge.org/svn/tos/trunk@93950 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-19 09:09:58 +00:00
wchen
e30f028102 bug TDI-23526 fixed :Can not use context for the MappingFile in the JDBC metadata
git-svn-id: http://talendforge.org/svn/tos/trunk@93946 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-19 08:33:23 +00:00
bchen
8c930e257c Fix Bug TDI-22821 : Flow time statistics after iterate cumulative
https://jira.talendforge.org/browse/TDI-22821

git-svn-id: http://talendforge.org/svn/tos/trunk@93942 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-19 07:34:54 +00:00
plv
c22ccb9d9e bug TDI-20748:revert code
git-svn-id: http://talendforge.org/svn/tos/trunk@93937 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-19 06:53:43 +00:00
hwang
125f8ce5a5 TDI-21955:Closed jobs updated when joblet changed
git-svn-id: http://talendforge.org/svn/tos/trunk@93930 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-19 06:24:56 +00:00
qiongli
835168e3d1 TDQ-6287 refresh the node parent when rename a connection in wizard.
git-svn-id: http://talendforge.org/svn/tos/trunk@93908 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-19 02:55:28 +00:00
wwang
71a4b4026c Fix Bug TDI-23699 : Check Ignore data out of range on tMSSqlOutput component throw error when input data type is DateTimeOffSet
https://jira.talendforge.org/browse/TDI-23699

git-svn-id: http://talendforge.org/svn/tos/trunk@93862 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-16 06:05:44 +00:00
fwang
822fc56947 bug TDI-23716 fixed:Create items in Metadata,when type a name there is no check
git-svn-id: http://talendforge.org/svn/tos/trunk@93861 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-16 05:52:51 +00:00
gliu
0d7d2a6134 [TESB-7603] fixed:
Re-order the ROUTE and ROUTE_WHEN

git-svn-id: http://talendforge.org/svn/tos/trunk@93860 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-16 04:15:10 +00:00
yyin
6a57518144 TDQ-6395 save the dependency of the connection when the name is changed
git-svn-id: http://talendforge.org/svn/tos/trunk@93857 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-16 03:59:50 +00:00
yyin
ec200a7ce7 TDQ-6395 save the dependency of the connection when name is changed
git-svn-id: http://talendforge.org/svn/tos/trunk@93856 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-16 03:58:14 +00:00
hcyi
acd8ce8499 bug TDI-23477 fixed : Set the dependency of the wizards dynamic for the module view .
git-svn-id: http://talendforge.org/svn/tos/trunk@93825 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-15 09:07:02 +00:00
ycbai
b8fdde0195 fix compile error.
git-svn-id: http://talendforge.org/svn/tos/trunk@93795 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-15 02:00:42 +00:00
fwang
1510486bd3 bug TDI-23345 fixed:DataOperation.FIX(value) Expression's Help explanation is incorrect
git-svn-id: http://talendforge.org/svn/tos/trunk@93794 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-15 01:52:39 +00:00
scorreia
c521f72efa some code cleansing
git-svn-id: http://talendforge.org/svn/tos/trunk@93787 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-14 15:25:48 +00:00
hcyi
60deb083fa bug TDI-23477 fixed : Set the dependency of the wizards dynamic for the module view .
git-svn-id: http://talendforge.org/svn/tos/trunk@93775 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-14 10:05:03 +00:00
wliu
f1f16757bb Fix Bug TDI-22891: revert the commit to the previous r89138
https://jira.talendforge.org/browse/TDI-22891

git-svn-id: http://talendforge.org/svn/tos/trunk@93765 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-14 08:15:50 +00:00
wliu
d42e5f2b49 Fix Bug TDI-22891: optimize the code to reduce memory
https://jira.talendforge.org/browse/TDI-22891

git-svn-id: http://talendforge.org/svn/tos/trunk@93762 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-14 07:24:52 +00:00
ycbai
170dd05b71 bug TDI-23508 fixed : can't export job with "OSGI Bundle For Esb" type and maven script in commandline
git-svn-id: http://talendforge.org/svn/tos/trunk@93750 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-14 05:43:16 +00:00
msjian
7fd3444033 TDQ-6302: revert the last commit
git-svn-id: http://talendforge.org/svn/tos/trunk@93736 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-14 03:00:06 +00:00
msjian
758aa56866 TDQ-6302: delete the useless code
git-svn-id: http://talendforge.org/svn/tos/trunk@93705 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-13 10:24:59 +00:00
plv
a567b60ed1 bug TDI-23424:Need to review the display of the db wizard
git-svn-id: http://talendforge.org/svn/tos/trunk@93678 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-13 08:47:02 +00:00
zwzhao
165d3b1776 bug TDI-23419 fixed : Update the links to the Documentation Guides on the Welcome page
git-svn-id: http://talendforge.org/svn/tos/trunk@93674 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-13 08:00:26 +00:00
zshen
778d569ed9 TDQ-6394 fixed a bug when judge whether sid or uischema is null.
fixed another bug when in context mode too many times added for filterList.

git-svn-id: http://talendforge.org/svn/tos/trunk@93669 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-13 06:43:15 +00:00
plv
b19c5364df bug TDI-23507:SQLserver JDBC: the sql of Guess Schema is wrong
git-svn-id: http://talendforge.org/svn/tos/trunk@93638 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-13 02:16:53 +00:00
sgandon
f869c17101 fix demo of repo view because of Interface change.
git-svn-id: http://talendforge.org/svn/tos/trunk@93622 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 12:49:30 +00:00
mzhao
1b2960f889 TDQ-6417 the returned password must not a null value. make it to "" if null.
git-svn-id: http://talendforge.org/svn/tos/trunk@93619 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 10:49:42 +00:00
zshen
c540d26be4 TDQ-5645 some lost code.
git-svn-id: http://talendforge.org/svn/tos/trunk@93614 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 10:26:36 +00:00
zshen
e3e5267080 TDQ-5645 some lost code.
git-svn-id: http://talendforge.org/svn/tos/trunk@93613 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 10:26:24 +00:00
ycbai
1c7fd683c7 bug TDI-23453 fixed : Need to add a way to set bundleId for system routines defined by extension point
git-svn-id: http://talendforge.org/svn/tos/trunk@93599 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 09:48:17 +00:00
qiongli
3cbfbaec44 TDQ-6166 add a function 'initAllConnectionsToSQLExplorer' to init connections for DataExploer perspective.
git-svn-id: http://talendforge.org/svn/tos/trunk@93595 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 09:29:54 +00:00
zwzhao
d1fdb65322 bug TDI-23419 fixed : Update the links to the Documentation Guides on the Welcome page
git-svn-id: http://talendforge.org/svn/tos/trunk@93579 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 06:25:58 +00:00
nrousseau
bf56b190cf TDI-23674 fixed: fix problem of latest version.
git-svn-id: http://talendforge.org/svn/tos/trunk@93572 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-12 03:56:31 +00:00
sizhaoliu
a548a15faa TDQ-5280 TDQ-6414 drag and drop a BRMS connection to job. the TAC_WEBAPP field is still empty.
git-svn-id: http://talendforge.org/svn/tos/trunk@93554 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 15:38:39 +00:00
sizhaoliu
c5d25f3c7d TDQ-5280 TDQ-6414 propagated TAC_WEBAPP from component to wizard
git-svn-id: http://talendforge.org/svn/tos/trunk@93552 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 14:14:26 +00:00
xqliu
d4842a6d35 TDQ-6291 TDQ-6363 fix the problem when the login don't have the permission to the catalog which user input in the database wizard page for Sybase database
git-svn-id: http://talendforge.org/svn/tos/trunk@93551 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 11:12:35 +00:00
wchen
63ae424e6c bug TUP-268 fixed: Merge project:if have a new route under "Meditation" perspective, and under main project "Integration" perspective, try to merge the project, get error
git-svn-id: http://talendforge.org/svn/tos/trunk@93547 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 10:31:13 +00:00
ldong
83597d7b51 bug TDI-23371 fixed:<Tag Management>:do Revert action, get warning.
git-svn-id: http://talendforge.org/svn/tos/trunk@93509 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 05:57:00 +00:00
fwang
4b53282447 bug TDI-23454 fixed: shortcut key ( ctrl+c or ctrl+drag on job ) to copy job didn't work
git-svn-id: http://talendforge.org/svn/tos/trunk@93495 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 03:39:40 +00:00
fwang
25ed3b60a3 bug TDI-23345 fixed:DataOperation.FIX(value) Expression's Help explanation is incorrect
git-svn-id: http://talendforge.org/svn/tos/trunk@93484 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-09 02:11:48 +00:00
xqliu
9378db4d61 TDQ-6291 TDQ-6363 1) fix the problem of reload sybase connection; 2) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@93460 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 11:07:39 +00:00
sgandon
31a951bce1 Fix task : Make SwtBot Test work with multiple Licence
remove the .JetEmmiters folder before every launch to avoid an issue (TDI-23640)

git-svn-id: http://talendforge.org/svn/tos/trunk@93459 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 10:58:11 +00:00
fwang
5815fedfb3 bug TDI-23257 fixed:When drag&drop more a context or a metadata with a context linked, it should ask to copy all context group.
git-svn-id: http://talendforge.org/svn/tos/trunk@93447 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 10:03:36 +00:00
hwang
671d85f6b9 TDI-22770:Joblet changes that do not affect input/output should not trigger job update detection
git-svn-id: http://talendforge.org/svn/tos/trunk@93436 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 08:53:30 +00:00
ycbai
5d11b7628b bug TDI-23588 fixed : If the namenode URL is incorrect in a component, file browser timeout is too long and none error is raised
git-svn-id: http://talendforge.org/svn/tos/trunk@93431 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 08:08:48 +00:00
mwang
6da79b1749 For bug TDI-23415, we assumed that all jars from user's choose are in our libs manager.
git-svn-id: http://talendforge.org/svn/tos/trunk@93425 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 07:46:06 +00:00
xqliu
949c5ccd48 TDQ-6389 TDQ-6393 1) remove the useless judgement codes; 2) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@93424 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 07:41:50 +00:00
cli
c882cf1b7e TDI-23377: enable to export the route with cTalendJob nodes and Maven option.
git-svn-id: http://talendforge.org/svn/tos/trunk@93419 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 07:25:46 +00:00
xqliu
44bf4250ef TDQ-6389 TDQ-6393 1) use the login name as the database name when user don't input it; 2) show database as a catalog; 3) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@93406 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-08 04:10:49 +00:00
mwang
74a9f5be23 For bug TDI-12596, from the screenshots, only schema can not be propagated to metadata db.
git-svn-id: http://talendforge.org/svn/tos/trunk@93380 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 10:06:11 +00:00
plv
7dd9eaf7ad bug TDI-23507:SQLserver JDBC: the sql of Guess Schema is wrong
git-svn-id: http://talendforge.org/svn/tos/trunk@93355 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 07:39:12 +00:00
mwang
eb0573cb9a For bug TDI-23523
git-svn-id: http://talendforge.org/svn/tos/trunk@93347 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 06:55:03 +00:00
fwang
0cd35912aa bug TDI-23454 fixed:shortcut key ( ctrl+c or ctrl+drag on job ) to copy job didn't work
git-svn-id: http://talendforge.org/svn/tos/trunk@93340 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 06:05:40 +00:00
zshen
06ff32e8e2 TDQ-6356 merge cache map between ConnectionUtils and MetadataConnectionUtils
git-svn-id: http://talendforge.org/svn/tos/trunk@93336 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 04:30:19 +00:00
zshen
2198387403 TDQ-6356 upgrate jtds.jar from 1.2 to 1.2.5 to resolve getSchema is user issue
git-svn-id: http://talendforge.org/svn/tos/trunk@93333 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 04:27:33 +00:00
mwang
413ca62cf4 For bug TUP-221
git-svn-id: http://talendforge.org/svn/tos/trunk@93329 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 03:51:51 +00:00
msjian
4c9ce8c140 TDQ-3574: add javadoc for these classes
git-svn-id: http://talendforge.org/svn/tos/trunk@93327 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-07 03:37:52 +00:00
zwzhao
a5059ad8b3 bug TDI-23419 fixed : Update the links to the Documentation Guides on the Welcome page
git-svn-id: http://talendforge.org/svn/tos/trunk@93303 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 10:03:47 +00:00
ycbai
747c1ac4dc bug TDI-23528 fixed : Can't create the remote conneciton if install path contain blank space
git-svn-id: http://talendforge.org/svn/tos/trunk@93301 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 09:58:55 +00:00
zwzhao
e2a6cd769e bug TDI-22320 fixed : Message should pop up to remind user there are jobs locked when delete folder contains locked jobs
git-svn-id: http://talendforge.org/svn/tos/trunk@93286 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 08:58:36 +00:00
ldong
a30482c431 bug TDI-23482 fixed:The studio do not send TAC the branch/tag it connects to at session opening.
git-svn-id: http://talendforge.org/svn/tos/trunk@93284 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 08:57:58 +00:00
plv
002e80155c bug TDI-23200:'#' Character in Password does not work
git-svn-id: http://talendforge.org/svn/tos/trunk@93282 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 08:49:17 +00:00
ycbai
c720071d56 bug TDI-23550 fixed : check API used to generate xml metadata from XSD
git-svn-id: http://talendforge.org/svn/tos/trunk@93253 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 02:43:40 +00:00
rbaldwin
cada111ad6 TOS specific changes related to the partitioning components. Most notably TDI-23122.
git-svn-id: http://talendforge.org/svn/tos/trunk@93246 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-06 00:20:19 +00:00
zshen
ed1715a077 TDQ-6356 to resolve only one schema display when empry UiSchema to create a new mssql connection
git-svn-id: http://talendforge.org/svn/tos/trunk@93227 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-05 07:33:48 +00:00
zwzhao
9672d061ab bug TDI-22320 fixed : Message should pop up to remind user there are jobs locked when delete folder contains locked jobs
git-svn-id: http://talendforge.org/svn/tos/trunk@93213 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-05 03:42:45 +00:00
ycbai
680a811621 bug TDI-23544 fixed : Cannot open project in studio
git-svn-id: http://talendforge.org/svn/tos/trunk@93212 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-05 02:55:12 +00:00
ycbai
0991ea14ec bug TDI-23178 fixed : Error when import a full project initialized by a different type of product (MDM > DQ/DI or DQ > DI)
git-svn-id: http://talendforge.org/svn/tos/trunk@93181 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-02 09:14:11 +00:00
plv
6bde1d62a3 bug TDI-23200:'#' Character in Password does not work
git-svn-id: http://talendforge.org/svn/tos/trunk@93175 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-02 09:00:46 +00:00
plv
c08589d2f0 bug TDI-23200:'#' Character in Password does not work
git-svn-id: http://talendforge.org/svn/tos/trunk@93152 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-02 02:51:22 +00:00
hcyi
3b98a3cc10 bug TDI-23426 fixed : upgrade the jar from mysql-connector-JAVA-5.1.0-bin.jar to mysql-connector-JAVA-5.1.22-bin.jar for studio part .
git-svn-id: http://talendforge.org/svn/tos/trunk@93135 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-01 09:57:12 +00:00
ycbai
6d6e9c178d bug TDI-22580 fixed : Hbase connection wizard: No db type and version option
git-svn-id: http://talendforge.org/svn/tos/trunk@93130 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-01 08:30:01 +00:00
ycbai
a8f36215fe bug TDI-22580 fixed : Hbase connection wizard: No db type and version option
git-svn-id: http://talendforge.org/svn/tos/trunk@93127 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-01 07:49:23 +00:00
xqliu
0804619f5b TDQ-6291 TDQ-6363 1) externalize strings 3) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@93118 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-01 04:41:04 +00:00
nrousseau
a356ebe5d7 TDI-23336 fixed: forbid any deletion of item in offline mode, allow for now the move item, enhance a little the dialog of changes detected.
git-svn-id: http://talendforge.org/svn/tos/trunk@93110 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-11-01 02:21:10 +00:00
sgandon
bf7f18a9ed make ant plugin unpack
git-svn-id: http://talendforge.org/svn/tos/trunk@93087 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 10:42:22 +00:00
xqliu
d7bdfa5dff TDQ-6291 TDQ-6363 1) refactory the method org.talend.utils.sql.ConnectionUtils.createConnection(String url, Driver driver, Properties props); 2) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@93061 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 08:53:31 +00:00
zshen
150e1b3846 TDQ-6041 TDQ-6345 Code optimize for commits on TDQ-6200
git-svn-id: http://talendforge.org/svn/tos/trunk@93056 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 08:17:19 +00:00
zshen
c5fa78da97 TDQ-6041 TDQ-6345 Code optimize for commits on TDQ-6200
git-svn-id: http://talendforge.org/svn/tos/trunk@93055 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 08:17:02 +00:00
wliu
1ddc72f5ef Fix Bug TDI-23184 : trunjob: BufferOutput + tAggregateRow with List returns wrong List parent job
https://jira.talendforge.org/browse/TDI-23184

git-svn-id: http://talendforge.org/svn/tos/trunk@93045 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 07:01:52 +00:00
wliu
2a104abf3b Fix Bug TDI-23184 : trunjob: BufferOutput + tAggregateRow with List returns wrong List parent job
https://jira.talendforge.org/browse/TDI-23184

git-svn-id: http://talendforge.org/svn/tos/trunk@93044 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 06:56:22 +00:00
fwang
19eb1997cf bug TDI-23357 fixed:.dll can't be installed from modules view.
git-svn-id: http://talendforge.org/svn/tos/trunk@93028 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-31 02:20:51 +00:00
cli
74f3d2910d TDI-23491: add the modifications
git-svn-id: http://talendforge.org/svn/tos/trunk@93013 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-30 10:10:16 +00:00
wchen
eb35ccccca bug TDI-23383 fixed : Merge reference project can not work
git-svn-id: http://talendforge.org/svn/tos/trunk@93012 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-30 10:06:21 +00:00
xqliu
119d11621d TDQ-6291 TDQ-6363 1) get sybase structure information from system tables; 2) do some code cleaning; 3) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@93010 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-30 10:04:19 +00:00
ycbai
b80af2672a fix missing ant lib bug
git-svn-id: http://talendforge.org/svn/tos/trunk@92985 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-30 05:54:11 +00:00
hcyi
ee5770ab24 bug TDI-23426 fixed : upgrade the jar from mysql-connector-java-5.1.0-bin.jar to mysql-connector-java-5.1.22-bin.jar for studio part .
git-svn-id: http://talendforge.org/svn/tos/trunk@92974 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-30 03:27:23 +00:00
wchen
3994cbd601 bug TDQ-6274 fixed: manually change label or db column won't lost the analysis
git-svn-id: http://talendforge.org/svn/tos/trunk@92973 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-30 03:15:42 +00:00
wchen
c15cec0699 bug TDI-23218 fixed: Unable to associate a fixed value with an XML element (duplicate to 0011723 which is NOT FIXED)
git-svn-id: http://talendforge.org/svn/tos/trunk@92947 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-29 07:42:44 +00:00
ycbai
874a0c4235 bug TDI-23389 fixed : Enhance the Services script manager to export with Maven option
git-svn-id: http://talendforge.org/svn/tos/trunk@92944 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-29 07:34:28 +00:00
xqliu
453536e41f TDQ-6291 TDQ-6363 1) code clean for MetadataConnectionUtils.java and DBConnectionFillerImpl.java; 2) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@92942 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-29 07:32:01 +00:00
cli
45bf2e9e3b TDI-23390: add the service karaf preference page.
git-svn-id: http://talendforge.org/svn/tos/trunk@92933 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-29 06:31:24 +00:00
mwang
c2a3c802da For bug TDI-22983, the fixes do not display the dialog to choose a context.
git-svn-id: http://talendforge.org/svn/tos/trunk@92927 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-29 04:18:57 +00:00
kpchen
b1f75fce20 TDI-23256, Get screenshot from generated zip instead of svn for stats:
add an opitional parameter to unzip method, Case-insensitive Suffixes , if these parameter are set, only the files named with these suffixes will be extracted.

git-svn-id: http://talendforge.org/svn/tos/trunk@92878 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-26 10:09:55 +00:00
hcyi
15831dbae7 bug TDI-23468 fixed : open refence service item in main project , have another problems .
git-svn-id: http://talendforge.org/svn/tos/trunk@92861 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-26 09:06:53 +00:00
cli
d3b618bd43 TDI-23391: refactor to enhance to split the lib with provided-lib and fix a problem for karaf preference page.
git-svn-id: http://talendforge.org/svn/tos/trunk@92841 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-26 06:02:35 +00:00
wchen
d88f81a451 bug TDQ-6274 fixed: manually change label or db column won't lost the analysis
git-svn-id: http://talendforge.org/svn/tos/trunk@92834 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-26 04:05:01 +00:00
fwang
22a15e0be7 bug TDI-23408 fixed:Close repository view / reopen, impossible to do any double click in any item.
git-svn-id: http://talendforge.org/svn/tos/trunk@92828 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-26 01:35:40 +00:00
sizhaoliu
a83d1f64ea Backport script : Handle branches starting with "branch-"
git-svn-id: http://talendforge.org/svn/tos/trunk@92821 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 13:07:06 +00:00
ilazebny
271975215a Update version in poms to 5.2.1-SNAPSHOT
git-svn-id: http://talendforge.org/svn/tis_shared/trunk@92816 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 12:06:20 +00:00
ilazebny
4ac002a57e Update version in poms to 5.2.1-SNAPSHOT
git-svn-id: http://talendforge.org/svn/tos/trunk@92815 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 12:05:57 +00:00
mwang
da1153f73e TDQ-6359, a tmp solution.
git-svn-id: http://talendforge.org/svn/tos/trunk@92800 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 10:59:01 +00:00
sizhaoliu
fd5a242722 TDQ-6316 the two tagged values should be also added for hive
git-svn-id: http://talendforge.org/svn/tos/trunk@92794 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 10:33:18 +00:00
fwang
93fdeddc27 bug TDI-23408 fixed:Close repository view / reopen, impossible to do any double click in any item.
git-svn-id: http://talendforge.org/svn/tos/trunk@92785 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 09:56:56 +00:00
ilazebny
f7b30fbf38 Update version to 5.2.0 in poms
git-svn-id: http://talendforge.org/svn/tis_shared/trunk@92778 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 08:46:48 +00:00
ilazebny
253f25a151 Update version to 5.2.0 in poms
git-svn-id: http://talendforge.org/svn/tos/trunk@92777 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 08:46:25 +00:00
zwzhao
fd47fb255e bug TDI-22320 fixed : Message should pop up to remind user there are jobs locked when delete folder contains locked jobs
git-svn-id: http://talendforge.org/svn/tos/trunk@92760 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 07:11:31 +00:00
wchen
7a6c5167d6 bug TDI-23416 fixed: TOS_BD Studio freezes when trying to download a jar after launching a job which has an error
git-svn-id: http://talendforge.org/svn/tos/trunk@92749 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 05:10:16 +00:00
jyhu
acaef21130 Fix Bug TDI-22793 : tMSSQLInput of small numbers
https://jira.talendforge.org/browse/TDI-22793 

git-svn-id: http://talendforge.org/svn/tos/trunk@92741 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 03:23:59 +00:00
fwang
e95e65bf25 bug TDI-23257 fixed:When drag&drop more a context or a metadata with a context linked, it should ask to copy all context group.
git-svn-id: http://talendforge.org/svn/tos/trunk@92736 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 03:02:25 +00:00
hcyi
ae4e6801b0 bug TDI-23181 fixed : On MSSQL Can't Retrieve Schema on a DB with a "-" .
git-svn-id: http://talendforge.org/svn/tos/trunk@92730 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-25 02:44:54 +00:00
sizhaoliu
0fef3ab346 TDI-23409 correct an error in the last commit.
git-svn-id: http://talendforge.org/svn/tos/trunk@92706 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 12:28:28 +00:00
wliu
950071f28b Fix Bug TDI-23411 : NodeUtil.getPrivateConnClassName(final IConnection conn) return value is not correct
https://jira.talendforge.org/browse/TDI-23411

git-svn-id: http://talendforge.org/svn/tos/trunk@92692 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 11:16:15 +00:00
sizhaoliu
5bd66a3fce fixed TDI-23409 by reverting the changes (database connection method call) in r92079 for TDQ-6288
git-svn-id: http://talendforge.org/svn/tos/trunk@92689 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 11:03:12 +00:00
mzhao
0cccb6e4eb TDQ-6360 - Create a new instance of TdColumn to avoid column lost after job generated.
git-svn-id: http://talendforge.org/svn/tos/trunk@92686 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 10:48:16 +00:00
jzhao
2f6704d026 Fixed Bug TDI-23411: NodeUtil.getPrivateConnClassName(final IConnection conn) return value is not correct
https://jira.talendforge.org/browse/TDI-23411

git-svn-id: http://talendforge.org/svn/tos/trunk@92666 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 08:24:45 +00:00
ycbai
42a1c62b3c bug TDI-22989 modified : HDFS browser doesn't work everytime
git-svn-id: http://talendforge.org/svn/tos/trunk@92655 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 05:56:42 +00:00
mwang
b80ef626f5 For bug TDI-23400
git-svn-id: http://talendforge.org/svn/tos/trunk@92652 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 03:44:49 +00:00
mwang
f8e6a731b8 For bug TDI-23400
git-svn-id: http://talendforge.org/svn/tos/trunk@92644 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 02:40:25 +00:00
xqliu
4899093457 TDQ-6204 TDQ-6335 1) set "AvoidUnloadResource" with true before execute the WorkUnit; 2) on trunk
git-svn-id: http://talendforge.org/svn/tos/trunk@92642 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-10-24 02:36:18 +00:00
217 changed files with 7369 additions and 2304 deletions

View File

@@ -104,13 +104,13 @@ TableViewerCreator.CellModifier.ExError=\u73FE\u5728\u306E CellModifier \u306F\u
TableViewerCreator.columnNoIBeanProperty=\u30AB\u30E9\u30E0 '{0}' ('{1}') \u306F CellEditor \u30BB\u30C3\u30C8\u3092\u6301\u3061\u307E\u3059\u304C\u3001 IBeanPropertyAccessors\u3092\u6301\u3061\u307E\u305B\u3093\u3002
TableViewerCreator.columnNullId=\u30AB\u30E9\u30E0 '{0}' \u306FNULL\u5024\u306Eid\u3092\u6301\u3063\u3066\u3044\u307E\u3059\u3002
TableViewerCreator.IdProperty.AssertMsg=\u30AB\u30E9\u30E0\u306EidProperty\u306E\u5909\u66F4\u304C\u5FC5\u8981\u3067\u3059\u3001idProperty\u306F\uFF11\u3064\u306E\u30C6\u30FC\u30D6\u30EB\u3067\u30E6\u30CB\u30FC\u30AF\u3067\u306A\u304F\u3066\u306F\u306A\u308A\u307E\u305B\u3093\u3002
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u5024\u3067\u3059
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304Cnull\u3067\u3059
TableViewerCreator.TableColumn.AssertMsg=idProperty'{0}'\u304C\u3042\u308BTableEditorColumn\u306ETableColumn\u306F\u3001\u6B63\u3057\u3044\u89AATable\u3092\u6301\u3063\u3066\u3044\u307E\u305B\u3093\u3002
TreeToTablesLinker.Type.Unsupported=\u3053\u306E\u30BF\u30A4\u30D7\u306EcurrentControl\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
exception.errorOccured=\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\uFF08{0}\uFF09\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Message=\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\uFF11\u3064\u9078\u629E\u3059\u308B\u304B\u3001\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3
ModelSelectionDialog.BuiltIn=\u7D44\u307F\u8FBC\u307F\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u5909\u66F4
ModelSelectionDialog.BuiltIn=\u7D44\u8FBC\u307F\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u5909\u66F4
ModelSelectionDialog.ViewSchema=\u30B9\u30AD\u30FC\u30DE\u306E\u8868\u793A\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09\u3002
ModelSelectionDialog.ViewQuery=\u30AF\u30A8\u30EA\u306E\u8868\u793A\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09\u3002
ModelSelectionDialog.Update=\u30EA\u30DD\u30B8\u30C8\u30EA\u63A5\u7D9A\u306E\u66F4\u65B0\u3002

View File

@@ -1,4 +1,5 @@
AddPushButton.AddButton.Tip=Toevoegen
DateDialog.textContent=Selecteer datum & tijd
DialogErrorForCellEditorListener.Error.MsgDialogTitle=Fout
EventUtil.modify=Wijzigen
EventUtil.move=Verplaatsen

View File

@@ -38,3 +38,5 @@ XmlNodeRetriever.proposal2Node=proposal2Nodes :
XmlNodeRetriever.prposal1Node=proposal1Nodes :
XmlNodeRetriever.singleQuotes='
VersionUtils.readPropertyFileError=Erreur de lecture de propriété dans le fichier talend.properties.
DatabaseContentRetriever.PRODUCTNAME=Nom de produit de la base de données :
DatabaseContentRetriever.PRODUCTVERSION=Version du produit de la base de données :

View File

@@ -16,6 +16,7 @@ Export-Package: org.talend.commons,
org.talend.commons.utils,
org.talend.commons.utils.data.bean,
org.talend.commons.utils.data.container,
org.talend.commons.utils.data.extractor,
org.talend.commons.utils.data.list,
org.talend.commons.utils.data.map,
org.talend.commons.utils.data.reflection,
@@ -33,7 +34,7 @@ Export-Package: org.talend.commons,
org.talend.commons.utils.scalability,
org.talend.commons.utils.system,
org.talend.commons.utils.threading,
org.talend.commons.utils.threading.lockerbykey,
org.talend.commons.utils.threading.lockerbykey,
org.talend.commons.utils.time,
org.talend.commons.utils.tracer,
org.talend.commons.utils.workbench.extensions,

View File

@@ -5,6 +5,11 @@ DatabaseContentRetriever.PRODUCTVERSION=Database Product Version:
DB2ForZosResultSet.outofRange=\ is out of range.
DB2ForZosResultSet.parameterIndex=Invalid argument\: parameter index
DB2ForZosResultSet.unknowCloumn=Invalid argument\: unknown column name
SybaseResultSet.outofRange=\ is out of range.
SybaseResultSet.parameterIndex=Invalid argument\: parameter index
SybaseResultSet.unknowCloumn=Invalid argument\: unknown column name
AbstractFakeResultSet.unknowCloumn=Invalid argument\: {0} is unknown column name
AbstractFakeResultSet.parameterIndexOutOfRange=Invalid argument\: parameter index {0} is out of range
EntryLocation.returnTableName={tableName={0}, columnName={1}}
ExceptionHandler.Parameter.BeNull=ex param cannot be null
ExtensionImplementationProviders.ExtensionPointError=Extension point must authoriez a single instance

View File

@@ -54,6 +54,10 @@ public final class CommonExceptionHandler {
log.log(Level.INFO, message);
}
public static void warn(String message) {
log.log(Level.WARN, message);
}
/**
* Return priority corresponding to the exception implementation.
*

View File

@@ -0,0 +1,45 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.data.extractor;
import java.io.File;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
/**
* Created by Marvin Wang on Nov 8, 2012.
*/
public class ModuleNameExtractor {
/**
* Extracts all file names from the given collection. This method is suitable the case that collection includes not
* only file names but also paths. And you just need a set only including file names. So this method cuts the
* directory of a file only the file name remaining. Added by Marvin Wang on Nov 8, 2012.
*
* @param collection must not be <code>null<code>, otherwise, it will throw NPE.
* @return a set that only includes file name.
*/
public static Set<String> extractFileName(Collection<String> collection) {
Set<String> moduleNameSet = new HashSet<String>();
if (!collection.isEmpty()) {
for (String module : collection) {
if (module != null) {
File moduleFile = new File(module);
moduleNameSet.add(moduleFile.getName());
}
}
}
return moduleNameSet;
}
}

View File

@@ -0,0 +1,54 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.database;
import java.sql.Connection;
import java.sql.SQLException;
import org.talend.fakejdbc.FakeDatabaseMetaData;
/**
* DOC ggu class global comment. Detailled comment <br/>
*
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
*
*/
public abstract class AbstractFakeDatabaseMetaData extends FakeDatabaseMetaData {
protected static final String[] TABLE_META = { "ID", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
protected static final String[] COLUMN_META = { "TABLE_NAME", "COLUMN_NAME", "TYPE_NAME", "COLUMN_SIZE", "DECIMAL_DIGITS", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
"NUM_PREC_RADIX", "IS_NULLABLE", "REMARKS", "COLUMN_DEF" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
private Connection connection;
/**
*
* DOC ggu AbstractFakeDatabaseMetaData constructor comment.
*
* @param connection
*/
public AbstractFakeDatabaseMetaData(Connection connection) {
this.connection = connection;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeDatabaseMetaData#getConnection()
*/
@Override
public Connection getConnection() throws SQLException {
return connection;
}
}

View File

@@ -0,0 +1,137 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.database;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.talend.commons.i18n.internal.Messages;
import org.talend.commons.utils.TalendDBUtils;
import org.talend.fakejdbc.FakeResultSet;
/**
* DOC ggu class global comment. Detailled comment <br/>
*
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
*
*/
public abstract class AbstractFakeResultSet extends FakeResultSet {
private String[] tableMeta = new String[0];
private List<String[]> data = new ArrayList<String[]>();;
int index = -1;
public AbstractFakeResultSet() {
super();
}
public void setMetadata(String[] tableMeta) {
this.tableMeta = tableMeta;
}
public void setData(List<String[]> data) {
this.data = data;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#next()
*/
@Override
public boolean next() throws SQLException {
if (data == null || data.size() == 0 || index >= data.size() - 1) {
return false;
}
index++;
return true;
}
protected int indexOf(String string, String[] search) {
for (int i = 0; i < search.length; i++) {
if (search[i].equals(string)) {
return i;
}
}
return -1;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getString(java.lang.String)
*/
@Override
public String getString(String columnLabel) throws SQLException {
int columnIndex = indexOf(columnLabel, tableMeta);
if (columnIndex == -1) {
throw new SQLException(Messages.getString("AbstractFakeResultSet.unknowCloumn", columnLabel)); //$NON-NLS-1$
}
return getString(columnIndex + 1);
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getInt(java.lang.String)
*/
@Override
public int getInt(String columnLabel) throws SQLException {
String str = getString(columnLabel);
if (columnLabel.equals("TYPE_NAME")) {
int index = TalendDBUtils.convertToJDBCType(str);
return index;
} else if (columnLabel.equals("IS_NULLABLE")) {
if (str.equals("N")) {
return 1;
} else {
return 0;
}
} else {
return Integer.parseInt(str);
}
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getBoolean(java.lang.String)
*/
@Override
public boolean getBoolean(String columnLabel) throws SQLException {
String str = getString(columnLabel);
return Boolean.parseBoolean(str);
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getString(int)
*/
@Override
public String getString(int columnIndex) throws SQLException {
String[] row = data.get(index);
columnIndex--;
if (columnIndex < 0 || columnIndex > row.length) {
throw new SQLException(Messages.getString("AbstractFakeResultSet.parameterIndexOutOfRange", columnIndex)); //$NON-NLS-1$
}
return row[columnIndex];
}
}

View File

@@ -0,0 +1,66 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.database;
import java.sql.SQLException;
import java.sql.Types;
/**
* DOC ggu class global comment. Detailled comment <br/>
*
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
*
*/
public class EmbeddedHiveResultSet extends AbstractFakeResultSet {
/**
* DOC ggu EmbeddedHiveResultSet constructor comment.
*/
public EmbeddedHiveResultSet() {
super();
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.AbstractFakeResultSet#getInt(java.lang.String)
*/
@Override
public int getInt(String columnLabel) throws SQLException {
if ("DATA_TYPE".equals(columnLabel)) {
String sqlType = getString("TYPE_NAME");
if (sqlType.trim().equalsIgnoreCase("TINYINT") || sqlType.trim().equalsIgnoreCase("SMALLINT")) { //$NON-NLS-1$
return Types.SMALLINT;
} else if (sqlType.trim().equalsIgnoreCase("INT")) { //$NON-NLS-1$
return Types.INTEGER;
} else if (sqlType.trim().equalsIgnoreCase("BIGINT")) { //$NON-NLS-1$
return Types.BIGINT;
} else if (sqlType.trim().equalsIgnoreCase("BOOLEAN")) { //$NON-NLS-1$
return Types.BOOLEAN;
} else if (sqlType.trim().equalsIgnoreCase("FLOAT")) { //$NON-NLS-1$
return Types.FLOAT;
} else if (sqlType.trim().equalsIgnoreCase("DOUBLE")) { //$NON-NLS-1$
return Types.DOUBLE;
} else if (sqlType.trim().equalsIgnoreCase("STRING")) { //$NON-NLS-1$
return Types.VARCHAR;
} else if (sqlType.trim().equalsIgnoreCase("BINARY")) { //$NON-NLS-1$
return Types.BINARY;
} else if (sqlType.trim().equalsIgnoreCase("TIMESTAMP")) { //$NON-NLS-1$
return Types.TIMESTAMP;
}
}
// TODO Auto-generated method stub
return super.getInt(columnLabel);
}
}

View File

@@ -0,0 +1,42 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.database;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.talend.fakejdbc.FakeDatabaseMetaData;
/**
*
* Created by Marvin Wang on Nov 29, 2012.
*/
public class HiveDatabaseMetaData extends FakeDatabaseMetaData {
private Connection connection;
private DatabaseMetaData metaData;
public HiveDatabaseMetaData(Connection connection) throws SQLException {
this.connection = connection;
metaData = connection.getMetaData();
}
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
return this.metaData.getTables(catalog, schemaPattern, tableNamePattern, types);
}
}

View File

@@ -0,0 +1,141 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.database;
import java.sql.SQLException;
import java.util.List;
import org.talend.commons.i18n.internal.Messages;
import org.talend.commons.utils.TalendDBUtils;
import org.talend.fakejdbc.FakeResultSet;
/**
* created by xqliu on Oct 26, 2012 Detailled comment
*
*/
public class SybaseResultSet extends FakeResultSet {
private String[] tableMeta = null;
private List<String[]> data;
int index = -1;
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#next()
*/
@Override
public boolean next() throws SQLException {
if (data == null || data.size() == 0 || index >= data.size() - 1) {
return false;
}
index++;
return true;
}
public static int indexOf(String string, String[] search) {
for (int i = 0; i < search.length; i++) {
if (search[i].equals(string)) {
return i;
}
}
return -1;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getString(java.lang.String)
*/
@Override
public String getString(String columnLabel) throws SQLException {
int columnIndex = indexOf(columnLabel, tableMeta);
if (columnIndex == -1) {
throw new SQLException(Messages.getString("SybaseResultSet.unknowCloumn") + columnLabel); //$NON-NLS-1$
}
return getString(columnIndex + 1);
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getInt(java.lang.String)
*/
@Override
public int getInt(String columnLabel) throws SQLException {
int value = 0;
String str = getString(columnLabel);
if (columnLabel.equals("TYPE_NAME")) { //$NON-NLS-1$
value = TalendDBUtils.convertToJDBCType(str);
} else if (columnLabel.equals("IS_NULLABLE")) { //$NON-NLS-1$
if (str.equals("N")) { //$NON-NLS-1$
value = 1;
} else {
value = 0;
}
} else {
value = Integer.parseInt(str);
}
return value;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getBoolean(java.lang.String)
*/
@Override
public boolean getBoolean(String columnLabel) throws SQLException {
String str = getString(columnLabel);
return Boolean.parseBoolean(str);
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.FakeResultSet#getString(int)
*/
@Override
public String getString(int columnIndex) throws SQLException {
String[] row = data.get(index);
columnIndex--;
if (columnIndex < 0 || columnIndex > row.length) {
throw new SQLException(
Messages.getString("SybaseResultSet.parameterIndex") + columnIndex + Messages.getString("SybaseResultSet.outofRange")); //$NON-NLS-1$ //$NON-NLS-2$
}
return row[columnIndex];
}
/**
* DOC bqian Comment method "setMetadata".
*
* @param table_meta
*/
public void setMetadata(String[] tableMeta) {
this.tableMeta = tableMeta;
}
/**
* DOC bqian Comment method "setData".
*
* @param tables
*/
public void setData(List<String[]> data) {
this.data = data;
}
}

View File

@@ -26,6 +26,8 @@ public final class PluginChecker {
private static final String TOP_BRANDING = "org.talend.rcp.branding.top"; //$NON-NLS-1$
private static final String AMCRAP_PLUGIN_ID = "org.talend.amc.rap"; //$NON-NLS-1$
private PluginChecker() {
}
@@ -74,4 +76,12 @@ public final class PluginChecker {
return isPluginLoaded(TOP_BRANDING) && !isTDCPLoaded() && !isTDQLoaded();
}
/**
* Method "isAMCRAPLoaded"
*
*/
public static boolean isAMCRAPLoaded() {
return isPluginLoaded(AMCRAP_PLUGIN_ID);
}
}

View File

@@ -1 +1 @@
talend.version=5.2.0
talend.version=5.2.1

View File

@@ -15,7 +15,7 @@ ImportPushButton.ImportButton.Tip=\u3059\u3079\u3066\u306e\u884c\u3092xml\u30d5\
LabelledFileField.FileDialog.Text=\u9078\u629E
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3
ModelSelectionDialog.Update=\u30EA\u30DD\u30B8\u30C8\u30EA\u63A5\u7D9A\u306E\u66F4\u65B0\u3002
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u5024\u3067\u3059
TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304Cnull\u3067\u3059
ModelSelectionDialog.Title=\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u3066\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u7DE8\u96C6
AddAllPushButton.AddAllButton.Tip=\u3059\u3079\u3066\u8ffd\u52a0
ExtendedTableRemoveCommand.Romve.Label=\u30C6\u30FC\u30D6\u30EB\u30A8\u30F3\u30C8\u30EA\u306E\u524A\u9664

View File

@@ -2,6 +2,7 @@ commons.error=Fout
AddPushButton.AddButton.Tip=Toevoegen
LabelledFileField.BrowseButton.Text=Blader...
DialogErrorForCellEditorListener.Error.MsgDialogTitle=Fout
DateDialog.textContent=Selecteer datum & tijd
EventUtil.modify=Wijzigen
EventUtil.move=Verplaatsen
EventUtil.show=Toon

View File

@@ -167,7 +167,7 @@ public class LabelledDirectoryField {
gridLayout.marginWidth = 0;
compositeButton.setLayout(gridLayout);
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true));
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
button = new Button(compositeButton, SWT.PUSH);
GridDataFactory.swtDefaults().applyTo(button);
button.setText(Messages.getString("LabelledFileField.BrowseButton.Text")); //$NON-NLS-1$

View File

@@ -171,7 +171,7 @@ public class LabelledFileField {
gridLayout.marginWidth = 0;
compositeButton.setLayout(gridLayout);
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true));
compositeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
button = new Button(compositeButton, SWT.PUSH);
GridDataFactory.swtDefaults().applyTo(button);
button.setText(Messages.getString("LabelledFileField.BrowseButton.Text")); //$NON-NLS-1$

View File

@@ -106,7 +106,9 @@ public abstract class DialogErrorForCellEditorListener implements ICellEditorLis
Messages.getString("DialogErrorForCellEditorListener.Error.MsgDialogTitle"), Messages.getString("ErrorDialogWidthDetailArea.ErrorMessage.ColumnText")); //$NON-NLS-1$
final int columnPosition = tableViewerCreator.getColumns().indexOf(column);
tableViewerCreator.getTableViewer().editElement(currentModifiedBean, columnPosition);
text.setText(newValue);
if (!("").equals(newValue)) {
text.setText(newValue);
}
text.setSelection(selection.x, selection.y);
} else {
MessageDialog.openError(text.getShell(),

View File

@@ -409,7 +409,7 @@ public class FilesUtils {
List<URL> urls = new ArrayList<URL>();
List<File> files = getFiles(file, extension, excludedFile, excludedFolder, nested);
for (File file2 : files) {
urls.add(file2.toURL());
urls.add(file2.toURI().toURL());
}
return urls;
}
@@ -468,6 +468,10 @@ public class FilesUtils {
return getFilesFromFolderByName(file, fileName, new String[] { ".jar", ".zip", ".bar" }, null, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static List<File> getDllFilesFromFolder(File file, String fileName) throws MalformedURLException {
return getFilesFromFolderByName(file, fileName, new String[] { ".dll" }, null, true); //$NON-NLS-1$
}
public static FileFilter getExcludeSystemFilesFilter() {
FileFilter filter = new FileFilter() {
@@ -913,6 +917,36 @@ public class FilesUtils {
}
}
public static void copyDirectoryWithoutSvnFolder(File source, File target) {
File tarpath = new File(target, source.getName());
if (source.isDirectory()) {
tarpath.mkdir();
File[] dir = source.listFiles();
for (File element : dir) {
if (element.getName().equals(".svn")) { //$NON-NLS-1$
continue;
}
copyDirectoryWithoutSvnFolder(element, tarpath);
}
} else {
try {
InputStream is = new FileInputStream(source);
OutputStream os = new FileOutputStream(tarpath);
byte[] buf = new byte[1024];
int len = 0;
while ((len = is.read(buf)) != -1) {
os.write(buf, 0, len);
}
is.close();
os.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static void deleteFile(File file, boolean delete) {
if (file.exists()) {
if (file.isFile() && delete) {
@@ -1057,4 +1091,17 @@ public class FilesUtils {
getAllFilesFromFolder(aFolder, files, filenameFilter);
return files;
}
public static String getFileRealPath(String filePath) {
File file = new File(filePath);
if (!file.exists()) {
filePath = filePath.replace("%20", " "); //$NON-NLS-1$ //$NON-NLS-2$
file = new File(filePath);
if (file.exists()) {
return filePath;
}
}
return filePath;
}
}

View File

@@ -7,7 +7,7 @@ ColorsCodeViewerPreferencePage.keyword2Color=\u30AD\u30FC\u30EF\u30FC\u30C92\u82
MetadataDialog.Message=\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u306E\u3059\u3079\u3066\u306E\u30AB\u30E9\u30E0\u304C\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u79FB\u884C\u3055\u308C\u307E\u3059
MetadataDialog.TransferMessage=\u51FA\u30B9\u30AD\u30FC\u30DE\u306E\u3059\u3079\u3066\u306E\u30AB\u30E9\u30E0\u304C\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u79FB\u884C\u3055\u308C\u307E\u3059
EMetadataEncoding.Cyrillic=\u30AD\u30EA\u30EB\u8A9E
EUpdateResult.BuiltIn=\u30D3\u30EB\u30C9\u30A4\u30F3\u30E2\u30FC\u30C9\u3078\u5909\u66F4
EUpdateResult.BuiltIn=\u7D44\u8FBC\u307F\u30E2\u30FC\u30C9\u3078\u5909\u66F4
EUpdateResult.Rename=\u540D\u524D\u3092\u5909\u66F4
MetadataTypeLengthConstants.DOUBLE_LENGTH=Double
ContextProcessSection.ParameterNameIsNotValid=\u5F15\u6570\u540D\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002
@@ -185,7 +185,9 @@ PaletteContentDialog.lable=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30E9\u30D9\u30E
MetadataDialog.CopySelectionToInput.toolTipText=\u9078\u629E\u3055\u308C\u305F\u30AB\u30E9\u30E0\u3092\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u304B\u3089\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u30B3\u30D4\u30FC
MetadataDialog.CopyToOutput=\u3059\u3079\u3066\u306E\u30AB\u30E9\u30E0\u3092\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u304B\u3089\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u30B3\u30D4\u30FC
MetadataDialog.CopySelectionToOutput=\u9078\u629E\u3055\u308C\u305F\u30AB\u30E9\u30E0\u3092\u5165\u529B\u30B9\u30AD\u30FC\u30DE\u304B\u3089\u51FA\u529B\u30B9\u30AD\u30FC\u30DE\u3078\u30B3\u30D4\u30FC
MetadataTalendType.dbIdNotFound=DBMS Id : {0} \u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093!
PaletteContentDialog.connection=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u63A5\u7D9A\u30C7\u30D5\u30A9\u30EB\u30C8\uFF1A
PaletteContentDialog.hint=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30D2\u30F3\u30C8\u30C7\u30D5\u30A9\u30EB\u30C8\uFF1A
PaletteContentDialog.lable=\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30E9\u30D9\u30EB\u30C7\u30D5\u30A9\u30EB\u30C8:
ProcessorUtilities.finalizeBuild=\u30D3\u30EB\u30C9\u3092\u7D42\u4E86\u4E2D...
ProcessorUtilities.generatingJob=\u30B8\u30E7\u30D6\u751F\u6210\u4E2D...
@@ -241,6 +243,8 @@ MetadataTool.schemaNull=\u30B9\u30AD\u30FC\u30DE\u540D\u304CNULL\u3067\u3059\u30
MetadataTool.invalidChar=\u7121\u52B9\u306A\u6587\u5B57
MetadataTool.nameNull=\u30B9\u30AD\u30FC\u30DE\u540D\u3092\u6307\u5B9A\u3057\u3066\u4E0B\u3055\u3044\u3002
MetadataTool.nullValue=Null\u5024
MetadataTool.schemaExist=\u30B9\u30AD\u30FC\u30DE\u540D\u306F\u5B58\u5728\u3057\u307E\u3059\u3002
MetadataTool.schemaIn=\u30B9\u30AD\u30FC\u30DE\u540D\u304C\u4E0D\u6B63\u3067\u3059\u3002
MetadataTool.schemaInvalid=\u30B9\u30AD\u30FC\u30DE\u540D\u304C\u4E0D\u6B63\u3067\u3059\u3002
MetadataTool.schemaNull=\u30B9\u30AD\u30FC\u30DE\u540D\u304CNULL\u3067\u3059\u3002
RepositoryUpdateManager.NotFoundTitle=\u898B\u3064\u304B\u308A\u307E\u305B\u3093

View File

@@ -119,3 +119,12 @@ ItemReferenceDialog.project=Projet
ItemReferenceDialog.deletedInfor=Dans la Corbeille
ItemReferenceDialog.messages=Des éléments ne peuvent être supprimés car ils sont référencés par d'autres.
ProxyRepositoryFactory.projectIsNotCompatible=Le projet {0} a été ouvert par un studio plus récent. Impossible de l'ouvrir.
NewFolderWizard.label=Libellé
NewFolderWizard.nameEmpty=Libellé requis
NewFolderWizard.nameIncorrect=Le libellé contient des caractères incorrects.
NewFolderWizard.nameInvalid=Libellé {0} interdit.
NewFolderWizard.title=Dossier
NewFolderWizard.windowTitle=Nouveau dossier
CreateFolderAction.action.title=Créer le dossier
RenameFolderAction.action.title=Renommer le dossier
RenameFolderAction.warning.editorOpen.title=Action indisponible

View File

@@ -1,4 +1,3 @@
ProxyRepositoryFactory.Label=Labela
CreateSandboxProjectDialog.ProjectLabel=Labela
PropertiesWizardPage.Select=SELECT
DeleteAction.action.logicalTitle=DELETE

View File

@@ -93,6 +93,8 @@ DeleteAction.dialog.messageAllElements=All the elements will be deleted forever
DeleteAction.dialog.title=Delete forever
DeleteAction.error.lockedOrOpenedObject.newMessage=The {0} is locked, so you can't delete it.\n If this object is opened ,you must close it before deletion.
DeleteAction.error.title=Deletion forbidden
DeleteAction.warning.message1=can not delete the folder because at least one item contained in this folder is currently open. Close any open item and try again.
DeleteAction.warning.title=Warning
DuplicateAction.cannotGenerateItem=Cannot generate pasted item label.
DuplicateAction.dialog.message=Give name to new job
DuplicateAction.dialog.title=Please input job name

View File

@@ -28,9 +28,9 @@ public interface IDBMetadataProvider {
public Map getConnectionMap();
/** test connection used for test a connection,for example ,click "check" button on database wizard **/
public ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema, String server,
String port, final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam);
String port, final String driverClassName, final String driverJarPath, String dbVersionString,
String additionalParam, Map<String, Object> otherParameters);
/** when check connection ,will update the package,this one no use for HBASE **/
public void updatePackage(IMetadataConnection metadataConnection);

View File

@@ -46,6 +46,9 @@ public class FileConstants {
// MOD klliu 2010-11-26
public static final String JRXML_EXTENSION = "jrxml"; //$NON-NLS-1$
/*
* file suffix
*/
public static final String PROPERTIES_FILE_SUFFIX = '.' + PROPERTIES_EXTENSION;
public static final String ITEM_FILE_SUFFIX = '.' + ITEM_EXTENSION;
@@ -67,4 +70,15 @@ public class FileConstants {
public static final String SH_FILE_SUFFIX = ".sh"; //$NON-NLS-1$
public static final String BAT_FILE_SUFFIX = ".bat"; //$NON-NLS-1$
public static final String KAR_FILE_SUFFIX = ".kar"; //$NON-NLS-1$
public static final String XLS_FILE_SUFFIX = ".xls"; //$NON-NLS-1$
/*
* file names
*/
public static final String MANIFEST_MF_FILE_NAME = "MANIFEST.MF"; //$NON-NLS-1$
public static final String META_INF_FOLDER_NAME = "META-INF"; //$NON-NLS-1$
}

View File

@@ -40,6 +40,7 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.ICoreService;
import org.talend.core.IStatusPreferenceInitService;
import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.LibraryInfo;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.EParameterFieldType;
@@ -400,7 +401,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
}
List<IRepositoryViewObject> repositoryObjects = getAll(project, ERepositoryObjectType.ROUTINES, false, false);
Map<String, List<String>> routineAndJars = coreSerivce.getRoutineAndJars();
Map<String, List<LibraryInfo>> routineAndJars = coreSerivce.getRoutineAndJars();
for (URL url : routines) {
String[] fragments = url.toString().split("/"); //$NON-NLS-1$
String label = fragments[fragments.length - 1];
@@ -508,7 +509,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
* @param url
* @throws PersistenceException
*/
private void createRoutine(URL url, IPath path, String label, List<String> neededJars) throws PersistenceException {
private void createRoutine(URL url, IPath path, String label, List<LibraryInfo> neededJars) throws PersistenceException {
if (url == null) {
throw new IllegalArgumentException();
}
@@ -532,12 +533,13 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
routineItem.setContent(byteArray);
routineItem.setBuiltIn(true);
if (neededJars != null) {
for (String jar : neededJars) {
for (LibraryInfo jar : neededJars) {
IMPORTType type = ComponentFactory.eINSTANCE.createIMPORTType();
type.setMESSAGE("");
type.setNAME(label);
type.setREQUIRED(true);
type.setMODULE(jar);
type.setMODULE(jar.getLibName());
type.setBundleID(jar.getBundleId());
routineItem.getImports().add(type);
}
}

View File

@@ -12,6 +12,9 @@
// ============================================================================
package org.talend.core.repository.utils;
import java.io.File;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.emf.ecore.resource.Resource;
@@ -20,8 +23,8 @@ import org.talend.core.IService;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import orgomg.cwm.objectmodel.core.ModelElement;
import org.talend.core.model.properties.TDQItem;
import org.talend.repository.model.IRepositoryNode;
/**
* DOC mzhao Abstract unload resource service which can be extended by client.
@@ -32,10 +35,6 @@ public class AbstractResourceChangesService implements IService {
}
// Add new elements to resource, remove elements from resource, delete resource
public boolean handleResourceChange(ModelElement modelElement) {
return true;
}
public void handleLogicalDelete(Property prop) {
}
@@ -76,8 +75,27 @@ public class AbstractResourceChangesService implements IService {
* @throws PersistenceException
*/
public void saveResourceByEMFShared(Resource toSave) {
}
/**
* if move TDQReportItem, need to move the generated doc of it also.
*
* @param tdqItem
* @param tarFolder
*/
public void moveReportGeneratedDocFolder(TDQItem tdqItem, File tarFolder) {
}
public List<IRepositoryNode> getDependentNodes(IRepositoryNode currentNode) {
return null;
}
public List<IRepositoryNode> getDependentConnNodesInRecycleBin(List<IRepositoryNode> children) {
return null;
}
public void openDependcesDialog(List<IRepositoryNode> nodes) {
}
}

View File

@@ -12,9 +12,9 @@
// ============================================================================
package org.talend.core.repository.utils;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -129,8 +129,9 @@ public class XmiResourceManager {
public void loadScreenshots(Property property, ProcessType processType) {
Resource screenshotResource = getScreenshotResource(property.getItem());
processType.getScreenshots().addAll(screenshotResource.getContents());
if (screenshotResource != null) { // if no screenshot, we will try to add later when save
processType.getScreenshots().addAll(screenshotResource.getContents());
}
}
public Property loadProperty(IResource iResource) {
@@ -199,8 +200,8 @@ public class XmiResourceManager {
public Resource createTempProjectResource() {
URI uri = null;
try {
uri = URI.createPlatformResourceURI(Platform.getInstallLocation().getURL().toURI().toString());
} catch (URISyntaxException e) {
uri = URI.createPlatformResourceURI(Platform.getInstallLocation().getURL().getFile(), true);
} catch (Exception e) {
ExceptionHandler.process(e);
}
return resourceSet.createResource(uri);
@@ -342,17 +343,41 @@ public class XmiResourceManager {
return itemResource;
}
public Resource getScreenshotResource(Item item) {
return getScreenshotResource(item, false);
}
/*
* Get a resource obj from Item resource file. if the resouce file does not exist ,will create it first.
*/
public Resource getScreenshotResource(Item item) {
public Resource getScreenshotResource(Item item, boolean createIfNotExist) {
URI itemResourceURI = null;
itemResourceURI = getScreenshotResourceURI(getItemURI(item));
Resource itemResource;
try {
// judge whether the physical file exists or not
itemResource = resourceSet.getResource(itemResourceURI, true);
} catch (Exception e) {
boolean fileExist = false;
if (itemResourceURI.isFile()) {
fileExist = new File(itemResourceURI.toFileString()).exists();
} else {
IPath path = URIHelper.convert(itemResourceURI);
if (path != null) {
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if (file.exists()) {
fileExist = true;
}
} else {
fileExist = false;
}
}
Resource itemResource = null;
if (fileExist) {
try {
// judge whether the physical file exists or not
itemResource = resourceSet.getResource(itemResourceURI, true);
} catch (Exception e) {
// do nothing, consider the file don't exist
itemResource = null;
}
}
if (itemResource == null && createIfNotExist) {
itemResource = resourceSet.createResource(itemResourceURI);
}
return itemResource;

View File

@@ -1147,7 +1147,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
"ProjectRepositoryNode.itemInvalid", repositoryObject.getRepositoryObjectType(), //$NON-NLS-1$,
repositoryObject.getLabel()));
if (repositoryObject.getProperty().getInformations().isEmpty()) {
if (repositoryObject.getProperty() != null && repositoryObject.getProperty().getInformations().isEmpty()) {
Information info = PropertiesFactory.eINSTANCE.createInformation();
info.setLevel(InformationLevel.ERROR_LITERAL);
info.setText(Messages.getString("ProjectRepositoryNode.invalidItem")); //$NON-NLS-1$
@@ -1813,7 +1813,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
}
public boolean getMergeRefProject() {
IPreferenceStore preferenceStore = RepositoryManager.getPreferenceStore();
IPreferenceStore preferenceStore = RepositoryManager.getRepositoryPreferenceStore();
return preferenceStore.getBoolean(IRepositoryPrefConstants.MERGE_REFERENCE_PROJECT);
}

View File

@@ -21,8 +21,6 @@ import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.repository.RepositoryManager;
@@ -34,6 +32,7 @@ import org.talend.core.repository.utils.AbstractResourceChangesService;
import org.talend.core.repository.utils.TDQServiceRegister;
import org.talend.repository.model.ERepositoryStatus;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryNode;
import org.talend.repository.model.IRepositoryNode.ENodeType;
import org.talend.repository.model.IRepositoryNode.EProperties;
import org.talend.repository.model.JobletReferenceBean;
@@ -217,6 +216,10 @@ public class MoveObjectAction {
public boolean isLock(RepositoryNode sourceNode) {
boolean isLock = false;
if (ProxyRepositoryFactory.getInstance().getRepositoryContext().isEditableAsReadOnly()) {
return false;
}
try {
ProxyRepositoryFactory.getInstance().initialize();
@@ -291,11 +294,10 @@ public class MoveObjectAction {
|| repositoryObjectType == ERepositoryObjectType.METADATA_MDMCONNECTION) {
AbstractResourceChangesService resourceChangeService = TDQServiceRegister.getInstance()
.getResourceChangeService(AbstractResourceChangesService.class);
Item item = objectToMove.getProperty() == null ? null : objectToMove.getProperty().getItem();
if (null != resourceChangeService && null != item) {
boolean handleResourceChange = resourceChangeService.handleResourceChange(((ConnectionItem) item)
.getConnection());
if (!handleResourceChange) {
if (null != resourceChangeService) {
List<IRepositoryNode> dependentNodes = resourceChangeService.getDependentNodes(sourceNode);
if (dependentNodes != null && !dependentNodes.isEmpty()) {
resourceChangeService.openDependcesDialog(dependentNodes);
return;
}
}

View File

@@ -68,6 +68,11 @@ public class CopyAction extends AContextualAction {
LocalSelectionTransfer.getTransfer().setSelection(selection);
LocalSelectionTransfer.getTransfer().setSelectionSetTime(System.currentTimeMillis());
// init paste action
PasteAction pasteActionInstance = PasteAction.getInstance();
if (pasteActionInstance != null) {
pasteActionInstance.init(null, selection);
}
// refresh();
}

View File

@@ -72,7 +72,6 @@ import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.model.properties.Property;
import org.talend.core.model.properties.TDQItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.Folder;
import org.talend.core.model.repository.IRepositoryViewObject;
@@ -428,14 +427,21 @@ public class DeleteAction extends AContextualAction {
ERepositoryObjectType objectType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);
List<IRepositoryNode> repositoryList = node.getChildren();
boolean success = true;
Exception bex = null;
for (IRepositoryNode repositoryNode : repositoryList) {
try {
deleteRepositoryNode(repositoryNode, factory);
} catch (Exception e) {
bex = e;
ExceptionHandler.process(e);
success = false;
}
}
if (bex != null) {
final Shell shell = getShell();
MessageDialog.openWarning(shell, Messages.getString("DeleteAction.warning.title"),
Messages.getString("DeleteAction.warning.message1"));
}
if (!success) {
return;
}
@@ -1152,18 +1158,8 @@ public class DeleteAction extends AContextualAction {
return true;
}
Item item = null;
if (objToDelete != null && objToDelete.getProperty() != null) {
item = objToDelete.getProperty().getItem();
}
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance().getResourceChangeService(
AbstractResourceChangesService.class);
if (resChangeService != null && item != null && item instanceof ConnectionItem && item.getState().isDeleted()) {
if (!resChangeService.handleResourceChange(((ConnectionItem) item).getConnection())) {
return true;
}
}
// To manage case of we have a subitem. This is possible using 'DEL' shortcut:
ERepositoryObjectType nodeType = (ERepositoryObjectType) currentJobNode.getProperties(EProperties.CONTENT_TYPE);
if (nodeType != null && nodeType.isSubItem()) {
@@ -1179,6 +1175,13 @@ public class DeleteAction extends AContextualAction {
needReturn = true;
} else {
if (factory.getStatus(objToDelete) == ERepositoryStatus.DELETED) {
if (resChangeService != null) {
List<IRepositoryNode> dependentNodes = resChangeService.getDependentNodes(currentJobNode);
if (dependentNodes != null && !dependentNodes.isEmpty()) {
resChangeService.openDependcesDialog(dependentNodes);
return true;
}
}
if (confirm == null) {
Display.getDefault().syncExec(new Runnable() {
@@ -1230,8 +1233,11 @@ public class DeleteAction extends AContextualAction {
} else {
// MOD qiongli 2011-5-10,bug 21189.should remove dependency after showing the question dialog of
// physical delete.
if (resChangeService != null && (item instanceof TDQItem || item instanceof ConnectionItem)) {
resChangeService.removeAllDependecies(item);
if (resChangeService != null && objToDelete != null && objToDelete.getProperty() != null) {
Item item = objToDelete.getProperty().getItem();
if (item != null) {
resChangeService.removeAllDependecies(item);
}
}
factory.deleteObjectPhysical(objToDelete);
ExpressionPersistance.getInstance().jobDeleted(objToDelete.getLabel());
@@ -1312,8 +1318,8 @@ public class DeleteAction extends AContextualAction {
if (factory.isUserReadOnlyOnCurrentProject()) {
visible = false;
}
// TDI-23105:only for read-only(tag) project
if (!factory.getRepositoryContext().isOffline() && factory.getRepositoryContext().isEditableAsReadOnly()) {
// TDI-23105:only for read-only(tag) project > also for offline, since TDI-23336
if (factory.getRepositoryContext().isOffline() || factory.getRepositoryContext().isEditableAsReadOnly()) {
visible = false;
}
for (Object o : (selection).toArray()) {
@@ -1390,6 +1396,12 @@ public class DeleteAction extends AContextualAction {
break;
}
if (contentType == ERepositoryObjectType.METADATA_CON_TABLE) {
enabled = false;
visible = false;
break;
}
IRepositoryViewObject repObj = node.getObject();
ERepositoryStatus status = repObj.getRepositoryStatus();

View File

@@ -52,6 +52,7 @@ import org.talend.core.repository.utils.TDQServiceRegister;
import org.talend.cwm.helper.SubItemHelper;
import org.talend.repository.model.ERepositoryStatus;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryNode;
import org.talend.repository.model.IRepositoryNode.ENodeType;
import org.talend.repository.model.IRepositoryNode.EProperties;
import org.talend.repository.model.RepositoryConstants;
@@ -124,11 +125,13 @@ public class DeleteTableAction extends AContextualAction {
return;
}
boolean isSave = true;
if (item instanceof ConnectionItem) {
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance()
.getResourceChangeService(AbstractResourceChangesService.class);
if (resChangeService != null) {
isSave = resChangeService.handleResourceChange(((ConnectionItem) item).getConnection());
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance().getResourceChangeService(
AbstractResourceChangesService.class);
if (resChangeService != null) {
List<IRepositoryNode> dependentNodes = resChangeService.getDependentNodes(node);
if (dependentNodes != null && !dependentNodes.isEmpty()) {
resChangeService.openDependcesDialog(dependentNodes);
isSave = false;
}
}
if (isSave) {
@@ -180,6 +183,7 @@ public class DeleteTableAction extends AContextualAction {
}
Display.getCurrent().syncExec(new Runnable() {
@Override
public void run() {
RepositoryManager.refreshDeletedNode(types);
}
@@ -205,6 +209,7 @@ public class DeleteTableAction extends AContextualAction {
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
* org.eclipse.jface.viewers.IStructuredSelection)
*/
@Override
public void init(TreeViewer viewer, IStructuredSelection selection) {
boolean canWork = false;
setText(null);

View File

@@ -48,7 +48,9 @@ import org.talend.core.model.repository.RepositoryManager;
import org.talend.core.repository.i18n.Messages;
import org.talend.core.repository.model.ISubRepositoryObject;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.repository.utils.AbstractResourceChangesService;
import org.talend.core.repository.utils.RepositoryNodeDeleteManager;
import org.talend.core.repository.utils.TDQServiceRegister;
import org.talend.designer.business.diagram.custom.IDiagramModelService;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.ERepositoryStatus;
@@ -86,9 +88,21 @@ public class EmptyRecycleBinAction extends AContextualAction {
// TDI-20542
List<IRepositoryNode> originalChildren = node.getChildren();
final List<IRepositoryNode> children = new ArrayList<IRepositoryNode>(originalChildren);
// MOD qiongli 2012-11-23 TUP-273 if a connection in recycle bin which depended by DQ analysis,should give a
// warning then return.
if (children.size() == 0) {
return;
} else if (children.size() > 1) {
}
AbstractResourceChangesService resChangeService = TDQServiceRegister.getInstance().getResourceChangeService(
AbstractResourceChangesService.class);
if (resChangeService != null) {
List<IRepositoryNode> dependentNodes = resChangeService.getDependentConnNodesInRecycleBin(children);
if (dependentNodes != null && !dependentNodes.isEmpty()) {
resChangeService.openDependcesDialog(dependentNodes);
return;
}
}
if (children.size() > 1) {
message = Messages.getString("DeleteAction.dialog.messageAllElements") + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
Messages.getString("DeleteAction.dialog.message2"); //$NON-NLS-1$;
} else {
@@ -125,6 +139,7 @@ public class EmptyRecycleBinAction extends AContextualAction {
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
for (IRepositoryNode child : children) {
@@ -144,6 +159,7 @@ public class EmptyRecycleBinAction extends AContextualAction {
IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
try {
@@ -167,6 +183,7 @@ public class EmptyRecycleBinAction extends AContextualAction {
if (unDeleteItems.size() > 0) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
ItemReferenceDialog dialog = new ItemReferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell(), unDeleteItems);
@@ -248,6 +265,7 @@ public class EmptyRecycleBinAction extends AContextualAction {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
@@ -315,14 +333,15 @@ public class EmptyRecycleBinAction extends AContextualAction {
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
* org.eclipse.jface.viewers.IStructuredSelection)
*/
@Override
public void init(TreeViewer viewer, IStructuredSelection selection) {
boolean canWork = !selection.isEmpty() && selection.size() == 1;
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
if (factory.isUserReadOnlyOnCurrentProject()) {
canWork = false;
}
// TDI-23105:only for read-only(tag) project
if (!factory.getRepositoryContext().isOffline() && factory.getRepositoryContext().isEditableAsReadOnly()) {
// TDI-23105:only for read-only(tag) project > also for offline, since TDI-23336
if (factory.getRepositoryContext().isOffline() || factory.getRepositoryContext().isEditableAsReadOnly()) {
canWork = false;
}
if (canWork) {

View File

@@ -96,10 +96,10 @@ public class PasteAction extends AContextualAction {
public void init(TreeViewer viewer, IStructuredSelection selection) {
boolean enabled = true;
if (selection.size() != 1) { // only one current node selected
setEnabled(false);
return;
}
// if (selection.size() != 1) { // only one current node selected
// setEnabled(false);
// return;
// }
Object targetObject = selection.getFirstElement();
if (!(targetObject instanceof RepositoryNode)) {

View File

@@ -38,7 +38,6 @@ import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.business.BusinessType;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.properties.RoutineItem;
@@ -96,8 +95,9 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
case DND.DROP_COPY:
RunnableWithReturnValue runnable = new CopyRunnable(
Messages.getString("RepositoryDropAdapter_copyingItems"), data, targetNode); //$NON-NLS-1$
runInProgressDialog(runnable);
toReturn = (Boolean) runnable.getReturnValue();
// runInProgressDialog(runnable);
// toReturn = (Boolean) runnable.getReturnValue();
runCopy(data, targetNode);
break;
case DND.DROP_MOVE:
runnable = new MoveRunnable(Messages.getString("RepositoryDropAdapter_movingItems"), data, targetNode); //$NON-NLS-1$
@@ -149,10 +149,10 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
// iRepositoryNode.getObject().getProperty().getItem().eResource().unload();
Item item = repositoryNode.getObject() == null ? null : repositoryNode.getObject().getProperty().getItem();
if (resourceChangeService != null && null != item) {
boolean handleResourceChange = resourceChangeService.handleResourceChange(((ConnectionItem) item)
.getConnection());
if (!handleResourceChange) {
return handleResourceChange;
List<IRepositoryNode> dependentNodes = resourceChangeService.getDependentNodes(repositoryNode);
if (dependentNodes != null && !dependentNodes.isEmpty()) {
resourceChangeService.openDependcesDialog(dependentNodes);
return false;
}
}
}
@@ -167,8 +167,9 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
*/
@Override
public boolean validateDrop(Object target, int operation, TransferData transferType) {
if (target == null)
if (target == null) {
return false;
}
super.validateDrop(target, operation, transferType);
boolean isValid = true;
for (Object obj : ((StructuredSelection) getViewer().getSelection()).toArray()) {
@@ -229,9 +230,29 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
return isValid;
}
private void runCopy(final Object data, final RepositoryNode targetNode) {
String copyName = "User action : Copy Object"; //$NON-NLS-1$
RepositoryWorkUnit<Object> repositoryWorkUnit = new RepositoryWorkUnit<Object>(copyName, CopyObjectAction.getInstance()) {
@Override
protected void run() throws LoginException, PersistenceException {
try {
for (Object obj : ((StructuredSelection) data).toArray()) {
final RepositoryNode sourceNode = (RepositoryNode) obj;
CopyObjectAction.getInstance().execute(sourceNode, targetNode);
}
} catch (Exception e) {
throw new PersistenceException(e);
}
}
};
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
}
private void runInProgressDialog(final IWorkspaceRunnable op) {
final IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
try {
@@ -279,6 +300,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
this.targetNode = targetNode;
}
@Override
public void run(IProgressMonitor monitor) throws CoreException {
monitor.beginTask(getTaskName(), IProgressMonitor.UNKNOWN);
String copyName = "User action : Copy Object"; //$NON-NLS-1$
@@ -319,6 +341,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
this.targetNode = targetNode;
}
@Override
public void run(final IProgressMonitor monitor) throws CoreException {
monitor.beginTask(getTaskName(), IProgressMonitor.UNKNOWN);
// MOD gdbu 2011-10-9 TDQ-3545
@@ -340,7 +363,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
}
MessageDialog.openInformation(getViewer().getControl().getShell(),
Messages.getString("RepositoryDropAdapter_moveTitle"), //$NON-NLS-1$
errorMsg); //$NON-NLS-1$
errorMsg);
setReturnValue(false);
return;
}
@@ -371,6 +394,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
protected void run() throws LoginException, PersistenceException {
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
for (Object obj : ((StructuredSelection) data).toArray()) {

View File

@@ -193,6 +193,10 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
if (object instanceof RepositoryViewObject && ((RepositoryViewObject) object).getCustomImage() != null) {
img = ((RepositoryViewObject) object).getCustomImage();
} else {
if (property == null) {
// means item has been deleted or is not available for display now, so just return null
return null;
}
// MOD sizhaoliu 2011-10-14
// TDQ-3356 enable different icons of extension points under a same repository node
Item item = property.getItem();

View File

@@ -483,3 +483,4 @@ TalendDataCollectorUploadingPreferencePage_Days=\u65E5
repository.servicesOperation=\u64CD\u4F5C
repository.servicesPort=\u30DD\u30FC\u30C8
BinRepositoryNode.label=\u3054\u307F\u7BB1
EMetadataEncoding.Latin9=Latin9

View File

@@ -6,11 +6,13 @@ Bundle-Version: 2.2.0.qualifier
Bundle-Localization: plugin
Bundle-Vendor: .Talend SA.
Export-Package: org.talend.core,
org.talend.core.classloader,
org.talend.core.context,
org.talend.core.database,
org.talend.core.database.conn,
org.talend.core.database.conn.template,
org.talend.core.database.conn.version,
org.talend.core.database.hbase.conn.version,
org.talend.core.database.utils,
org.talend.core.download,
org.talend.core.exception,

View File

@@ -8,6 +8,7 @@
<extension-point id="check_servers" name="Check servers" schema="schema/check_servers.exsd"/>
<extension-point id="repositoryComponent_provider" name="Repository Component Provider" schema="schema/repositoryComponent_provider.exsd"/>
<extension-point id="hidePreferencePages_provider" name="Hide Preference Pages" schema="schema/hidePreferencePages_provider.exsd"/>
<extension-point id="classloader_provider" name="Classloader Provider" schema="schema/classloader_provider.exsd"/>
<extension
point="org.eclipse.ui.preferencePages">
@@ -82,11 +83,4 @@
</Component>
</SortedComponents>
</extension>
<extension
point="org.talend.cwm.mip.cwmService">
<cwmService
class="org.talend.core.service.TalendCWMService"
serviceId="CWMService">
</cwmService>
</extension>
</plugin>

View File

@@ -1,109 +1,106 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.talend.cwm.mip" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.talend.cwm.mip" id="cwmService" name="cwm service"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="cwmService"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="cwmService">
<complexType>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn="org.talend.cwm.mip.service.CWMService:"/>
</appInfo>
</annotation>
</attribute>
<attribute name="serviceId" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.talend.core.runtime" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.talend.core.runtime" id="classloader_provider" name="Classloader Provider"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="classloader"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="classloader">
<complexType>
<attribute name="index" type="string" use="required">
<annotation>
<documentation>
The index to search the classloader.
</documentation>
</annotation>
</attribute>
<attribute name="libraries" type="string" use="required">
<annotation>
<documentation>
Libraries which classloader search class from. If have multiple values use semicolon to separate.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>

View File

@@ -125,6 +125,7 @@ EConnectionType.onRowsEndMenu=On Rows End
EConnectionType.mergeMenu=Merge
EConnectionType.synchronize=Synchronize
EConnectionType.parallelize=Parallelize
EConnectionType.startsMenu=Starts
EConnectionType.route=Route
EConnectionType.when=When
EConnectionType.otherwise=Otherwise

View File

@@ -10,13 +10,12 @@
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.utils;
package org.talend.core;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.widgets.Display;
import org.talend.commons.CommonsPlugin;
import org.talend.core.CorePlugin;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.ui.branding.IBrandingService;
/**
@@ -28,7 +27,7 @@ public class BrandingChecker {
private static boolean isBrandingChanged;
private static final String LAST_STARTED_PRODUCT = "last started product"; //$NON-NLS-1$
private static final String LAST_STARTED_PRODUCT = "last_started_product"; //$NON-NLS-1$
public static boolean isBrandingChanged() {
if (!initialized) {
@@ -45,8 +44,9 @@ public class BrandingChecker {
}
display.syncExec(new Runnable() {
@Override
public void run() {
IPreferenceStore preferenceStore = CorePlugin.getDefault().getPreferenceStore();
IPreferenceStore preferenceStore = CoreRuntimePlugin.getInstance().getPreferenceStore();
String oldBrandingName = preferenceStore.getString(LAST_STARTED_PRODUCT);
if (oldBrandingName == null || oldBrandingName.equals("") || !oldBrandingName.equals(fullProductName)) { //$NON-NLS-1$
isBrandingChanged = true;

View File

@@ -27,6 +27,7 @@ import org.eclipse.swt.graphics.Image;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.exception.SystemException;
import org.talend.commons.ui.swt.actions.ITreeContextualAction;
import org.talend.core.model.general.LibraryInfo;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.ColumnNameChanged;
import org.talend.core.model.metadata.IMetadataTable;
@@ -60,7 +61,7 @@ public interface ICoreService extends IService {
public boolean getContextFlagFromQueryUtils();
public Map<String, List<String>> getRoutineAndJars();
public Map<String, List<LibraryInfo>> getRoutineAndJars();
public String getTemplateString();

View File

@@ -72,6 +72,14 @@ public interface ILibraryManagerService extends IService {
*/
public Set<String> list(IProgressMonitor... monitorWrap);
/**
*
* List all .dll files
*
* @return
*/
public Set<String> listAllDllFiles();
public boolean delete(String jarName);
public boolean contains(String jarName);

View File

@@ -41,7 +41,7 @@ public interface ITDQRepositoryService extends IService {
public IViewPart getTDQRespositoryView();
public void openEditor(Item item);
public void openConnectionEditor(Item item);
public void notifySQLExplorer(Item... items);
@@ -98,4 +98,13 @@ public interface ITDQRepositoryService extends IService {
// ADD xqliu 2012-07-24 TDQ-5853
public void checkUsernameBeforeSaveConnection(ConnectionItem connectionItem);
// ADD qiongli 2012-11-12 TDQ-6166
public void initAllConnectionsToSQLExplorer();
// Add yyin 2012-11-15 TDQ-6395
public void saveConnectionWithDependency(ConnectionItem connectionItem);
public void refreshConnectionEditor(Item item);
}

View File

@@ -80,6 +80,8 @@ public class PluginChecker {
private static final String HDFS_PLUGIN_ID = "org.talend.repository.hdfs"; //$NON-NLS-1$
private static final String METADATA_PLUGIN_ID = "org.talend.repository.metadata"; //$NON-NLS-1$
/**
* Check if specific plug-in is loaded.
*
@@ -241,4 +243,8 @@ public class PluginChecker {
public static boolean isHDFSPluginLoaded() {
return isPluginLoaded(HDFS_PLUGIN_ID);
}
public static boolean isMetadataPluginLoaded() {
return isPluginLoaded(METADATA_PLUGIN_ID);
}
}

View File

@@ -0,0 +1,146 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.classloader;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.model.general.Project;
import org.talend.repository.ProjectManager;
import org.talend.utils.io.FilesUtils;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class ClassLoaderFactory {
private static Logger log = Logger.getLogger(ClassLoaderFactory.class);
private final static String EXTENSION_POINT_ID = "org.talend.core.runtime.classloader_provider"; //$NON-NLS-1$
private static IConfigurationElement[] configurationElements = null;
private final static String SEPARATOR = ";"; //$NON-NLS-1$
private final static String PATH_SEPARATOR = "/"; //$NON-NLS-1$
private static Map<String, DynamicClassLoader> classLoadersMap = null;
private static final String INDEX_ATTR = "index"; //$NON-NLS-1$
private static final String LIB_ATTR = "libraries"; //$NON-NLS-1$
static {
IExtensionRegistry registry = Platform.getExtensionRegistry();
configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT_ID);
}
public static ClassLoader getClassLoader(String index) {
if (classLoadersMap == null) {
initClassLoaders();
}
return classLoadersMap.get(index);
}
private static void initClassLoaders() {
File tmpFolder = getTmpFolder();
if (tmpFolder.exists()) {
FilesUtils.removeFolder(tmpFolder, true);
}
classLoadersMap = new HashMap<String, DynamicClassLoader>();
for (IConfigurationElement current : configurationElements) {
String index = current.getAttribute(INDEX_ATTR);
String libraries = current.getAttribute(LIB_ATTR);
if (StringUtils.isNotEmpty(index)) {
DynamicClassLoader classLoader = new DynamicClassLoader();
if (StringUtils.isNotEmpty(libraries)) {
String[] librariesArray = libraries.split(SEPARATOR);
List<String> jarPathList = retrieveJarPaths(librariesArray);
classLoader.addLibraries(jarPathList);
}
classLoadersMap.put(index, classLoader);
}
}
}
private static List<String> retrieveJarPaths(String[] driversArray) {
List<String> jarPathList = new ArrayList<String>();
if (driversArray == null || driversArray.length == 0) {
return jarPathList;
}
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerService.class);
String libPath = getLibPath();
for (String driverName : driversArray) {
String jarPath = libPath + PATH_SEPARATOR + driverName;
File jarFile = new File(jarPath);
if (!jarFile.exists()) {
boolean retrieved = librairesManagerService.retrieve(driverName, libPath, new NullProgressMonitor());
if (!retrieved) {
log.warn("Cannot retrieve lib: " + driverName);
}
}
jarPathList.add(jarFile.getAbsolutePath());
}
return jarPathList;
}
private static String getLibPath() {
File tmpFolder = getTmpFolder();
if (!tmpFolder.exists()) {
tmpFolder.mkdirs();
}
try {
tmpFolder = File.createTempFile("libs", null, tmpFolder); //$NON-NLS-1$
if (tmpFolder.exists() && tmpFolder.isFile()) {
tmpFolder.delete();
tmpFolder.mkdirs();
}
} catch (IOException e) {
}
return tmpFolder.getAbsolutePath();
}
private static File getTmpFolder() {
Project project = ProjectManager.getInstance().getCurrentProject();
IProject physProject;
String tmpFolderPath = System.getProperty("user.dir"); //$NON-NLS-1$
try {
physProject = ResourceUtils.getProject(project.getTechnicalLabel());
tmpFolderPath = physProject.getFolder("temp").getLocation().toPortableString(); //$NON-NLS-1$
} catch (Exception e) {
ExceptionHandler.process(e);
}
tmpFolderPath = tmpFolderPath + "/libraries"; //$NON-NLS-1$
return new File(tmpFolderPath);
}
}

View File

@@ -0,0 +1,54 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.classloader;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.List;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class DynamicClassLoader extends URLClassLoader {
/**
* DOC ycbai DynamicClassLoader constructor comment.
*/
public DynamicClassLoader() {
super(new URL[0], DynamicClassLoader.class.getClassLoader());
}
public void addLibraries(String lib) {
if (lib != null) {
File libFile = new File(lib);
try {
addURL(libFile.toURL());
} catch (MalformedURLException e) {
ExceptionHandler.process(e);
}
}
}
public void addLibraries(List<String> libs) {
if (libs != null && libs.size() > 0) {
for (String lib : libs) {
addLibraries(lib);
}
}
}
}

View File

@@ -65,8 +65,11 @@ public enum EDatabase4DriverClassName {
SAS(EDatabaseTypeName.SAS, "com.sas.rio.MVADriver"), //$NON-NLS-1$
SQLITE(EDatabaseTypeName.SQLITE, "org.sqlite.JDBC"), //$NON-NLS-1$
SYBASEASE(EDatabaseTypeName.SYBASEASE, "com.sybase.jdbc3.jdbc.SybDriver"), //$NON-NLS-1$
SYBASEIQ(EDatabaseTypeName.SYBASEIQ, "com.sybase.jdbc3.jdbc.SybDriver"), //$NON-NLS-1$
SYBASEASE(EDatabaseTypeName.SYBASEASE, new String[] {
"com.sybase.jdbc3.jdbc.SybDriver", "com.sybase.jdbc3.jdbc.SybDataSource" }, new String[] {}), //$NON-NLS-1$
SYBASEIQ(
EDatabaseTypeName.SYBASEIQ,
new String[] { "com.sybase.jdbc3.jdbc.SybDriver", "com.sybase.jdbc3.jdbc.SybDataSource" }, new String[] {}), //$NON-NLS-1$
EXASOLUTION(EDatabaseTypeName.EXASOL, "com.exasol.jdbc.EXADriver"), //$NON-NLS-1$
// MOD klliu 2010-06-04 bug 12819: upgrade jdbc driver class used in sql explorer

View File

@@ -27,26 +27,43 @@ public class ConnParameterKeys {
/**
* The key is used for Hive Mode to store its value.
*/
public static final String CONN_PARA_KEY_HIVE_MODE = "CONN_PARA_KEY_HIVE_MODE";
public static final String CONN_PARA_KEY_HIVE_MODE = "CONN_PARA_KEY_HIVE_MODE"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_DISTRIBUTION = "CONN_PARA_KEY_HIVE_DISTRIBUTION";
public static final String CONN_PARA_KEY_HIVE_DISTRIBUTION = "CONN_PARA_KEY_HIVE_DISTRIBUTION"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_VERSION = "CONN_PARA_KEY_HIVE_VERSION";
public static final String CONN_PARA_KEY_HIVE_VERSION = "CONN_PARA_KEY_HIVE_VERSION"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_CHARACTER_ENCODING = "CONN_PARA_KEY_CHARACTER_ENCODING"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_NAME_NODE_URL = "CONN_PARA_KEY_NAME_NODE_URL"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_JOB_TRACKER_URL = "CONN_PARA_KEY_JOB_TRACKER_URL"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_METASTORE_CONN_URL = "CONN_PARA_KEY_METASTORE_CONN_URL"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_METASTORE_CONN_USERNAME = "CONN_PARA_KEY_METASTORE_CONN_USERNAME"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_METASTORE_CONN_PASSWORD = "CONN_PARA_KEY_METASTORE_CONN_PASSWORD"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_METASTORE_CONN_DRIVER_JAR = "CONN_PARA_KEY_METASTORE_CONN_DRIVER_JAR"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_METASTORE_CONN_DRIVER_NAME = "CONN_PARA_KEY_METASTORE_CONN_DRIVER_NAME"; //$NON-NLS-1$
/**
* The key is for metastore server.
*/
public static final String CONN_PARA_KEY_METASTORE_SERVERNAME = "CONN_PARA_KEY_METASTORE_SERVERNAME"; //$NON-NLS-1$
/**
* The key is for metastore server port.
*/
public static final String CONN_PARA_KEY_METASTORE_PROT = "CONN_PARA_KEY_METASTORE_PROT"; //$NON-NLS-1$
/**
* keys used for Hadoop settings.
*/
public static final String CONN_PARA_KEY_HBASE_DISTRIBUTION = "CONN_PARA_KEY_HBASE_DISTRIBUTION"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_HBASE_VERSION = "CONN_PARA_KEY_HBASE_VERSION"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_CHARACTER_ENCODING = "CONN_PARA_KEY_CHARACTER_ENCODING";
public static final String CONN_PARA_KEY_NAME_NODE_URL = "CONN_PARA_KEY_NAME_NODE_URL";
public static final String CONN_PARA_KEY_JOB_TRACKER_URL = "CONN_PARA_KEY_JOB_TRACKER_URL";
public static final String CONN_PARA_KEY_METASTORE_CONN_URL = "CONN_PARA_KEY_METASTORE_CONN_URL";
public static final String CONN_PARA_KEY_METASTORE_CONN_USERNAME = "CONN_PARA_KEY_METASTORE_CONN_USERNAME";
public static final String CONN_PARA_KEY_METASTORE_CONN_PASSWORD = "CONN_PARA_KEY_METASTORE_CONN_PASSWORD";
public static final String CONN_PARA_KEY_METASTORE_CONN_DRIVER_JAR = "CONN_PARA_KEY_METASTORE_CONN_DRIVER_JAR";
public static final String CONN_PARA_KEY_METASTORE_CONN_DRIVER_NAME = "CONN_PARA_KEY_METASTORE_CONN_DRIVER_NAME";
}

View File

@@ -0,0 +1,63 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.database.conn;
/**
* These keys in this enum are the key of configuration properties for Hive from <code>HiveConf</code>. Created by
* Marvin Wang on Nov 22, 2012.
*/
public enum HiveConfKeysForTalend {
/**
* This is for the url of name node, the value of the key is <code>fs.default.name</code>.
*/
HIVE_CONF_KEY_FS_DEFAULT_NAME("fs.default.name"), //$NON-NLS-1$
/**
* This key is for job traker url, value of the key is <code>mapred.job.tracker</code>.
*/
HIVE_CONF_KEY_MAPRED_JOB_TRACKER("mapred.job.tracker"), //$NON-NLS-1$
HIVE_CONF_KEY_JDO_CONNECTION_URL("javax.jdo.option.ConnectionURL"), //$NON-NLS-1$
HIVE_CONF_KEY_JDO_CONNECTION_USERNAME("javax.jdo.option.ConnectionUserName"), //$NON-NLS-1$
HIVE_CONF_KEY_JDO_CONNECTION_PASSWORD("javax.jdo.option.ConnectionPassword"), //$NON-NLS-1$
HIVE_CONF_KEY_JDO_CONNECTION_DRIVERNAME("javax.jdo.option.ConnectionDriverName"), //$NON-NLS-1$
HIVE_CONF_KEY_HIVE_METASTORE_LOCAL("hive.metastore.local"), //$NON-NLS-1$
HIVE_CONF_KEY_HIVE_METASTORE_URI("hive.metastore.uris"), //$NON-NLS-1$
HIVE_CONF_KEY_HIVE_METASTORE_EXECUTE_SETUGI("hive.metastore.execute.setugi"), //$NON-NLS-1$
HIVE_CONF_KEY_TALEND_HIVE_MODE("talend.hive.mode"), //$NON-NLS-1$
;
private String key;
HiveConfKeysForTalend(String key) {
this.key = key;
}
public String getKey() {
return this.key;
}
@Override
public String toString() {
return this.key;
}
}

View File

@@ -19,8 +19,6 @@ import java.util.List;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.language.LanguageManager;
/**
* cli class global comment. Detailled comment
@@ -257,37 +255,16 @@ public enum EDatabaseConnTemplate {
databaseType.add(typeName);
}
}
if (!all && LanguageManager.getCurrentLanguage() == ECodeLanguage.PERL) {
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.MSSQL, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.INGRES, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.INTERBASE, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.INFORMIX, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.FIREBIRD, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.ACCESS, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.TERADATA, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.AS400, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.JAVADB_DERBYCLIENT, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.JAVADB_EMBEDED, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.JAVADB_JCCJDBC, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HSQLDB_IN_PROGRESS, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HSQLDB_SERVER, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HSQLDB_WEBSERVER, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.VERTICA, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HIVE, display));
databaseType.remove(getDBTypeName(EDatabaseConnTemplate.HBASE, display));
}
if (sort) {
String[] sortedArray = databaseType.toArray(new String[0]);
Arrays.sort(sortedArray, new Comparator() {
Arrays.sort(sortedArray, new Comparator<String>() {
public int compare(Object o1, Object o2) {
if (o1 instanceof String && o2 instanceof String) {
return o1.toString().compareTo(o2.toString());
}
return 0;
@Override
public int compare(String o1, String o2) {
return o1.compareTo(o2);
}
});
return Arrays.asList(sortedArray);
return new ArrayList<String>(Arrays.asList(sortedArray));
}
return databaseType;
}

View File

@@ -63,7 +63,7 @@ public enum EDatabaseVersion4Drivers {
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
// MYSQL, add for 9594
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.0-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.22-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MYSQL_4(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 4", "MYSQL_4", "mysql-connector-java-3.1.14-bin.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// add for 9594
MSSQL(new DbVersion4Drivers(EDatabaseTypeName.MSSQL, "jtds-1.2.5.jar")), //$NON-NLS-1$

View File

@@ -0,0 +1,112 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.database.hbase.conn.version;
import java.util.ArrayList;
import java.util.List;
/**
* DOC ycbai class global comment. Detailled comment
*/
public enum EHBaseDistribution4Versions {
HDP_1_0(EHBaseDistributions.HORTONWORKS, "Hortonworks Data Platform V1", "HDP_1_0"),
APACHE_1_0_0(EHBaseDistributions.APACHE, "Apache 1.0.0", "APACHE_1_0_0"),
APACHE_0_20_204(EHBaseDistributions.APACHE, "Apache 0.20.203", "APACHE_0_20_203"),
CLOUDERA_CDH4(EHBaseDistributions.CLOUDERA, "Cloudera CDH4", "Cloudera_CDH4"),
MAPR(EHBaseDistributions.MAPR, "MapR 2.0.0", "MAPR2");
private EHBaseDistributions distribution;
private String versionDisplayName;
private String versionValue;
EHBaseDistribution4Versions(EHBaseDistributions distribution, String versionDisplayName, String versionValue) {
this.distribution = distribution;
this.versionDisplayName = versionDisplayName;
this.versionValue = versionValue;
}
public static List<EHBaseDistribution4Versions> indexOfByDistribution(String distribution) {
List<EHBaseDistribution4Versions> distribution4Versions = new ArrayList<EHBaseDistribution4Versions>();
if (distribution != null) {
for (EHBaseDistribution4Versions d4v : EHBaseDistribution4Versions.values()) {
if (d4v.getDistribution().getName().equals(distribution)
|| d4v.getDistribution().getDisplayName().equals(distribution)) {
distribution4Versions.add(d4v);
}
}
}
return distribution4Versions;
}
public static EHBaseDistribution4Versions indexOfByVersionDisplay(String displayName) {
return indexOf(displayName, true);
}
public static EHBaseDistribution4Versions indexOfByVersion(String value) {
return indexOf(value, false);
}
private static EHBaseDistribution4Versions indexOf(String name, boolean display) {
if (name != null) {
for (EHBaseDistribution4Versions version : EHBaseDistribution4Versions.values()) {
if (display) {
if (name.equalsIgnoreCase(version.getVersionDisplayName())) {
return version;
}
} else {
if (name.equalsIgnoreCase(version.getVersionValue())) {
return version;
}
}
}
}
return null;
}
public static List<String> getHadoopDistributionVersions(String distribution) {
return getHadoopDistributionVersions(distribution, true);
}
public static List<String> getHadoopDistributionVersions(String distribution, boolean display) {
List<String> result = new ArrayList<String>();
List<EHBaseDistribution4Versions> d4vList = EHBaseDistribution4Versions.indexOfByDistribution(distribution);
for (EHBaseDistribution4Versions d4v : d4vList) {
if (display) {
result.add(d4v.getVersionDisplayName());
} else {
result.add(d4v.getVersionValue());
}
}
return result;
}
public EHBaseDistributions getDistribution() {
return this.distribution;
}
public String getVersionDisplayName() {
return this.versionDisplayName;
}
public String getVersionValue() {
return this.versionValue;
}
}

View File

@@ -0,0 +1,84 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.database.hbase.conn.version;
import java.util.ArrayList;
import java.util.List;
/**
* DOC ycbai class global comment. Detailled comment
*/
public enum EHBaseDistributions {
HORTONWORKS("HortonWorks"),
CLOUDERA("Cloudera"),
MAPR("MapR"),
APACHE("Apache");
private String displayName;
EHBaseDistributions(String displayName) {
this.displayName = displayName;
}
public String getName() {
return name();
}
public String getDisplayName() {
return this.displayName;
}
public static List<String> getAllDistributionDisplayNames() {
return getAllDistributionNames(true);
}
public static List<String> getAllDistributionNames(boolean display) {
List<String> names = new ArrayList<String>();
EHBaseDistributions[] values = values();
for (EHBaseDistributions distribution : values) {
if (display) {
names.add(distribution.getDisplayName());
} else {
names.add(distribution.getName());
}
}
return names;
}
public static EHBaseDistributions getDistributionByDisplayName(String name) {
return getDistributionByName(name, true);
}
public static EHBaseDistributions getDistributionByName(String name, boolean display) {
if (name != null) {
for (EHBaseDistributions distribution : values()) {
if (display) {
if (name.equalsIgnoreCase(distribution.getDisplayName())) {
return distribution;
}
} else {
if (name.equalsIgnoreCase(distribution.getName())) {
return distribution;
}
}
}
}
return null;
}
}

View File

@@ -127,14 +127,17 @@ public class JobContextManager implements IContextManager {
loadFromEmf(contextTypeList, defaultContextName);
}
@Override
public void addContextListener(IContextListener listener) {
contextListenerList.add(listener);
}
@Override
public void removeContextListener(IContextListener listener) {
contextListenerList.remove(listener);
}
@Override
public void fireContextsChangedEvent() {
for (IContextListener contextListener : contextListenerList) {
contextListener.contextsChanged();
@@ -170,6 +173,7 @@ public class JobContextManager implements IContextManager {
*
* @see org.talend.core.model.process.IContextManager#getDefaultContext()
*/
@Override
public IContext getDefaultContext() {
return defaultContext;
}
@@ -179,6 +183,7 @@ public class JobContextManager implements IContextManager {
*
* @see org.talend.core.model.process.IContextManager#setDefaultContext(org.talend.core.model.process.IContext)
*/
@Override
public void setDefaultContext(IContext context) {
defaultContext = context;
}
@@ -188,6 +193,7 @@ public class JobContextManager implements IContextManager {
*
* @see org.talend.core.model.process.IContextManager#getListContext()
*/
@Override
public List<IContext> getListContext() {
return listContext;
}
@@ -197,6 +203,7 @@ public class JobContextManager implements IContextManager {
*
* @see org.talend.core.model.process.IContextManager#getListContext(java.util.List)
*/
@Override
public void setListContext(List<IContext> listContext) {
this.listContext = listContext;
}
@@ -208,6 +215,7 @@ public class JobContextManager implements IContextManager {
* @param uniqueName
* @return true if the name is unique
*/
@Override
public boolean checkValidParameterName(String oldContextName, String newContextName) {
for (IContextParameter contextParameter : listContext.get(0).getContextParameterList()) {
// TDI-17682:avoid to compare the lower/uper case with the parameter itself
@@ -234,6 +242,7 @@ public class JobContextManager implements IContextManager {
return Pattern.matches(RepositoryConstants.CONTEXT_AND_VARIABLE_PATTERN, newContextName);
}
@Override
public IContext getContext(String name) {
for (int i = 0; i < listContext.size(); i++) {
if (listContext.get(i).getName().equals(name)) {
@@ -243,6 +252,7 @@ public class JobContextManager implements IContextManager {
return defaultContext;
}
@Override
public void saveToEmf(EList contextTypeList) {
ContextType contextType;
IContext context;
@@ -295,6 +305,7 @@ public class JobContextManager implements IContextManager {
}
}
@Override
public void loadFromEmf(EList contextTypeList, String defaultContextName) {
IContext context;
ContextType contextType;
@@ -316,7 +327,7 @@ public class JobContextManager implements IContextManager {
contextType = (ContextType) contextTypeList.get(i);
String name = contextType.getName();
if (name == null) {
name = "Default";
name = IContext.DEFAULT;
}
context = new JobContext(name);
context.setConfirmationNeeded(contextType.isConfirmationNeeded());
@@ -342,8 +353,8 @@ public class JobContextManager implements IContextManager {
} else {
String[] existingTypes;
existingTypes = ContextParameterJavaTypeManager.getPerlTypesLabels();
for (int k = 0; k < existingTypes.length; k++) {
if (existingTypes[k].equals(contextParamType.getType())) {
for (String existingType : existingTypes) {
if (existingType.equals(contextParamType.getType())) {
exists = true;
}
}
@@ -383,6 +394,7 @@ public class JobContextManager implements IContextManager {
}
}
@Override
public boolean sameAs(IContextManager contextManager) {
if (!contextManager.getDefaultContext().getName().equals(defaultContext.getName())) {
return false;

View File

@@ -13,10 +13,13 @@
package org.talend.core.model.general;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.runtime.i18n.Messages;
import org.talend.json.JSONException;
import org.talend.json.JSONObject;
import org.talend.repository.model.RepositoryConstants;
/**
@@ -31,22 +34,26 @@ public class ConnectionBean implements Cloneable {
private static final String FIELDS_SEPARATOR = "#"; //$NON-NLS-1$
private String repositoryId;
private static final String ID = "id"; //$NON-NLS-1$
private String name;
private static final String DESCRIPTION = "description"; //$NON-NLS-1$
private String description;
private static final String NAME = "name"; //$NON-NLS-1$
private String user;
private static final String PASSWORD = "password"; //$NON-NLS-1$
private String password;
private static final String USER = "user"; //$NON-NLS-1$
private static final String WORKSPACE = "workSpace"; //$NON-NLS-1$
private static final String DYNAMICFIELDS = "dynamicFields"; //$NON-NLS-1$
private static final String COMPLETE = "complete"; //$NON-NLS-1$
private JSONObject conDetails = new JSONObject();
private Map<String, String> dynamicFields = new HashMap<String, String>();
private boolean complete;
private String workSpace;
/**
* DOC smallet ConnectionBean constructor comment.
*/
@@ -73,12 +80,33 @@ public class ConnectionBean implements Cloneable {
return newConnection;
}
/**
* Getter for ID.
*
* @return the ID
*/
public String getRepositoryId() {
return this.repositoryId;
try {
if (conDetails.has(ID)) {
return conDetails.getString(ID);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
/**
* Sets the ID.
*
* @param id the id to set
*/
public void setRepositoryId(String repositoryId) {
this.repositoryId = repositoryId;
try {
conDetails.put(ID, repositoryId);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
/**
@@ -87,7 +115,14 @@ public class ConnectionBean implements Cloneable {
* @return the description
*/
public String getDescription() {
return this.description;
try {
if (conDetails.has(DESCRIPTION)) {
return conDetails.getString(DESCRIPTION);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
/**
@@ -96,7 +131,11 @@ public class ConnectionBean implements Cloneable {
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
try {
conDetails.put(DESCRIPTION, description);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
/**
@@ -105,7 +144,14 @@ public class ConnectionBean implements Cloneable {
* @return the name
*/
public String getName() {
return this.name;
try {
if (conDetails.has(NAME)) {
return conDetails.getString(NAME);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
/**
@@ -114,7 +160,11 @@ public class ConnectionBean implements Cloneable {
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
try {
conDetails.put(NAME, name);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
/**
@@ -123,7 +173,14 @@ public class ConnectionBean implements Cloneable {
* @return the password
*/
public String getPassword() {
return this.password;
try {
if (conDetails.has(PASSWORD)) {
return conDetails.getString(PASSWORD);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
/**
@@ -132,7 +189,11 @@ public class ConnectionBean implements Cloneable {
* @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
try {
conDetails.put(PASSWORD, password);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
/**
@@ -141,7 +202,14 @@ public class ConnectionBean implements Cloneable {
* @return the user
*/
public String getUser() {
return this.user;
try {
if (conDetails.has(USER)) {
return conDetails.getString(USER);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
/**
@@ -150,7 +218,11 @@ public class ConnectionBean implements Cloneable {
* @param user the user to set
*/
public void setUser(String user) {
this.user = user;
try {
conDetails.put(USER, user);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
/**
@@ -159,10 +231,14 @@ public class ConnectionBean implements Cloneable {
* @return the workSpace
*/
public String getWorkSpace() {
if (this.workSpace == null) {
return ""; //$NON-NLS-1$
try {
if (conDetails.has(WORKSPACE)) {
return conDetails.getString(WORKSPACE);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return this.workSpace;
return "";
}
/**
@@ -171,11 +247,15 @@ public class ConnectionBean implements Cloneable {
* @param workSpace the workSpace to set
*/
public void setWorkSpace(String workSpace) {
this.workSpace = workSpace;
try {
conDetails.put(WORKSPACE, workSpace);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
public Map<String, String> getDynamicFields() {
return this.dynamicFields;
return dynamicFields;
}
public void setDynamicFields(Map<String, String> dynamicFields) {
@@ -183,53 +263,32 @@ public class ConnectionBean implements Cloneable {
}
public boolean isComplete() {
return this.complete;
try {
if (conDetails.has(COMPLETE)) {
return (Boolean) conDetails.get(COMPLETE);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return false;
}
public void setComplete(boolean complete) {
this.complete = complete;
try {
conDetails.put(COMPLETE, complete);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public ConnectionBean clone() throws CloneNotSupportedException {
ConnectionBean object = (ConnectionBean) super.clone();
object.setDynamicFields(new HashMap<String, String>(this.dynamicFields));
return object;
return writeFromJSON(this.getConDetails());
}
@Override
public String toString() {
StringBuffer string = new StringBuffer("Repository:" + getRepositoryId() + ", Name:" + getName() //$NON-NLS-1$ //$NON-NLS-2$
+ ", Desription:" + getDescription() + ", User:" + getUser() + ", Password:" + getPassword() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ", WorkSpace:" + getWorkSpace() + ", Complete:" + isComplete()); //$NON-NLS-1$//$NON-NLS-1$ //$NON-NLS-2$
string.append(", Dyn:").append(dynamicFields); //$NON-NLS-1$
return string.toString();
}
public String readToString() {
StringBuffer fields = new StringBuffer(256);
fields.append(assertValue(getRepositoryId()));
fields.append(FIELDS_SEPARATOR);
fields.append(assertValue(getName()));
fields.append(FIELDS_SEPARATOR);
fields.append(assertValue(getDescription()));
fields.append(FIELDS_SEPARATOR);
fields.append(assertValue(getUser()));
fields.append(FIELDS_SEPARATOR);
fields.append(assertValue(getPassword()));
fields.append(FIELDS_SEPARATOR);
fields.append(assertValue(getWorkSpace()));
fields.append(FIELDS_SEPARATOR);
fields.append(isComplete());
if (dynamicFields.size() > 0) {
for (String current : dynamicFields.keySet()) {
fields.append(FIELDS_SEPARATOR);
fields.append(current + DYN_FIELDS_SEPARATOR + dynamicFields.get(current));
}
}
return fields.toString();
return this.getConDetails().toString();
}
public static ConnectionBean writeFromString(String s) {
@@ -244,41 +303,28 @@ public class ConnectionBean implements Cloneable {
toReturn.setPassword(st[i++]);
toReturn.setWorkSpace(st[i++]);
toReturn.setComplete(new Boolean(st[i++]));
JSONObject dynamicJson = new JSONObject();
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);
while (i < st.length) {
String[] st2 = st[i++].split(DYN_FIELDS_SEPARATOR, -1);
toReturn.getDynamicFields().put(st2[0], st2[1]);
dynamicJson.put(st2[0], st2[1]);
}
} catch (ArrayIndexOutOfBoundsException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return toReturn;
}
// public static void main(String[] args) {
// ConnectionBean tt = new ConnectionBean();
// tt.setName("tagada");
// System.out.println(tt);
// tt.setDescription("MyDesc");
// tt.setUser("smallet@talend.com");
// tt.setPassword("");
// tt.getDynamicFields().put("DbLogin", "root");
// tt.getDynamicFields().put("DbPassword", "toor");
// String test2 = tt.readToString();
// ConnectionBean bean2 = writeFromString(test2);
// System.out.println(bean2 + " (" + test2 + ")");
// }
/**
*
* DOC ggu Comment method "assertValue".
*/
private String assertValue(final String value) {
if (value == null) {
return ""; //$NON-NLS-1$
public static ConnectionBean writeFromJSON(JSONObject json) {
ConnectionBean toReturn = new ConnectionBean();
try {
toReturn.setConDetails(new JSONObject(json.toString()));
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return value;
return toReturn;
}
@Override
@@ -289,8 +335,43 @@ public class ConnectionBean implements Cloneable {
if (!(obj instanceof ConnectionBean)) {
return false;
}
ConnectionBean other = (ConnectionBean) obj;
return this.readToString().equals(((ConnectionBean) obj).readToString());
return this.getConDetails().toString().equals(other.getConDetails().toString());
}
public JSONObject getConDetails() {
JSONObject dynamicJson = new JSONObject();
try {
for (String key : dynamicFields.keySet()) {
dynamicJson.put(key, dynamicFields.get(key));
}
conDetails.put(DYNAMICFIELDS, dynamicJson);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return conDetails;
}
public void setConDetails(JSONObject conDetails) {
this.conDetails = conDetails;
try {
if (conDetails.has(DYNAMICFIELDS)) {
Object object = conDetails.get(DYNAMICFIELDS);
if (object instanceof JSONObject) {
JSONObject dynamicJson = (JSONObject) object;
Iterator sortedKeys = dynamicJson.sortedKeys();
while (sortedKeys.hasNext()) {
String key = (String) sortedKeys.next();
String value = dynamicJson.getString(key);
dynamicFields.put(key, value);
}
}
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
}

View File

@@ -0,0 +1,71 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.general;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class LibraryInfo {
private String libName;
private String bundleId;
public String getLibName() {
return this.libName;
}
public void setLibName(String libName) {
this.libName = libName;
}
public String getBundleId() {
return this.bundleId;
}
public void setBundleId(String bundleId) {
this.bundleId = bundleId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.bundleId == null) ? 0 : this.bundleId.hashCode());
result = prime * result + ((this.libName == null) ? 0 : this.libName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LibraryInfo other = (LibraryInfo) obj;
if (this.bundleId == null) {
if (other.bundleId != null)
return false;
} else if (!this.bundleId.equals(other.bundleId))
return false;
if (this.libName == null) {
if (other.libName != null)
return false;
} else if (!this.libName.equals(other.libName))
return false;
return true;
}
}

View File

@@ -244,4 +244,83 @@ public class ModuleNeeded {
return moduleName + "[" + bundleName + ":" + bundleVersion + "]";
}
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
int hashCode = 31;
if (this.getModuleName() != null) {
hashCode *= this.getModuleName().hashCode();
}
if (this.getBundleName() != null) {
hashCode *= this.getBundleName().hashCode();
}
if (this.getBundleVersion() != null) {
hashCode *= this.getBundleVersion().hashCode();
}
hashCode *= new Boolean(this.isRequired()).hashCode();
return hashCode;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof ModuleNeeded)) {
return false;
}
ModuleNeeded other = (ModuleNeeded) obj;
// ModuleName
if (other.getModuleName() == null) {
if (this.getModuleName() != null) {
return false;
}
} else {
if (this.getModuleName() == null) {
return false;
} else if (!other.getModuleName().equals(this.getModuleName())) {
return false;
}
}
// BundleName
if (other.getBundleName() == null) {
if (this.getBundleName() != null) {
return false;
}
} else {
if (this.getBundleName() == null) {
return false;
} else if (!other.getBundleName().equals(this.getBundleName())) {
return false;
}
}
// BundleVersion
if (other.getBundleVersion() == null) {
if (this.getBundleVersion() != null) {
return false;
}
} else {
if (this.getBundleVersion() == null) {
return false;
} else if (!other.getBundleVersion().equals(this.getBundleVersion())) {
return false;
}
}
if (other.isRequired() != this.isRequired()) {
return false;
}
return true;
}
}

View File

@@ -388,8 +388,12 @@ public class MetadataSchema {
if (pattern.getNodeValue() != null) {
metadataColumn.setPattern(pattern.getNodeValue());
}
metadataColumn.setOriginalField(metadataColumn.getLabel());
if (originalField.getNodeValue() != null) {
String originalFieldValue = MetadataToolHelper.validateColumnName(originalField.getNodeValue(), 0);
metadataColumn.setOriginalField(originalFieldValue);
} else {
metadataColumn.setOriginalField(metadataColumn.getLabel());
}
if (!columnsAlreadyAdded.contains(metadataColumn.getLabel())) {
listColumns.add(metadataColumn);
columnsAlreadyAdded.add(metadataColumn.getLabel());

View File

@@ -15,6 +15,8 @@ package org.talend.core.model.metadata.connection.hive;
import java.util.ArrayList;
import java.util.List;
import org.talend.commons.utils.platform.PluginChecker;
/**
* @author Marvin Wang
* @version 1.0 jdk1.6
@@ -31,10 +33,11 @@ public class HiveConnUtils {
*/
public static String[] getDistributionNames() {
List<String> list = getDistributionNameList();
if (list == null)
if (list == null) {
return new String[0];
else
} else {
return list.toArray(new String[list.size()]);
}
}
/**
@@ -81,8 +84,9 @@ public class HiveConnUtils {
HiveConnVersionInfo[] followsBeans = bean.getFollows();
if (followsBeans != null && followsBeans.length > 0) {
for (HiveConnVersionInfo followsBean : followsBeans) {
if (followsBean.getKey().equals(key))
if (followsBean.getKey().equals(key)) {
listFollowingKey.add(bean);
}
}
}
}
@@ -117,9 +121,15 @@ public class HiveConnUtils {
List<HiveConnVersionInfo> list = new ArrayList<HiveConnVersionInfo>();
for (HiveConnVersionInfo bean : beans) {
int beanLevel = bean.getLevel();
if (level == beanLevel)
if (level == beanLevel) {
list.add(bean);
}
}
// ADD msjian TDQ-6407 2012-11-26:for top not support hive embedded mode
if (PluginChecker.isOnlyTopLoaded() && (level == 0 || level == 2)) {
list.remove(0);
}
// TDQ-6407~
return list;
}
return null;
@@ -135,8 +145,9 @@ public class HiveConnUtils {
String[] names = getDistributionNames();
if (names != null && names.length > 0) {
for (int i = 0; i < names.length; i++) {
if (displayName != null && displayName.equals(names[i]))
if (displayName != null && displayName.equals(names[i])) {
return i;
}
}
}
return -1;
@@ -153,8 +164,9 @@ public class HiveConnUtils {
List<HiveConnVersionInfo> beans = getObjectsByLevel(level);
if (beans != null && beans.size() > 0) {
for (HiveConnVersionInfo bean : beans) {
if (displayName != null && displayName.equals(bean.getDisplayName()))
if (displayName != null && displayName.equals(bean.getDisplayName())) {
return bean.getKey();
}
}
}
return null;
@@ -187,10 +199,11 @@ public class HiveConnUtils {
public static String[] getHiveVersionNames(int distributionIndex) {
List<String> hiveVersionNameList = getHiveVersionNameList(distributionIndex);
if (hiveVersionNameList != null && hiveVersionNameList.size() > 0)
if (hiveVersionNameList != null && hiveVersionNameList.size() > 0) {
return hiveVersionNameList.toArray(new String[hiveVersionNameList.size()]);
else
} else {
return new String[0];
}
}
/**
@@ -212,6 +225,11 @@ public class HiveConnUtils {
protected static List<String> getHiveModeNameList(int distributionIndex, int versionIndex) {
List<HiveConnVersionInfo> hiveModeObjs = getHiveModes(distributionIndex, versionIndex);
// ADD msjian TDQ-6407 2012-11-26: for top, not support hive embeded mode,hide this menu
if (PluginChecker.isOnlyTopLoaded() && hiveModeObjs.size() > 1) {
hiveModeObjs.remove(0);
}
// TDQ-6407~
if (hiveModeObjs != null && hiveModeObjs.size() > 0) {
List<String> hiveModeNameList = new ArrayList<String>();
for (HiveConnVersionInfo bean : hiveModeObjs) {
@@ -224,10 +242,11 @@ public class HiveConnUtils {
public static String[] getHiveModeNames(int distributionIndex, int versionIndex) {
List<String> hiveModeNameList = getHiveModeNameList(distributionIndex, versionIndex);
if (hiveModeNameList != null && hiveModeNameList.size() > 0)
if (hiveModeNameList != null && hiveModeNameList.size() > 0) {
return hiveModeNameList.toArray(new String[hiveModeNameList.size()]);
else
} else {
return new String[0];
}
}
public static int getIndexOfDistribution(String distributionKey) {
@@ -235,8 +254,9 @@ public class HiveConnUtils {
List<HiveConnVersionInfo> distributions = getObjectsByLevel(level);
if (distributions != null && distributions.size() > 0) {
for (int i = 0; i < distributions.size(); i++) {
if (distributions.get(i).getKey().equals(distributionKey))
if (distributions.get(i).getKey().equals(distributionKey)) {
return i;
}
}
}
return -1;
@@ -252,8 +272,9 @@ public class HiveConnUtils {
List<HiveConnVersionInfo> hiveVersions = getHiveVersions(distributionIndex);
if (hiveVersions != null && hiveVersions.size() > 0) {
for (int i = 0; i < hiveVersions.size(); i++) {
if (hiveVersions.get(i).getKey().equals(hiveVersionKey))
if (hiveVersions.get(i).getKey().equals(hiveVersionKey)) {
return i;
}
}
}
return -1;
@@ -271,8 +292,9 @@ public class HiveConnUtils {
List<HiveConnVersionInfo> hiveModes = getHiveModes(distributionIndex, hiveVersionIndex);
if (hiveModes != null && hiveModes.size() > 0) {
for (int i = 0; i < hiveModes.size(); i++) {
if (hiveModes.get(i).getKey().equals(hiveModeKey))
if (hiveModes.get(i).getKey().equals(hiveModeKey)) {
return i;
}
}
}
return -1;
@@ -290,8 +312,9 @@ public class HiveConnUtils {
List<HiveConnVersionInfo> hiveModes = getHiveModes(distributionIndex, hiveVersionIndex);
if (hiveModes != null && hiveModes.size() > 0) {
HiveConnVersionInfo hiveMode = hiveModes.get(hiveModeIndex);
if (HiveConnVersionInfo.MODE_EMBEDDED.getKey().equals(hiveMode.getKey()))
if (HiveConnVersionInfo.MODE_EMBEDDED.getKey().equals(hiveMode.getKey())) {
return true;
}
}
return false;
}
@@ -305,8 +328,9 @@ public class HiveConnUtils {
*/
public static HiveConnVersionInfo getDistributionObj(int index) {
List<HiveConnVersionInfo> distributions = getObjectsByLevel(0);
if (distributions != null && distributions.size() > 0)
if (distributions != null && distributions.size() > 0) {
return distributions.get(index);
}
return null;
}
@@ -320,8 +344,9 @@ public class HiveConnUtils {
*/
public static HiveConnVersionInfo getHiveVersionObj(int distributionIndex, int hiveVersionIndex) {
List<HiveConnVersionInfo> objs = getHiveVersions(distributionIndex);
if (objs != null && objs.size() > 0)
if (objs != null && objs.size() > 0) {
return objs.get(hiveVersionIndex);
}
return null;
}
@@ -336,15 +361,17 @@ public class HiveConnUtils {
*/
public static HiveConnVersionInfo getHiveModeObj(int distributionIndex, int hiveVersionIndex, int hiveModeIndex) {
List<HiveConnVersionInfo> objs = getHiveModes(distributionIndex, hiveVersionIndex);
if (objs != null && objs.size() > 0)
if (objs != null && objs.size() > 0) {
return objs.get(hiveModeIndex);
}
return null;
}
public static String getHiveModeObjKey(int distributionIndex, int hiveVersionIndex, int hiveModeIndex) {
HiveConnVersionInfo hiveModeObj = getHiveModeObj(distributionIndex, hiveVersionIndex, hiveModeIndex);
if (hiveModeObj != null)
if (hiveModeObj != null) {
return hiveModeObj.getKey();
}
return null;
}

View File

@@ -1157,6 +1157,13 @@ public class ComponentToRepositoryProperty {
}
}
if ("TAC_WEBAPP".equals(repositoryValue)) {//$NON-NLS-1$
String value = getParameterValue(connection, node, "TAC_WEBAPP"); //$NON-NLS-1$
if (value != null) {
connection.setTacWebappName(value);
}
}
if ("CLASS_NAME".equals(repositoryValue)) {//$NON-NLS-1$
String value = getParameterValue(connection, node, "CLASS_NAME"); //$NON-NLS-1$
if (value != null) {

View File

@@ -0,0 +1,52 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.metadata.designerproperties;
/**
* Uses this to store all repository values of "
* <code>NAME<code>" from component t*_java.xml file. Note that the names also can be
* used for "<code>REPOSITORY_VALUE</code>" in component t*_java.xml file. Created by Marvin Wang on Nov 26, 2012.
*/
public enum EParameterNameForComponent {
PARA_NAME_TYPE("TYPE"), //$NON-NLS-1$
PARA_NAME_SET_MAPRED_JT("SET_MAPRED_JT"), //$NON-NLS-1$
PARA_NAME_MAPRED_JT("MAPRED_JT"), //$NON-NLS-1$
PARA_NAME_SET_FS_DEFAULT_NAME("SET_FS_DEFAULT_NAME"), //$NON-NLS-1$
PARA_NAME_FS_DEFAULT_NAME("FS_DEFAULT_NAME"); //$NON-NLS-1$
private String name;
EParameterNameForComponent(String name) {
this.name = name;
}
/**
* Getter for name.
*
* @return the name
*/
public String getName() {
return this.name;
}
@Override
public String toString() {
return this.name;
}
}

View File

@@ -26,7 +26,6 @@ import org.eclipse.emf.common.util.EList;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.utils.PathUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.database.EDatabase4DriverClassName;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.database.conn.ConnParameterKeys;
import org.talend.core.database.conn.template.EDatabaseConnTemplate;
@@ -197,7 +196,7 @@ public class RepositoryToComponentProperty {
}
SAPFunctionUnit unit = null;
for (int i = 0; i < conn.getFuntions().size(); i++) {
SAPFunctionUnit tmp = (SAPFunctionUnit) conn.getFuntions().get(i);
SAPFunctionUnit tmp = conn.getFuntions().get(i);
if (tmp.getLabel().equals(functionLabel)) {
unit = tmp;
break;
@@ -214,7 +213,7 @@ public class RepositoryToComponentProperty {
value2.clear(); // Make sure for this
Map<String, List<Object>> mergedKeyValues = new HashMap<String, List<Object>>(); // all merged columns's key
for (int i = 0; i < table.getColumns().size(); i++) {
SAPFunctionParameterColumn column = (SAPFunctionParameterColumn) table.getColumns().get(i);
SAPFunctionParameterColumn column = table.getColumns().get(i);
Map<String, Object> map = new HashMap<String, Object>();
if (isInput) {
mergeColumn(map, column, table.getColumns(), mergedKeyValues);
@@ -239,26 +238,26 @@ public class RepositoryToComponentProperty {
String value = "";
String talendType = getTalendTypeFromJCOType(column.getDataType());
if (talendType.contains("String")) { //$NON-NLS-1$
value = TalendQuoteUtils.addQuotes(column.getValue()); //$NON-NLS-1$
value = TalendQuoteUtils.addQuotes(column.getValue());
} else {
value = column.getValue(); //$NON-NLS-1$
value = column.getValue();
}
for (SAPFunctionParameterColumn current : columns) {
String currentValue = "";
if (talendType.contains("String")) { //$NON-NLS-1$
currentValue = TalendQuoteUtils.addQuotes(current.getValue()); //$NON-NLS-1$
currentValue = TalendQuoteUtils.addQuotes(current.getValue());
} else {
currentValue = current.getValue(); //$NON-NLS-1$
currentValue = current.getValue();
}
if (current.getStructureOrTableName() != null && !"".equals(current.getStructureOrTableName())) {
if (current.getStructureOrTableName().equals(column.getStructureOrTableName())
&& current.getName().equals(column.getName())) {
String key = current.getStructureOrTableName() + "_" + current.getName(); //$NON-NLS-N$
String key = current.getStructureOrTableName() + "_" + current.getName();
if (!mergedMapping.keySet().contains(key)) {// need
// merge
mergeType = column.getParameterType().replace('.', '_'); //$NON-NLS-0$ //$NON-NLS-1$
mergeType = column.getParameterType().replace('.', '_');
mergeStructure = current.getStructureOrTableName();
if ("".equals(mergeValue)) {
mergeValue = value;
@@ -274,7 +273,7 @@ public class RepositoryToComponentProperty {
*/
} else if (mergedMapping.keySet().contains(key) && !mergedMapping.get(key).contains(current.getValue())) {
mergedMapping.get(key).add(current.getValue());
mergeType = column.getParameterType().replace('.', '_'); //$NON-NLS-0$ //$NON-NLS-1$
mergeType = column.getParameterType().replace('.', '_');
mergeStructure = current.getStructureOrTableName();
if ("".equals(mergeValue)) {
mergeValue = value;
@@ -316,7 +315,7 @@ public class RepositoryToComponentProperty {
return null;
}
for (int i = 0; i < conn.getFuntions().size(); i++) {
unit = (SAPFunctionUnit) conn.getFuntions().get(i);
unit = conn.getFuntions().get(i);
if (unit.getLabel().equals(functionLabel)) {
break;
}
@@ -657,9 +656,9 @@ public class RepositoryToComponentProperty {
private static Object getMDMValue(MDMConnection connection, String value, IMetadataTable table) {
if ("MDMURL".equals(value)) { //$NON-NLS-1$
if (isContextMode(connection, connection.getServer()) && isContextMode(connection, connection.getPort())) {
return "http://" + connection.getServer() + ":" + connection.getPort() + "/talend/TalendPort";//$NON-NLS-1$//$NON-NLS-1$//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return "http://" + connection.getServer() + ":" + connection.getPort() + "/talend/TalendPort";//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
} else {
return TalendQuoteUtils.addQuotes("http://" + connection.getServer() + ":" + connection.getPort()//$NON-NLS-1$//$NON-NLS-1$ //$NON-NLS-2$
return TalendQuoteUtils.addQuotes("http://" + connection.getServer() + ":" + connection.getPort()//$NON-NLS-1$//$NON-NLS-2$
+ "/talend/TalendPort");//$NON-NLS-1$
}
} else if ("USERNAME".equals(value)) { //$NON-NLS-1$
@@ -746,7 +745,7 @@ public class RepositoryToComponentProperty {
private static Concept getConcept(MDMConnection connection, IMetadataTable table) {
if (table != null) {
for (Concept concept : (List<Concept>) connection.getSchemas()) {
for (Concept concept : connection.getSchemas()) {
// test if sourcename is null, this is only for compatibility with first mdm repository
// released.
if (concept != null && (concept.getLabel() != null && concept.getLabel().equals(table.getLabel()))) {
@@ -912,11 +911,18 @@ public class RepositoryToComponentProperty {
if (value.equals("DB_VERSION")) { //$NON-NLS-1$
String dbVersionString = connection.getDbVersionString();
if (EDatabaseConnTemplate.ACCESS.getDBDisplayName().equals(databaseType)) {
if (EDatabaseConnTemplate.ACCESS.getDBDisplayName().equals(databaseType)
|| EDatabaseConnTemplate.MYSQL.getDBDisplayName().equals(databaseType)) {
// @Deprecated: see bug 7262 this bug is Deprecated
return dbVersionString;
} else {
String driverValue = EDatabaseVersion4Drivers.getDriversStr(databaseType, dbVersionString);
if (EDatabaseConnTemplate.ORACLE_OCI.getDBDisplayName().equals(databaseType)
|| EDatabaseConnTemplate.ORACLE_RAC.getDBDisplayName().equals(databaseType)
|| EDatabaseConnTemplate.ORACLEFORSID.getDBDisplayName().equals(databaseType)
|| EDatabaseConnTemplate.ORACLESN.getDBDisplayName().equals(databaseType)) {
driverValue = dbVersionString;
}
if (isContextMode(connection, dbVersionString)) {
return dbVersionString;
} else if (EDatabaseTypeName.VERTICA.getXmlName().equals(databaseType)
@@ -971,6 +977,13 @@ public class RepositoryToComponentProperty {
String h2Prefix = "jdbc:h2:"; //$NON-NLS-1$
if (url.startsWith(h2Prefix)) {
String path = url.substring(h2Prefix.length(), url.length());
// TDI-23861: handle the server mode of H2 which url has more than one colon.
if (path.split(":").length > 2) { //$NON-NLS-1$
int startIndex = path.lastIndexOf(":") - 1; //$NON-NLS-1$
String filePath = path.substring(startIndex);
h2Prefix += path.substring(0, startIndex);
path = filePath;
}
path = PathUtils.getPortablePath(path);
url = h2Prefix + path;
}
@@ -1096,6 +1109,33 @@ public class RepositoryToComponentProperty {
if (value.equals("CONNECTION_MODE")) {
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
}
if (value.equals("HBASE_DISTRIBUTION")) {
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_DISTRIBUTION);
}
if (value.equals("HBASE_VERSION")) {
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION);
}
if (value.equals(EParameterNameForComponent.PARA_NAME_FS_DEFAULT_NAME.getName())) {
String nameNodeURL = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL);
if (isContextMode(connection, nameNodeURL)) {
return nameNodeURL;
} else {
return TalendQuoteUtils.addQuotes(nameNodeURL);
}
}
if (value.equals(EParameterNameForComponent.PARA_NAME_MAPRED_JT.getName())) {
String jobTrackerURL = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL);
if (isContextMode(connection, jobTrackerURL)) {
return jobTrackerURL;
} else {
return TalendQuoteUtils.addQuotes(jobTrackerURL);
}
}
return null;
}
@@ -1610,7 +1650,7 @@ public class RepositoryToComponentProperty {
List<IMetadataTable> newMetaTables = new ArrayList<IMetadataTable>(metaTables);
HL7Connection hl7Connection = (HL7Connection) connection;
tableInfo.clear();
for (MetadataTable repTable : (Set<MetadataTable>) ConnectionHelper.getTables(connection)) {
for (MetadataTable repTable : ConnectionHelper.getTables(connection)) {
IMetadataTable metaTable = null;
Iterator<IMetadataTable> iterator = newMetaTables.iterator();
while (iterator.hasNext()) {
@@ -1622,7 +1662,7 @@ public class RepositoryToComponentProperty {
}
}
String xpathValue = "";
for (MetadataColumn col : (List<MetadataColumn>) repTable.getColumns()) {
for (MetadataColumn col : repTable.getColumns()) {
String original = col.getOriginalField();
if (original != null && !"".equals(original)) {
if (original.indexOf(TalendQuoteUtils.LBRACKET) != -1) {
@@ -1645,7 +1685,7 @@ public class RepositoryToComponentProperty {
.getService(IMetadataManagmentService.class);
IMetadataTable convert = mmService.convertMetadataTable(repTable);
String uinqueTableName = node.getProcess().generateUniqueConnectionName(
MultiSchemasUtil.getConnectionBaseName((String) repTable.getLabel()));
MultiSchemasUtil.getConnectionBaseName(repTable.getLabel()));
convert.setTableName(uinqueTableName);
// IProxyRepositoryFactory factory =
// CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
@@ -1925,7 +1965,7 @@ public class RepositoryToComponentProperty {
for (MetadataTable table : (Set<MetadataTable>) objectList) {
if (table != null && (table.getLabel() == null || table.getLabel().equals(tableOfNode.getLabel()))) {
String xpathValue = "";
for (MetadataColumn col : (List<MetadataColumn>) table.getColumns()) {
for (MetadataColumn col : table.getColumns()) {
String original = col.getOriginalField();
if (original != null && !"".equals(original)) {
if (original.indexOf(TalendQuoteUtils.LBRACKET) != -1) {
@@ -2028,8 +2068,9 @@ public class RepositoryToComponentProperty {
if (connection.getCustomEncode() == null) {
// get the default encoding
return TalendQuoteUtils.addQuotes(EMetadataEncoding.getMetadataEncoding("").getName()); //$NON-NLS-1$
} else
} else {
return TalendQuoteUtils.addQuotes(connection.getCustomEncode());
}
}
}
if (value.equals("USE_PROXY")) {
@@ -2071,14 +2112,29 @@ public class RepositoryToComponentProperty {
return connection.getXmlField();
}
if (value.equals("GUVNOR_URL")) {
return connection.getUrlName();
return addQuotesIfNecessary(connection, connection.getUrlName());
}
if (value.equals("TAC_WEBAPP")) {
return addQuotesIfNecessary(connection, connection.getTacWebappName());
}
if (value.equals("CLASS_NAME")) {
return connection.getClassName();
return addQuotesIfNecessary(connection, connection.getClassName());
}
if (value.equals("GUVNOR_PACKAGE")) {
return addQuotesIfNecessary(connection, connection.getPackage());
}
if (value.equals("MODULE_USED")) {
return connection.getModuleUsed();
}
return null;
}
private static Object addQuotesIfNecessary(Connection connection, String value) {
if (!isContextMode(connection, value)) {
if (!value.startsWith(TalendQuoteUtils.QUOTATION_MARK) && !value.endsWith(TalendQuoteUtils.QUOTATION_MARK)) {
return TalendQuoteUtils.addQuotes(value);
}
}
return value;
}
}

View File

@@ -160,8 +160,14 @@ public enum EConnectionType implements IConnectionCategory, IDraw2dGraphics {
CAMEL | UNIQUE_NAME,
"Route", "Route", //$NON-NLS-1$ //$NON-NLS-2$
new Integer(LINE_SOLID),
new RGB(230, 100, 0));
new RGB(230, 100, 0)),
STARTS(21, "STARTS", EConnectionCategory.OTHER,
CONDITION | DEPENDENCY | UNIQUE_NAME,
"Starts", Messages.getString("EConnectionType.startsMenu"),
new Integer(LINE_SOLID),
new RGB(0,0,150));
private String name;
private int id;

View File

@@ -33,6 +33,8 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
ProcessType saveXmlFile() throws IOException;
ProcessType saveXmlFile(boolean checkJoblet) throws IOException;
void setPropertyValue(String id, Object value);
void updateProperties();

View File

@@ -103,8 +103,6 @@ public class RelationshipItemBuilder {
public static final String SURVIVOR_RELATION = "survivorshipRuleRelation"; //$NON-NLS-1$
public static RelationshipItemBuilder instance;
private Map<Relation, Set<Relation>> currentProjectItemsRelations;
private Map<Relation, Set<Relation>> referencesItemsRelations;
@@ -117,14 +115,20 @@ public class RelationshipItemBuilder {
private static final String COMMA = ";";
private static Map<String, RelationshipItemBuilder> projectToInstanceMap = new HashMap<String, RelationshipItemBuilder>();
private RelationshipItemBuilder() {
}
public static RelationshipItemBuilder getInstance() {
if (instance == null) {
instance = new RelationshipItemBuilder();
String currentProject = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
if (projectToInstanceMap.containsKey(currentProject)) {
return projectToInstanceMap.get(currentProject);
}
RelationshipItemBuilder instance = new RelationshipItemBuilder();
projectToInstanceMap.put(currentProject, instance);
return instance;
}
@@ -588,7 +592,7 @@ public class RelationshipItemBuilder {
currentValue = param.getValue();
}
if (builtIn != null && currentValue != null) { //$NON-NLS-1$
if (builtIn != null && currentValue != null) {
if (!builtIn) {
addRelationShip(item, currentValue, LATEST_VERSION, relationType);
}
@@ -642,7 +646,7 @@ public class RelationshipItemBuilder {
currentValue = param.getValue();
}
if (builtIn != null && currentValue != null) { //$NON-NLS-1$
if (builtIn != null && currentValue != null) {
if (!builtIn) {
addRelationShip(item, currentValue, LATEST_VERSION, relationType);
}
@@ -663,7 +667,7 @@ public class RelationshipItemBuilder {
// only for SurvivorshipFileItem
if (param.getField() != null
&& param.getField().equals(EParameterFieldType.SURVIVOR_RELATION.getName())) { //$NON-NLS-1$
&& param.getField().equals(EParameterFieldType.SURVIVOR_RELATION.getName())) {
String relatedID = param.getValue();
addRelationShip(item, relatedID, LATEST_VERSION, SURVIVOR_RELATION);
}
@@ -702,8 +706,9 @@ public class RelationshipItemBuilder {
}
Property property = service.getJobletComponentItem(cc);
if (property != null)
if (property != null) {
addRelationShip(item, property.getId(), version, JOBLET_RELATION);
}
}
if ("tRunJob".equals(currentNode.getComponentName())) { //$NON-NLS-1$
// in case of tRunJob
@@ -831,28 +836,37 @@ public class RelationshipItemBuilder {
@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
Relation other = (Relation) obj;
if (id == null) {
if (other.id != null)
if (other.id != null) {
return false;
} else if (!id.equals(other.id))
}
} else if (!id.equals(other.id)) {
return false;
}
if (type == null) {
if (other.type != null)
if (other.type != null) {
return false;
} else if (!type.equals(other.type))
}
} else if (!type.equals(other.type)) {
return false;
}
if (version == null) {
if (other.version != null)
if (other.version != null) {
return false;
} else if (!version.equals(other.version))
}
} else if (!version.equals(other.version)) {
return false;
}
// if (name == null) {
// if (other.name != null)
// return false;
@@ -870,6 +884,7 @@ public class RelationshipItemBuilder {
this.version = version;
}
@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}

View File

@@ -386,9 +386,6 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
public final static ERepositoryObjectType SYSTEM_INDICATORS_FRAUDDETECTION = new ERepositoryObjectType(
"repository.systemIndicators.fraudDetection", "TDQ_Libraries/Indicators/System Indicators/Fraud Detection", "SYSTEM_INDICATORS_FRAUDDETECTION", 103, true, "repository.systemIndicators.fraudDetectionStatistics.alias", new String[] { "DQ" }, new String[] {}, false); //$NON-NLS-1$ //$NON-NLS-2$
public final static ERepositoryObjectType METADATA_HDFS = new ERepositoryObjectType(
"HDFS", "metadata/hdfs", "HDFS", 104, false, "HDFS", new String[] { "DI" }, new String[] {}); //$NON-NLS-1$ //$NON-NLS-2$
private String alias;
private String folder = "";
@@ -478,6 +475,18 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
return toReturn.toArray(new ERepositoryObjectType[] {});
}
// Bad code here to fix bug TDI-23178. If DQ repository type implemented by extention point like what MDM does
// will avoid this bug.
if (!PluginChecker.isPluginLoaded("org.talend.dataprofiler.core")) { //$NON-NLS-1$
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
for (ERepositoryObjectType currentType : values(ERepositoryObjectType.class)) {
if (!(currentType.getProducts().length == 1 && ArrayUtils.contains(currentType.getProducts(), "DQ"))) { //$NON-NLS-1$
toReturn.add(currentType);
}
}
return toReturn.toArray(new ERepositoryObjectType[0]);
}
return values(ERepositoryObjectType.class);
}

View File

@@ -45,6 +45,8 @@ public interface IRepositoryPrefConstants {
public static final String USE_EXPORT_SAVE = "use_export_save_for_jobscript";
public static final String ADD_CLASSPATH_JAR = "add_classpath_jar_for_export_job";
public static final String ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS = "allow_specific_characters_for_schema_columns";
}

View File

@@ -50,6 +50,16 @@ public final class RepositoryManager {
return CoreRuntimePlugin.getInstance().getDesignerCoreService().getDesignerCorePreferenceStore();
}
/**
*
* DOC wchen DesignerCorePreference disappear in some case ,so i change to use repository preference store.
*
* @return
*/
public static IPreferenceStore getRepositoryPreferenceStore() {
return CoreRuntimePlugin.getInstance().getRepositoryService().getRepositoryPreferenceStore();
}
public static boolean isRefreshManually() {
return getPreferenceStore().getBoolean(IRepositoryPrefConstants.MANUALLY_REFRESH);
}

View File

@@ -312,7 +312,8 @@ public class RepositoryViewObject implements IRepositoryViewObject {
return property;
} catch (PersistenceException e) {
exception = e;
ExceptionHandler.process(e);
// for TDI-23371:no need this warning
// ExceptionHandler.process(e);
// if (!CommonsPlugin.isHeadless() && PlatformUI.isWorkbenchRunning()) {
// MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", exception.getMessage());
// }

View File

@@ -296,6 +296,7 @@ public abstract class RepositoryUpdateManager {
boolean cancelable = !needForcePropagation();
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
List<UpdateResult> returnResult = checkJobItemsForUpdate(monitor, getTypes(), onlyImpactAnalysis);
if (returnResult != null) {
@@ -455,7 +456,7 @@ public abstract class RepositoryUpdateManager {
}
// query for wizard
if (parameter instanceof QueriesConnection && object instanceof Query) {
for (Query query : (List<Query>) ((QueriesConnection) parameter).getQuery()) {
for (Query query : ((QueriesConnection) parameter).getQuery()) {
if (query.getId().equals(((Query) object).getId())) {
return true;
}
@@ -508,7 +509,7 @@ public abstract class RepositoryUpdateManager {
Set<MetadataTable> tables = ConnectionHelper.getTables((Connection) parameter);
if (tables.size() == 1) {
IMetadataTable table1 = ((IMetadataTable) object);
MetadataTable table2 = (MetadataTable) tables.toArray(new MetadataTable[0])[0];
MetadataTable table2 = tables.toArray(new MetadataTable[0])[0];
return table1.getId().equals(table2.getId());
}
if (parameter instanceof XmlFileConnection) {
@@ -584,6 +585,10 @@ public abstract class RepositoryUpdateManager {
dbConn.setDriverJarPath(newValue);
} else if (dbConn.getURL() != null && dbConn.getURL().equals(oldValue)) {
dbConn.setURL(newValue);
} else if (dbConn.getUiSchema() != null && dbConn.getUiSchema().equals(oldValue)) {
// Added by Marvin Wang on Nov.7, 2012 for bug TDI-12596, because schema can not be
// propagated to metadata db.
dbConn.setUiSchema(newValue);
}
factory.save(item);
}
@@ -888,6 +893,7 @@ public abstract class RepositoryUpdateManager {
final List<IEditorReference> list = new ArrayList<IEditorReference>();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
IEditorReference[] reference = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getEditorReferences();
@@ -915,6 +921,7 @@ public abstract class RepositoryUpdateManager {
final List<IEditorReference> list = new ArrayList<IEditorReference>();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
IEditorReference[] reference = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getEditorReferences();
@@ -1491,7 +1498,7 @@ public abstract class RepositoryUpdateManager {
Map<String, String> idAndNameMap = new HashMap<String, String>();
Set<MetadataTable> tables = ConnectionHelper.getTables(connItem.getConnection());
if (tables != null) {
for (MetadataTable table : (Set<MetadataTable>) tables) {
for (MetadataTable table : tables) {
idAndNameMap.put(table.getId(), table.getLabel());
}
}
@@ -1542,7 +1549,7 @@ public abstract class RepositoryUpdateManager {
final String prefix = connItem.getProperty().getId() + UpdatesConstants.SEGMENT_LINE;
Set<MetadataTable> tables = ConnectionHelper.getTables(connItem.getConnection());
if (tables != null) {
for (MetadataTable table : (Set<MetadataTable>) tables) {
for (MetadataTable table : tables) {
String oldName = oldTableMap.get(table.getId());
String newName = table.getLabel();
if (oldName != null && !oldName.equals(newName)) {
@@ -1573,7 +1580,7 @@ public abstract class RepositoryUpdateManager {
final String prefix = property.getId() + UpdatesConstants.SEGMENT_LINE;
Set<MetadataTable> tables = ConnectionHelper.getTables(connection);
if (tables != null) {
for (MetadataTable table : (Set<MetadataTable>) tables) {
for (MetadataTable table : tables) {
String oldName = oldTableMap.get(table.getId());
String newName = table.getLabel();
if (oldName != null && !oldName.equals(newName)) {
@@ -1691,8 +1698,7 @@ public abstract class RepositoryUpdateManager {
List<IRepositoryViewObject> updateList = new ArrayList<IRepositoryViewObject>();
List<RelationshipItemBuilder.Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(
((ConnectionItem) connItem).getProperty().getId(), ItemCacheManager.LATEST_VERSION,
RelationshipItemBuilder.PROPERTY_RELATION);
(connItem).getProperty().getId(), ItemCacheManager.LATEST_VERSION, RelationshipItemBuilder.PROPERTY_RELATION);
/*
* the id for schema which stored in .project file is like "_dlkjfhjkdfioi - metadata",not only indicate by a
@@ -1700,9 +1706,9 @@ public abstract class RepositoryUpdateManager {
* RelationshipItemBuilder.PROPERTY_RELATION,it can't find
*/
if (connItem instanceof GenericSchemaConnectionItem) {
String id = ((ConnectionItem) connItem).getProperty().getId();
String id = (connItem).getProperty().getId();
if (table instanceof MetadataTable) {
id = id + " - " + ((MetadataTable) table).getLabel(); //$NON-NLS-N$
id = id + " - " + ((MetadataTable) table).getLabel();
}
List<RelationshipItemBuilder.Relation> schemaRelations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(id,
ItemCacheManager.LATEST_VERSION, RelationshipItemBuilder.SCHEMA_RELATION);
@@ -1809,6 +1815,11 @@ public abstract class RepositoryUpdateManager {
*/
public static boolean sameAsMetadatTable(List<IMetadataTable> newTables, List<IMetadataTable> oldTables,
Map<String, String> oldTableMap) {
return sameAsMetadatTable(newTables, oldTables, oldTableMap, IMetadataColumn.OPTIONS_NONE);
}
public static boolean sameAsMetadatTable(List<IMetadataTable> newTables, List<IMetadataTable> oldTables,
Map<String, String> oldTableMap, int options) {
if (newTables == null || oldTables == null) {
return false;
}
@@ -1824,7 +1835,7 @@ public abstract class RepositoryUpdateManager {
if (oldTable == null) {
return false;
} else {
if (!newTable.sameMetadataAs(oldTable, IMetadataColumn.OPTIONS_NONE)) {
if (!newTable.sameMetadataAs(oldTable, options)) {
return false;
}
}
@@ -1935,7 +1946,7 @@ public abstract class RepositoryUpdateManager {
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
List<IRepositoryViewObject> updateList = new ArrayList<IRepositoryViewObject>();
List<RelationshipItemBuilder.Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(
((ConnectionItem) connItem).getProperty().getId(), RelationshipItemBuilder.LATEST_VERSION,
(connItem).getProperty().getId(), RelationshipItemBuilder.LATEST_VERSION,
RelationshipItemBuilder.PROPERTY_RELATION);
RepositoryUpdateManager repositoryUpdateManager = new RepositoryUpdateManager(table, relations) {

View File

@@ -112,12 +112,60 @@ public abstract class UpdateResult {
case DELETE:
setChecked(true);
break;
case JOBLET_UPDATE:
case RELOAD:
setChecked(true);
break;
default:
setChecked(true);
setReadOnly(true);
}
}
/**
*
* hwang Comment method "setResult".
*
* @param updateType
* @param resultType
* @param parameter
* @param remark
* @param open
*/
public void setResult(EUpdateItemType updateType, EUpdateResult resultType, Object parameter, String remark,
boolean openedJoblet) {
this.updateType = updateType;
this.resultType = resultType;
this.parameter = parameter;
this.remark = remark;
// must initialize the checked==true, so it will show in the dialog
switch (resultType) {
case UPDATE:
break;
case ADD:
case DELETE:
setChecked(true);
break;
case JOBLET_UPDATE:
case RELOAD:
if (openedJoblet) {
setChecked(true);
setReadOnly(true);
} else {
setChecked(false);
}
break;
default:
// if (openedJoblet) {
setChecked(true);
// } else {
// setChecked(false);
// }
setReadOnly(true);
}
}
public void setResult(EUpdateItemType updateType, EUpdateResult resultType, Object parameter) {
setResult(updateType, resultType, parameter, null);
}

View File

@@ -21,6 +21,7 @@ import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.repository.ProjectManager;
@@ -88,4 +89,28 @@ public class JavaResourcesHelper {
return projectFolderName;
}
public static String getGroupItemName(String projectName, String itemName) {
if (itemName == null) {
return null;
}
String itemGroupPrefixName = "org."; //$NON-NLS-1$
String corporationName = null;
IBrandingService service = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (service != null) {
corporationName = service.getCorporationName();
if (corporationName != null) {
corporationName = corporationName.trim();
}
}
if (corporationName == null || "".equals(corporationName)) { //$NON-NLS-1$
corporationName = "talend"; //$NON-NLS-1$
}
itemGroupPrefixName += corporationName;
if (projectName != null) {
itemGroupPrefixName += '.' + projectName;
}
itemGroupPrefixName += '.' + itemName;
return itemGroupPrefixName.trim().toLowerCase();
}
}

View File

@@ -58,8 +58,12 @@ public class NodeUtil {
Collections.sort(conns, new Comparator<IConnection>() {
public int compare(IConnection o1, IConnection o2) {
if (EConnectionType.ROUTE_WHEN == o1.getLineStyle())
if (EConnectionType.ROUTE_WHEN == o1.getLineStyle()){
if(EConnectionType.ROUTE == o2.getLineStyle()){
return 1;
}
return -1;
}
if (EConnectionType.ROUTE_OTHER == o1.getLineStyle())
if (EConnectionType.ROUTE_WHEN == o2.getLineStyle())
return 1;

View File

@@ -56,4 +56,17 @@ public final class TalendPropertiesUtil {
return Boolean.parseBoolean(value);
}
/**
*
* DOC ggu Comment method "isEnabledMultiBranchesInWorkspacee".
*
* @return
*/
public static boolean isCleanCache() {
String value = System.getProperty("talend.clean.cache"); //$NON-NLS-1$
return Boolean.parseBoolean(value);
}
}

View File

@@ -22,6 +22,9 @@ import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.PlatformUI;
import org.talend.core.model.general.ConnectionBean;
import org.talend.json.JSONArray;
import org.talend.json.JSONException;
import org.talend.json.JSONObject;
/**
* Used to store connections / users for the login dialog <br/>
@@ -31,6 +34,8 @@ import org.talend.core.model.general.ConnectionBean;
*/
public final class PreferenceManipulator implements ITalendCorePrefConstants {
private static final String JSON_CONNECTIONS = "Connections.new";
private static final String PREF_DELIMITER = "|"; //$NON-NLS-1$
/** The preference store manipulated. */
@@ -74,14 +79,28 @@ public final class PreferenceManipulator implements ITalendCorePrefConstants {
return array;
}
private List<String> readStringList(final String prefName) {
private JSONArray readJsonArray(final String prefName) {
String prefs = store.getString(prefName);
List<String> strings = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(prefs, PREF_DELIMITER);
while (st.hasMoreTokens()) {
strings.add(st.nextToken());
}
if (prefs != null) {
try {
return new JSONArray(prefs);
} catch (JSONException e) {
//
}
}
return new JSONArray();
}
private List<String> readStringList(final String prefName) {
List<String> strings = new ArrayList<String>();
String prefs = store.getString(prefName);
if (prefs != null) {
StringTokenizer st = new StringTokenizer(prefs, PREF_DELIMITER);
while (st.hasMoreTokens()) {
strings.add(st.nextToken());
}
}
return strings;
}
@@ -103,6 +122,11 @@ public final class PreferenceManipulator implements ITalendCorePrefConstants {
save();
}
private void saveJsonArray(final JSONArray prefArray, String prefName) {
store.setValue(prefName, prefArray.toString());
save();
}
/**
* Add a string to an array preference.
*
@@ -128,20 +152,38 @@ public final class PreferenceManipulator implements ITalendCorePrefConstants {
for (String currentConnectionToLoad : readStringArray(CONNECTIONS)) {
toReturn.add(ConnectionBean.writeFromString(currentConnectionToLoad));
}
// store.setValue(CONNECTIONS, "");
JSONArray jsonArray = readJsonArray(JSON_CONNECTIONS);
for (int i = 0; i < jsonArray.length(); i++) {
try {
Object object = jsonArray.get(i);
if (object instanceof JSONObject) {
toReturn.add(ConnectionBean.writeFromJSON((JSONObject) object));
}
} catch (JSONException e) {
//
}
}
return toReturn;
}
public void saveConnections(List<ConnectionBean> cons) {
String[] prefArray = new String[cons.size()];
int i = 0;
JSONArray array = new JSONArray();
for (ConnectionBean currentConnection : cons) {
prefArray[i++] = currentConnection.readToString();
array.put(currentConnection.getConDetails());
}
saveStringArray(prefArray, CONNECTIONS);
// clear the old value
store.setValue(CONNECTIONS, "");
saveJsonArray(array, JSON_CONNECTIONS);
}
public void addConnection(ConnectionBean con) {
addStringToArray(con.readToString(), CONNECTIONS);
JSONArray array = new JSONArray();
array.put(con.getConDetails());
// clear the old value
store.setValue(CONNECTIONS, "");
saveJsonArray(array, JSON_CONNECTIONS);
}
/**

View File

@@ -340,7 +340,6 @@ public final class RepositoryComponentManager {
List<IComponent> exceptedComponents = new ArrayList<IComponent>();
for (IComponent component : components) {
//
for (RepositoryComponentDndFilterSetting dndFilter : getDndFilterSettings()) {
IRepositoryComponentDndFilter filter = dndFilter.getFilter();
if (filter == null) {

View File

@@ -7,17 +7,25 @@ import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.utils.ContextParameterUtils;
import org.talend.cwm.mip.service.CWMService;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import orgomg.cwm.foundation.softwaredeployment.DataManager;
public class TalendCWMService extends CWMService {
public class TalendCWMService {
private Logger log = Logger.getLogger(TalendCWMService.class);
private static Logger log = Logger.getLogger(TalendCWMService.class);
@Override
public String getReadableName(DataManager dataManager, String contextualName) {
/**
*
* Get the readable name (actual item display name) via context style name when the item is on context mode.<BR>
* Note that in order to make it easier for caller to get a name, this contextualName may be passed as an actual
* display name, in this case, this name will be simply returned.
*
* @param dataManager
* @param contextualName eigher the contextual name or the actual display name.
* @return the readable actual item display name.
*/
public static String getReadableName(DataManager dataManager, String contextualName) {
if (contextualName == null) {
log.error("Null context name in connection " + dataManager); //$NON-NLS-1$
return contextualName;

View File

@@ -103,4 +103,6 @@ public interface IJobletProviderService extends IService {
public List<INode> checkDeleteNodes(IElement jobletContainer);
public boolean checkModify(IElement jobletContainer);
public boolean jobletIsDirty(INode node);
}

View File

@@ -49,4 +49,6 @@ public interface IBrandingService extends IService {
public boolean isPoweredOnlyCamel();
public String getStartingBrowserId();
public String getUserManuals();
}

View File

@@ -79,7 +79,7 @@ public class SelectRepositoryContextGroupDialog extends SelectionDialog {
private Set<String> nameSet = new HashSet<String>();
protected SelectRepositoryContextGroupDialog(Shell parentShell, IContextManager manager, ContextManagerHelper helper,
public SelectRepositoryContextGroupDialog(Shell parentShell, IContextManager manager, ContextManagerHelper helper,
List<ContextItem> selectedContextItems) {
super(parentShell);
setBlockOnOpen(true);

View File

@@ -10,11 +10,12 @@
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.utils.data.reflection;
package org.talend.core.utils;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.apache.log4j.Logger;
@@ -37,18 +38,18 @@ public class ReflectionUtils {
* @param owner
* @param fieldName
* @return
* @throws NoSuchFieldException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
* @throws Exception
*/
public static Object getPublicField(Object owner, String fieldName) {
public static Object getPublicField(Object owner, String fieldName) throws SecurityException, NoSuchFieldException,
IllegalArgumentException, IllegalAccessException {
Object fieldValue = null;
Class ownerClass = owner.getClass();
try {
Field field = ownerClass.getField(fieldName);
fieldValue = field.get(owner);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
}
Field field = ownerClass.getField(fieldName);
fieldValue = field.get(owner);
return fieldValue;
}
@@ -61,18 +62,18 @@ public class ReflectionUtils {
* @param owner
* @param fieldName
* @return
* @throws NoSuchFieldException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public static Object getPrivateField(Object owner, String fieldName) {
public static Object getPrivateField(Object owner, String fieldName) throws SecurityException, NoSuchFieldException,
IllegalArgumentException, IllegalAccessException {
Object fieldValue = null;
Class ownerClass = owner.getClass();
try {
Field f = ownerClass.getDeclaredField(fieldName);
f.setAccessible(true);
fieldValue = f.get(owner);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
}
Field f = ownerClass.getDeclaredField(fieldName);
f.setAccessible(true);
fieldValue = f.get(owner);
return fieldValue;
}
@@ -86,31 +87,31 @@ public class ReflectionUtils {
* @param loader
* @param fieldName
* @return
* @throws ClassNotFoundException
* @throws NoSuchFieldException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public static Object getStaticField(String className, ClassLoader loader, String fieldName) {
public static Object getStaticField(String className, ClassLoader loader, String fieldName) throws ClassNotFoundException,
SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
Object fieldValue = null;
try {
Class ownerClass = null;
if (loader != null) {
ownerClass = Class.forName(className, true, loader);
} else {
ownerClass = Class.forName(className);
}
Field field = ownerClass.getField(fieldName);
fieldValue = field.get(ownerClass);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
Class ownerClass = null;
if (loader != null) {
ownerClass = Class.forName(className, true, loader);
} else {
ownerClass = Class.forName(className);
}
Field field = ownerClass.getField(fieldName);
fieldValue = field.get(ownerClass);
return fieldValue;
}
/**
* To set the field using the given <code>value</code>.
* Added by Marvin Wang on Oct 19, 2012.
* To set the field using the given <code>value</code>. Added by Marvin Wang on Oct 19, 2012.
*/
public static void setStaticFieldValue(String className, ClassLoader loader, String fieldName, Object value){
public static void setStaticFieldValue(String className, ClassLoader loader, String fieldName, Object value) {
try {
Class ownerClass = null;
if (loader != null) {
@@ -122,12 +123,12 @@ public class ReflectionUtils {
field.setAccessible(true);
field.set(null, value);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
log.error("", e);
}
}
public static Object getStaticField(String className, String fieldName) {
public static Object getStaticField(String className, String fieldName) throws SecurityException, IllegalArgumentException,
ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getStaticField(className, null, fieldName);
}
@@ -140,21 +141,22 @@ public class ReflectionUtils {
* @param methodName
* @param args
* @return
* @throws NoSuchMethodException
* @throws SecurityException
* @throws InvocationTargetException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public static Object invokeMethod(Object owner, String methodName, Object[] args) {
public static Object invokeMethod(Object owner, String methodName, Object[] args) throws SecurityException,
NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
Object returnValue = null;
Class ownerClass = owner.getClass();
Class[] argsClass = new Class[args.length];
for (int i = 0, j = args.length; i < j; i++) {
argsClass[i] = args[i].getClass();
}
try {
Method method = ownerClass.getMethod(methodName, argsClass);
returnValue = method.invoke(owner, args);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
}
Method method = ownerClass.getMethod(methodName, argsClass);
returnValue = method.invoke(owner, args);
return returnValue;
}
@@ -169,31 +171,36 @@ public class ReflectionUtils {
* @param methodName
* @param args
* @return
* @throws ClassNotFoundException
* @throws NoSuchMethodException
* @throws SecurityException
* @throws InvocationTargetException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public static Object invokeStaticMethod(String className, ClassLoader loader, String methodName, Object[] args) {
public static Object invokeStaticMethod(String className, ClassLoader loader, String methodName, Object[] args)
throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException,
IllegalAccessException, InvocationTargetException {
Object returnValue = null;
try {
Class ownerClass = null;
if (loader != null) {
ownerClass = Class.forName(className, true, loader);
} else {
ownerClass = Class.forName(className);
}
Class[] argsClass = new Class[args.length];
for (int i = 0, j = args.length; i < j; i++) {
argsClass[i] = args[i].getClass();
}
Method method = ownerClass.getMethod(methodName, argsClass);
returnValue = method.invoke(null, args);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
Class ownerClass = null;
if (loader != null) {
ownerClass = Class.forName(className, true, loader);
} else {
ownerClass = Class.forName(className);
}
Class[] argsClass = new Class[args.length];
for (int i = 0, j = args.length; i < j; i++) {
argsClass[i] = args[i].getClass();
}
Method method = ownerClass.getMethod(methodName, argsClass);
returnValue = method.invoke(null, args);
return returnValue;
}
public static Object invokeStaticMethod(String className, String methodName, Object[] args) {
public static Object invokeStaticMethod(String className, String methodName, Object[] args) throws SecurityException,
IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
return invokeStaticMethod(className, null, methodName, args);
}
@@ -207,31 +214,37 @@ public class ReflectionUtils {
* @param loader
* @param args
* @return
* @throws ClassNotFoundException
* @throws NoSuchMethodException
* @throws SecurityException
* @throws InvocationTargetException
* @throws IllegalAccessException
* @throws InstantiationException
* @throws IllegalArgumentException
*/
public static Object newInstance(String className, ClassLoader loader, Object[] args) {
public static Object newInstance(String className, ClassLoader loader, Object[] args) throws ClassNotFoundException,
SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException,
InvocationTargetException {
Object instance = null;
try {
Class newClass = null;
if (loader != null) {
newClass = Class.forName(className, true, loader);
} else {
newClass = Class.forName(className);
}
Class[] argsClass = new Class[args.length];
for (int i = 0, j = args.length; i < j; i++) {
argsClass[i] = args[i].getClass();
}
Constructor cons = newClass.getConstructor(argsClass);
instance = cons.newInstance(args);
} catch (Exception e) {
log.error(e);
e.printStackTrace();
Class newClass = null;
if (loader != null) {
newClass = Class.forName(className, true, loader);
} else {
newClass = Class.forName(className);
}
Class[] argsClass = new Class[args.length];
for (int i = 0, j = args.length; i < j; i++) {
argsClass[i] = args[i].getClass();
}
Constructor cons = newClass.getConstructor(argsClass);
instance = cons.newInstance(args);
return instance;
}
public static Object newInstance(String className, Object[] args) {
public static Object newInstance(String className, Object[] args) throws SecurityException, IllegalArgumentException,
ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException {
return newInstance(className, null, args);
}

View File

@@ -0,0 +1,44 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.utils;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.runtime.Platform;
import org.talend.core.BrandingChecker;
import org.talend.core.model.utils.TalendPropertiesUtil;
/**
* DOC ggu class global comment. Detailled comment <br/>
*
* $Id: talend.epf 55206 2011-02-15 17:32:14Z mhirt $
*
*/
public final class TalendCacheUtils {
private static final String CLEAN = "-clean"; //$NON-NLS-1$
private static final String CLEAN_COMPONENT_CACHE = "--clean_component_cache"; //$NON-NLS-1$
public static boolean isSetCleanComponentCache() {
return ArrayUtils.contains(Platform.getApplicationArgs(), CLEAN_COMPONENT_CACHE);
}
public static boolean isSetClean() {
return ArrayUtils.contains(Platform.getApplicationArgs(), CLEAN);
}
public static boolean cleanComponentCache() {
return TalendPropertiesUtil.isCleanCache() || isSetCleanComponentCache() || isSetClean()
|| BrandingChecker.isBrandingChanged();
}
}

View File

@@ -32,6 +32,7 @@ import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IComponentsFactory;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.process.IConnection;
import org.talend.core.model.process.IElementParameter;
@@ -142,7 +143,8 @@ public interface IDesignerCoreService extends IService {
public void removeConnection(INode node, String schemaName);
public CsvArray convertNode(ConnectionItem connectionItem, String tableName) throws ProcessorException;
public CsvArray convertNode(ConnectionItem connectionItem, IMetadataConnection convertedConnection, String tableName)
throws ProcessorException;
public void updateTraceColumnValues(IConnection conn, Map<String, String> changedNameColumns, Set<String> addedColumns);

View File

@@ -19,6 +19,7 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.runtime.CoreRuntimePlugin;
@@ -26,17 +27,18 @@ import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
/**
* DOC nrousseau class global comment. Detailled comment
*
* @deprecated
*
* Do not cache anymore. This class actually is only used for compatibility, and keep the system of LASTEST_VERSION
* Class to review, no cache anymore here.
*
* to be renamed in future versions.
*/
public class ItemCacheManager {
public static final String LATEST_VERSION = "Latest"; //$NON-NLS-1$
// variable to replace by RelationshipItemBuilder.LATEST_VERSION later
public static final String LATEST_VERSION = RelationshipItemBuilder.LATEST_VERSION;
@Deprecated
public static void clearCache() {
// deprecated, do nothing
}
public static ProcessItem getProcessItem(Project project, String processId) {
@@ -104,7 +106,7 @@ public class ItemCacheManager {
return null;
}
// feature 19312
if (version == null || version.equals("") || LATEST_VERSION.equals(version)) {
if (version == null || version.equals("") || LATEST_VERSION.equals(version)) { //$NON-NLS-1$
return getProcessItem(project, processId);
}
ProcessItem selectedProcessItem = null;

View File

@@ -56,6 +56,14 @@ public final class ProjectManager {
public static final String UNDER_LINE = "_"; //$NON-NLS-1$
public static final String SEP_CHAR = SVNConstant.SEP_CHAR;
public static final String NAME_TRUNK = SVNConstant.NAME_TRUNK;
public static final String NAME_BRANCHES = SVNConstant.NAME_BRANCHES;
public static final String NAME_TAGS = SVNConstant.NAME_TAGS;
private static ProjectManager singleton;
private Project currentProject;
@@ -101,9 +109,11 @@ public final class ProjectManager {
Context ctx = CoreRuntimePlugin.getInstance().getContext();
if (p != null && ctx != null) {
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(p);
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
resolveRefProject(pr.getReferencedProject()); // only to resolve all
if (parentBranch != null) {
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
resolveRefProject(pr.getReferencedProject()); // only to resolve all
}
}
}
}
@@ -113,11 +123,13 @@ public final class ProjectManager {
Context ctx = CoreRuntimePlugin.getInstance().getContext();
if (ctx != null && p != null) {
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(p);
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
Project project = new Project(pr.getReferencedProject());
allReferencedprojects.add(project);
resolveSubRefProject(pr.getReferencedProject()); // only to resolve all
if (parentBranch != null) {
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
Project project = new Project(pr.getReferencedProject());
allReferencedprojects.add(project);
resolveSubRefProject(pr.getReferencedProject()); // only to resolve all
}
}
}
}
@@ -473,6 +485,30 @@ public final class ProjectManager {
return ""; //$NON-NLS-1$
}
/**
*
* DOC ldong Comment method "getCurrentBranchLabel".
*
* @param project
* @return
*/
public static String getCurrentBranchLabel(Project project) {
// just for TAC session,they do not want the label start with "/"
String branchSelection = NAME_TRUNK;
String branchSelectionFromProject = ProjectManager.getInstance().getMainProjectBranch(project);
if (branchSelectionFromProject != null) {
branchSelection = branchSelectionFromProject;
} else {
ProjectManager.getInstance().setMainProjectBranch(project, NAME_TRUNK);
}
if (!branchSelection.contains(NAME_TAGS) && !branchSelection.contains(NAME_BRANCHES)
&& !branchSelection.contains(NAME_TRUNK)) {
branchSelection = NAME_BRANCHES + branchSelection;
}
return branchSelection;
}
public String getMainProjectBranch(Project project) {
return project != null ? getMainProjectBranch(project.getEmfProject()) : null;
}

View File

@@ -84,6 +84,9 @@ public class RepositoryConstants {
public static final String SERVICES_NAME_PATTERN = "[a-zA-Z_][a-zA-Z0-9\\.\\-_]*";
public static final String MDM_ITEM_PATTERN = ".*"; //$NON-NLS-1$
public static final String METADATA_NAME_PATTERN = "^[^\\s\\\\~\\!\\`\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\+\\=\\{\\[\\]\\}\\:\\;\\'\\|\\<\\,\\>\\.\\?\\/\"¥;:‘”、《,》。?……]{1,}$";
public static String getPattern(ERepositoryObjectType type) {
if (type == ERepositoryObjectType.FOLDER) {
return FOLDER_PATTERN;
@@ -99,7 +102,18 @@ public class RepositoryConstants {
|| type == ERepositoryObjectType.TDQ_SOURCE_FILE_ELEMENT || type == ERepositoryObjectType.TDQ_RULES
|| type == ERepositoryObjectType.TDQ_RULES_SQL || type == ERepositoryObjectType.TDQ_INDICATOR_ELEMENT) {
return TDQ_ALL_ITEM_PATTERN;
}
} else if (type == ERepositoryObjectType.METADATA_CONNECTIONS || type == ERepositoryObjectType.METADATA_FILE_DELIMITED
|| type == ERepositoryObjectType.METADATA_FILE_POSITIONAL || type == ERepositoryObjectType.METADATA_FILE_REGEXP
|| type == ERepositoryObjectType.METADATA_FILE_XML || type == ERepositoryObjectType.METADATA_FILE_EXCEL
|| type == ERepositoryObjectType.METADATA_FILE_LDIF || type == ERepositoryObjectType.METADATA_LDAP_SCHEMA
|| type == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA
|| type == ERepositoryObjectType.METADATA_GENERIC_SCHEMA || type == ERepositoryObjectType.METADATA_MDMCONNECTION
|| type == ERepositoryObjectType.METADATA_FILE_HL7 || type == ERepositoryObjectType.METADATA_FILE_RULES
|| type == ERepositoryObjectType.METADATA_FILE_EBCDIC || type == ERepositoryObjectType.METADATA_WSDL_SCHEMA
|| type == ERepositoryObjectType.METADATA_VALIDATION_RULES || type == ERepositoryObjectType.METADATA_FILE_FTP
|| type == ERepositoryObjectType.METADATA_EDIFACT) {
return METADATA_NAME_PATTERN;
}
// GLIU: add for TESB-3837
else if (type != null && "SERVICES".equals(type.getType())) {
return SERVICES_NAME_PATTERN;

View File

@@ -30,7 +30,11 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.adaptor.LocationManager;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.model.general.ConnectionBean;
import org.talend.json.JSONArray;
import org.talend.json.JSONException;
import org.talend.json.JSONObject;
/**
* DOC hwang class global comment. Detailled comment
@@ -89,22 +93,35 @@ public class ConnectionUserPerReader {
* @throws DocumentException
*/
public List<ConnectionBean> readConnections() {
if (!isRead)
if (!isRead) {
this.readProperties();
}
List<ConnectionBean> toReturn = new ArrayList<ConnectionBean>();
String userString = proper.getProperty("connection.users"); //$NON-NLS-1$
if (userString == null) {
userString = "";//$NON-NLS-1$
return new ArrayList<ConnectionBean>(0);
} else {
if (userString != null) {
String[] users = userString.split("\\|");//$NON-NLS-1$
List<ConnectionBean> toReturn = new ArrayList<ConnectionBean>(users.length);
for (String usr : users) {
ConnectionBean conBean = ConnectionBean.writeFromString(proper.getProperty(usr));
toReturn.add(conBean);
}
return toReturn;
// FIXME
// proper.remove("connection.users");
}
try {
String jsonString = proper.getProperty("connection.define"); //$NON-NLS-1$
if (jsonString != null) {
JSONArray users = new JSONArray(jsonString);
for (int i = 0; i < users.length(); i++) {
JSONObject user = users.getJSONObject(i);
ConnectionBean conBean = ConnectionBean.writeFromJSON(user);
toReturn.add(conBean);
}
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return toReturn;
}
private ConnectionUserPerReader readProperties() {
@@ -151,23 +168,26 @@ public class ConnectionUserPerReader {
createPropertyFile();
if (!isRead)
this.readProperties();
StringBuilder sb = new StringBuilder();
int i = 0;
if (cons == null || cons.size() == 0) {
proper.remove("connection.users");//$NON-NLS-1$
} else {
JSONArray usersJsonArray = new JSONArray();
for (ConnectionBean currentConnection : cons) {
String userName = currentConnection.getName();
if (i != 0 && userName != null) {
sb.append("|");//$NON-NLS-1$
}
if (userName != null)
sb.append(userName);
proper.setProperty(userName, currentConnection.readToString());
i++;
// String userName = currentConnection.getName();
// if (i != 0 && userName != null) {
// sb.append("|");//$NON-NLS-1$
// }
// if (userName != null) {
JSONObject userJson = currentConnection.getConDetails();
// proper.setProperty(userName, userJson.toString());
usersJsonArray.put(userJson);
// }
}
proper.setProperty("connection.users", sb.toString());//$NON-NLS-1$
//proper.setProperty("connection.users", sb.toString());//$NON-NLS-1$
if (proper.getProperty("connection.users") != null) {
proper.remove("connection.users");
}
proper.setProperty("connection.define", usersJsonArray.toString());//$NON-NLS-1$
}
try {

View File

@@ -64,6 +64,9 @@
<element name="library">
<complexType>
<sequence minOccurs="0" maxOccurs="1">
<element ref="bundleId"/>
</sequence>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>
@@ -74,6 +77,29 @@
</complexType>
</element>
<element name="bundleId">
<complexType>
<attribute name="bundleId" type="string">
<annotation>
<documentation>
Note: parameter used only for OSGI, other exports won&apos;t use this.
If defined in the library:
- emtpy value:
- jar will never be exported.
- have one value:
- jar will be exported, and value will be used for the OSGI bundle (name,version) .
If not defined at all:
- jar will always be exported.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>

View File

@@ -52,6 +52,7 @@ import org.talend.commons.utils.generation.JavaUtils;
import org.talend.commons.xml.XmlUtil;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.general.LibraryInfo;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.ColumnNameChanged;
import org.talend.core.model.metadata.IMetadataTable;
@@ -152,7 +153,7 @@ public class CoreService implements ICoreService {
*
* @see org.talend.core.ICoreService#getRoutineAndJars()
*/
public Map<String, List<String>> getRoutineAndJars() {
public Map<String, List<LibraryInfo>> getRoutineAndJars() {
return RoutineLibraryMananger.getInstance().getRoutineAndJars();
}

View File

@@ -251,6 +251,14 @@ public class QueryUtil {
TalendTextUtils.declareString(" FROM "), declareString + realTableName[0].substring(2, realTableName[0].length() - 2) //$NON-NLS-1$
+ declareString);
}
query = checkAndConcatString(checkAndConcatString(query, columnsQuery), end);
} else if (dbType != null && dbType.equals(EDatabaseTypeName.MSSQL.getDisplayName())) {
String declareString = TalendTextUtils.getStringDeclare();
String end = checkAndConcatString(
TalendTextUtils.declareString(" FROM "), declareString + realTableName[0] + declareString); //$NON-NLS-1$
end = replaceTheSchemaString(end);
query = checkAndConcatString(checkAndConcatString(query, columnsQuery), end);
} else {
String end = checkAndConcatString(TalendTextUtils.declareString(" FROM "), tableNameWithQuoteIfNeed); //$NON-NLS-1$

View File

@@ -19,6 +19,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -27,6 +28,8 @@ import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
import org.talend.core.CorePlugin;
import org.talend.core.ILibraryManagerService;
import org.talend.core.model.general.LibraryInfo;
import org.talend.core.repository.constants.FileConstants;
/**
* wchen class global comment. Detailled comment
@@ -37,17 +40,17 @@ public class RoutineLibraryMananger {
private static final String LIB_FOLDER = "/lib"; //$NON-NLS-1$
private static final String LIB_EXT = ".jar"; //$NON-NLS-1$
private static final String LIBRARY_ELE = "library"; //$NON-NLS-1$
private static final String NAME_ATTR = "name"; //$NON-NLS-1$
private static final String BUNDLE_ID = "bundleId"; //$NON-NLS-1$
protected static Logger log = Logger.getLogger(RoutineLibraryMananger.class.getName());
private boolean initialized = false;
private Map<String, List<String>> routineAndJars = null;
private Map<String, List<LibraryInfo>> routineAndJars = null;
private static IConfigurationElement[] configurationElements = null;
@@ -79,7 +82,7 @@ public class RoutineLibraryMananger {
Object entryPath = entryPaths.nextElement();
if (entryPath != null && entryPath instanceof String) {
String path = (String) entryPath;
if (path.endsWith(LIB_EXT)) {
if (path.endsWith(FileConstants.JAR_FILE_SUFFIX)) {
URL entry = bundle.getEntry(path);
if (entry != null) {
try {
@@ -98,21 +101,32 @@ public class RoutineLibraryMananger {
}
}
public Map<String, List<String>> getRoutineAndJars() {
public Map<String, List<LibraryInfo>> getRoutineAndJars() {
if (routineAndJars == null) {
routineAndJars = new HashMap<String, List<String>>();
routineAndJars = new HashMap<String, List<LibraryInfo>>();
for (IConfigurationElement current : configurationElements) {
String routine = current.getAttribute(NAME_ATTR);
List<String> jarList = routineAndJars.get(routine);
List<LibraryInfo> jarList = routineAndJars.get(routine);
if (jarList == null) {
jarList = new ArrayList<String>();
jarList = new ArrayList<LibraryInfo>();
routineAndJars.put(routine, jarList);
}
IConfigurationElement[] children = current.getChildren(LIBRARY_ELE);
for (IConfigurationElement child : children) {
LibraryInfo libraryInfo = new LibraryInfo();
String library = child.getAttribute(NAME_ATTR);
if (!jarList.contains(library)) {
jarList.add(library);
libraryInfo.setLibName(library);
IConfigurationElement[] bundleIdChildren = child.getChildren(BUNDLE_ID);
if (bundleIdChildren == null || bundleIdChildren.length == 0) {
libraryInfo.setBundleId(null);
} else {
for (IConfigurationElement bundleIdChild : bundleIdChildren) {
String bundleId = bundleIdChild.getAttribute(BUNDLE_ID);
libraryInfo.setBundleId(StringUtils.trimToEmpty(bundleId));
}
}
if (!jarList.contains(libraryInfo)) {
jarList.add(libraryInfo);
}
}
}

View File

@@ -19,8 +19,6 @@ import java.util.regex.Pattern;
import org.eclipse.swt.graphics.RGB;
import org.talend.core.CorePlugin;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.language.LanguageManager;
import org.talend.core.model.metadata.QueryUtil;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.utils.KeywordsValidator;
@@ -73,17 +71,19 @@ public class TalendTextUtils {
return TalendQuoteUtils.addQuotes(text, quoteStyle);
}
public static String addSQLQuotes(String text, boolean force) {
if (force) { // in this case, do not consider context params
return addSQLQuotes(text, QUOTATION_MARK);
} else {
return addSQLQuotes(text);
}
}
public static String addSQLQuotes(String text) {
ECodeLanguage language = LanguageManager.getCurrentLanguage();
if (ContextParameterUtils.isContainContextParam(text)) {
return text;
}
switch (language) {
case JAVA:
return addSQLQuotes(text, QUOTATION_MARK);
default: // PERL
return addSQLQuotes(text, SINGLE_QUOTE);
}
return addSQLQuotes(text, QUOTATION_MARK);
}
private static String addSQLQuotes(String text, String quoteStyle) {
@@ -474,7 +474,7 @@ public class TalendTextUtils {
* @return
*/
public static boolean isEmptyString(final String str) {
return str == null || str.length() > 0;
return str == null || str.length() <= 0;
}
/**
@@ -589,4 +589,5 @@ public class TalendTextUtils {
return string + " ---> " + key; //$NON-NLS-1$
}
}
}

View File

@@ -43,4 +43,8 @@ public abstract class AbstractBrandingService implements IBrandingService {
// default is StartingBrowser implement in org.talend.rcp
return "org.talend.rcp.intro.starting.StartingBrowser";
}
public String getUserManuals() {
return "DI";
}
}

View File

@@ -169,31 +169,50 @@ public class TalendJavaSourceViewer extends ReconcilerViewer {
}
public static ISourceViewer createViewer(Composite composite, int styles, boolean checkCode) {
/*
* Special for cProcessor
* https://jira.talendforge.org/browse/TESB-3687
* for cJavaDSLProcessor
* https://jira.talendforge.org/browse/TESB-7615
*/
boolean isRouteProcess = isRouteProcess();
StringBuffer buff = new StringBuffer();
buff.append("package internal;\n\n"); //$NON-NLS-1$
buff.append(getImports());
//add special imports for RouteBuilder
if(isRouteProcess){
buff.append("import org.apache.camel.*;");
}
buff.append("public class " + VIEWER_CLASS_NAME + currentId + " {\n"); //$NON-NLS-1$ //$NON-NLS-2$
buff.append("\tprivate static java.util.Properties context = new java.util.Properties();\n"); //$NON-NLS-1$
buff.append("\tprivate static final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();\n"); //$NON-NLS-1$
/*
* Special for cProcessor
* https://jira.talendforge.org/browse/TESB-3687
*/
try{
IProcess activeProcess = CorePlugin.getDefault().getRunProcessService().getActiveProcess();
if(activeProcess != null && "org.talend.camel.designer.ui.editor.RouteProcess".equals(activeProcess.getClass().getName())){
buff.append("\tprivate org.apache.camel.Exchange exchange;\n"); //$NON-NLS-1$
buff.append("\torg.apache.camel.impl.DefaultCamelContext camelContext;\n"); //$NON-NLS-1$
buff.append("\tjavax.jms.ConnectionFactory jmsConnectionFactory;\n"); //$NON-NLS-1$
}
}catch(Exception e){
/*
* Special for cProcessor
* https://jira.talendforge.org/browse/TESB-3687
*/
if(isRouteProcess){
buff.append("\tprivate org.apache.camel.Exchange exchange;\n"); //$NON-NLS-1$
buff.append("\torg.apache.camel.impl.DefaultCamelContext camelContext;\n"); //$NON-NLS-1$
buff.append("\tjavax.jms.ConnectionFactory jmsConnectionFactory;\n"); //$NON-NLS-1$
}
//end of https://jira.talendforge.org/browse/TESB-3687
buff.append("\tpublic void myFunction(){\n"); //$NON-NLS-1$
buff.append("\t if( \n"); //$NON-NLS-1$
/*
* for cJavaDSLProcessor
* https://jira.talendforge.org/browse/TESB-7615
*/
if(isRouteProcess){
buff.append("new org.apache.camel.model.RouteDefinition()\n");
}
// End of https://jira.talendforge.org/browse/TESB-7615
int documentOffset = buff.toString().length();
buff.append("){\n\t}"); //$NON-NLS-1$
buff.append("\n\t\n}\n}"); //$NON-NLS-1$
@@ -203,6 +222,22 @@ public class TalendJavaSourceViewer extends ReconcilerViewer {
return initializeViewer(composite, styles, checkCode, document, documentOffset);
}
/**
* if the current process is a route process or not
* @return
*/
private static boolean isRouteProcess(){
try {
IProcess activeProcess = CorePlugin.getDefault()
.getRunProcessService().getActiveProcess();
boolean isRouteProcess = (activeProcess != null && "org.talend.camel.designer.ui.editor.RouteProcess"
.equals(activeProcess.getClass().getName()));
return isRouteProcess;
} catch (Throwable e) {
return false;
}
}
public static ISourceViewer createViewerForIfConnection(Composite composite) {
StringBuffer buff = new StringBuffer();
buff.append("package internal;\n\n"); //$NON-NLS-1$

View File

@@ -35,6 +35,7 @@ import org.eclipse.jface.operation.ModalContext;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.io.FilesUtils;
import org.talend.core.i18n.Messages;
/**
@@ -153,12 +154,14 @@ public class ArchiveFileExportOperationFullPath implements IRunnableWithProgress
if (rootName != null && !"".equals(destinationName)) { //$NON-NLS-1$
if (file.getName().equals(Messages.getString("ArchiveFileExportOperationFullPath.SpecialFile"))) { //$NON-NLS-1$
destinationName = rootName.substring(0, rootName.indexOf("/")) + SEPARATOR + destinationName; //$NON-NLS-1$
} else {
} else if (!"".equals(rootName)) { //$NON-NLS-1$
destinationName = rootName + SEPARATOR + destinationName;
}
}
}
destinationName = destinationName.replace("//", SEPARATOR); //$NON-NLS-1$
monitor.subTask(destinationName);
try {
@@ -214,7 +217,7 @@ public class ArchiveFileExportOperationFullPath implements IRunnableWithProgress
String relativePath = (String) iter.next();
Set<URL> resource = fileResource.getResourcesByRelativePath(relativePath);
for (URL url : resource) {
String currentResource = url.getPath();
String currentResource = FilesUtils.getFileRealPath(url.getPath());
exportResource(rootName, relativePath, currentResource, 1);
}
}

Some files were not shown because too many files have changed in this diff Show More